static struct snd_soc_codec *rt3261_codec;
-#if 1
+#if 0
#define DBG(x...) printk(KERN_DEBUG x)
#else
#define DBG(x...)
}
#endif
- rt3261_reset(codec);
+ ret=rt3261_reset(codec);
+ if (ret < 0)
+ {
+ return -ENODEV;
+ }
snd_soc_update_bits(codec, RT3261_PWR_ANLG1,
RT3261_PWR_VREF1 | RT3261_PWR_MB |
RT3261_PWR_BG | RT3261_PWR_VREF2,
int ret;
enum of_gpio_flags flags;
- printk("%s()\n", __FUNCTION__);
+ DBG("%s()\n", __FUNCTION__);
if (!node)
return -ENODEV;
unsigned int reg)
{
unsigned int value;
+ int ret = 0;
+
+ ret = rt5631_write(codec, RT5631_INDEX_ADD, reg);
+ if (ret < 0)
+ {
+ return ret;
+ }
- rt5631_write(codec, RT5631_INDEX_ADD, reg);
value = rt5631_read(codec, RT5631_INDEX_DATA);
return value;
static int rt5631_probe(struct snd_soc_codec *codec)
{
struct rt5631_priv *rt5631 = snd_soc_codec_get_drvdata(codec);
- unsigned int val;
+ int val;
int ret;
ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_I2C);
if (ret != 0) {
codec->cache_bypass = 1;
val = rt5631_read_index(codec, RT5631_ADDA_MIXER_INTL_REG3);
+ if(val < 0)
+ {
+ return -ENODEV;
+ }
if (val & 0x0002)
rt5631->codec_version = 1;
else
#if (RT5631_SPK_TIMER == 1)
- /* Timer¡¡module¡¡uninstalling */
int ret;
ret = del_timer(&spk_timer);
if(ret) printk("The timer is still in use...\n");