#define VERSION "RT3261_V1.0.0"
+extern void rt5623_on(void);
+extern void rt5623_off(void);
+
struct rt3261_init_reg {
u8 reg;
u16 val;
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
- unsigned int i,j,k;
if(ucontrol->value.integer.value[0]) {
/* headphone unmute sequence */
return 0;
}
+static int rt3261_modem_input_switch_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct rt3261_priv *rt3261 = snd_soc_codec_get_drvdata(codec);
+
+ ucontrol->value.integer.value[0] = rt3261->modem_is_open;
+ return 0;
+}
+
+static int rt3261_modem_input_switch_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct rt3261_priv *rt3261 = snd_soc_codec_get_drvdata(codec);
+
+ if(ucontrol->value.integer.value[0]) {
+ rt5623_on( );
+ rt3261->modem_is_open = 1;
+ }else {
+ rt5623_off( );
+ rt3261->modem_is_open = 0;
+ }
+
+ return 0;
+}
+
/* IN1/IN2 Input Type */
static const char *rt3261_input_mode[] = {
"Single ended", "Differential"};
static const SOC_ENUM_SINGLE_DECL(rt3261_hp_mute_enum, 0, 0, rt3261_hp_mute_mode);
+static const char *rt3261_modem_input_switch_mode[] = {"off", "on",};
+
+static const SOC_ENUM_SINGLE_DECL(rt3261_modem_input_switch_enum, 0, 0, rt3261_modem_input_switch_mode);
+
#ifdef RT3261_REG_RW
#define REGVAL_MAX 0xffff
static unsigned int regctl_addr;
SOC_ENUM_EXT("HP mute Switch", rt3261_hp_mute_enum,
rt3261_hp_mute_get, rt3261_hp_mute_put),
+
+ SOC_ENUM_EXT("Modem Input Switch", rt3261_modem_input_switch_enum,
+ rt3261_modem_input_switch_get, rt3261_modem_input_switch_put),
};
/**
if(rt3261->io_init)
rt3261->io_init(pdata->codec_en_gpio, pdata->codec_en_gpio_info.iomux_name, pdata->codec_en_gpio_info.iomux_mode);
+ rt3261->modem_is_open = 0;
+
i2c_set_clientdata(i2c, rt3261);
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt3261,