diff options
author | Andres Salomon <dilinger@queued.net> | 2011-02-17 22:07:20 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-03-23 05:41:54 -0400 |
commit | 0638d56fbb6cf8367fcf01a1febf6a191b0e0704 (patch) | |
tree | e2af7c684550df22c6dce4b3a00bd64a3a24806d | |
parent | 7d76ac15ad1a8d8b1a7b7b4f6be7a9d8dfd225bf (diff) |
mfd: mfd_cell is now implicitly available to twl4030 drivers
The cell's platform_data is now accessed with a helper function;
change clients to use that, and remove the now-unused data_size.
Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | drivers/input/misc/twl4030-vibra.c | 3 | ||||
-rw-r--r-- | drivers/mfd/twl4030-codec.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/twl4030.c | 6 |
3 files changed, 6 insertions, 5 deletions
diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c index 014dd4ad0d4f..6a11694e3fc7 100644 --- a/drivers/input/misc/twl4030-vibra.c +++ b/drivers/input/misc/twl4030-vibra.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/workqueue.h> | 29 | #include <linux/workqueue.h> |
30 | #include <linux/i2c/twl.h> | 30 | #include <linux/i2c/twl.h> |
31 | #include <linux/mfd/twl4030-codec.h> | 31 | #include <linux/mfd/twl4030-codec.h> |
32 | #include <linux/mfd/core.h> | ||
32 | #include <linux/input.h> | 33 | #include <linux/input.h> |
33 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
34 | 35 | ||
@@ -196,7 +197,7 @@ static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops, | |||
196 | 197 | ||
197 | static int __devinit twl4030_vibra_probe(struct platform_device *pdev) | 198 | static int __devinit twl4030_vibra_probe(struct platform_device *pdev) |
198 | { | 199 | { |
199 | struct twl4030_codec_vibra_data *pdata = pdev->dev.platform_data; | 200 | struct twl4030_codec_vibra_data *pdata = mfd_get_data(pdev); |
200 | struct vibra_info *info; | 201 | struct vibra_info *info; |
201 | int ret; | 202 | int ret; |
202 | 203 | ||
diff --git a/drivers/mfd/twl4030-codec.c b/drivers/mfd/twl4030-codec.c index 9a4b196d6deb..0f5742655b46 100644 --- a/drivers/mfd/twl4030-codec.c +++ b/drivers/mfd/twl4030-codec.c | |||
@@ -209,14 +209,12 @@ static int __devinit twl4030_codec_probe(struct platform_device *pdev) | |||
209 | cell = &codec->cells[childs]; | 209 | cell = &codec->cells[childs]; |
210 | cell->name = "twl4030-codec"; | 210 | cell->name = "twl4030-codec"; |
211 | cell->platform_data = pdata->audio; | 211 | cell->platform_data = pdata->audio; |
212 | cell->data_size = sizeof(*pdata->audio); | ||
213 | childs++; | 212 | childs++; |
214 | } | 213 | } |
215 | if (pdata->vibra) { | 214 | if (pdata->vibra) { |
216 | cell = &codec->cells[childs]; | 215 | cell = &codec->cells[childs]; |
217 | cell->name = "twl4030-vibra"; | 216 | cell->name = "twl4030-vibra"; |
218 | cell->platform_data = pdata->vibra; | 217 | cell->platform_data = pdata->vibra; |
219 | cell->data_size = sizeof(*pdata->vibra); | ||
220 | childs++; | 218 | childs++; |
221 | } | 219 | } |
222 | 220 | ||
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index e4d464b937d6..8512800f6326 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/pm.h> | 26 | #include <linux/pm.h> |
27 | #include <linux/i2c.h> | 27 | #include <linux/i2c.h> |
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <linux/mfd/core.h> | ||
29 | #include <linux/i2c/twl.h> | 30 | #include <linux/i2c/twl.h> |
30 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
31 | #include <sound/core.h> | 32 | #include <sound/core.h> |
@@ -732,7 +733,8 @@ static int aif_event(struct snd_soc_dapm_widget *w, | |||
732 | 733 | ||
733 | static void headset_ramp(struct snd_soc_codec *codec, int ramp) | 734 | static void headset_ramp(struct snd_soc_codec *codec, int ramp) |
734 | { | 735 | { |
735 | struct twl4030_codec_audio_data *pdata = codec->dev->platform_data; | 736 | struct twl4030_codec_audio_data *pdata = |
737 | mfd_get_data(to_platform_device(codec->dev)); | ||
736 | unsigned char hs_gain, hs_pop; | 738 | unsigned char hs_gain, hs_pop; |
737 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); | 739 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); |
738 | /* Base values for ramp delay calculation: 2^19 - 2^26 */ | 740 | /* Base values for ramp delay calculation: 2^19 - 2^26 */ |
@@ -2297,7 +2299,7 @@ static struct snd_soc_codec_driver soc_codec_dev_twl4030 = { | |||
2297 | 2299 | ||
2298 | static int __devinit twl4030_codec_probe(struct platform_device *pdev) | 2300 | static int __devinit twl4030_codec_probe(struct platform_device *pdev) |
2299 | { | 2301 | { |
2300 | struct twl4030_codec_audio_data *pdata = pdev->dev.platform_data; | 2302 | struct twl4030_codec_audio_data *pdata = mfd_get_data(pdev); |
2301 | 2303 | ||
2302 | if (!pdata) { | 2304 | if (!pdata) { |
2303 | dev_err(&pdev->dev, "platform_data is missing\n"); | 2305 | dev_err(&pdev->dev, "platform_data is missing\n"); |