mirror of
https://github.com/openharmony/third_party_tinyalsa.git
synced 2026-07-19 15:24:22 -04:00
mixer: show BYTE controls
Use existing routines to read BYTE controls. Somewhat inefficient since an ioctl is done for every byte, some caching in intermediate fields would be beneficial.
This commit is contained in:
committed by
Simon Wilson
parent
a912d706c1
commit
52510160f9
@@ -306,6 +306,9 @@ int mixer_ctl_get_value(struct mixer_ctl *ctl, unsigned int id)
|
||||
case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
|
||||
return ev.value.enumerated.item[id];
|
||||
|
||||
case SNDRV_CTL_ELEM_TYPE_BYTES:
|
||||
return ev.value.bytes.data[id];
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -140,6 +140,9 @@ static void tinymix_detail_control(struct mixer *mixer, unsigned int id,
|
||||
case MIXER_CTL_TYPE_ENUM:
|
||||
tinymix_print_enum(ctl, print_all);
|
||||
break;
|
||||
case MIXER_CTL_TYPE_BYTE:
|
||||
printf(" 0x%02x", mixer_ctl_get_value(ctl, i));
|
||||
break;
|
||||
default:
|
||||
printf(" unknown");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user