Commit d4a8ca24 authored by Takashi Iwai's avatar Takashi Iwai

ASoC: missing conversions to snd_soc_codec_*_drvdata()

Conversions to snd_soc_codec_{get|set}_drvdata() were missing in some files
in the previous commit.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent b2c812e2
...@@ -48,7 +48,7 @@ struct aic26 { ...@@ -48,7 +48,7 @@ struct aic26 {
static unsigned int aic26_reg_read(struct snd_soc_codec *codec, static unsigned int aic26_reg_read(struct snd_soc_codec *codec,
unsigned int reg) unsigned int reg)
{ {
struct aic26 *aic26 = codec->private_data; struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
u16 *cache = codec->reg_cache; u16 *cache = codec->reg_cache;
u16 cmd, value; u16 cmd, value;
u8 buffer[2]; u8 buffer[2];
...@@ -92,7 +92,7 @@ static unsigned int aic26_reg_read_cache(struct snd_soc_codec *codec, ...@@ -92,7 +92,7 @@ static unsigned int aic26_reg_read_cache(struct snd_soc_codec *codec,
static int aic26_reg_write(struct snd_soc_codec *codec, unsigned int reg, static int aic26_reg_write(struct snd_soc_codec *codec, unsigned int reg,
unsigned int value) unsigned int value)
{ {
struct aic26 *aic26 = codec->private_data; struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
u16 *cache = codec->reg_cache; u16 *cache = codec->reg_cache;
u16 cmd; u16 cmd;
u8 buffer[4]; u8 buffer[4];
...@@ -131,7 +131,7 @@ static int aic26_hw_params(struct snd_pcm_substream *substream, ...@@ -131,7 +131,7 @@ static int aic26_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_device *socdev = rtd->socdev; struct snd_soc_device *socdev = rtd->socdev;
struct snd_soc_codec *codec = socdev->card->codec; struct snd_soc_codec *codec = socdev->card->codec;
struct aic26 *aic26 = codec->private_data; struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
int fsref, divisor, wlen, pval, jval, dval, qval; int fsref, divisor, wlen, pval, jval, dval, qval;
u16 reg; u16 reg;
...@@ -198,7 +198,7 @@ static int aic26_hw_params(struct snd_pcm_substream *substream, ...@@ -198,7 +198,7 @@ static int aic26_hw_params(struct snd_pcm_substream *substream,
static int aic26_mute(struct snd_soc_dai *dai, int mute) static int aic26_mute(struct snd_soc_dai *dai, int mute)
{ {
struct snd_soc_codec *codec = dai->codec; struct snd_soc_codec *codec = dai->codec;
struct aic26 *aic26 = codec->private_data; struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
u16 reg = aic26_reg_read_cache(codec, AIC26_REG_DAC_GAIN); u16 reg = aic26_reg_read_cache(codec, AIC26_REG_DAC_GAIN);
dev_dbg(&aic26->spi->dev, "aic26_mute(dai=%p, mute=%i)\n", dev_dbg(&aic26->spi->dev, "aic26_mute(dai=%p, mute=%i)\n",
...@@ -217,7 +217,7 @@ static int aic26_set_sysclk(struct snd_soc_dai *codec_dai, ...@@ -217,7 +217,7 @@ static int aic26_set_sysclk(struct snd_soc_dai *codec_dai,
int clk_id, unsigned int freq, int dir) int clk_id, unsigned int freq, int dir)
{ {
struct snd_soc_codec *codec = codec_dai->codec; struct snd_soc_codec *codec = codec_dai->codec;
struct aic26 *aic26 = codec->private_data; struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
dev_dbg(&aic26->spi->dev, "aic26_set_sysclk(dai=%p, clk_id==%i," dev_dbg(&aic26->spi->dev, "aic26_set_sysclk(dai=%p, clk_id==%i,"
" freq=%i, dir=%i)\n", " freq=%i, dir=%i)\n",
...@@ -234,7 +234,7 @@ static int aic26_set_sysclk(struct snd_soc_dai *codec_dai, ...@@ -234,7 +234,7 @@ static int aic26_set_sysclk(struct snd_soc_dai *codec_dai,
static int aic26_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) static int aic26_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
{ {
struct snd_soc_codec *codec = codec_dai->codec; struct snd_soc_codec *codec = codec_dai->codec;
struct aic26 *aic26 = codec->private_data; struct aic26 *aic26 = snd_soc_codec_get_drvdata(codec);
dev_dbg(&aic26->spi->dev, "aic26_set_fmt(dai=%p, fmt==%i)\n", dev_dbg(&aic26->spi->dev, "aic26_set_fmt(dai=%p, fmt==%i)\n",
codec_dai, fmt); codec_dai, fmt);
...@@ -430,7 +430,7 @@ static int aic26_spi_probe(struct spi_device *spi) ...@@ -430,7 +430,7 @@ static int aic26_spi_probe(struct spi_device *spi)
/* Setup what we can in the codec structure so that the register /* Setup what we can in the codec structure so that the register
* access functions will work as expected. More will be filled * access functions will work as expected. More will be filled
* out when it is probed by the SoC CODEC part of this driver */ * out when it is probed by the SoC CODEC part of this driver */
aic26->codec.private_data = aic26; snd_soc_codec_set_drvdata(&aic26->codec, aic26);
aic26->codec.name = "aic26"; aic26->codec.name = "aic26";
aic26->codec.owner = THIS_MODULE; aic26->codec.owner = THIS_MODULE;
aic26->codec.dai = &aic26_dai; aic26->codec.dai = &aic26_dai;
......
...@@ -2001,7 +2001,7 @@ static int twl4030_voice_set_dai_sysclk(struct snd_soc_dai *codec_dai, ...@@ -2001,7 +2001,7 @@ static int twl4030_voice_set_dai_sysclk(struct snd_soc_dai *codec_dai,
int clk_id, unsigned int freq, int dir) int clk_id, unsigned int freq, int dir)
{ {
struct snd_soc_codec *codec = codec_dai->codec; struct snd_soc_codec *codec = codec_dai->codec;
struct twl4030_priv *twl4030 = codec->private_data; struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
if (freq != 26000000) { if (freq != 26000000) {
dev_err(codec->dev, "Unsupported APLL mclk: %u, the Voice" dev_err(codec->dev, "Unsupported APLL mclk: %u, the Voice"
......
...@@ -364,7 +364,7 @@ static int twl6040_power_mode_event(struct snd_soc_dapm_widget *w, ...@@ -364,7 +364,7 @@ static int twl6040_power_mode_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event) struct snd_kcontrol *kcontrol, int event)
{ {
struct snd_soc_codec *codec = w->codec; struct snd_soc_codec *codec = w->codec;
struct twl6040_data *priv = codec->private_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
if (SND_SOC_DAPM_EVENT_ON(event)) if (SND_SOC_DAPM_EVENT_ON(event))
priv->non_lp++; priv->non_lp++;
...@@ -378,7 +378,7 @@ static int twl6040_power_mode_event(struct snd_soc_dapm_widget *w, ...@@ -378,7 +378,7 @@ static int twl6040_power_mode_event(struct snd_soc_dapm_widget *w,
static irqreturn_t twl6040_naudint_handler(int irq, void *data) static irqreturn_t twl6040_naudint_handler(int irq, void *data)
{ {
struct snd_soc_codec *codec = data; struct snd_soc_codec *codec = data;
struct twl6040_data *priv = codec->private_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
u8 intid; u8 intid;
twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &intid, TWL6040_REG_INTID); twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &intid, TWL6040_REG_INTID);
...@@ -636,7 +636,7 @@ static int twl6040_add_widgets(struct snd_soc_codec *codec) ...@@ -636,7 +636,7 @@ static int twl6040_add_widgets(struct snd_soc_codec *codec)
static int twl6040_power_up_completion(struct snd_soc_codec *codec, static int twl6040_power_up_completion(struct snd_soc_codec *codec,
int naudint) int naudint)
{ {
struct twl6040_data *priv = codec->private_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
int time_left; int time_left;
u8 intid; u8 intid;
...@@ -660,7 +660,7 @@ static int twl6040_power_up_completion(struct snd_soc_codec *codec, ...@@ -660,7 +660,7 @@ static int twl6040_power_up_completion(struct snd_soc_codec *codec,
static int twl6040_set_bias_level(struct snd_soc_codec *codec, static int twl6040_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level) enum snd_soc_bias_level level)
{ {
struct twl6040_data *priv = codec->private_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
int audpwron = priv->audpwron; int audpwron = priv->audpwron;
int naudint = priv->naudint; int naudint = priv->naudint;
int ret; int ret;
...@@ -753,7 +753,7 @@ static int twl6040_startup(struct snd_pcm_substream *substream, ...@@ -753,7 +753,7 @@ static int twl6040_startup(struct snd_pcm_substream *substream,
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_device *socdev = rtd->socdev; struct snd_soc_device *socdev = rtd->socdev;
struct snd_soc_codec *codec = socdev->card->codec; struct snd_soc_codec *codec = socdev->card->codec;
struct twl6040_data *priv = codec->private_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
if (!priv->sysclk) { if (!priv->sysclk) {
dev_err(codec->dev, dev_err(codec->dev,
...@@ -786,7 +786,7 @@ static int twl6040_hw_params(struct snd_pcm_substream *substream, ...@@ -786,7 +786,7 @@ static int twl6040_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_device *socdev = rtd->socdev; struct snd_soc_device *socdev = rtd->socdev;
struct snd_soc_codec *codec = socdev->card->codec; struct snd_soc_codec *codec = socdev->card->codec;
struct twl6040_data *priv = codec->private_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
u8 lppllctl; u8 lppllctl;
int rate; int rate;
...@@ -822,7 +822,7 @@ static int twl6040_trigger(struct snd_pcm_substream *substream, ...@@ -822,7 +822,7 @@ static int twl6040_trigger(struct snd_pcm_substream *substream,
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_device *socdev = rtd->socdev; struct snd_soc_device *socdev = rtd->socdev;
struct snd_soc_codec *codec = socdev->card->codec; struct snd_soc_codec *codec = socdev->card->codec;
struct twl6040_data *priv = codec->private_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
switch (cmd) { switch (cmd) {
case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_START:
...@@ -849,7 +849,7 @@ static int twl6040_set_dai_sysclk(struct snd_soc_dai *codec_dai, ...@@ -849,7 +849,7 @@ static int twl6040_set_dai_sysclk(struct snd_soc_dai *codec_dai,
int clk_id, unsigned int freq, int dir) int clk_id, unsigned int freq, int dir)
{ {
struct snd_soc_codec *codec = codec_dai->codec; struct snd_soc_codec *codec = codec_dai->codec;
struct twl6040_data *priv = codec->private_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
u8 hppllctl, lppllctl; u8 hppllctl, lppllctl;
hppllctl = twl6040_read_reg_cache(codec, TWL6040_REG_HPPLLCTL); hppllctl = twl6040_read_reg_cache(codec, TWL6040_REG_HPPLLCTL);
...@@ -1095,7 +1095,7 @@ static int __devinit twl6040_codec_probe(struct platform_device *pdev) ...@@ -1095,7 +1095,7 @@ static int __devinit twl6040_codec_probe(struct platform_device *pdev)
codec->read = twl6040_read_reg_cache; codec->read = twl6040_read_reg_cache;
codec->write = twl6040_write; codec->write = twl6040_write;
codec->set_bias_level = twl6040_set_bias_level; codec->set_bias_level = twl6040_set_bias_level;
codec->private_data = priv; snd_soc_codec_set_drvdata(codec, priv);
codec->dai = &twl6040_dai; codec->dai = &twl6040_dai;
codec->num_dai = 1; codec->num_dai = 1;
codec->reg_cache_size = ARRAY_SIZE(twl6040_reg); codec->reg_cache_size = ARRAY_SIZE(twl6040_reg);
...@@ -1183,7 +1183,7 @@ static int __devinit twl6040_codec_probe(struct platform_device *pdev) ...@@ -1183,7 +1183,7 @@ static int __devinit twl6040_codec_probe(struct platform_device *pdev)
static int __devexit twl6040_codec_remove(struct platform_device *pdev) static int __devexit twl6040_codec_remove(struct platform_device *pdev)
{ {
struct twl6040_data *priv = twl6040_codec->private_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(twl6040_codec);
int audpwron = priv->audpwron; int audpwron = priv->audpwron;
int naudint = priv->naudint; int naudint = priv->naudint;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment