struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
u32 add, val, val1, val2;
/*TODO: return 0 for tmp, this wolud modified later */
struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
u32 add = ADC_VOL_CTR_PGA_IN_CONFIG;
u32 val = snd_soc_read(codec, add);
struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
u32 add = ADC_VOL_CTR_PGA_IN_CONFIG;
u32 val = snd_soc_read(codec, add);
u32 val1 = (val & (0x1 << DAC_GAIN_SEL_L)) >> DAC_GAIN_SEL_L;
struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
u32 add = ADC_VOL_CTR_PGA_IN_CONFIG;
u32 val = snd_soc_read(codec, add);
static int pcm186x_dsp_coefficients_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct device *dev = codec->dev;
struct pcm186x_priv *priv = snd_soc_codec_get_drvdata(codec);
struct regmap *map = priv->regmap;
static int pcm186x_dsp_coefficients_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct device *dev = codec->dev;
struct pcm186x_priv *priv = snd_soc_codec_get_drvdata(codec);
struct regmap *map = priv->regmap;
unsigned char Ch2_vol;
unsigned char master_vol;
unsigned int mclk;
+ unsigned int EQ_enum_value;
+ unsigned int DRC_enum_value;
#ifdef CONFIG_HAS_EARLYSUSPEND
struct early_suspend early_suspend;
#endif
return 0;
}
-static bool EQ_enum_value = 1;
static int tas5707_set_EQ_enum(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct tas5707_priv *tas5707 = snd_soc_codec_get_drvdata(codec);
u8 tas5707_eq_ctl_table[] = { 0x00, 0x00, 0x00, 0x80 };
- EQ_enum_value = ucontrol->value.integer.value[0];
+ tas5707->EQ_enum_value = ucontrol->value.integer.value[0];
- if (EQ_enum_value == 1)
+ if (tas5707->EQ_enum_value == 1)
tas5707_set_eq(codec);
else
regmap_raw_write(tas5707->regmap,
static int tas5707_get_EQ_enum(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- ucontrol->value.integer.value[0] = EQ_enum_value;
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
+ struct tas5707_priv *tas5707 = snd_soc_codec_get_drvdata(codec);
+
+ ucontrol->value.integer.value[0] = tas5707->EQ_enum_value;
return 0;
}
-static bool DRC_enum_value = 1;
static int tas5707_set_DRC_enum(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct tas5707_priv *tas5707 = snd_soc_codec_get_drvdata(codec);
u8 tas5707_drc_ctl_table[] = { 0x00, 0x00, 0x00, 0x00 };
- DRC_enum_value = ucontrol->value.integer.value[0];
+ tas5707->DRC_enum_value = ucontrol->value.integer.value[0];
- if (DRC_enum_value == 1)
+ if (tas5707->DRC_enum_value == 1)
tas5707_set_drc(codec);
else
regmap_raw_write(tas5707->regmap, DDX_DRC_CTL,
static int tas5707_get_DRC_enum(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- ucontrol->value.integer.value[0] = DRC_enum_value;
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
+ struct tas5707_priv *tas5707 = snd_soc_codec_get_drvdata(codec);
+
+ ucontrol->value.integer.value[0] = tas5707->DRC_enum_value;
return 0;
}
regmap_raw_write(tas5707->regmap, DDX_PWM_MUX, burst_data[2], 4);
/*drc */
- tas5707_set_drc(codec);
+ //tas5707_set_drc(codec);
/*eq */
- tas5707_set_eq(codec);
+ //tas5707_set_eq(codec);
snd_soc_write(codec, DDX_VOLUME_CONFIG, 0xD1);
snd_soc_write(codec, DDX_SYS_CTL_2, 0x84);