[ALSA] soc - wm8753 - Clean up checkpatch warnings
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
0ff5ce7f30
commit
60fc684adf
1 changed files with 18 additions and 16 deletions
|
@ -150,7 +150,7 @@ static int wm8753_write(struct snd_soc_codec *codec, unsigned int reg,
|
||||||
data[0] = (reg << 1) | ((value >> 8) & 0x0001);
|
data[0] = (reg << 1) | ((value >> 8) & 0x0001);
|
||||||
data[1] = value & 0x00ff;
|
data[1] = value & 0x00ff;
|
||||||
|
|
||||||
wm8753_write_reg_cache (codec, reg, value);
|
wm8753_write_reg_cache(codec, reg, value);
|
||||||
if (codec->hw_write(codec->control_data, data, 2) == 2)
|
if (codec->hw_write(codec->control_data, data, 2) == 2)
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
|
@ -249,7 +249,7 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
||||||
int mode = wm8753_read_reg_cache(codec, WM8753_IOCTL);
|
int mode = wm8753_read_reg_cache(codec, WM8753_IOCTL);
|
||||||
|
|
||||||
if (((mode &0xc) >> 2) == ucontrol->value.integer.value[0])
|
if (((mode & 0xc) >> 2) == ucontrol->value.integer.value[0])
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
mode &= 0xfff3;
|
mode &= 0xfff3;
|
||||||
|
@ -342,7 +342,8 @@ static int wm8753_add_controls(struct snd_soc_codec *codec)
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(wm8753_snd_controls); i++) {
|
for (i = 0; i < ARRAY_SIZE(wm8753_snd_controls); i++) {
|
||||||
err = snd_ctl_add(codec->card,
|
err = snd_ctl_add(codec->card,
|
||||||
snd_soc_cnew(&wm8753_snd_controls[i],codec, NULL));
|
snd_soc_cnew(&wm8753_snd_controls[i],
|
||||||
|
codec, NULL));
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -722,7 +723,7 @@ static void pll_factors(struct _pll_div *pll_div, unsigned int target,
|
||||||
|
|
||||||
if ((Ndiv < 6) || (Ndiv > 12))
|
if ((Ndiv < 6) || (Ndiv > 12))
|
||||||
printk(KERN_WARNING
|
printk(KERN_WARNING
|
||||||
"WM8753 N value outwith recommended range! N = %d\n",Ndiv);
|
"wm8753: unsupported N = %d\n", Ndiv);
|
||||||
|
|
||||||
pll_div->n = Ndiv;
|
pll_div->n = Ndiv;
|
||||||
Nmod = target % source;
|
Nmod = target % source;
|
||||||
|
@ -1300,8 +1301,9 @@ static int wm8753_dapm_event(struct snd_soc_codec *codec, int event)
|
||||||
}
|
}
|
||||||
|
|
||||||
#define WM8753_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
|
#define WM8753_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
|
||||||
SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \
|
SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
|
||||||
SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
|
SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\
|
||||||
|
SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
|
||||||
|
|
||||||
#define WM8753_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
|
#define WM8753_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
|
||||||
SNDRV_PCM_FMTBIT_S24_LE)
|
SNDRV_PCM_FMTBIT_S24_LE)
|
||||||
|
@ -1507,9 +1509,9 @@ static int wm8753_suspend(struct platform_device *pdev, pm_message_t state)
|
||||||
struct snd_soc_codec *codec = socdev->codec;
|
struct snd_soc_codec *codec = socdev->codec;
|
||||||
|
|
||||||
/* we only need to suspend if we are a valid card */
|
/* we only need to suspend if we are a valid card */
|
||||||
if(!codec->card)
|
if (!codec->card)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
wm8753_dapm_event(codec, SNDRV_CTL_POWER_D3cold);
|
wm8753_dapm_event(codec, SNDRV_CTL_POWER_D3cold);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1523,7 +1525,7 @@ static int wm8753_resume(struct platform_device *pdev)
|
||||||
u16 *cache = codec->reg_cache;
|
u16 *cache = codec->reg_cache;
|
||||||
|
|
||||||
/* we only need to resume if we are a valid card */
|
/* we only need to resume if we are a valid card */
|
||||||
if(!codec->card)
|
if (!codec->card)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Sync reg_cache with the hardware */
|
/* Sync reg_cache with the hardware */
|
||||||
|
@ -1613,9 +1615,10 @@ static int wm8753_init(struct snd_soc_device *socdev)
|
||||||
wm8753_add_widgets(codec);
|
wm8753_add_widgets(codec);
|
||||||
ret = snd_soc_register_card(socdev);
|
ret = snd_soc_register_card(socdev);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
printk(KERN_ERR "wm8753: failed to register card\n");
|
printk(KERN_ERR "wm8753: failed to register card\n");
|
||||||
goto card_err;
|
goto card_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
card_err:
|
card_err:
|
||||||
|
@ -1630,7 +1633,7 @@ static int wm8753_init(struct snd_soc_device *socdev)
|
||||||
around */
|
around */
|
||||||
static struct snd_soc_device *wm8753_socdev;
|
static struct snd_soc_device *wm8753_socdev;
|
||||||
|
|
||||||
#if defined (CONFIG_I2C) || defined (CONFIG_I2C_MODULE)
|
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* WM8753 2 wire address is determined by GPIO5
|
* WM8753 2 wire address is determined by GPIO5
|
||||||
|
@ -1661,7 +1664,7 @@ static int wm8753_codec_probe(struct i2c_adapter *adap, int addr, int kind)
|
||||||
client_template.addr = addr;
|
client_template.addr = addr;
|
||||||
|
|
||||||
i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
|
i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
|
||||||
if (i2c == NULL){
|
if (!i2c) {
|
||||||
kfree(codec);
|
kfree(codec);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
@ -1749,7 +1752,7 @@ static int wm8753_probe(struct platform_device *pdev)
|
||||||
wm8753_socdev = socdev;
|
wm8753_socdev = socdev;
|
||||||
INIT_DELAYED_WORK(&codec->delayed_work, wm8753_work);
|
INIT_DELAYED_WORK(&codec->delayed_work, wm8753_work);
|
||||||
|
|
||||||
#if defined (CONFIG_I2C) || defined (CONFIG_I2C_MODULE)
|
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
|
||||||
if (setup->i2c_address) {
|
if (setup->i2c_address) {
|
||||||
normal_i2c[0] = setup->i2c_address;
|
normal_i2c[0] = setup->i2c_address;
|
||||||
codec->hw_write = (hw_write_t)i2c_master_send;
|
codec->hw_write = (hw_write_t)i2c_master_send;
|
||||||
|
@ -1793,7 +1796,7 @@ static int wm8753_remove(struct platform_device *pdev)
|
||||||
run_delayed_work(&codec->delayed_work);
|
run_delayed_work(&codec->delayed_work);
|
||||||
snd_soc_free_pcms(socdev);
|
snd_soc_free_pcms(socdev);
|
||||||
snd_soc_dapm_free(socdev);
|
snd_soc_dapm_free(socdev);
|
||||||
#if defined (CONFIG_I2C) || defined (CONFIG_I2C_MODULE)
|
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
|
||||||
i2c_del_driver(&wm8753_i2c_driver);
|
i2c_del_driver(&wm8753_i2c_driver);
|
||||||
#endif
|
#endif
|
||||||
kfree(codec->private_data);
|
kfree(codec->private_data);
|
||||||
|
@ -1808,7 +1811,6 @@ struct snd_soc_codec_device soc_codec_dev_wm8753 = {
|
||||||
.suspend = wm8753_suspend,
|
.suspend = wm8753_suspend,
|
||||||
.resume = wm8753_resume,
|
.resume = wm8753_resume,
|
||||||
};
|
};
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(soc_codec_dev_wm8753);
|
EXPORT_SYMBOL_GPL(soc_codec_dev_wm8753);
|
||||||
|
|
||||||
MODULE_DESCRIPTION("ASoC WM8753 driver");
|
MODULE_DESCRIPTION("ASoC WM8753 driver");
|
||||||
|
|
Loading…
Add table
Reference in a new issue