return err;
}
-int snd_soc_get_gpio_enum_double(struct snd_kcontrol *kcontrol,
+static int snd_soc_get_gpio_enum_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
return 0;
}
-int snd_soc_put_gpio_enum_double(struct snd_kcontrol *kcontrol,
+static int snd_soc_put_gpio_enum_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct rt3261_priv *rt3261 = snd_soc_codec_get_drvdata(codec);
- printk("%s\n", __FUNCTION__);
+ DBG("%s\n", __FUNCTION__);
ucontrol->value.integer.value[0] = rt3261->asrc_en;
return 0;
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
struct rt3261_priv *rt3261 = snd_soc_codec_get_drvdata(codec);
- printk("%s\n", __FUNCTION__);
+ DBG("%s\n", __FUNCTION__);
if (rt3261->asrc_en == ucontrol->value.integer.value[0])
return 0;
rt3261->asrc_en = ucontrol->value.integer.value[0];
switch (rt3261->asrc_en) {
case RT3261_ASRC_DIS://disable ASRC
- printk("%s disable\n", __FUNCTION__);
+ DBG("%s disable\n", __FUNCTION__);
snd_soc_write(codec, RT3261_ASRC_1, 0x0);
snd_soc_write(codec, RT3261_ASRC_2, 0x0);
snd_soc_update_bits(codec, RT3261_GEN_CTRL1, 0x70, 0x0); //bard 8-29
break;
case RT3261_ASRC_EN://enable ASRC
- printk("%s enable\n", __FUNCTION__);
+ DBG("%s enable\n", __FUNCTION__);
snd_soc_write(codec, RT3261_ASRC_1, 0x9800);
snd_soc_write(codec, RT3261_ASRC_2, 0xF800);
snd_soc_update_bits(codec, RT3261_GEN_CTRL1, 0x70, 0x70); //bard 8-29
void rt3261_hp_amp_power(struct snd_soc_codec *codec, int on)
{
static int hp_amp_power_count;
- printk("rt3261_hp_amp_power on=%d hp_amp_power_count=%d\n",on,hp_amp_power_count);
+ DBG("rt3261_hp_amp_power on=%d hp_amp_power_count=%d\n",on,hp_amp_power_count);
// dump_reg(codec);
if(on) {
if(hp_amp_power_count <= 0) {
8, 8, TLV_DB_SCALE_ITEM(5200, 0, 0),
};
-int snd_soc_get_gpio_enum_double(struct snd_kcontrol *kcontrol,
+static int snd_soc_get_gpio_enum_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
return 0;
}
-int snd_soc_put_gpio_enum_double(struct snd_kcontrol *kcontrol,
+static int snd_soc_put_gpio_enum_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
{
struct rt5616_priv *rt5616 = snd_soc_codec_get_drvdata(codec);
int ret;
- printk("enter %s\n",__func__);
+
ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_I2C);
if (ret != 0) {
dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
return ret;
}
- rt5616_reset(codec);
+ ret = rt5616_reset(codec);
+ if (ret < 0)
+ return ret;
+
snd_soc_update_bits(codec, RT5616_PWR_ANLG1,
RT5616_PWR_VREF1 | RT5616_PWR_MB |
RT5616_PWR_BG | RT5616_PWR_VREF2,