@@ -81,7 +81,7 @@ static const struct reg_sequence init_list[] = {
8181static const struct reg_sequence rt5650_init_list [] = {
8282 {0xf6 , 0x0100 },
8383 {RT5645_PWR_ANLG1 , 0x02 },
84- {RT5645_IL_CMD3 , 0x0018 },
84+ {RT5645_IL_CMD3 , 0x6728 },
8585};
8686
8787static const struct reg_default rt5645_reg [] = {
@@ -3130,20 +3130,32 @@ static void rt5645_enable_push_button_irq(struct snd_soc_component *component,
31303130 bool enable )
31313131{
31323132 struct snd_soc_dapm_context * dapm = snd_soc_component_get_dapm (component );
3133+ int ret ;
31333134
31343135 if (enable ) {
31353136 snd_soc_dapm_force_enable_pin (dapm , "ADC L power" );
31363137 snd_soc_dapm_force_enable_pin (dapm , "ADC R power" );
31373138 snd_soc_dapm_sync (dapm );
31383139
3140+ snd_soc_component_update_bits (component , RT5650_4BTN_IL_CMD2 ,
3141+ RT5645_EN_4BTN_IL_MASK | RT5645_RST_4BTN_IL_MASK ,
3142+ RT5645_EN_4BTN_IL_EN | RT5645_RST_4BTN_IL_RST );
3143+ usleep_range (10000 , 15000 );
3144+ snd_soc_component_update_bits (component , RT5650_4BTN_IL_CMD2 ,
3145+ RT5645_EN_4BTN_IL_MASK | RT5645_RST_4BTN_IL_MASK ,
3146+ RT5645_EN_4BTN_IL_EN | RT5645_RST_4BTN_IL_NORM );
3147+ msleep (50 );
3148+ ret = snd_soc_component_read (component , RT5645_INT_IRQ_ST );
3149+ pr_debug ("%s read %x = %x\n" , __func__ , RT5645_INT_IRQ_ST ,
3150+ snd_soc_component_read (component , RT5645_INT_IRQ_ST ));
3151+ snd_soc_component_write (component , RT5645_INT_IRQ_ST , ret );
3152+ ret = snd_soc_component_read (component , RT5650_4BTN_IL_CMD1 );
3153+ pr_debug ("%s read %x = %x\n" , __func__ , RT5650_4BTN_IL_CMD1 ,
3154+ snd_soc_component_read (component , RT5650_4BTN_IL_CMD1 ));
3155+ snd_soc_component_write (component , RT5650_4BTN_IL_CMD1 , ret );
31393156 snd_soc_component_update_bits (component , RT5650_4BTN_IL_CMD1 , 0x3 , 0x3 );
31403157 snd_soc_component_update_bits (component ,
31413158 RT5645_INT_IRQ_ST , 0x8 , 0x8 );
3142- snd_soc_component_update_bits (component ,
3143- RT5650_4BTN_IL_CMD2 , 0x8000 , 0x8000 );
3144- snd_soc_component_read (component , RT5650_4BTN_IL_CMD1 );
3145- pr_debug ("%s read %x = %x\n" , __func__ , RT5650_4BTN_IL_CMD1 ,
3146- snd_soc_component_read (component , RT5650_4BTN_IL_CMD1 ));
31473159 } else {
31483160 snd_soc_component_update_bits (component , RT5650_4BTN_IL_CMD2 , 0x8000 , 0x0 );
31493161 snd_soc_component_update_bits (component , RT5645_INT_IRQ_ST , 0x8 , 0x0 );
0 commit comments