[ARM] mfd: cpcap-audio: add Bluetooth bypass switch
authorChris Fries <C.Fries@motorola.com>
Thu, 7 Oct 2010 04:49:20 +0000 (23:49 -0500)
committerIliyan Malchev <malchev@google.com>
Thu, 7 Oct 2010 18:06:16 +0000 (11:06 -0700)
Added a new IOCTL for controlling whether the digital audio is routed out of
the DAP2 (CPCAP CODEC) or DAP4 (Bluetooth SCO).

Change-Id: Ib48a5c1ce66992b653addd854e51e5d3dc69ee31
Signed-off-by: Iliyan Malchev <malchev@google.com>
arch/arm/mach-tegra/include/mach/cpcap_audio.h
drivers/mfd/tegra-cpcap-audio.c
include/linux/cpcap_audio.h

index 6bba47059d0897c4a9c6c98d7768f04378f64cc6..2c572b749b38cbd4c4209b2dda023eb190170d5b 100644 (file)
@@ -230,6 +230,7 @@ struct cpcap_audio_platform_data {
        struct cpcap_audio_state *state;
        int speaker_gpio;
        int headset_gpio;
+       void (*bluetooth_bypass)(bool);
 };
 
 int cpcap_audio_init(struct cpcap_audio_state *state, const char *regulator);
index 6aecc6dfcf19156db1863f953d5432105b145d66..ba150ad40131bb6f9c981c92b95e5fe8ab070079 100644 (file)
@@ -415,6 +415,12 @@ static long cpcap_audio_ctl_ioctl(struct file *file, unsigned int cmd,
                pr_info("%s: setting input rate to %dHz\n", __func__, rate);
                tegra_setup_audio_in_rate(rate);
                break;
+       case CPCAP_AUDIO_SET_BLUETOOTH_BYPASS:
+               if (pdata->bluetooth_bypass)
+                       pdata->bluetooth_bypass((bool)arg);
+               else
+                       pr_err("%s: no bluetooth bypass handler\n", __func__);
+               break;
        }
 
 done:
index f91f712ec1d91ba9ccd2a486ccbb70641f607ddf..d804f4df25c428a980d565b1550a137f89ecddd3 100644 (file)
@@ -70,4 +70,6 @@ struct cpcap_audio_stream {
 #define CPCAP_AUDIO_IN_GET_RATE   _IOR(CPCAP_AUDIO_MAGIC, 10, unsigned int *)
 #define CPCAP_AUDIO_IN_SET_RATE   _IOW(CPCAP_AUDIO_MAGIC, 11, unsigned int *)
 
+#define CPCAP_AUDIO_SET_BLUETOOTH_BYPASS _IOW(CPCAP_AUDIO_MAGIC, 12, unsigned int)
+
 #endif/*_CPCAP_AUDIO_H*/