aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wl1273.c
diff options
context:
space:
mode:
authorMatti J. Aaltonen <matti.j.aaltonen@nokia.com>2011-01-13 08:22:45 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-01-14 07:29:40 -0500
commit228dd545147a07c5e81e4732ad0e829d19ce5daa (patch)
tree4970f4b1c7211e9654f282fb6c080954dc8b9e7f /sound/soc/codecs/wl1273.c
parent18b022eb117e7f70c191267551ff865f278a9258 (diff)
ASoC: WL1273 FM radio: Fix breakage with MFD API changes
These changes are needed to keep up with the changes in the MFD core and V4L2 parts of the wl1273 FM radio driver. Use function pointers instead of exported functions for I2C IO. Also move all preprocessor constants from the wl1273.h to include/linux/mfd/wl1273-core.h. Signed-off-by: Matti J. Aaltonen <matti.j.aaltonen@nokia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wl1273.c')
-rw-r--r--sound/soc/codecs/wl1273.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c
index d3ffa2f0122a..861b28f543d2 100644
--- a/sound/soc/codecs/wl1273.c
+++ b/sound/soc/codecs/wl1273.c
@@ -42,7 +42,7 @@ struct wl1273_priv {
42static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core, 42static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core,
43 int rate, int width) 43 int rate, int width)
44{ 44{
45 struct device *dev = &core->i2c_dev->dev; 45 struct device *dev = &core->client->dev;
46 int r = 0; 46 int r = 0;
47 u16 mode; 47 u16 mode;
48 48
@@ -123,13 +123,13 @@ static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core,
123 dev_dbg(dev, "mode: 0x%04x\n", mode); 123 dev_dbg(dev, "mode: 0x%04x\n", mode);
124 124
125 if (core->i2s_mode != mode) { 125 if (core->i2s_mode != mode) {
126 r = wl1273_fm_write_cmd(core, WL1273_I2S_MODE_CONFIG_SET, mode); 126 r = core->write(core, WL1273_I2S_MODE_CONFIG_SET, mode);
127 if (r) 127 if (r)
128 goto out; 128 goto out;
129 129
130 core->i2s_mode = mode; 130 core->i2s_mode = mode;
131 r = wl1273_fm_write_cmd(core, WL1273_AUDIO_ENABLE, 131 r = core->write(core, WL1273_AUDIO_ENABLE,
132 WL1273_AUDIO_ENABLE_I2S); 132 WL1273_AUDIO_ENABLE_I2S);
133 if (r) 133 if (r)
134 goto out; 134 goto out;
135 } 135 }
@@ -142,8 +142,7 @@ out:
142static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core, 142static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core,
143 int channel_number) 143 int channel_number)
144{ 144{
145 struct i2c_client *client = core->i2c_dev; 145 struct device *dev = &core->client->dev;
146 struct device *dev = &client->dev;
147 int r = 0; 146 int r = 0;
148 147
149 dev_dbg(dev, "%s\n", __func__); 148 dev_dbg(dev, "%s\n", __func__);
@@ -154,17 +153,13 @@ static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core,
154 goto out; 153 goto out;
155 154
156 if (channel_number == 1 && core->mode == WL1273_MODE_RX) 155 if (channel_number == 1 && core->mode == WL1273_MODE_RX)
157 r = wl1273_fm_write_cmd(core, WL1273_MOST_MODE_SET, 156 r = core->write(core, WL1273_MOST_MODE_SET, WL1273_RX_MONO);
158 WL1273_RX_MONO);
159 else if (channel_number == 1 && core->mode == WL1273_MODE_TX) 157 else if (channel_number == 1 && core->mode == WL1273_MODE_TX)
160 r = wl1273_fm_write_cmd(core, WL1273_MONO_SET, 158 r = core->write(core, WL1273_MONO_SET, WL1273_TX_MONO);
161 WL1273_TX_MONO);
162 else if (channel_number == 2 && core->mode == WL1273_MODE_RX) 159 else if (channel_number == 2 && core->mode == WL1273_MODE_RX)
163 r = wl1273_fm_write_cmd(core, WL1273_MOST_MODE_SET, 160 r = core->write(core, WL1273_MOST_MODE_SET, WL1273_RX_STEREO);
164 WL1273_RX_STEREO);
165 else if (channel_number == 2 && core->mode == WL1273_MODE_TX) 161 else if (channel_number == 2 && core->mode == WL1273_MODE_TX)
166 r = wl1273_fm_write_cmd(core, WL1273_MONO_SET, 162 r = core->write(core, WL1273_MONO_SET, WL1273_TX_STEREO);
167 WL1273_TX_STEREO);
168 else 163 else
169 r = -EINVAL; 164 r = -EINVAL;
170out: 165out:
@@ -237,7 +232,7 @@ static int snd_wl1273_fm_audio_put(struct snd_kcontrol *kcontrol,
237 if (wl1273->core->audio_mode == val) 232 if (wl1273->core->audio_mode == val)
238 return 0; 233 return 0;
239 234
240 r = wl1273_fm_set_audio(wl1273->core, val); 235 r = wl1273->core->set_audio(wl1273->core, val);
241 if (r < 0) 236 if (r < 0)
242 return r; 237 return r;
243 238
@@ -272,8 +267,8 @@ static int snd_wl1273_fm_volume_put(struct snd_kcontrol *kcontrol,
272 267
273 dev_dbg(codec->dev, "%s: enter.\n", __func__); 268 dev_dbg(codec->dev, "%s: enter.\n", __func__);
274 269
275 r = wl1273_fm_set_volume(wl1273->core, 270 r = wl1273->core->set_volume(wl1273->core,
276 ucontrol->value.integer.value[0]); 271 ucontrol->value.integer.value[0]);
277 if (r) 272 if (r)
278 return r; 273 return r;
279 274