Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1326392 > unrolled thread
| Started by | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| First post | 2016-02-04 05:20 +0100 |
| Last post | 2016-02-04 12:00 +0100 |
| Articles | 6 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v2 00/22] Sharing media resources across ALSA and au0828 drivers Shuah Khan <shuahkh@osg.samsung.com> - 2016-02-04 05:20 +0100
[PATCH v2 03/22] media: Media Controller register/unregister entity_notify API Shuah Khan <shuahkh@osg.samsung.com> - 2016-02-04 05:20 +0100
Re: [PATCH v2 03/22] media: Media Controller register/unregister entity_notify API Mauro Carvalho Chehab <mchehab@osg.samsung.com> - 2016-02-04 10:10 +0100
[PATCH v2 04/22] media: Media Controller enable/disable source handler API Shuah Khan <shuahkh@osg.samsung.com> - 2016-02-04 05:20 +0100
[PATCH v2 08/22] media: Move au8522_media_pads enum to au8522.h from au8522_priv.h Shuah Khan <shuahkh@osg.samsung.com> - 2016-02-04 05:20 +0100
Re: [PATCH v2 00/22] Sharing media resources across ALSA and au0828 drivers Mauro Carvalho Chehab <mchehab@osg.samsung.com> - 2016-02-04 12:00 +0100
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Date | 2016-02-04 05:20 +0100 |
| Subject | [PATCH v2 00/22] Sharing media resources across ALSA and au0828 drivers |
| Message-ID | <qYjoZ-3uR-3@gated-at.bofh.it> |
This patch series updates ALSA driver, and au0828 core
driver to use Managed Media controller API and Media
Controller API to share media resource (tuner).
This Patch v2 series is based on linux_media master.
This work addresses Mauro and Takashi's comments.
Composite or S-Video connector is the input case
is still under discussion and isn't addressed in
this series.
Patches 3 and 4 need documentation updates and will
be sent later this week.
Shuah Khan (22):
uapi/media.h: Declare interface types for ALSA
media: Add ALSA Media Controller function entities
media: Media Controller register/unregister entity_notify API
media: Media Controller enable/disable source handler API
media: Media Controller export non locking __media_entity_setup_link()
media: Media Controller non-locking
__media_entity_pipeline_start/stop()
media: v4l-core add enable/disable source common interfaces
media: Move au8522_media_pads enum to au8522.h from au8522_priv.h
media: au8522 change to create MC pad for ALSA Audio Out
media: Change v4l-core to check if source is free
media: dvb-frontend invoke enable/disable_source handlers
media: au0828 video remove au0828_enable_analog_tuner()
media: au0828 video change to use v4l_enable_media_source()
media: au0828 change to use Managed Media Controller API
media: au0828 handle media_init and media_register window
media: au0828 create tuner to decoder link in disabled state
media: au0828 disable tuner to demod link
media: au0828 Use au8522_media_pads enum for pad defines
media: au0828-core register entity_notify hook
media: au0828 add enable, disable source handlers
sound/usb: Use Media Controller API to share media resources
media: Ensure media device unregister is done only once
drivers/media/dvb-core/dvb_frontend.c | 139 ++----------
drivers/media/dvb-core/dvb_frontend.h | 3 +
drivers/media/dvb-frontends/au8522.h | 8 +
drivers/media/dvb-frontends/au8522_decoder.c | 1 +
drivers/media/dvb-frontends/au8522_priv.h | 8 -
drivers/media/media-device.c | 73 +++++-
drivers/media/media-devnode.c | 15 +-
drivers/media/media-entity.c | 51 ++++-
drivers/media/usb/au0828/au0828-core.c | 272 +++++++++++++++++++++--
drivers/media/usb/au0828/au0828-video.c | 75 +------
drivers/media/usb/au0828/au0828.h | 4 +
drivers/media/v4l2-core/Makefile | 2 +-
drivers/media/v4l2-core/v4l2-fh.c | 2 +
drivers/media/v4l2-core/v4l2-ioctl.c | 30 +++
drivers/media/v4l2-core/v4l2-mc.c | 60 +++++
drivers/media/v4l2-core/videobuf2-core.c | 4 +
include/media/media-device.h | 44 ++++
include/media/media-devnode.h | 17 ++
include/media/media-entity.h | 12 +
include/media/v4l2-dev.h | 1 +
include/media/v4l2-mc.h | 52 +++++
include/uapi/linux/media.h | 33 +++
sound/usb/Kconfig | 4 +
sound/usb/Makefile | 2 +
sound/usb/card.c | 14 ++
sound/usb/card.h | 1 +
sound/usb/media.c | 319 +++++++++++++++++++++++++++
sound/usb/media.h | 72 ++++++
sound/usb/mixer.h | 1 +
sound/usb/pcm.c | 28 ++-
sound/usb/quirks-table.h | 1 +
sound/usb/stream.c | 2 +
sound/usb/usbaudio.h | 3 +
33 files changed, 1117 insertions(+), 236 deletions(-)
create mode 100644 drivers/media/v4l2-core/v4l2-mc.c
create mode 100644 sound/usb/media.c
create mode 100644 sound/usb/media.h
--
2.5.0
[toc] | [next] | [standalone]
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Date | 2016-02-04 05:20 +0100 |
| Subject | [PATCH v2 03/22] media: Media Controller register/unregister entity_notify API |
| Message-ID | <qYjyG-3ys-7@gated-at.bofh.it> |
| In reply to | #1326392 |
Add new interfaces to register and unregister entity_notify
hook to media device. These interfaces allow drivers to add
hooks to take appropriate actions when new entities get added
to a shared media device. For example, au0828 bridge driver
registers an entity_notify hook to create links as needed
between media graph nodes.
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
drivers/media/media-device.c | 61 ++++++++++++++++++++++++++++++++++++++++++++
include/media/media-device.h | 25 ++++++++++++++++++
2 files changed, 86 insertions(+)
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 4d1c13d..1f5d67e 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -536,6 +536,7 @@ static void media_device_release(struct media_devnode *mdev)
int __must_check media_device_register_entity(struct media_device *mdev,
struct media_entity *entity)
{
+ struct media_entity_notify *notify, *next;
unsigned int i;
int ret;
@@ -575,6 +576,11 @@ int __must_check media_device_register_entity(struct media_device *mdev,
media_gobj_create(mdev, MEDIA_GRAPH_PAD,
&entity->pads[i].graph_obj);
+ /* invoke entity_notify callbacks */
+ list_for_each_entry_safe(notify, next, &mdev->entity_notify, list) {
+ (notify)->notify(entity, notify->notify_data);
+ }
+
spin_unlock(&mdev->lock);
return 0;
@@ -608,6 +614,8 @@ static void __media_device_unregister_entity(struct media_entity *entity)
/* Remove the entity */
media_gobj_destroy(&entity->graph_obj);
+ /* invoke entity_notify callbacks to handle entity removal?? */
+
entity->graph_obj.mdev = NULL;
}
@@ -640,6 +648,7 @@ void media_device_init(struct media_device *mdev)
INIT_LIST_HEAD(&mdev->interfaces);
INIT_LIST_HEAD(&mdev->pads);
INIT_LIST_HEAD(&mdev->links);
+ INIT_LIST_HEAD(&mdev->entity_notify);
spin_lock_init(&mdev->lock);
mutex_init(&mdev->graph_mutex);
ida_init(&mdev->entity_internal_idx);
@@ -685,11 +694,59 @@ int __must_check __media_device_register(struct media_device *mdev,
}
EXPORT_SYMBOL_GPL(__media_device_register);
+/**
+ * media_device_register_entity_notify - Register a media entity notify
+ * callback with a media device. When a new entity is registered, all
+ * the registered media_entity_notify callbacks are invoked.
+ * @mdev: The media device
+ * @nptr: The media_entity_notify
+ */
+int __must_check media_device_register_entity_notify(struct media_device *mdev,
+ struct media_entity_notify *nptr)
+{
+ spin_lock(&mdev->lock);
+ list_add_tail(&nptr->list, &mdev->entity_notify);
+ spin_unlock(&mdev->lock);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(media_device_register_entity_notify);
+
+/**
+ * __media_device_unregister_entity_notify - Unregister a media entity notify
+ * callback with a media device. When a new entity is registered, all
+ * the registered media_entity_notify callbacks are invoked.
+ * @mdev: The media device
+ * @nptr: The media_entity_notify
+ * Non-locking version. Should be called with mdev->lock held.
+ */
+static void __media_device_unregister_entity_notify(struct media_device *mdev,
+ struct media_entity_notify *nptr)
+{
+ list_del(&nptr->list);
+}
+
+/**
+ * media_device_unregister_entity_notify - Unregister a media entity notify
+ * callback with a media device. When a new entity is registered, all
+ * the registered media_entity_notify callbacks are invoked.
+ * @mdev: The media device
+ * @nptr: The media_entity_notify
+ */
+void media_device_unregister_entity_notify(struct media_device *mdev,
+ struct media_entity_notify *nptr)
+{
+ spin_lock(&mdev->lock);
+ __media_device_unregister_entity_notify(mdev, nptr);
+ spin_unlock(&mdev->lock);
+}
+EXPORT_SYMBOL_GPL(media_device_unregister_entity_notify);
+
void media_device_unregister(struct media_device *mdev)
{
struct media_entity *entity;
struct media_entity *next;
struct media_interface *intf, *tmp_intf;
+ struct media_entity_notify *notify, *nextp;
if (mdev == NULL)
return;
@@ -706,6 +763,10 @@ void media_device_unregister(struct media_device *mdev)
list_for_each_entry_safe(entity, next, &mdev->entities, graph_obj.list)
__media_device_unregister_entity(entity);
+ /* Remove all entity_notify callbacks from the media device */
+ list_for_each_entry_safe(notify, nextp, &mdev->entity_notify, list)
+ __media_device_unregister_entity_notify(mdev, notify);
+
/* Remove all interfaces from the media device */
list_for_each_entry_safe(intf, tmp_intf, &mdev->interfaces,
graph_obj.list) {
diff --git a/include/media/media-device.h b/include/media/media-device.h
index d385589..bad8242a 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -264,6 +264,12 @@
struct ida;
struct device;
+struct media_entity_notify {
+ struct list_head list;
+ void *notify_data;
+ void (*notify)(struct media_entity *entity, void *notify_data);
+};
+
/**
* struct media_device - Media device
* @dev: Parent device
@@ -319,6 +325,9 @@ struct media_device {
struct list_head pads;
struct list_head links;
+ /* notify callback list invoked when a new entity is registered */
+ struct list_head entity_notify;
+
/* Protects the graph objects creation/removal */
spinlock_t lock;
/* Serializes graph operations. */
@@ -497,6 +506,11 @@ int __must_check media_device_register_entity(struct media_device *mdev,
*/
void media_device_unregister_entity(struct media_entity *entity);
+int __must_check media_device_register_entity_notify(struct media_device *mdev,
+ struct media_entity_notify *nptr);
+void media_device_unregister_entity_notify(struct media_device *mdev,
+ struct media_entity_notify *nptr);
+
/**
* media_device_get_devres() - get media device as device resource
* creates if one doesn't exist
@@ -552,6 +566,17 @@ static inline int media_device_register_entity(struct media_device *mdev,
static inline void media_device_unregister_entity(struct media_entity *entity)
{
}
+static inline int media_device_register_entity_notify(
+ struct media_device *mdev,
+ struct media_entity_notify *nptr)
+{
+ return 0;
+}
+static inline void media_device_unregister_entity_notify(
+ struct media_device *mdev,
+ struct media_entity_notify *nptr)
+{
+}
static inline struct media_device *media_device_get_devres(struct device *dev)
{
return NULL;
--
2.5.0
[toc] | [prev] | [next] | [standalone]
| From | Mauro Carvalho Chehab <mchehab@osg.samsung.com> |
|---|---|
| Date | 2016-02-04 10:10 +0100 |
| Subject | Re: [PATCH v2 03/22] media: Media Controller register/unregister entity_notify API |
| Message-ID | <qYo5k-6yj-5@gated-at.bofh.it> |
| In reply to | #1326394 |
Em Wed, 03 Feb 2016 21:03:35 -0700
Shuah Khan <shuahkh@osg.samsung.com> escreveu:
> Add new interfaces to register and unregister entity_notify
> hook to media device. These interfaces allow drivers to add
> hooks to take appropriate actions when new entities get added
> to a shared media device. For example, au0828 bridge driver
> registers an entity_notify hook to create links as needed
> between media graph nodes.
Shuah,
It seems you didn't address the documentation issues I pointed on the
last review. While not ideal, I'll accept, in this specific case,
although this requires an extra time for me (as I want to read the
documentation *before* actually reviewing the patches), I'm OK
if you send the documentation a the end of the series, but please
send it *together* with the patch series.
That affect not only me, but others that build documentation and
gets lots of errors if something is not documented at the right
place.
See below for some notes. I won't be commenting documentation on
the rest of this patch series.
>
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
> drivers/media/media-device.c | 61 ++++++++++++++++++++++++++++++++++++++++++++
> include/media/media-device.h | 25 ++++++++++++++++++
> 2 files changed, 86 insertions(+)
>
> diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
> index 4d1c13d..1f5d67e 100644
> --- a/drivers/media/media-device.c
> +++ b/drivers/media/media-device.c
> @@ -536,6 +536,7 @@ static void media_device_release(struct media_devnode *mdev)
> int __must_check media_device_register_entity(struct media_device *mdev,
> struct media_entity *entity)
> {
> + struct media_entity_notify *notify, *next;
> unsigned int i;
> int ret;
>
> @@ -575,6 +576,11 @@ int __must_check media_device_register_entity(struct media_device *mdev,
> media_gobj_create(mdev, MEDIA_GRAPH_PAD,
> &entity->pads[i].graph_obj);
>
> + /* invoke entity_notify callbacks */
> + list_for_each_entry_safe(notify, next, &mdev->entity_notify, list) {
> + (notify)->notify(entity, notify->notify_data);
> + }
> +
> spin_unlock(&mdev->lock);
>
> return 0;
> @@ -608,6 +614,8 @@ static void __media_device_unregister_entity(struct media_entity *entity)
> /* Remove the entity */
> media_gobj_destroy(&entity->graph_obj);
>
> + /* invoke entity_notify callbacks to handle entity removal?? */
> +
> entity->graph_obj.mdev = NULL;
> }
>
> @@ -640,6 +648,7 @@ void media_device_init(struct media_device *mdev)
> INIT_LIST_HEAD(&mdev->interfaces);
> INIT_LIST_HEAD(&mdev->pads);
> INIT_LIST_HEAD(&mdev->links);
> + INIT_LIST_HEAD(&mdev->entity_notify);
> spin_lock_init(&mdev->lock);
> mutex_init(&mdev->graph_mutex);
> ida_init(&mdev->entity_internal_idx);
> @@ -685,11 +694,59 @@ int __must_check __media_device_register(struct media_device *mdev,
> }
> EXPORT_SYMBOL_GPL(__media_device_register);
>
> +/**
> + * media_device_register_entity_notify - Register a media entity notify
> + * callback with a media device. When a new entity is registered, all
> + * the registered media_entity_notify callbacks are invoked.
> + * @mdev: The media device
> + * @nptr: The media_entity_notify
> + */
Please split the comments into a short description and a detailed
description, and add blank lines to make it easier to be read by
mortals.
The short description appears at the index of the html page:
https://linuxtv.org/downloads/v4l-dvb-internals/device-drivers/ch06s04.html
So, we want it to be short ;)
The detailed description appears at the end:
https://linuxtv.org/downloads/v4l-dvb-internals/device-drivers/API-dvb-create-media-graph.html
Btw, in the above comment, you don't have actually a detailed description,
but, instead, a note. So, the best would be do to it as:
/**
* media_device_register_entity_notify() - Register a media entity notify
* callback with a media device.
*
* @mdev: The media device
* @nptr: The media_entity_notify
*
* NOTE: When a new entity is registered, all the registered
* media_entity_notify callbacks are invoked.
*/
The "NOTE: foo" will appear as:
https://linuxtv.org/downloads/v4l-dvb-internals/device-drivers/API-media-device-register-entity.html
P.S.: Don't forget to test if everything is OK with:
rm Documentation/DocBook/device-drivers.aux.xml Documentation/DocBook/device-drivers.xml
LC_ALL=en_US.UTF-8 make DOCBOOKS=device-drivers.xml htmldocs
The same note applied to the other DocBook tags you added.
Btw, add the documentation *only* at the .h.
> +int __must_check media_device_register_entity_notify(struct media_device *mdev,
> + struct media_entity_notify *nptr)
> +{
> + spin_lock(&mdev->lock);
> + list_add_tail(&nptr->list, &mdev->entity_notify);
> + spin_unlock(&mdev->lock);
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(media_device_register_entity_notify);
> +
> +/**
> + * __media_device_unregister_entity_notify - Unregister a media entity notify
> + * callback with a media device. When a new entity is registered, all
> + * the registered media_entity_notify callbacks are invoked.
> + * @mdev: The media device
> + * @nptr: The media_entity_notify
> + * Non-locking version. Should be called with mdev->lock held.
> + */
> +static void __media_device_unregister_entity_notify(struct media_device *mdev,
> + struct media_entity_notify *nptr)
> +{
> + list_del(&nptr->list);
> +}
> +
> +/**
> + * media_device_unregister_entity_notify - Unregister a media entity notify
> + * callback with a media device. When a new entity is registered, all
> + * the registered media_entity_notify callbacks are invoked.
> + * @mdev: The media device
> + * @nptr: The media_entity_notify
> + */
> +void media_device_unregister_entity_notify(struct media_device *mdev,
> + struct media_entity_notify *nptr)
> +{
> + spin_lock(&mdev->lock);
> + __media_device_unregister_entity_notify(mdev, nptr);
> + spin_unlock(&mdev->lock);
> +}
> +EXPORT_SYMBOL_GPL(media_device_unregister_entity_notify);
> +
> void media_device_unregister(struct media_device *mdev)
> {
> struct media_entity *entity;
> struct media_entity *next;
> struct media_interface *intf, *tmp_intf;
> + struct media_entity_notify *notify, *nextp;
>
> if (mdev == NULL)
> return;
> @@ -706,6 +763,10 @@ void media_device_unregister(struct media_device *mdev)
> list_for_each_entry_safe(entity, next, &mdev->entities, graph_obj.list)
> __media_device_unregister_entity(entity);
>
> + /* Remove all entity_notify callbacks from the media device */
> + list_for_each_entry_safe(notify, nextp, &mdev->entity_notify, list)
> + __media_device_unregister_entity_notify(mdev, notify);
> +
> /* Remove all interfaces from the media device */
> list_for_each_entry_safe(intf, tmp_intf, &mdev->interfaces,
> graph_obj.list) {
> diff --git a/include/media/media-device.h b/include/media/media-device.h
> index d385589..bad8242a 100644
> --- a/include/media/media-device.h
> +++ b/include/media/media-device.h
> @@ -264,6 +264,12 @@
> struct ida;
> struct device;
>
> +struct media_entity_notify {
> + struct list_head list;
> + void *notify_data;
> + void (*notify)(struct media_entity *entity, void *notify_data);
> +};
> +
Documentation is missing.
> /**
> * struct media_device - Media device
> * @dev: Parent device
> @@ -319,6 +325,9 @@ struct media_device {
> struct list_head pads;
> struct list_head links;
>
> + /* notify callback list invoked when a new entity is registered */
> + struct list_head entity_notify;
> +
Documentation is missing. You should have noticed if you tried to
generate the docbook, as it would produce an error like:
include/media/media-device.h:357: warning: No description found for parameter 'entity_notify'
as reported by kbuild test robot.
> /* Protects the graph objects creation/removal */
> spinlock_t lock;
> /* Serializes graph operations. */
> @@ -497,6 +506,11 @@ int __must_check media_device_register_entity(struct media_device *mdev,
> */
> void media_device_unregister_entity(struct media_entity *entity);
>
> +int __must_check media_device_register_entity_notify(struct media_device *mdev,
> + struct media_entity_notify *nptr);
> +void media_device_unregister_entity_notify(struct media_device *mdev,
> + struct media_entity_notify *nptr);
> +
Documentation is missing.
> /**
> * media_device_get_devres() - get media device as device resource
> * creates if one doesn't exist
> @@ -552,6 +566,17 @@ static inline int media_device_register_entity(struct media_device *mdev,
> static inline void media_device_unregister_entity(struct media_entity *entity)
> {
> }
> +static inline int media_device_register_entity_notify(
> + struct media_device *mdev,
> + struct media_entity_notify *nptr)
> +{
> + return 0;
> +}
> +static inline void media_device_unregister_entity_notify(
> + struct media_device *mdev,
> + struct media_entity_notify *nptr)
> +{
> +}
Documentation is missing.
> static inline struct media_device *media_device_get_devres(struct device *dev)
> {
> return NULL;
[toc] | [prev] | [next] | [standalone]
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Date | 2016-02-04 05:20 +0100 |
| Subject | [PATCH v2 04/22] media: Media Controller enable/disable source handler API |
| Message-ID | <qYjyG-3ys-5@gated-at.bofh.it> |
| In reply to | #1326392 |
Add new fields to struct media_device to add enable_source, and
disable_source handlers, and source_priv to stash driver private
data that is used to run these handlers. The enable_source handler
finds source entity for the passed in entity and checks if it is
available. When link is found, it activates it. Disable source
handler deactivates the link.
Bridge driver is expected to implement and set these handlers.
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
include/media/media-device.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/include/media/media-device.h b/include/media/media-device.h
index bad8242a..9415f1b 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -333,6 +333,25 @@ struct media_device {
/* Serializes graph operations. */
struct mutex graph_mutex;
+ /* Handlers to find source entity for the sink entity and
+ * check if it is available, and activate the link using
+ * media_entity_setup_link() interface and start pipeline
+ * from the source to the entity.
+ * Bridge driver is expected to implement and set the
+ * handler when media_device is registered or when
+ * bridge driver finds the media_device during probe.
+ * Bridge driver sets source_priv with information
+ * necessary to run enable/disable source handlers.
+ *
+ * Use-case: find tuner entity connected to the decoder
+ * entity and check if it is available, and activate the
+ * using media_entity_setup_link() if it is available.
+ */
+ void *source_priv;
+ int (*enable_source)(struct media_entity *entity,
+ struct media_pipeline *pipe);
+ void (*disable_source)(struct media_entity *entity);
+
int (*link_notify)(struct media_link *link, u32 flags,
unsigned int notification);
};
--
2.5.0
[toc] | [prev] | [next] | [standalone]
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Date | 2016-02-04 05:20 +0100 |
| Subject | [PATCH v2 08/22] media: Move au8522_media_pads enum to au8522.h from au8522_priv.h |
| Message-ID | <qYjyG-3ys-9@gated-at.bofh.it> |
| In reply to | #1326392 |
Move the au8522_media_pads enum to au8522.h
from au8522_priv.h to export them. This will
allow au0828-core to use these defines instead
of hard-coding them them.
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
drivers/media/dvb-frontends/au8522.h | 7 +++++++
drivers/media/dvb-frontends/au8522_priv.h | 8 --------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/media/dvb-frontends/au8522.h b/drivers/media/dvb-frontends/au8522.h
index dde6158..3c72f40 100644
--- a/drivers/media/dvb-frontends/au8522.h
+++ b/drivers/media/dvb-frontends/au8522.h
@@ -90,4 +90,11 @@ enum au8522_audio_input {
AU8522_AUDIO_SIF,
};
+enum au8522_media_pads {
+ AU8522_PAD_INPUT,
+ AU8522_PAD_VID_OUT,
+ AU8522_PAD_VBI_OUT,
+
+ AU8522_NUM_PADS
+};
#endif /* __AU8522_H__ */
diff --git a/drivers/media/dvb-frontends/au8522_priv.h b/drivers/media/dvb-frontends/au8522_priv.h
index 404a0cb..505215a 100644
--- a/drivers/media/dvb-frontends/au8522_priv.h
+++ b/drivers/media/dvb-frontends/au8522_priv.h
@@ -39,14 +39,6 @@
#define AU8522_DIGITAL_MODE 1
#define AU8522_SUSPEND_MODE 2
-enum au8522_media_pads {
- AU8522_PAD_INPUT,
- AU8522_PAD_VID_OUT,
- AU8522_PAD_VBI_OUT,
-
- AU8522_NUM_PADS
-};
-
struct au8522_state {
struct i2c_client *c;
struct i2c_adapter *i2c;
--
2.5.0
[toc] | [prev] | [next] | [standalone]
| From | Mauro Carvalho Chehab <mchehab@osg.samsung.com> |
|---|---|
| Date | 2016-02-04 12:00 +0100 |
| Subject | Re: [PATCH v2 00/22] Sharing media resources across ALSA and au0828 drivers |
| Message-ID | <qYpNN-7uB-33@gated-at.bofh.it> |
| In reply to | #1326392 |
Em Wed, 03 Feb 2016 21:03:32 -0700
Shuah Khan <shuahkh@osg.samsung.com> escreveu:
> This patch series updates ALSA driver, and au0828 core
> driver to use Managed Media controller API and Media
> Controller API to share media resource (tuner).
Please see my comments to patch 20. I guess this series break support
for the digital-only boards below (where .has_analog is not set):
[AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL] = {
.name = "Hauppauge HVR950Q rev xxF8",
.tuner_type = TUNER_XC5000,
.tuner_addr = 0x61,
.i2c_clk_divider = AU0828_I2C_CLK_250KHZ,
},
[AU0828_BOARD_DVICO_FUSIONHDTV7] = {
.name = "DViCO FusionHDTV USB",
.tuner_type = TUNER_XC5000,
.tuner_addr = 0x61,
.i2c_clk_divider = AU0828_I2C_CLK_250KHZ,
},
[AU0828_BOARD_HAUPPAUGE_WOODBURY] = {
.name = "Hauppauge Woodbury",
.tuner_type = TUNER_NXP_TDA18271,
.tuner_addr = 0x60,
.i2c_clk_divider = AU0828_I2C_CLK_250KHZ,
},
None of this boards have V4L2. So, only the DVB part of the driver
should be enabled. Well, the DVB core won't be creating a tuner
subdev. So, calling au0828_enable_source() (and disable source) would
return -ENODEV, causing the driver to fail.
>
> This Patch v2 series is based on linux_media master.
> This work addresses Mauro and Takashi's comments.
It is in a way better shape, but there are still several things I
noticed :)
Please see my per-patch review.
>
> Composite or S-Video connector is the input case
> is still under discussion and isn't addressed in
> this series.
You need at least address pure DVB boards at patch 20 and
add there a FIXME for the composite/svideo connector pending
issue.
>
> Patches 3 and 4 need documentation updates and will
> be sent later this week.
Please send documentation at the same series. Nobody wants to see the
documentation warnings when checking at the main media development
branch or at -next. Also, it helps to better understand the changes.
Regards,
Mauro
>
> Shuah Khan (22):
> uapi/media.h: Declare interface types for ALSA
> media: Add ALSA Media Controller function entities
> media: Media Controller register/unregister entity_notify API
> media: Media Controller enable/disable source handler API
> media: Media Controller export non locking __media_entity_setup_link()
> media: Media Controller non-locking
> __media_entity_pipeline_start/stop()
> media: v4l-core add enable/disable source common interfaces
> media: Move au8522_media_pads enum to au8522.h from au8522_priv.h
> media: au8522 change to create MC pad for ALSA Audio Out
> media: Change v4l-core to check if source is free
> media: dvb-frontend invoke enable/disable_source handlers
> media: au0828 video remove au0828_enable_analog_tuner()
> media: au0828 video change to use v4l_enable_media_source()
> media: au0828 change to use Managed Media Controller API
> media: au0828 handle media_init and media_register window
> media: au0828 create tuner to decoder link in disabled state
> media: au0828 disable tuner to demod link
> media: au0828 Use au8522_media_pads enum for pad defines
> media: au0828-core register entity_notify hook
> media: au0828 add enable, disable source handlers
> sound/usb: Use Media Controller API to share media resources
> media: Ensure media device unregister is done only once
>
> drivers/media/dvb-core/dvb_frontend.c | 139 ++----------
> drivers/media/dvb-core/dvb_frontend.h | 3 +
> drivers/media/dvb-frontends/au8522.h | 8 +
> drivers/media/dvb-frontends/au8522_decoder.c | 1 +
> drivers/media/dvb-frontends/au8522_priv.h | 8 -
> drivers/media/media-device.c | 73 +++++-
> drivers/media/media-devnode.c | 15 +-
> drivers/media/media-entity.c | 51 ++++-
> drivers/media/usb/au0828/au0828-core.c | 272 +++++++++++++++++++++--
> drivers/media/usb/au0828/au0828-video.c | 75 +------
> drivers/media/usb/au0828/au0828.h | 4 +
> drivers/media/v4l2-core/Makefile | 2 +-
> drivers/media/v4l2-core/v4l2-fh.c | 2 +
> drivers/media/v4l2-core/v4l2-ioctl.c | 30 +++
> drivers/media/v4l2-core/v4l2-mc.c | 60 +++++
> drivers/media/v4l2-core/videobuf2-core.c | 4 +
> include/media/media-device.h | 44 ++++
> include/media/media-devnode.h | 17 ++
> include/media/media-entity.h | 12 +
> include/media/v4l2-dev.h | 1 +
> include/media/v4l2-mc.h | 52 +++++
> include/uapi/linux/media.h | 33 +++
> sound/usb/Kconfig | 4 +
> sound/usb/Makefile | 2 +
> sound/usb/card.c | 14 ++
> sound/usb/card.h | 1 +
> sound/usb/media.c | 319 +++++++++++++++++++++++++++
> sound/usb/media.h | 72 ++++++
> sound/usb/mixer.h | 1 +
> sound/usb/pcm.c | 28 ++-
> sound/usb/quirks-table.h | 1 +
> sound/usb/stream.c | 2 +
> sound/usb/usbaudio.h | 3 +
> 33 files changed, 1117 insertions(+), 236 deletions(-)
> create mode 100644 drivers/media/v4l2-core/v4l2-mc.c
> create mode 100644 sound/usb/media.c
> create mode 100644 sound/usb/media.h
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web