diff mbox

[v3,02/22] uapi/media.h: Declare interface types for ALSA

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

Commit Message

Shuah Khan Feb. 11, 2016, 11:41 p.m. UTC
Declare the interface types to be used on alsa for
the new G_TOPOLOGY ioctl.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 drivers/media/media-entity.c | 16 ++++++++++++++++
 include/uapi/linux/media.h   | 10 ++++++++++
 2 files changed, 26 insertions(+)

Comments

Mauro Carvalho Chehab Feb. 17, 2016, 12:21 p.m. UTC | #1
Em Thu, 11 Feb 2016 16:41:18 -0700
Shuah Khan <shuahkh@osg.samsung.com> escreveu:

> Declare the interface types to be used on alsa for
> the new G_TOPOLOGY ioctl.
> 
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
>  drivers/media/media-entity.c | 16 ++++++++++++++++
>  include/uapi/linux/media.h   | 10 ++++++++++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> index f2e4360..6179543 100644
> --- a/drivers/media/media-entity.c
> +++ b/drivers/media/media-entity.c
> @@ -65,6 +65,22 @@ 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";
> +	case MEDIA_INTF_T_ALSA_SEQUENCER:
> +		return "sequencer";
> +	case MEDIA_INTF_T_ALSA_TIMER:
> +		return "timer";
>  	default:
>  		return "unknown-intf";
>  	}
> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> index c9eb42a..3cc0366 100644
> --- a/include/uapi/linux/media.h
> +++ b/include/uapi/linux/media.h
> @@ -265,6 +265,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 */
>  
> @@ -280,6 +281,15 @@ 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)
> +#define MEDIA_INTF_T_ALSA_SEQUENCER     (MEDIA_INTF_T_ALSA_BASE + 6)
> +#define MEDIA_INTF_T_ALSA_TIMER         (MEDIA_INTF_T_ALSA_BASE + 7)
> +
>  /*
>   * MC next gen API definitions
>   *

Looks OK to me.

Takashi,

If this is OK for you too, would you mind acking it?

Thanks,
Mauro
--
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. 26, 2016, 7:30 p.m. UTC | #2
On 02/17/2016 05:21 AM, Mauro Carvalho Chehab wrote:
> Em Thu, 11 Feb 2016 16:41:18 -0700
> Shuah Khan <shuahkh@osg.samsung.com> escreveu:
> 
>> Declare the interface types to be used on alsa for
>> the new G_TOPOLOGY ioctl.
>>
>> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
>> ---
>>  drivers/media/media-entity.c | 16 ++++++++++++++++
>>  include/uapi/linux/media.h   | 10 ++++++++++
>>  2 files changed, 26 insertions(+)
>>
>> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
>> index f2e4360..6179543 100644
>> --- a/drivers/media/media-entity.c
>> +++ b/drivers/media/media-entity.c
>> @@ -65,6 +65,22 @@ 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";
>> +	case MEDIA_INTF_T_ALSA_SEQUENCER:
>> +		return "sequencer";
>> +	case MEDIA_INTF_T_ALSA_TIMER:
>> +		return "timer";
>>  	default:
>>  		return "unknown-intf";
>>  	}
>> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
>> index c9eb42a..3cc0366 100644
>> --- a/include/uapi/linux/media.h
>> +++ b/include/uapi/linux/media.h
>> @@ -265,6 +265,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 */
>>  
>> @@ -280,6 +281,15 @@ 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)
>> +#define MEDIA_INTF_T_ALSA_SEQUENCER     (MEDIA_INTF_T_ALSA_BASE + 6)
>> +#define MEDIA_INTF_T_ALSA_TIMER         (MEDIA_INTF_T_ALSA_BASE + 7)
>> +
>>  /*
>>   * MC next gen API definitions
>>   *
> 
> Looks OK to me.
> 
> Takashi,
> 
> If this is OK for you too, would you mind acking it?
> 

Hi Takashi,

Are you okay with this patch? Could you please
Ack it.

thanks,
-- Shuah
Takashi Iwai Feb. 26, 2016, 7:38 p.m. UTC | #3
On Fri, 26 Feb 2016 20:30:03 +0100,
Shuah Khan wrote:
> 
> On 02/17/2016 05:21 AM, Mauro Carvalho Chehab wrote:
> > Em Thu, 11 Feb 2016 16:41:18 -0700
> > Shuah Khan <shuahkh@osg.samsung.com> escreveu:
> > 
> >> Declare the interface types to be used on alsa for
> >> the new G_TOPOLOGY ioctl.
> >>
> >> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> >> ---
> >>  drivers/media/media-entity.c | 16 ++++++++++++++++
> >>  include/uapi/linux/media.h   | 10 ++++++++++
> >>  2 files changed, 26 insertions(+)
> >>
> >> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> >> index f2e4360..6179543 100644
> >> --- a/drivers/media/media-entity.c
> >> +++ b/drivers/media/media-entity.c
> >> @@ -65,6 +65,22 @@ 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";
> >> +	case MEDIA_INTF_T_ALSA_SEQUENCER:
> >> +		return "sequencer";
> >> +	case MEDIA_INTF_T_ALSA_TIMER:
> >> +		return "timer";
> >>  	default:
> >>  		return "unknown-intf";
> >>  	}
> >> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> >> index c9eb42a..3cc0366 100644
> >> --- a/include/uapi/linux/media.h
> >> +++ b/include/uapi/linux/media.h
> >> @@ -265,6 +265,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 */
> >>  
> >> @@ -280,6 +281,15 @@ 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)
> >> +#define MEDIA_INTF_T_ALSA_SEQUENCER     (MEDIA_INTF_T_ALSA_BASE + 6)
> >> +#define MEDIA_INTF_T_ALSA_TIMER         (MEDIA_INTF_T_ALSA_BASE + 7)
> >> +
> >>  /*
> >>   * MC next gen API definitions
> >>   *
> > 
> > Looks OK to me.
> > 
> > Takashi,
> > 
> > If this is OK for you too, would you mind acking it?
> > 
> 
> Hi Takashi,
> 
> Are you okay with this patch? Could you please
> Ack it.

Sorry for the late response.
Yes, this definition looks OK to me.

Acked-by: Takashi Iwai <tiwai@suse.de>


thanks,

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
Hans Verkuil March 3, 2016, 2:59 p.m. UTC | #4
On 02/12/16 00:41, Shuah Khan wrote:
> Declare the interface types to be used on alsa for
> the new G_TOPOLOGY ioctl.
> 
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
>  drivers/media/media-entity.c | 16 ++++++++++++++++
>  include/uapi/linux/media.h   | 10 ++++++++++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> index f2e4360..6179543 100644
> --- a/drivers/media/media-entity.c
> +++ b/drivers/media/media-entity.c
> @@ -65,6 +65,22 @@ 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";
> +	case MEDIA_INTF_T_ALSA_SEQUENCER:
> +		return "sequencer";
> +	case MEDIA_INTF_T_ALSA_TIMER:
> +		return "timer";

Wouldn't it be better to add an 'alsa' prefix for all of these?

And 'dvb-' or 'v4l2-' (or v4l-) for the others as well.

Names like 'timer' are very generic. I think it would be a good idea to
make the naming more regular and have it include the subsystem name just
as the define does.

Regards,

	Hans

>  	default:
>  		return "unknown-intf";
>  	}
> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> index c9eb42a..3cc0366 100644
> --- a/include/uapi/linux/media.h
> +++ b/include/uapi/linux/media.h
> @@ -265,6 +265,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 */
>  
> @@ -280,6 +281,15 @@ 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)
> +#define MEDIA_INTF_T_ALSA_SEQUENCER     (MEDIA_INTF_T_ALSA_BASE + 6)
> +#define MEDIA_INTF_T_ALSA_TIMER         (MEDIA_INTF_T_ALSA_BASE + 7)
> +
>  /*
>   * 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 March 3, 2016, 3:57 p.m. UTC | #5
On 03/03/2016 07:59 AM, Hans Verkuil wrote:
> On 02/12/16 00:41, Shuah Khan wrote:
>> Declare the interface types to be used on alsa for
>> the new G_TOPOLOGY ioctl.
>>
>> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
>> ---
>>  drivers/media/media-entity.c | 16 ++++++++++++++++
>>  include/uapi/linux/media.h   | 10 ++++++++++
>>  2 files changed, 26 insertions(+)
>>
>> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
>> index f2e4360..6179543 100644
>> --- a/drivers/media/media-entity.c
>> +++ b/drivers/media/media-entity.c
>> @@ -65,6 +65,22 @@ 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";
>> +	case MEDIA_INTF_T_ALSA_SEQUENCER:
>> +		return "sequencer";
>> +	case MEDIA_INTF_T_ALSA_TIMER:
>> +		return "timer";
> 
> Wouldn't it be better to add an 'alsa' prefix for all of these?
> 
> And 'dvb-' or 'v4l2-' (or v4l-) for the others as well.
> 
> Names like 'timer' are very generic. I think it would be a good idea to
> make the naming more regular and have it include the subsystem name just
> as the define does.
> 
> Regards,
> 
> 	Hans
> 

Yes adding more information 'dvb-' or 'v4l2-' (or v4l-), alsa
to strings would help. I can fix all of them in a separate
patch if that is okay with you.

thanks,
-- Shuah
diff mbox

Patch

diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index f2e4360..6179543 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -65,6 +65,22 @@  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";
+	case MEDIA_INTF_T_ALSA_SEQUENCER:
+		return "sequencer";
+	case MEDIA_INTF_T_ALSA_TIMER:
+		return "timer";
 	default:
 		return "unknown-intf";
 	}
diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
index c9eb42a..3cc0366 100644
--- a/include/uapi/linux/media.h
+++ b/include/uapi/linux/media.h
@@ -265,6 +265,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 */
 
@@ -280,6 +281,15 @@  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)
+#define MEDIA_INTF_T_ALSA_SEQUENCER     (MEDIA_INTF_T_ALSA_BASE + 6)
+#define MEDIA_INTF_T_ALSA_TIMER         (MEDIA_INTF_T_ALSA_BASE + 7)
+
 /*
  * MC next gen API definitions
  *