From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: "Linux Media Mailing List" <linux-media@vger.kernel.org>,
"Rafael Lourenço de Lima Chehab" <chehabrafael@gmail.com>,
"Hans Verkuil" <hans.verkuil@cisco.com>,
"Shuah Khan" <shuahkh@osg.samsung.com>,
"Lad, Prabhakar" <prabhakar.csengg@gmail.com>,
"Julia Lawall" <Julia.Lawall@lip6.fr>
Subject: Re: [PATCH 02/18] [media] au0828: add support for the connectors
Date: Thu, 10 Dec 2015 16:24:37 -0200 [thread overview]
Message-ID: <20151210162437.51e716cf@recife.lan> (raw)
In-Reply-To: <55F2EBD2.2010603@xs4all.nl>
Em Fri, 11 Sep 2015 16:57:22 +0200
Hans Verkuil <hverkuil@xs4all.nl> escreveu:
> On 09/06/2015 07:30 PM, Mauro Carvalho Chehab wrote:
> > Depending on the input, an au0828 may have a different
> > number of connectors. add entities to represent them.
>
> Hmm, this patch uses the new connector defines that are only added in patch 6!
> So this doesn't compile.
It is compiling fine here, perhaps due to some patch reorder during one
of the hundreds of rebase that this long patch series the needed
patch was moved already.
>
> Is there a reason why the connector support is needed now? I would prefer to have
> this in a separate follow-up patch series.
Better to add those connectors earlier than later, as we need to
double check that the ALSA patches that Shuah did will work fine
also for the Composite/S-Video cases.
Regards,
Mauro
>
> Regards,
>
> Hans
>
> >
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> >
> > diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
> > index f54c7d10f350..fe9a60484343 100644
> > --- a/drivers/media/usb/au0828/au0828-core.c
> > +++ b/drivers/media/usb/au0828/au0828-core.c
> > @@ -153,11 +153,26 @@ static void au0828_usb_release(struct au0828_dev *dev)
> > }
> >
> > #ifdef CONFIG_VIDEO_AU0828_V4L2
> > +
> > +static void au0828_usb_v4l2_media_release(struct au0828_dev *dev)
> > +{
> > +#ifdef CONFIG_MEDIA_CONTROLLER
> > + int i;
> > +
> > + for (i = 0; i < AU0828_MAX_INPUT; i++) {
> > + if (AUVI_INPUT(i).type == AU0828_VMUX_UNDEFINED)
> > + return;
> > + media_device_unregister_entity(&dev->input_ent[i]);
> > + }
> > +#endif
> > +}
> > +
> > static void au0828_usb_v4l2_release(struct v4l2_device *v4l2_dev)
> > {
> > struct au0828_dev *dev =
> > container_of(v4l2_dev, struct au0828_dev, v4l2_dev);
> >
> > + au0828_usb_v4l2_media_release(dev);
> > v4l2_ctrl_handler_free(&dev->v4l2_ctrl_hdl);
> > v4l2_device_unregister(&dev->v4l2_dev);
> > au0828_usb_release(dev);
> > diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
> > index 4511e2893282..806b8d320bae 100644
> > --- a/drivers/media/usb/au0828/au0828-video.c
> > +++ b/drivers/media/usb/au0828/au0828-video.c
> > @@ -1793,6 +1793,69 @@ static int au0828_vb2_setup(struct au0828_dev *dev)
> > return 0;
> > }
> >
> > +static void au0828_analog_create_entities(struct au0828_dev *dev)
> > +{
> > +#if defined(CONFIG_MEDIA_CONTROLLER)
> > + static const char *inames[] = {
> > + [AU0828_VMUX_COMPOSITE] = "Composite",
> > + [AU0828_VMUX_SVIDEO] = "S-Video",
> > + [AU0828_VMUX_CABLE] = "Cable TV",
> > + [AU0828_VMUX_TELEVISION] = "Television",
> > + [AU0828_VMUX_DVB] = "DVB",
> > + [AU0828_VMUX_DEBUG] = "tv debug"
> > + };
> > + int ret, i;
> > +
> > + /* Initialize Video and VBI pads */
> > + dev->video_pad.flags = MEDIA_PAD_FL_SINK;
> > + ret = media_entity_init(&dev->vdev.entity, 1, &dev->video_pad);
> > + if (ret < 0)
> > + pr_err("failed to initialize video media entity!\n");
> > +
> > + dev->vbi_pad.flags = MEDIA_PAD_FL_SINK;
> > + ret = media_entity_init(&dev->vbi_dev.entity, 1, &dev->vbi_pad);
> > + if (ret < 0)
> > + pr_err("failed to initialize vbi media entity!\n");
> > +
> > + /* Create entities for each input connector */
> > + for (i = 0; i < AU0828_MAX_INPUT; i++) {
> > + struct media_entity *ent = &dev->input_ent[i];
> > +
> > + if (AUVI_INPUT(i).type == AU0828_VMUX_UNDEFINED)
> > + break;
> > +
> > + ent->name = inames[AUVI_INPUT(i).type];
> > + ent->flags = MEDIA_ENT_FL_CONNECTOR;
> > + dev->input_pad[i].flags = MEDIA_PAD_FL_SOURCE;
> > +
> > + switch(AUVI_INPUT(i).type) {
> > + case AU0828_VMUX_COMPOSITE:
> > + ent->type = MEDIA_ENT_T_CONN_COMPOSITE;
> > + break;
> > + case AU0828_VMUX_SVIDEO:
> > + ent->type = MEDIA_ENT_T_CONN_SVIDEO;
> > + break;
> > + case AU0828_VMUX_CABLE:
> > + case AU0828_VMUX_TELEVISION:
> > + case AU0828_VMUX_DVB:
> > + ent->type = MEDIA_ENT_T_CONN_RF;
> > + break;
> > + default: /* AU0828_VMUX_DEBUG */
> > + ent->type = MEDIA_ENT_T_CONN_TEST;
> > + break;
> > + }
> > +
> > + ret = media_entity_init(ent, 1, &dev->input_pad[i]);
> > + if (ret < 0)
> > + pr_err("failed to initialize input pad[%d]!\n", i);
> > +
> > + ret = media_device_register_entity(dev->media_dev, ent);
> > + if (ret < 0)
> > + pr_err("failed to register input entity %d!\n", i);
> > + }
> > +#endif
> > +}
> > +
> > /**************************************************************************/
> >
> > int au0828_analog_register(struct au0828_dev *dev,
> > @@ -1881,17 +1944,8 @@ int au0828_analog_register(struct au0828_dev *dev,
> > dev->vbi_dev.queue->lock = &dev->vb_vbi_queue_lock;
> > strcpy(dev->vbi_dev.name, "au0828a vbi");
> >
> > -#if defined(CONFIG_MEDIA_CONTROLLER)
> > - dev->video_pad.flags = MEDIA_PAD_FL_SINK;
> > - ret = media_entity_init(&dev->vdev.entity, 1, &dev->video_pad);
> > - if (ret < 0)
> > - pr_err("failed to initialize video media entity!\n");
> > -
> > - dev->vbi_pad.flags = MEDIA_PAD_FL_SINK;
> > - ret = media_entity_init(&dev->vbi_dev.entity, 1, &dev->vbi_pad);
> > - if (ret < 0)
> > - pr_err("failed to initialize vbi media entity!\n");
> > -#endif
> > + /* Init entities at the Media Controller */
> > + au0828_analog_create_entities(dev);
> >
> > /* initialize videobuf2 stuff */
> > retval = au0828_vb2_setup(dev);
> > diff --git a/drivers/media/usb/au0828/au0828.h b/drivers/media/usb/au0828/au0828.h
> > index d3644b3fe6fa..b7940c54d006 100644
> > --- a/drivers/media/usb/au0828/au0828.h
> > +++ b/drivers/media/usb/au0828/au0828.h
> > @@ -93,7 +93,6 @@ struct au0828_board {
> > unsigned char has_ir_i2c:1;
> > unsigned char has_analog:1;
> > struct au0828_input input[AU0828_MAX_INPUT];
> > -
> > };
> >
> > struct au0828_dvb {
> > @@ -281,6 +280,8 @@ struct au0828_dev {
> > struct media_device *media_dev;
> > struct media_pad video_pad, vbi_pad;
> > struct media_entity *decoder;
> > + struct media_entity input_ent[AU0828_MAX_INPUT];
> > + struct media_pad input_pad[AU0828_MAX_INPUT];
> > #endif
> > };
> >
> >
>
> --
> 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
next prev parent reply other threads:[~2015-12-10 18:24 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-06 17:30 [PATCH 00/18] MC fixes, improvements and cleanups Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 01/18] [media] tuner-core: add an input pad Mauro Carvalho Chehab
2015-09-11 14:48 ` Hans Verkuil
2015-11-23 20:01 ` Laurent Pinchart
2015-11-24 11:00 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 02/18] [media] au0828: add support for the connectors Mauro Carvalho Chehab
2015-09-11 14:57 ` Hans Verkuil
2015-12-10 18:24 ` Mauro Carvalho Chehab [this message]
2015-09-06 17:30 ` [PATCH 03/18] [media] au0828: Create connector links Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 04/18] [media] media-device: supress backlinks at G_TOPOLOGY ioctl Mauro Carvalho Chehab
2015-09-11 14:58 ` Hans Verkuil
2015-11-23 19:56 ` Laurent Pinchart
2015-11-24 10:57 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 05/18] [media] media-controller: enable all interface links at init Mauro Carvalho Chehab
2015-09-11 15:18 ` Hans Verkuil
2015-11-23 19:46 ` Laurent Pinchart
2015-12-10 11:37 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 06/18] [media] media.h: create connector entities for hybrid TV devices Mauro Carvalho Chehab
2015-09-11 15:19 ` Hans Verkuil
2015-11-23 18:09 ` Laurent Pinchart
2015-12-10 18:43 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 07/18] [media] dvbdev: returns error if graph object creation fails Mauro Carvalho Chehab
2015-09-11 15:20 ` Hans Verkuil
2015-12-10 17:33 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 08/18] [media] dvb core: must check dvb_create_media_graph() Mauro Carvalho Chehab
2015-09-11 15:22 ` Hans Verkuil
2015-09-06 17:30 ` [PATCH 09/18] [media] media-entity: enforce check of interface and links creation Mauro Carvalho Chehab
2015-09-11 15:23 ` Hans Verkuil
2015-09-06 17:30 ` [PATCH 10/18] [media] cx231xx: enforce check for graph creation Mauro Carvalho Chehab
2015-09-11 15:23 ` Hans Verkuil
2015-09-06 17:30 ` [PATCH 11/18] [media] au0828:: " Mauro Carvalho Chehab
2015-09-11 15:23 ` Hans Verkuil
2015-09-06 17:30 ` [PATCH 12/18] [media] media-entity: must check media_create_pad_link() Mauro Carvalho Chehab
2015-09-11 15:24 ` Hans Verkuil
2015-11-23 17:54 ` Laurent Pinchart
2015-12-10 19:13 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 13/18] [media] media-entity.h: rename entity.type to entity.function Mauro Carvalho Chehab
2015-09-11 15:25 ` Hans Verkuil
2015-11-23 17:51 ` Laurent Pinchart
2015-11-24 10:32 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 14/18] [media] media-device: export the entity function via new ioctl Mauro Carvalho Chehab
2015-09-11 15:26 ` Hans Verkuil
2015-11-23 17:46 ` Laurent Pinchart
2015-11-24 10:27 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 15/18] [media] uapi/media.h: Rename entities types to functions Mauro Carvalho Chehab
2015-09-11 15:36 ` Hans Verkuil
2015-12-10 19:54 ` Mauro Carvalho Chehab
2015-09-06 17:30 ` [PATCH 16/18] [media] DocBook: update entities documentation Mauro Carvalho Chehab
2015-09-06 17:31 ` [PATCH 17/18] [media] dvbdev: move indirect links on dvr/demux to a separate function Mauro Carvalho Chehab
2015-09-11 15:38 ` Hans Verkuil
2015-09-06 17:31 ` [PATCH 18/18] [media] dvbdev: Don't create indirect links Mauro Carvalho Chehab
2015-09-11 15:48 ` Hans Verkuil
2015-12-10 20:20 ` Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151210162437.51e716cf@recife.lan \
--to=mchehab@osg.samsung.com \
--cc=Julia.Lawall@lip6.fr \
--cc=chehabrafael@gmail.com \
--cc=hans.verkuil@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=prabhakar.csengg@gmail.com \
--cc=shuahkh@osg.samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).