From: Chris Fries Date: Thu, 7 Oct 2010 04:49:20 +0000 (-0500) Subject: [ARM] mfd: cpcap-audio: add Bluetooth bypass switch X-Git-Tag: firefly_0821_release~9834^2~480 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c038ff67e81eafc4455a2a30fc00022238296be8;p=firefly-linux-kernel-4.4.55.git [ARM] mfd: cpcap-audio: add Bluetooth bypass switch 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 --- diff --git a/arch/arm/mach-tegra/include/mach/cpcap_audio.h b/arch/arm/mach-tegra/include/mach/cpcap_audio.h index 6bba47059d08..2c572b749b38 100644 --- a/arch/arm/mach-tegra/include/mach/cpcap_audio.h +++ b/arch/arm/mach-tegra/include/mach/cpcap_audio.h @@ -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); diff --git a/drivers/mfd/tegra-cpcap-audio.c b/drivers/mfd/tegra-cpcap-audio.c index 6aecc6dfcf19..ba150ad40131 100644 --- a/drivers/mfd/tegra-cpcap-audio.c +++ b/drivers/mfd/tegra-cpcap-audio.c @@ -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: diff --git a/include/linux/cpcap_audio.h b/include/linux/cpcap_audio.h index f91f712ec1d9..d804f4df25c4 100644 --- a/include/linux/cpcap_audio.h +++ b/include/linux/cpcap_audio.h @@ -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*/