From 9698d03a63b89fd5a2a2d775bcfc542812da54d9 Mon Sep 17 00:00:00 2001 From: Pankaj Bharadiya Date: Mon, 9 Jan 2017 12:23:14 +0530 Subject: mixer: Add support for TLV RW access check api Tinyalsa doesn't expose an api to check TLV RW access Add mixer_ctl_is_access_tlv_rw(). This api will get used by tinymix and audio HALs for checking TLV RW access before managing the byte related mixer controls. Change-Id: Ib5707fabf479de638e1c7abd4cd149e7637ff9c2 Signed-off-by: Pankaj Bharadiya --- include/tinyalsa/mixer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/tinyalsa/mixer.h b/include/tinyalsa/mixer.h index d82d4b1..b9d6cf3 100644 --- a/include/tinyalsa/mixer.h +++ b/include/tinyalsa/mixer.h @@ -107,6 +107,8 @@ const char *mixer_ctl_get_enum_string(struct mixer_ctl *ctl, unsigned int enum_i */ void mixer_ctl_update(struct mixer_ctl *ctl); +int mixer_ctl_is_access_tlv_rw(const struct mixer_ctl *ctl); + /* Set and get mixer controls */ int mixer_ctl_get_percent(const struct mixer_ctl *ctl, unsigned int id); -- cgit v1.2.3 From 3f813e47784674a3909fe1277bc10b70d03791e2 Mon Sep 17 00:00:00 2001 From: Pankaj Bharadiya Date: Mon, 9 Jan 2017 13:42:14 +0530 Subject: Fix the byte control set/get method The TLV byte controls expect a TLV header as well. Check for TLV access and add TLV header size before invoking mixer API. Change-Id: I12ba129e5bbc0676e80eb920e85b3683decfe0db Signed-off-by: Pawse, GuruprasadX Signed-off-by: Pankaj Bharadiya --- include/tinyalsa/mixer.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/tinyalsa/mixer.h b/include/tinyalsa/mixer.h index b9d6cf3..0a48b6f 100644 --- a/include/tinyalsa/mixer.h +++ b/include/tinyalsa/mixer.h @@ -41,6 +41,9 @@ extern "C" { #endif +/* TLV header size*/ +#define TLV_HEADER_SIZE (2 * sizeof(unsigned int)) + struct mixer; struct mixer_ctl; -- cgit v1.2.3