@@ -595,18 +595,10 @@ static struct snd_soc_dai_driver ak4497_dai = {
595595 .ops = & ak4458_dai_ops ,
596596};
597597
598- static void ak4458_power_off (struct ak4458_priv * ak4458 )
598+ static void ak4458_reset (struct ak4458_priv * ak4458 , bool active )
599599{
600600 if (ak4458 -> reset_gpiod ) {
601- gpiod_set_value_cansleep (ak4458 -> reset_gpiod , 0 );
602- usleep_range (1000 , 2000 );
603- }
604- }
605-
606- static void ak4458_power_on (struct ak4458_priv * ak4458 )
607- {
608- if (ak4458 -> reset_gpiod ) {
609- gpiod_set_value_cansleep (ak4458 -> reset_gpiod , 1 );
601+ gpiod_set_value_cansleep (ak4458 -> reset_gpiod , active );
610602 usleep_range (1000 , 2000 );
611603 }
612604}
@@ -620,7 +612,7 @@ static int ak4458_init(struct snd_soc_component *component)
620612 if (ak4458 -> mute_gpiod )
621613 gpiod_set_value_cansleep (ak4458 -> mute_gpiod , 1 );
622614
623- ak4458_power_on (ak4458 );
615+ ak4458_reset (ak4458 , false );
624616
625617 ret = snd_soc_component_update_bits (component , AK4458_00_CONTROL1 ,
626618 0x80 , 0x80 ); /* ACKS bit = 1; 10000000 */
@@ -650,7 +642,7 @@ static void ak4458_remove(struct snd_soc_component *component)
650642{
651643 struct ak4458_priv * ak4458 = snd_soc_component_get_drvdata (component );
652644
653- ak4458_power_off (ak4458 );
645+ ak4458_reset (ak4458 , true );
654646}
655647
656648#ifdef CONFIG_PM
@@ -660,7 +652,7 @@ static int __maybe_unused ak4458_runtime_suspend(struct device *dev)
660652
661653 regcache_cache_only (ak4458 -> regmap , true);
662654
663- ak4458_power_off (ak4458 );
655+ ak4458_reset (ak4458 , true );
664656
665657 if (ak4458 -> mute_gpiod )
666658 gpiod_set_value_cansleep (ak4458 -> mute_gpiod , 0 );
@@ -685,8 +677,8 @@ static int __maybe_unused ak4458_runtime_resume(struct device *dev)
685677 if (ak4458 -> mute_gpiod )
686678 gpiod_set_value_cansleep (ak4458 -> mute_gpiod , 1 );
687679
688- ak4458_power_off (ak4458 );
689- ak4458_power_on (ak4458 );
680+ ak4458_reset (ak4458 , true );
681+ ak4458_reset (ak4458 , false );
690682
691683 regcache_cache_only (ak4458 -> regmap , false);
692684 regcache_mark_dirty (ak4458 -> regmap );
0 commit comments