ASoC: SDP3430: Add support for EXTMUTE using TWL GPIO6
Board sdp3430 has hardware support for EXTMUTE using TWL4030 GPIO6 line, controlled by register INTBR_PMBR1. Machine driver takes care of enabling gpio line through i2c and codec driver manipulates the line during headset ramp up/down sequence. Signed-off-by: Jorge Eduardo Candelaria <x0107209@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
416c8fe3cd
commit
c5910a7038
1 changed files with 9 additions and 0 deletions
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/i2c/twl4030.h>
|
||||||
#include <sound/core.h>
|
#include <sound/core.h>
|
||||||
#include <sound/pcm.h>
|
#include <sound/pcm.h>
|
||||||
#include <sound/soc.h>
|
#include <sound/soc.h>
|
||||||
|
@ -39,6 +40,9 @@
|
||||||
#include "omap-pcm.h"
|
#include "omap-pcm.h"
|
||||||
#include "../codecs/twl4030.h"
|
#include "../codecs/twl4030.h"
|
||||||
|
|
||||||
|
#define TWL4030_INTBR_PMBR1 0x0D
|
||||||
|
#define EXTMUTE(value) (value << 2)
|
||||||
|
|
||||||
static struct snd_soc_card snd_soc_sdp3430;
|
static struct snd_soc_card snd_soc_sdp3430;
|
||||||
|
|
||||||
static int sdp3430_hw_params(struct snd_pcm_substream *substream,
|
static int sdp3430_hw_params(struct snd_pcm_substream *substream,
|
||||||
|
@ -280,6 +284,7 @@ static struct snd_soc_card snd_soc_sdp3430 = {
|
||||||
static struct twl4030_setup_data twl4030_setup = {
|
static struct twl4030_setup_data twl4030_setup = {
|
||||||
.ramp_delay_value = 3,
|
.ramp_delay_value = 3,
|
||||||
.sysclk = 26000,
|
.sysclk = 26000,
|
||||||
|
.hs_extmute = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Audio subsystem */
|
/* Audio subsystem */
|
||||||
|
@ -312,6 +317,10 @@ static int __init sdp3430_soc_init(void)
|
||||||
*(unsigned int *)sdp3430_dai[0].cpu_dai->private_data = 1; /* McBSP2 */
|
*(unsigned int *)sdp3430_dai[0].cpu_dai->private_data = 1; /* McBSP2 */
|
||||||
*(unsigned int *)sdp3430_dai[1].cpu_dai->private_data = 2; /* McBSP3 */
|
*(unsigned int *)sdp3430_dai[1].cpu_dai->private_data = 2; /* McBSP3 */
|
||||||
|
|
||||||
|
/* Set TWL4030 GPIO6 as EXTMUTE signal */
|
||||||
|
twl4030_i2c_write_u8(TWL4030_MODULE_INTBR, EXTMUTE(0x02),
|
||||||
|
TWL4030_MODULE_INTBR);
|
||||||
|
|
||||||
ret = platform_device_add(sdp3430_snd_device);
|
ret = platform_device_add(sdp3430_snd_device);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err1;
|
goto err1;
|
||||||
|
|
Reference in a new issue