linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Prabhakar Lad <prabhakar.csengg@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Joe Perches <joe@perches.com>,
	Boris BREZILLON <boris.brezillon@free-electrons.com>
Subject: Re: [PATCHv3 10/20] cx25840: fill the media controller entity
Date: Wed, 7 Jan 2015 10:14:02 -0200	[thread overview]
Message-ID: <20150107101402.7928fdc3@concha.lan> (raw)
In-Reply-To: <CA+V-a8sJzqbM5T-pRJ-gkZq-0HPDqG4MxO5DRUZy_GwMU-QKkQ@mail.gmail.com>

Hi Prabhakar,

Em Wed, 7 Jan 2015 11:44:08 +0000
Prabhakar Lad <prabhakar.csengg@gmail.com> escreveu:

> Hi Mauro,
> 
> Thanks for the patch.

Thanks for review.

> On Tue, Jan 6, 2015 at 9:08 PM, Mauro Carvalho Chehab
> <mchehab@osg.samsung.com> wrote:
> > Instead of keeping the media controller entity not initialized,
> > fill it and create the pads for cx25840.
> >
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> >
> > diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c
> > index 573e08826b9b..bdb5bb6b58da 100644
> > --- a/drivers/media/i2c/cx25840/cx25840-core.c
> > +++ b/drivers/media/i2c/cx25840/cx25840-core.c
> > @@ -5137,6 +5137,9 @@ static int cx25840_probe(struct i2c_client *client,
> >         int default_volume;
> >         u32 id;
> >         u16 device_id;
> > +#if defined(CONFIG_MEDIA_CONTROLLER)
> > +       int ret;
> > +#endif
> >
> >         /* Check if the adapter supports the needed features */
> >         if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
> > @@ -5178,6 +5181,21 @@ static int cx25840_probe(struct i2c_client *client,
> >
> >         sd = &state->sd;
> >         v4l2_i2c_subdev_init(sd, client, &cx25840_ops);
> > +#if defined(CONFIG_MEDIA_CONTROLLER)
> > +       /* TODO: need to represent analog inputs too */
> > +       state->pads[0].flags = MEDIA_PAD_FL_SINK;       /* Tuner or input */
> 
>  | MEDIA_PAD_FL_MUST_CONNECT ?

Maybe. Currently, only omap3 uses this flag. Not sure what difference
it will make.

> > +       state->pads[1].flags = MEDIA_PAD_FL_SOURCE;     /* Video */
> > +       state->pads[2].flags = MEDIA_PAD_FL_SOURCE;     /* VBI */
> 
> Macros for 0,1,2, and 3 would make it more readable.

Yes, but IMHO the best would be to add those macros on some global place,
as all analog demod PADs will look the same: one sync to connect to the
tuner and two PADs, one for video stream and another one for VBI.
A few decoders may have an additional PAD for sliced-VBI.

Doing such definition globally helps to support drivers like em28xx,
where, depending on the board, there are several different alternatives
for the demod, all providing the very same 3 pads.

> > +       sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
> > +
> > +       ret = media_entity_init(&sd->entity, ARRAY_SIZE(state->pads),
> > +                               state->pads, 0);
> > +       if (ret < 0) {
> > +               v4l_info(client, "failed to initialize media entity!\n");
> > +               kfree(state);
> Not required.

Why not? state were allocated previously in this function. If we don't free
it, it will have a memory leak.

> 
> > +               return -ENODEV;
> return ret; instead ?


Yeah, makes sense. I'll fix that on a next spin of the patch.
> 
> Thanks,
> --Prabhakar Lad


-- 

Cheers,
Mauro

  reply	other threads:[~2015-01-07 12:14 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-06 21:08 [PATCHv3 00/20] dvb core: add basic support for the media controller Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 01/20] media: add new types for DVB devnodes Mauro Carvalho Chehab
2015-01-07 14:09   ` Sakari Ailus
2015-01-07 14:22     ` Mauro Carvalho Chehab
2015-01-08 16:10       ` Laurent Pinchart
2015-01-08 17:44         ` Mauro Carvalho Chehab
2015-01-11 13:54           ` Laurent Pinchart
2015-01-11 14:09             ` Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 02/20] dvbdev: add support for media controller Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 03/20] cx231xx: add media controller support Mauro Carvalho Chehab
2015-01-08  1:44   ` Shuah Khan
2015-01-08  3:15     ` Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 04/20] dvb_frontend: add media controller support for DVB frontend Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 05/20] dmxdev: add support for demux/dvr nodes at media controller Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 06/20] dvb_ca_en50221: add support for CA node at the " Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 07/20] dvb_net: add support for DVB net " Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 08/20] dvbdev: add pad for the DVB devnodes Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 09/20] tuner-core: properly initialize media controller subdev Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 10/20] cx25840: fill the media controller entity Mauro Carvalho Chehab
2015-01-07 11:44   ` Prabhakar Lad
2015-01-07 12:14     ` Mauro Carvalho Chehab [this message]
2015-01-06 21:08 ` [PATCHv3 11/20] cx231xx: initialize video/vbi pads Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 12/20] cx231xx: create media links for analog mode Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 13/20] dvbdev: represent frontend with two pads Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 14/20] dvbdev: add a function to create DVB media graph Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 15/20] cx231xx: create DVB graph Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 16/20] dvbdev: enable DVB-specific links Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 17/20] dvb-frontend: enable tuner link when the FE thread starts Mauro Carvalho Chehab
2015-01-08 21:11   ` Shuah Khan
2015-01-06 21:08 ` [PATCHv3 18/20] cx231xx: enable tuner->decoder link at videobuf start Mauro Carvalho Chehab
2015-01-08 21:15   ` Shuah Khan
2015-01-06 21:08 ` [PATCHv3 19/20] cx231xx: create a streaming pipeline at VB start Mauro Carvalho Chehab
2015-01-06 21:08 ` [PATCHv3 20/20] dvb_frontend: start media pipeline while thread is running 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=20150107101402.7928fdc3@concha.lan \
    --to=mchehab@osg.samsung.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=hans.verkuil@cisco.com \
    --cc=joe@perches.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=prabhakar.csengg@gmail.com \
    --cc=sakari.ailus@linux.intel.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).