From 2489007e7d740ccbc3e0a202914e243ad5178787 Mon Sep 17 00:00:00 2001 From: codeworkx Date: Sat, 22 Sep 2012 09:48:20 +0200 Subject: merge opensource jb u5 Change-Id: I1aaec157aa196f3448eff8636134fce89a814cf2 --- sound/soc/codecs/mc1n2/mc1n2.c | 25 ++++++++++++++++++++----- sound/soc/codecs/mc1n2/mc1n2.h | 2 ++ 2 files changed, 22 insertions(+), 5 deletions(-) (limited to 'sound/soc/codecs/mc1n2') diff --git a/sound/soc/codecs/mc1n2/mc1n2.c b/sound/soc/codecs/mc1n2/mc1n2.c index 975f40b..17dbefa 100644 --- a/sound/soc/codecs/mc1n2/mc1n2.c +++ b/sound/soc/codecs/mc1n2/mc1n2.c @@ -149,6 +149,7 @@ struct mc1n2_data { MCDRV_PDM_INFO pdm_store; UINT32 hdmicount; UINT32 delay_mic1in; + UINT32 lineoutenable; }; struct mc1n2_info_store { @@ -666,6 +667,12 @@ static int mc1n2_i2s_hw_params(struct snd_pcm_substream *substream, } #endif +/* Because of line out pop up noise issue, i2s port already opend */ + if ((mc1n2->lineoutenable == 1) && (port->stream & (1 << dir))) { + err = 0; + goto error; + } + port->rate = rate; port->channels = params_channels(params); @@ -739,6 +746,12 @@ static int mc1n2_hw_free(struct snd_pcm_substream *substream, } #endif +/* Because of line out pop up noise, leave codec opened */ + if (mc1n2->lineoutenable == 1) { + err = 0; + goto error; + } + if (dir == SNDRV_PCM_STREAM_PLAYBACK) { err = mc1n2_control_dir(mc1n2, get_port_id(dai->id), 0); } else { @@ -3777,6 +3790,12 @@ static int mc1n2_hwdep_ioctl_notify(struct snd_soc_codec *codec, (mc1n2->hdmicount)--; } break; + case MCDRV_NOTIFY_LINEOUT_START: + mc1n2->lineoutenable = 1; + break; + case MCDRV_NOTIFY_LINEOUT_STOP: + mc1n2->lineoutenable = 0; + break; case MCDRV_NOTIFY_RECOVER: { int err, i; @@ -4335,7 +4354,7 @@ static int mc1n2_i2c_probe(struct i2c_client *client, #endif mc1n2->hdmicount = 0; - + mc1n2->lineoutenable = 0; mc1n2->pdata = client->dev.platform_data; /* setup i2c client data */ @@ -4449,7 +4468,6 @@ static int mc1n2_i2c_remove(struct i2c_client *client) return 0; } -#ifdef CONFIG_TARGET_LOCALE_KOR /* * Function to prevent tick-noise when reboot menu selected. * if you have Power-Off sound and same problem, use this function @@ -4521,7 +4539,6 @@ error: return; } -#endif static const struct i2c_device_id mc1n2_i2c_id[] = { {MC1N2_NAME, 0}, @@ -4536,9 +4553,7 @@ static struct i2c_driver mc1n2_i2c_driver = { }, .probe = mc1n2_i2c_probe, .remove = mc1n2_i2c_remove, -#ifdef CONFIG_TARGET_LOCALE_KOR .shutdown = mc1n2_i2c_shutdown, -#endif .id_table = mc1n2_i2c_id, }; diff --git a/sound/soc/codecs/mc1n2/mc1n2.h b/sound/soc/codecs/mc1n2/mc1n2.h index 4587273..8167f7c 100644 --- a/sound/soc/codecs/mc1n2/mc1n2.h +++ b/sound/soc/codecs/mc1n2/mc1n2.h @@ -100,6 +100,8 @@ struct mc1n2_ctrl_args { #define MCDRV_NOTIFY_HDMI_STOP 0x0000000B #define MCDRV_NOTIFY_RECOVER 0x0000000C #define MCDRV_NOTIFY_2MIC_CALL_START 0x0000000D +#define MCDRV_NOTIFY_LINEOUT_START 0x00000010 +#define MCDRV_NOTIFY_LINEOUT_STOP 0x00000011 #define MC1N2_MODE_IDLE (0x00) #define MC1N2_MODE_CALL_ON (0x1<<0) -- cgit v1.1