diff mbox

[v2,3/3] ALSA: topology: Export ID types for TLV controls.

Message ID 1432574570-7436-3-git-send-email-liam.r.girdwood@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Liam Girdwood May 25, 2015, 5:22 p.m. UTC
Make sure userspace can define TLV controls for topolofy using the correct
type numbers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
---
 include/sound/tlv.h      |  7 +------
 include/uapi/sound/tlv.h | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+), 6 deletions(-)
 create mode 100644 include/uapi/sound/tlv.h

Comments

Liam Girdwood May 28, 2015, 2:47 p.m. UTC | #1
On Mon, 2015-05-25 at 18:22 +0100, Liam Girdwood wrote:
> Make sure userspace can define TLV controls for topolofy using the correct
> type numbers.
> 
> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
> ---
>  include/sound/tlv.h      |  7 +------
>  include/uapi/sound/tlv.h | 23 +++++++++++++++++++++++
>  2 files changed, 24 insertions(+), 6 deletions(-)
>  create mode 100644 include/uapi/sound/tlv.h
> 
> diff --git a/include/sound/tlv.h b/include/sound/tlv.h

Takashi, do you want this rolled into uapi/sound/asound.h or is it fine
as a separate file ?

Liam

> index e11e179..7209331 100644
> --- a/include/sound/tlv.h
> +++ b/include/sound/tlv.h
> @@ -31,12 +31,7 @@
>   *                       ~(sizeof(unsigned int) - 1)) ....
>   */
>  
> -#define SNDRV_CTL_TLVT_CONTAINER 0	/* one level down - group of TLVs */
> -#define SNDRV_CTL_TLVT_DB_SCALE	1       /* dB scale */
> -#define SNDRV_CTL_TLVT_DB_LINEAR 2	/* linear volume */
> -#define SNDRV_CTL_TLVT_DB_RANGE 3	/* dB range container */
> -#define SNDRV_CTL_TLVT_DB_MINMAX 4	/* dB scale with min/max */
> -#define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5	/* dB scale with min/max with mute */
> +#include <uapi/sound/tlv.h>
>  
>  #define TLV_ITEM(type, ...) \
>  	(type), TLV_LENGTH(__VA_ARGS__), __VA_ARGS__
> diff --git a/include/uapi/sound/tlv.h b/include/uapi/sound/tlv.h
> new file mode 100644
> index 0000000..33d747d
> --- /dev/null
> +++ b/include/uapi/sound/tlv.h
> @@ -0,0 +1,23 @@
> +/*
> + *   This program is free software; you can redistribute it and/or modify
> + *   it under the terms of the GNU General Public License as published by
> + *   the Free Software Foundation; either version 2 of the License, or
> + *   (at your option) any later version.
> + *
> + *   This program is distributed in the hope that it will be useful,
> + *   but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *   GNU General Public License for more details.
> + */
> +
> +#ifndef __UAPI_SOUND_TLV_H
> +#define __UAPI_SOUND_TLV_H
> +
> +#define SNDRV_CTL_TLVT_CONTAINER 0	/* one level down - group of TLVs */
> +#define SNDRV_CTL_TLVT_DB_SCALE	1       /* dB scale */
> +#define SNDRV_CTL_TLVT_DB_LINEAR 2	/* linear volume */
> +#define SNDRV_CTL_TLVT_DB_RANGE 3	/* dB range container */
> +#define SNDRV_CTL_TLVT_DB_MINMAX 4	/* dB scale with min/max */
> +#define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5	/* dB scale with min/max with mute */
> +
> +#endif
Takashi Iwai May 28, 2015, 2:59 p.m. UTC | #2
At Thu, 28 May 2015 15:47:36 +0100,
Liam Girdwood wrote:
> 
> On Mon, 2015-05-25 at 18:22 +0100, Liam Girdwood wrote:
> > Make sure userspace can define TLV controls for topolofy using the correct
> > type numbers.
> > 
> > Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
> > ---
> >  include/sound/tlv.h      |  7 +------
> >  include/uapi/sound/tlv.h | 23 +++++++++++++++++++++++
> >  2 files changed, 24 insertions(+), 6 deletions(-)
> >  create mode 100644 include/uapi/sound/tlv.h
> > 
> > diff --git a/include/sound/tlv.h b/include/sound/tlv.h
> 
> Takashi, do you want this rolled into uapi/sound/asound.h or is it fine
> as a separate file ?

I think uapi/sound/tlv.h is fine.

But don't forget to export other consts.  For example,
SNDRV_CTL_TLVT_CHMAP_* are also reserved for channel-maps.


thanks,

Takashi
diff mbox

Patch

diff --git a/include/sound/tlv.h b/include/sound/tlv.h
index e11e179..7209331 100644
--- a/include/sound/tlv.h
+++ b/include/sound/tlv.h
@@ -31,12 +31,7 @@ 
  *                       ~(sizeof(unsigned int) - 1)) ....
  */
 
-#define SNDRV_CTL_TLVT_CONTAINER 0	/* one level down - group of TLVs */
-#define SNDRV_CTL_TLVT_DB_SCALE	1       /* dB scale */
-#define SNDRV_CTL_TLVT_DB_LINEAR 2	/* linear volume */
-#define SNDRV_CTL_TLVT_DB_RANGE 3	/* dB range container */
-#define SNDRV_CTL_TLVT_DB_MINMAX 4	/* dB scale with min/max */
-#define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5	/* dB scale with min/max with mute */
+#include <uapi/sound/tlv.h>
 
 #define TLV_ITEM(type, ...) \
 	(type), TLV_LENGTH(__VA_ARGS__), __VA_ARGS__
diff --git a/include/uapi/sound/tlv.h b/include/uapi/sound/tlv.h
new file mode 100644
index 0000000..33d747d
--- /dev/null
+++ b/include/uapi/sound/tlv.h
@@ -0,0 +1,23 @@ 
+/*
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ */
+
+#ifndef __UAPI_SOUND_TLV_H
+#define __UAPI_SOUND_TLV_H
+
+#define SNDRV_CTL_TLVT_CONTAINER 0	/* one level down - group of TLVs */
+#define SNDRV_CTL_TLVT_DB_SCALE	1       /* dB scale */
+#define SNDRV_CTL_TLVT_DB_LINEAR 2	/* linear volume */
+#define SNDRV_CTL_TLVT_DB_RANGE 3	/* dB range container */
+#define SNDRV_CTL_TLVT_DB_MINMAX 4	/* dB scale with min/max */
+#define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5	/* dB scale with min/max with mute */
+
+#endif