diff options
Diffstat (limited to 'sound/soc/codecs/wl1273.c')
-rw-r--r-- | sound/soc/codecs/wl1273.c | 29 |
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 { | |||
42 | static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core, | 42 | static 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: | |||
142 | static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core, | 142 | static 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; |
170 | out: | 165 | out: |
@@ -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 | ||