diff options
author | Eliot Blennerhassett <eblennerhassett@audioscience.com> | 2011-02-10 04:26:11 (GMT) |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-02-10 17:49:32 (GMT) |
commit | fc3a399019a5a54258095c9bb0e17d4be5d51e67 (patch) | |
tree | e097f648fe07054328300a51ff51870cba87eb60 /sound/pci/asihpi/hpicmn.c | |
parent | 1225367a481ae751738630158c7ca96aa1c7bac8 (diff) | |
download | linux-fc3a399019a5a54258095c9bb0e17d4be5d51e67.tar.xz |
ALSA: asihpi - Add volume mute control.
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/asihpi/hpicmn.c')
-rw-r--r-- | sound/pci/asihpi/hpicmn.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sound/pci/asihpi/hpicmn.c b/sound/pci/asihpi/hpicmn.c index e0a08f6..4b3f476 100644 --- a/sound/pci/asihpi/hpicmn.c +++ b/sound/pci/asihpi/hpicmn.c @@ -347,8 +347,21 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache, if (phm->u.c.attribute == HPI_VOLUME_GAIN) { phr->u.c.an_log_value[0] = pC->u.vol.an_log[0]; phr->u.c.an_log_value[1] = pC->u.vol.an_log[1]; - } else + } else if (phm->u.c.attribute == HPI_VOLUME_MUTE) { + if (pC->u.vol.flags & HPI_VOLUME_FLAG_HAS_MUTE) { + if (pC->u.vol.flags & HPI_VOLUME_FLAG_MUTED) + phr->u.c.param1 = + HPI_BITMASK_ALL_CHANNELS; + else + phr->u.c.param1 = 0; + } else { + phr->error = + HPI_ERROR_INVALID_CONTROL_ATTRIBUTE; + phr->u.c.param1 = 0; + } + } else { found = 0; + } break; case HPI_CONTROL_MULTIPLEXER: if (phm->u.c.attribute == HPI_MULTIPLEXER_SOURCE) { @@ -544,6 +557,11 @@ void hpi_cmn_control_cache_sync_to_msg(struct hpi_control_cache *p_cache, if (phm->u.c.attribute == HPI_VOLUME_GAIN) { pC->u.vol.an_log[0] = phr->u.c.an_log_value[0]; pC->u.vol.an_log[1] = phr->u.c.an_log_value[1]; + } else if (phm->u.c.attribute == HPI_VOLUME_MUTE) { + if (phm->u.c.param1) + pC->u.vol.flags |= HPI_VOLUME_FLAG_MUTED; + else + pC->u.vol.flags &= ~HPI_VOLUME_FLAG_MUTED; } break; case HPI_CONTROL_MULTIPLEXER: |