diff options
Diffstat (limited to 'sound/aoa/codecs/snd-aoa-codec-tas.c')
-rw-r--r-- | sound/aoa/codecs/snd-aoa-codec-tas.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas.c b/sound/aoa/codecs/snd-aoa-codec-tas.c index 2f771f57c76f..70c341684794 100644 --- a/sound/aoa/codecs/snd-aoa-codec-tas.c +++ b/sound/aoa/codecs/snd-aoa-codec-tas.c | |||
@@ -272,15 +272,7 @@ static struct snd_kcontrol_new volume_control = { | |||
272 | .put = tas_snd_vol_put, | 272 | .put = tas_snd_vol_put, |
273 | }; | 273 | }; |
274 | 274 | ||
275 | static int tas_snd_mute_info(struct snd_kcontrol *kcontrol, | 275 | #define tas_snd_mute_info snd_ctl_boolean_stereo_info |
276 | struct snd_ctl_elem_info *uinfo) | ||
277 | { | ||
278 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
279 | uinfo->count = 2; | ||
280 | uinfo->value.integer.min = 0; | ||
281 | uinfo->value.integer.max = 1; | ||
282 | return 0; | ||
283 | } | ||
284 | 276 | ||
285 | static int tas_snd_mute_get(struct snd_kcontrol *kcontrol, | 277 | static int tas_snd_mute_get(struct snd_kcontrol *kcontrol, |
286 | struct snd_ctl_elem_value *ucontrol) | 278 | struct snd_ctl_elem_value *ucontrol) |
@@ -431,15 +423,7 @@ static struct snd_kcontrol_new drc_range_control = { | |||
431 | .put = tas_snd_drc_range_put, | 423 | .put = tas_snd_drc_range_put, |
432 | }; | 424 | }; |
433 | 425 | ||
434 | static int tas_snd_drc_switch_info(struct snd_kcontrol *kcontrol, | 426 | #define tas_snd_drc_switch_info snd_ctl_boolean_mono_info |
435 | struct snd_ctl_elem_info *uinfo) | ||
436 | { | ||
437 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
438 | uinfo->count = 1; | ||
439 | uinfo->value.integer.min = 0; | ||
440 | uinfo->value.integer.max = 1; | ||
441 | return 0; | ||
442 | } | ||
443 | 427 | ||
444 | static int tas_snd_drc_switch_get(struct snd_kcontrol *kcontrol, | 428 | static int tas_snd_drc_switch_get(struct snd_kcontrol *kcontrol, |
445 | struct snd_ctl_elem_value *ucontrol) | 429 | struct snd_ctl_elem_value *ucontrol) |
@@ -743,6 +727,7 @@ static int tas_switch_clock(struct codec_info_item *cii, enum clock_switch clock | |||
743 | return 0; | 727 | return 0; |
744 | } | 728 | } |
745 | 729 | ||
730 | #ifdef CONFIG_PM | ||
746 | /* we are controlled via i2c and assume that is always up | 731 | /* we are controlled via i2c and assume that is always up |
747 | * If that wasn't the case, we'd have to suspend once | 732 | * If that wasn't the case, we'd have to suspend once |
748 | * our i2c device is suspended, and then take note of that! */ | 733 | * our i2c device is suspended, and then take note of that! */ |
@@ -768,7 +753,6 @@ static int tas_resume(struct tas *tas) | |||
768 | return 0; | 753 | return 0; |
769 | } | 754 | } |
770 | 755 | ||
771 | #ifdef CONFIG_PM | ||
772 | static int _tas_suspend(struct codec_info_item *cii, pm_message_t state) | 756 | static int _tas_suspend(struct codec_info_item *cii, pm_message_t state) |
773 | { | 757 | { |
774 | return tas_suspend(cii->codec_data); | 758 | return tas_suspend(cii->codec_data); |
@@ -778,7 +762,10 @@ static int _tas_resume(struct codec_info_item *cii) | |||
778 | { | 762 | { |
779 | return tas_resume(cii->codec_data); | 763 | return tas_resume(cii->codec_data); |
780 | } | 764 | } |
781 | #endif | 765 | #else /* CONFIG_PM */ |
766 | #define _tas_suspend NULL | ||
767 | #define _tas_resume NULL | ||
768 | #endif /* CONFIG_PM */ | ||
782 | 769 | ||
783 | static struct codec_info tas_codec_info = { | 770 | static struct codec_info tas_codec_info = { |
784 | .transfers = tas_transfers, | 771 | .transfers = tas_transfers, |
@@ -791,10 +778,8 @@ static struct codec_info tas_codec_info = { | |||
791 | .owner = THIS_MODULE, | 778 | .owner = THIS_MODULE, |
792 | .usable = tas_usable, | 779 | .usable = tas_usable, |
793 | .switch_clock = tas_switch_clock, | 780 | .switch_clock = tas_switch_clock, |
794 | #ifdef CONFIG_PM | ||
795 | .suspend = _tas_suspend, | 781 | .suspend = _tas_suspend, |
796 | .resume = _tas_resume, | 782 | .resume = _tas_resume, |
797 | #endif | ||
798 | }; | 783 | }; |
799 | 784 | ||
800 | static int tas_init_codec(struct aoa_codec *codec) | 785 | static int tas_init_codec(struct aoa_codec *codec) |