diff options
Diffstat (limited to 'sound/soc/codecs/tlv320aic26.c')
-rw-r--r-- | sound/soc/codecs/tlv320aic26.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c index 357b609196e3..f0e00fd4b435 100644 --- a/sound/soc/codecs/tlv320aic26.c +++ b/sound/soc/codecs/tlv320aic26.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/device.h> | 13 | #include <linux/device.h> |
14 | #include <linux/sysfs.h> | 14 | #include <linux/sysfs.h> |
15 | #include <linux/spi/spi.h> | 15 | #include <linux/spi/spi.h> |
16 | #include <linux/slab.h> | ||
16 | #include <sound/core.h> | 17 | #include <sound/core.h> |
17 | #include <sound/pcm.h> | 18 | #include <sound/pcm.h> |
18 | #include <sound/pcm_params.h> | 19 | #include <sound/pcm_params.h> |
@@ -48,7 +49,7 @@ struct aic26 { | |||
48 | static unsigned int aic26_reg_read(struct snd_soc_codec *codec, | 49 | static unsigned int aic26_reg_read(struct snd_soc_codec *codec, |
49 | unsigned int reg) | 50 | unsigned int reg) |
50 | { | 51 | { |
51 | struct aic26 *aic26 = codec->private_data; | 52 | struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec); |
52 | u16 *cache = codec->reg_cache; | 53 | u16 *cache = codec->reg_cache; |
53 | u16 cmd, value; | 54 | u16 cmd, value; |
54 | u8 buffer[2]; | 55 | u8 buffer[2]; |
@@ -92,7 +93,7 @@ static unsigned int aic26_reg_read_cache(struct snd_soc_codec *codec, | |||
92 | static int aic26_reg_write(struct snd_soc_codec *codec, unsigned int reg, | 93 | static int aic26_reg_write(struct snd_soc_codec *codec, unsigned int reg, |
93 | unsigned int value) | 94 | unsigned int value) |
94 | { | 95 | { |
95 | struct aic26 *aic26 = codec->private_data; | 96 | struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec); |
96 | u16 *cache = codec->reg_cache; | 97 | u16 *cache = codec->reg_cache; |
97 | u16 cmd; | 98 | u16 cmd; |
98 | u8 buffer[4]; | 99 | u8 buffer[4]; |
@@ -131,7 +132,7 @@ static int aic26_hw_params(struct snd_pcm_substream *substream, | |||
131 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 132 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
132 | struct snd_soc_device *socdev = rtd->socdev; | 133 | struct snd_soc_device *socdev = rtd->socdev; |
133 | struct snd_soc_codec *codec = socdev->card->codec; | 134 | struct snd_soc_codec *codec = socdev->card->codec; |
134 | struct aic26 *aic26 = codec->private_data; | 135 | struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec); |
135 | int fsref, divisor, wlen, pval, jval, dval, qval; | 136 | int fsref, divisor, wlen, pval, jval, dval, qval; |
136 | u16 reg; | 137 | u16 reg; |
137 | 138 | ||
@@ -198,7 +199,7 @@ static int aic26_hw_params(struct snd_pcm_substream *substream, | |||
198 | static int aic26_mute(struct snd_soc_dai *dai, int mute) | 199 | static int aic26_mute(struct snd_soc_dai *dai, int mute) |
199 | { | 200 | { |
200 | struct snd_soc_codec *codec = dai->codec; | 201 | struct snd_soc_codec *codec = dai->codec; |
201 | struct aic26 *aic26 = codec->private_data; | 202 | struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec); |
202 | u16 reg = aic26_reg_read_cache(codec, AIC26_REG_DAC_GAIN); | 203 | u16 reg = aic26_reg_read_cache(codec, AIC26_REG_DAC_GAIN); |
203 | 204 | ||
204 | dev_dbg(&aic26->spi->dev, "aic26_mute(dai=%p, mute=%i)\n", | 205 | dev_dbg(&aic26->spi->dev, "aic26_mute(dai=%p, mute=%i)\n", |
@@ -217,7 +218,7 @@ static int aic26_set_sysclk(struct snd_soc_dai *codec_dai, | |||
217 | int clk_id, unsigned int freq, int dir) | 218 | int clk_id, unsigned int freq, int dir) |
218 | { | 219 | { |
219 | struct snd_soc_codec *codec = codec_dai->codec; | 220 | struct snd_soc_codec *codec = codec_dai->codec; |
220 | struct aic26 *aic26 = codec->private_data; | 221 | struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec); |
221 | 222 | ||
222 | dev_dbg(&aic26->spi->dev, "aic26_set_sysclk(dai=%p, clk_id==%i," | 223 | dev_dbg(&aic26->spi->dev, "aic26_set_sysclk(dai=%p, clk_id==%i," |
223 | " freq=%i, dir=%i)\n", | 224 | " freq=%i, dir=%i)\n", |
@@ -234,7 +235,7 @@ static int aic26_set_sysclk(struct snd_soc_dai *codec_dai, | |||
234 | static int aic26_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | 235 | static int aic26_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) |
235 | { | 236 | { |
236 | struct snd_soc_codec *codec = codec_dai->codec; | 237 | struct snd_soc_codec *codec = codec_dai->codec; |
237 | struct aic26 *aic26 = codec->private_data; | 238 | struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec); |
238 | 239 | ||
239 | dev_dbg(&aic26->spi->dev, "aic26_set_fmt(dai=%p, fmt==%i)\n", | 240 | dev_dbg(&aic26->spi->dev, "aic26_set_fmt(dai=%p, fmt==%i)\n", |
240 | codec_dai, fmt); | 241 | codec_dai, fmt); |
@@ -430,7 +431,7 @@ static int aic26_spi_probe(struct spi_device *spi) | |||
430 | /* Setup what we can in the codec structure so that the register | 431 | /* Setup what we can in the codec structure so that the register |
431 | * access functions will work as expected. More will be filled | 432 | * access functions will work as expected. More will be filled |
432 | * out when it is probed by the SoC CODEC part of this driver */ | 433 | * out when it is probed by the SoC CODEC part of this driver */ |
433 | aic26->codec.private_data = aic26; | 434 | snd_soc_codec_set_drvdata(&aic26->codec, aic26); |
434 | aic26->codec.name = "aic26"; | 435 | aic26->codec.name = "aic26"; |
435 | aic26->codec.owner = THIS_MODULE; | 436 | aic26->codec.owner = THIS_MODULE; |
436 | aic26->codec.dai = &aic26_dai; | 437 | aic26->codec.dai = &aic26_dai; |