aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-09-10 06:46:31 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-22 11:18:33 -0400
commit182f73f6bbd6a2bf65cd7e15558aa8a651b8c9f7 (patch)
tree279142f8c1537c51633ad03be609fab39ff6abd4
parentf2b1ce4949d6b52a9224118efb562a94e9b5d400 (diff)
ASoC: twl4030: Add pointer to pdata within the private data
Access the pdata via a pointer within the twl4030_priv structure. In preparation for DeviceTree support. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/twl4030.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index d5e60d639ee8..b4d1a4e794d8 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -153,8 +153,7 @@ struct twl4030_priv {
153 u8 predrivel_enabled, predriver_enabled; 153 u8 predrivel_enabled, predriver_enabled;
154 u8 carkitl_enabled, carkitr_enabled; 154 u8 carkitl_enabled, carkitr_enabled;
155 155
156 /* Delay needed after enabling the digimic interface */ 156 struct twl4030_codec_data *pdata;
157 unsigned int digimic_delay;
158}; 157};
159 158
160/* 159/*
@@ -348,7 +347,7 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)
348 if (!pdata) 347 if (!pdata)
349 return; 348 return;
350 349
351 twl4030->digimic_delay = pdata->digimic_delay; 350 twl4030->pdata = pdata;
352 351
353 reg = twl4030_read_reg_cache(codec, TWL4030_REG_HS_POPN_SET); 352 reg = twl4030_read_reg_cache(codec, TWL4030_REG_HS_POPN_SET);
354 reg &= ~TWL4030_RAMP_DELAY; 353 reg &= ~TWL4030_RAMP_DELAY;
@@ -749,9 +748,9 @@ static int aif_event(struct snd_soc_dapm_widget *w,
749 748
750static void headset_ramp(struct snd_soc_codec *codec, int ramp) 749static void headset_ramp(struct snd_soc_codec *codec, int ramp)
751{ 750{
752 struct twl4030_codec_data *pdata = codec->dev->platform_data;
753 unsigned char hs_gain, hs_pop; 751 unsigned char hs_gain, hs_pop;
754 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); 752 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
753 struct twl4030_codec_data *pdata = twl4030->pdata;
755 /* Base values for ramp delay calculation: 2^19 - 2^26 */ 754 /* Base values for ramp delay calculation: 2^19 - 2^26 */
756 unsigned int ramp_base[] = {524288, 1048576, 2097152, 4194304, 755 unsigned int ramp_base[] = {524288, 1048576, 2097152, 4194304,
757 8388608, 16777216, 33554432, 67108864}; 756 8388608, 16777216, 33554432, 67108864};
@@ -864,9 +863,10 @@ static int digimic_event(struct snd_soc_dapm_widget *w,
864 struct snd_kcontrol *kcontrol, int event) 863 struct snd_kcontrol *kcontrol, int event)
865{ 864{
866 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec); 865 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec);
866 struct twl4030_codec_data *pdata = twl4030->pdata;
867 867
868 if (twl4030->digimic_delay) 868 if (pdata && pdata->digimic_delay)
869 twl4030_wait_ms(twl4030->digimic_delay); 869 twl4030_wait_ms(pdata->digimic_delay);
870 return 0; 870 return 0;
871} 871}
872 872
@@ -2254,8 +2254,8 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec)
2254 2254
2255static int twl4030_soc_remove(struct snd_soc_codec *codec) 2255static int twl4030_soc_remove(struct snd_soc_codec *codec)
2256{ 2256{
2257 struct twl4030_codec_data *pdata = dev_get_platdata(codec->dev);
2258 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); 2257 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
2258 struct twl4030_codec_data *pdata = twl4030->pdata;
2259 2259
2260 /* Reset registers to their chip default before leaving */ 2260 /* Reset registers to their chip default before leaving */
2261 twl4030_reset_registers(codec); 2261 twl4030_reset_registers(codec);