diff mbox

[01/31] uapi/media.h: Declare interface types for ALSA

Message ID b1d228cdcc9246f7bfe28877e9f6bff174e94993.1452105878.git.shuahkh@osg.samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shuah Khan Jan. 6, 2016, 8:26 p.m. UTC
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

Declare the interface types to be used on alsa for the new
G_TOPOLOGY ioctl.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
---
 drivers/media/media-entity.c | 12 ++++++++++++
 include/uapi/linux/media.h   |  8 ++++++++
 2 files changed, 20 insertions(+)

Comments

Mauro Carvalho Chehab Jan. 28, 2016, 2:59 p.m. UTC | #1
Em Wed,  6 Jan 2016 13:26:50 -0700
Shuah Khan <shuahkh@osg.samsung.com> escreveu:

> From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> 
> Declare the interface types to be used on alsa for the new
> G_TOPOLOGY ioctl.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> ---
>  drivers/media/media-entity.c | 12 ++++++++++++
>  include/uapi/linux/media.h   |  8 ++++++++
>  2 files changed, 20 insertions(+)
> 
> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> index eb38bc3..6e02d19 100644
> --- a/drivers/media/media-entity.c
> +++ b/drivers/media/media-entity.c
> @@ -65,6 +65,18 @@ static inline const char *intf_type(struct media_interface *intf)
>  		return "v4l2-subdev";
>  	case MEDIA_INTF_T_V4L_SWRADIO:
>  		return "swradio";
> +	case MEDIA_INTF_T_ALSA_PCM_CAPTURE:
> +		return "pcm-capture";
> +	case MEDIA_INTF_T_ALSA_PCM_PLAYBACK:
> +		return "pcm-playback";
> +	case MEDIA_INTF_T_ALSA_CONTROL:
> +		return "alsa-control";
> +	case MEDIA_INTF_T_ALSA_COMPRESS:
> +		return "compress";
> +	case MEDIA_INTF_T_ALSA_RAWMIDI:
> +		return "rawmidi";
> +	case MEDIA_INTF_T_ALSA_HWDEP:
> +		return "hwdep";
>  	default:
>  		return "unknown-intf";
>  	}
> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> index cacfceb..75cbe92 100644
> --- a/include/uapi/linux/media.h
> +++ b/include/uapi/linux/media.h
> @@ -252,6 +252,7 @@ struct media_links_enum {
>  
>  #define MEDIA_INTF_T_DVB_BASE	0x00000100
>  #define MEDIA_INTF_T_V4L_BASE	0x00000200
> +#define MEDIA_INTF_T_ALSA_BASE	0x00000300
>  
>  /* Interface types */
>  
> @@ -267,6 +268,13 @@ struct media_links_enum {
>  #define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3)
>  #define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4)
>  
> +#define MEDIA_INTF_T_ALSA_PCM_CAPTURE   (MEDIA_INTF_T_ALSA_BASE)
> +#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK  (MEDIA_INTF_T_ALSA_BASE + 1)
> +#define MEDIA_INTF_T_ALSA_CONTROL       (MEDIA_INTF_T_ALSA_BASE + 2)
> +#define MEDIA_INTF_T_ALSA_COMPRESS      (MEDIA_INTF_T_ALSA_BASE + 3)
> +#define MEDIA_INTF_T_ALSA_RAWMIDI       (MEDIA_INTF_T_ALSA_BASE + 4)
> +#define MEDIA_INTF_T_ALSA_HWDEP         (MEDIA_INTF_T_ALSA_BASE + 5)

Patch looks ok, but please document the new media interfaces at KernelDoc
documentation.

> +
>  /*
>   * MC next gen API definitions
>   *
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Shuah Khan Feb. 1, 2016, 4:07 p.m. UTC | #2
On 01/28/2016 07:59 AM, Mauro Carvalho Chehab wrote:
> Em Wed,  6 Jan 2016 13:26:50 -0700
> Shuah Khan <shuahkh@osg.samsung.com> escreveu:
> 
>> From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
>>
>> Declare the interface types to be used on alsa for the new
>> G_TOPOLOGY ioctl.
>>
>> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
>> ---
>>  drivers/media/media-entity.c | 12 ++++++++++++
>>  include/uapi/linux/media.h   |  8 ++++++++
>>  2 files changed, 20 insertions(+)
>>
>> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
>> index eb38bc3..6e02d19 100644
>> --- a/drivers/media/media-entity.c
>> +++ b/drivers/media/media-entity.c
>> @@ -65,6 +65,18 @@ static inline const char *intf_type(struct media_interface *intf)
>>  		return "v4l2-subdev";
>>  	case MEDIA_INTF_T_V4L_SWRADIO:
>>  		return "swradio";
>> +	case MEDIA_INTF_T_ALSA_PCM_CAPTURE:
>> +		return "pcm-capture";
>> +	case MEDIA_INTF_T_ALSA_PCM_PLAYBACK:
>> +		return "pcm-playback";
>> +	case MEDIA_INTF_T_ALSA_CONTROL:
>> +		return "alsa-control";
>> +	case MEDIA_INTF_T_ALSA_COMPRESS:
>> +		return "compress";
>> +	case MEDIA_INTF_T_ALSA_RAWMIDI:
>> +		return "rawmidi";
>> +	case MEDIA_INTF_T_ALSA_HWDEP:
>> +		return "hwdep";
>>  	default:
>>  		return "unknown-intf";
>>  	}
>> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
>> index cacfceb..75cbe92 100644
>> --- a/include/uapi/linux/media.h
>> +++ b/include/uapi/linux/media.h
>> @@ -252,6 +252,7 @@ struct media_links_enum {
>>  
>>  #define MEDIA_INTF_T_DVB_BASE	0x00000100
>>  #define MEDIA_INTF_T_V4L_BASE	0x00000200
>> +#define MEDIA_INTF_T_ALSA_BASE	0x00000300
>>  
>>  /* Interface types */
>>  
>> @@ -267,6 +268,13 @@ struct media_links_enum {
>>  #define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3)
>>  #define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4)
>>  
>> +#define MEDIA_INTF_T_ALSA_PCM_CAPTURE   (MEDIA_INTF_T_ALSA_BASE)
>> +#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK  (MEDIA_INTF_T_ALSA_BASE + 1)
>> +#define MEDIA_INTF_T_ALSA_CONTROL       (MEDIA_INTF_T_ALSA_BASE + 2)
>> +#define MEDIA_INTF_T_ALSA_COMPRESS      (MEDIA_INTF_T_ALSA_BASE + 3)
>> +#define MEDIA_INTF_T_ALSA_RAWMIDI       (MEDIA_INTF_T_ALSA_BASE + 4)
>> +#define MEDIA_INTF_T_ALSA_HWDEP         (MEDIA_INTF_T_ALSA_BASE + 5)
> 
> Patch looks ok, but please document the new media interfaces at KernelDoc
> documentation.
> 

Hi Takashi,

If you are okay with these changes, could you please
Ack this patch. I am addressing documentation comment
from Mauro.

thanks,
-- Shuah
>> +
>>  /*
>>   * MC next gen API definitions
>>   *
Takashi Iwai Feb. 1, 2016, 4:18 p.m. UTC | #3
On Mon, 01 Feb 2016 17:07:51 +0100,
Shuah Khan wrote:
> 
> On 01/28/2016 07:59 AM, Mauro Carvalho Chehab wrote:
> > Em Wed,  6 Jan 2016 13:26:50 -0700
> > Shuah Khan <shuahkh@osg.samsung.com> escreveu:
> > 
> >> From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> >>
> >> Declare the interface types to be used on alsa for the new
> >> G_TOPOLOGY ioctl.
> >>
> >> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> >> ---
> >>  drivers/media/media-entity.c | 12 ++++++++++++
> >>  include/uapi/linux/media.h   |  8 ++++++++
> >>  2 files changed, 20 insertions(+)
> >>
> >> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> >> index eb38bc3..6e02d19 100644
> >> --- a/drivers/media/media-entity.c
> >> +++ b/drivers/media/media-entity.c
> >> @@ -65,6 +65,18 @@ static inline const char *intf_type(struct media_interface *intf)
> >>  		return "v4l2-subdev";
> >>  	case MEDIA_INTF_T_V4L_SWRADIO:
> >>  		return "swradio";
> >> +	case MEDIA_INTF_T_ALSA_PCM_CAPTURE:
> >> +		return "pcm-capture";
> >> +	case MEDIA_INTF_T_ALSA_PCM_PLAYBACK:
> >> +		return "pcm-playback";
> >> +	case MEDIA_INTF_T_ALSA_CONTROL:
> >> +		return "alsa-control";
> >> +	case MEDIA_INTF_T_ALSA_COMPRESS:
> >> +		return "compress";
> >> +	case MEDIA_INTF_T_ALSA_RAWMIDI:
> >> +		return "rawmidi";
> >> +	case MEDIA_INTF_T_ALSA_HWDEP:
> >> +		return "hwdep";
> >>  	default:
> >>  		return "unknown-intf";
> >>  	}
> >> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> >> index cacfceb..75cbe92 100644
> >> --- a/include/uapi/linux/media.h
> >> +++ b/include/uapi/linux/media.h
> >> @@ -252,6 +252,7 @@ struct media_links_enum {
> >>  
> >>  #define MEDIA_INTF_T_DVB_BASE	0x00000100
> >>  #define MEDIA_INTF_T_V4L_BASE	0x00000200
> >> +#define MEDIA_INTF_T_ALSA_BASE	0x00000300
> >>  
> >>  /* Interface types */
> >>  
> >> @@ -267,6 +268,13 @@ struct media_links_enum {
> >>  #define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3)
> >>  #define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4)
> >>  
> >> +#define MEDIA_INTF_T_ALSA_PCM_CAPTURE   (MEDIA_INTF_T_ALSA_BASE)
> >> +#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK  (MEDIA_INTF_T_ALSA_BASE + 1)
> >> +#define MEDIA_INTF_T_ALSA_CONTROL       (MEDIA_INTF_T_ALSA_BASE + 2)
> >> +#define MEDIA_INTF_T_ALSA_COMPRESS      (MEDIA_INTF_T_ALSA_BASE + 3)
> >> +#define MEDIA_INTF_T_ALSA_RAWMIDI       (MEDIA_INTF_T_ALSA_BASE + 4)
> >> +#define MEDIA_INTF_T_ALSA_HWDEP         (MEDIA_INTF_T_ALSA_BASE + 5)
> > 
> > Patch looks ok, but please document the new media interfaces at KernelDoc
> > documentation.
> > 
> 
> Hi Takashi,
> 
> If you are okay with these changes, could you please
> Ack this patch. I am addressing documentation comment
> from Mauro.

Well, the available ALSA devices are:

CONTROL
SEQUENCER
TIMER
COMPRESS
HWDEP
RAWMIDI
PCM_PLAYBACK
PCM_CAPTURE

as found in sound/minors.h.

Any reason not to define for some of them?


Takashi
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Shuah Khan Feb. 1, 2016, 5:04 p.m. UTC | #4
On 02/01/2016 09:18 AM, Takashi Iwai wrote:
> On Mon, 01 Feb 2016 17:07:51 +0100,
> Shuah Khan wrote:
>>
>> On 01/28/2016 07:59 AM, Mauro Carvalho Chehab wrote:
>>> Em Wed,  6 Jan 2016 13:26:50 -0700
>>> Shuah Khan <shuahkh@osg.samsung.com> escreveu:
>>>
>>>> From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
>>>>
>>>> Declare the interface types to be used on alsa for the new
>>>> G_TOPOLOGY ioctl.
>>>>
>>>> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
>>>> ---
>>>>  drivers/media/media-entity.c | 12 ++++++++++++
>>>>  include/uapi/linux/media.h   |  8 ++++++++
>>>>  2 files changed, 20 insertions(+)
>>>>
>>>> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
>>>> index eb38bc3..6e02d19 100644
>>>> --- a/drivers/media/media-entity.c
>>>> +++ b/drivers/media/media-entity.c
>>>> @@ -65,6 +65,18 @@ static inline const char *intf_type(struct media_interface *intf)
>>>>  		return "v4l2-subdev";
>>>>  	case MEDIA_INTF_T_V4L_SWRADIO:
>>>>  		return "swradio";
>>>> +	case MEDIA_INTF_T_ALSA_PCM_CAPTURE:
>>>> +		return "pcm-capture";
>>>> +	case MEDIA_INTF_T_ALSA_PCM_PLAYBACK:
>>>> +		return "pcm-playback";
>>>> +	case MEDIA_INTF_T_ALSA_CONTROL:
>>>> +		return "alsa-control";
>>>> +	case MEDIA_INTF_T_ALSA_COMPRESS:
>>>> +		return "compress";
>>>> +	case MEDIA_INTF_T_ALSA_RAWMIDI:
>>>> +		return "rawmidi";
>>>> +	case MEDIA_INTF_T_ALSA_HWDEP:
>>>> +		return "hwdep";
>>>>  	default:
>>>>  		return "unknown-intf";
>>>>  	}
>>>> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
>>>> index cacfceb..75cbe92 100644
>>>> --- a/include/uapi/linux/media.h
>>>> +++ b/include/uapi/linux/media.h
>>>> @@ -252,6 +252,7 @@ struct media_links_enum {
>>>>  
>>>>  #define MEDIA_INTF_T_DVB_BASE	0x00000100
>>>>  #define MEDIA_INTF_T_V4L_BASE	0x00000200
>>>> +#define MEDIA_INTF_T_ALSA_BASE	0x00000300
>>>>  
>>>>  /* Interface types */
>>>>  
>>>> @@ -267,6 +268,13 @@ struct media_links_enum {
>>>>  #define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3)
>>>>  #define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4)
>>>>  
>>>> +#define MEDIA_INTF_T_ALSA_PCM_CAPTURE   (MEDIA_INTF_T_ALSA_BASE)
>>>> +#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK  (MEDIA_INTF_T_ALSA_BASE + 1)
>>>> +#define MEDIA_INTF_T_ALSA_CONTROL       (MEDIA_INTF_T_ALSA_BASE + 2)
>>>> +#define MEDIA_INTF_T_ALSA_COMPRESS      (MEDIA_INTF_T_ALSA_BASE + 3)
>>>> +#define MEDIA_INTF_T_ALSA_RAWMIDI       (MEDIA_INTF_T_ALSA_BASE + 4)
>>>> +#define MEDIA_INTF_T_ALSA_HWDEP         (MEDIA_INTF_T_ALSA_BASE + 5)
>>>
>>> Patch looks ok, but please document the new media interfaces at KernelDoc
>>> documentation.
>>>
>>
>> Hi Takashi,
>>
>> If you are okay with these changes, could you please
>> Ack this patch. I am addressing documentation comment
>> from Mauro.
> 
> Well, the available ALSA devices are:
> 
> CONTROL
> SEQUENCER
> TIMER
> COMPRESS
> HWDEP
> RAWMIDI
> PCM_PLAYBACK
> PCM_CAPTURE
> 
> as found in sound/minors.h.
> 
> Any reason not to define for some of them?

Looks like SEQUENCER and TIMER are missing in
the MC defines. I can see how SEQUENCER could
be relevant as an MC node, however not sure
about TIMER use-case. That said, I don't see
any reason for not including it.

I will add Media Interface Types for both
of these missing ones.

thanks,
-- Shuah
diff mbox

Patch

diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index eb38bc3..6e02d19 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -65,6 +65,18 @@  static inline const char *intf_type(struct media_interface *intf)
 		return "v4l2-subdev";
 	case MEDIA_INTF_T_V4L_SWRADIO:
 		return "swradio";
+	case MEDIA_INTF_T_ALSA_PCM_CAPTURE:
+		return "pcm-capture";
+	case MEDIA_INTF_T_ALSA_PCM_PLAYBACK:
+		return "pcm-playback";
+	case MEDIA_INTF_T_ALSA_CONTROL:
+		return "alsa-control";
+	case MEDIA_INTF_T_ALSA_COMPRESS:
+		return "compress";
+	case MEDIA_INTF_T_ALSA_RAWMIDI:
+		return "rawmidi";
+	case MEDIA_INTF_T_ALSA_HWDEP:
+		return "hwdep";
 	default:
 		return "unknown-intf";
 	}
diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
index cacfceb..75cbe92 100644
--- a/include/uapi/linux/media.h
+++ b/include/uapi/linux/media.h
@@ -252,6 +252,7 @@  struct media_links_enum {
 
 #define MEDIA_INTF_T_DVB_BASE	0x00000100
 #define MEDIA_INTF_T_V4L_BASE	0x00000200
+#define MEDIA_INTF_T_ALSA_BASE	0x00000300
 
 /* Interface types */
 
@@ -267,6 +268,13 @@  struct media_links_enum {
 #define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3)
 #define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4)
 
+#define MEDIA_INTF_T_ALSA_PCM_CAPTURE   (MEDIA_INTF_T_ALSA_BASE)
+#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK  (MEDIA_INTF_T_ALSA_BASE + 1)
+#define MEDIA_INTF_T_ALSA_CONTROL       (MEDIA_INTF_T_ALSA_BASE + 2)
+#define MEDIA_INTF_T_ALSA_COMPRESS      (MEDIA_INTF_T_ALSA_BASE + 3)
+#define MEDIA_INTF_T_ALSA_RAWMIDI       (MEDIA_INTF_T_ALSA_BASE + 4)
+#define MEDIA_INTF_T_ALSA_HWDEP         (MEDIA_INTF_T_ALSA_BASE + 5)
+
 /*
  * MC next gen API definitions
  *