data[0] = (reg << 1) | ((value >> 8) & 0x0001);
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)
return 0;
else
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
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;
mode &= 0xfff3;
for (i = 0; i < ARRAY_SIZE(wm8753_snd_controls); i++) {
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)
return err;
}
if ((Ndiv < 6) || (Ndiv > 12))
printk(KERN_WARNING
- "WM8753 N value outwith recommended range! N = %d\n",Ndiv);
+ "wm8753: unsupported N = %d\n", Ndiv);
pll_div->n = Ndiv;
Nmod = target % source;
}
#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_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
+ SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
+ 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 |\
SNDRV_PCM_FMTBIT_S24_LE)
struct snd_soc_codec *codec = socdev->codec;
/* we only need to suspend if we are a valid card */
- if(!codec->card)
+ if (!codec->card)
return 0;
-
+
wm8753_dapm_event(codec, SNDRV_CTL_POWER_D3cold);
return 0;
}
u16 *cache = codec->reg_cache;
/* we only need to resume if we are a valid card */
- if(!codec->card)
+ if (!codec->card)
return 0;
/* Sync reg_cache with the hardware */
wm8753_add_widgets(codec);
ret = snd_soc_register_card(socdev);
if (ret < 0) {
- printk(KERN_ERR "wm8753: failed to register card\n");
+ printk(KERN_ERR "wm8753: failed to register card\n");
goto card_err;
- }
+ }
+
return ret;
card_err:
around */
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
client_template.addr = addr;
i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL){
+ if (!i2c) {
kfree(codec);
return -ENOMEM;
}
wm8753_socdev = socdev;
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) {
normal_i2c[0] = setup->i2c_address;
codec->hw_write = (hw_write_t)i2c_master_send;
run_delayed_work(&codec->delayed_work);
snd_soc_free_pcms(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);
#endif
kfree(codec->private_data);
.suspend = wm8753_suspend,
.resume = wm8753_resume,
};
-
EXPORT_SYMBOL_GPL(soc_codec_dev_wm8753);
MODULE_DESCRIPTION("ASoC WM8753 driver");