From: Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Mauro Carvalho Chehab
<mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>,
Laurent Pinchart
<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
Cc: Linux Media Mailing List
<linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Mauro Carvalho Chehab
<mchehab-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
Hans Verkuil
<hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
Prabhakar Lad
<prabhakar.csengg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/7] tuner-core: properly initialize media controller subdev
Date: Sun, 04 Jan 2015 02:39:17 +0200 [thread overview]
Message-ID: <54A88BB5.1030103@linux.intel.com> (raw)
In-Reply-To: <4ff2de5fce002a6f6f87993440f45e0f198c57cb.1420315245.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
Hi Mauro,
Mauro Carvalho Chehab wrote:
> Properly initialize tuner core subdev at the media controller.
>
> That requires a new subtype at the media controller API.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
>
> diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c
> index 559f8372e2eb..114715ed0110 100644
> --- a/drivers/media/v4l2-core/tuner-core.c
> +++ b/drivers/media/v4l2-core/tuner-core.c
> @@ -134,6 +134,9 @@ struct tuner {
> unsigned int type; /* chip type id */
> void *config;
> const char *name;
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> + struct media_pad pad;
> +#endif
> };
>
> /*
> @@ -434,6 +437,8 @@ static void set_type(struct i2c_client *c, unsigned int type,
> t->name = analog_ops->info.name;
> }
>
> + t->sd.entity.name = t->name;
> +
> tuner_dbg("type set to %s\n", t->name);
>
> t->mode_mask = new_mode_mask;
> @@ -592,6 +597,7 @@ static int tuner_probe(struct i2c_client *client,
> struct tuner *t;
> struct tuner *radio;
> struct tuner *tv;
> + int ret;
This will emit a compiler warning if CONFIG_MEDIA_CONTROLLER isn't defined.
> t = kzalloc(sizeof(struct tuner), GFP_KERNEL);
> if (NULL == t)
> @@ -696,6 +702,15 @@ register_client:
> t->type,
> t->mode_mask & T_RADIO ? " Radio" : "",
> t->mode_mask & T_ANALOG_TV ? " TV" : "");
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> + t->pad.flags = MEDIA_PAD_FL_SOURCE;
> + t->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_TUNER;
> + t->sd.entity.name = t->name;
> +
> + ret = media_entity_init(&t->sd.entity, 1, &t->pad, 0);
> + if (ret < 0)
> + tuner_err("failed to initialize media entity!\n");
I might return the error back to the caller. The failing initialisation
of a media entity itself might not be a fatal problem, but someone later
assuming it has been initialised might be.
> +#endif
> return 0;
> }
>
> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> index 707db275f92b..5ffde035789b 100644
> --- a/include/uapi/linux/media.h
> +++ b/include/uapi/linux/media.h
> @@ -66,6 +66,8 @@ struct media_device_info {
> /* A converter of analogue video to its digital representation. */
> #define MEDIA_ENT_T_V4L2_SUBDEV_DECODER (MEDIA_ENT_T_V4L2_SUBDEV + 4)
>
> +#define MEDIA_ENT_T_V4L2_SUBDEV_TUNER (MEDIA_ENT_T_V4L2_SUBDEV + 5)
> +
> #define MEDIA_ENT_FL_DEFAULT (1 << 0)
>
> struct media_entity_desc {
>
--
Kind regards,
Sakari Ailus
sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org
WARNING: multiple messages have this Message-ID (diff)
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
Hans Verkuil <hans.verkuil@cisco.com>,
Prabhakar Lad <prabhakar.csengg@gmail.com>,
linux-api@vger.kernel.org
Subject: Re: [PATCH 1/7] tuner-core: properly initialize media controller subdev
Date: Sun, 04 Jan 2015 02:39:17 +0200 [thread overview]
Message-ID: <54A88BB5.1030103@linux.intel.com> (raw)
In-Reply-To: <4ff2de5fce002a6f6f87993440f45e0f198c57cb.1420315245.git.mchehab@osg.samsung.com>
Hi Mauro,
Mauro Carvalho Chehab wrote:
> Properly initialize tuner core subdev at the media controller.
>
> That requires a new subtype at the media controller API.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
>
> diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c
> index 559f8372e2eb..114715ed0110 100644
> --- a/drivers/media/v4l2-core/tuner-core.c
> +++ b/drivers/media/v4l2-core/tuner-core.c
> @@ -134,6 +134,9 @@ struct tuner {
> unsigned int type; /* chip type id */
> void *config;
> const char *name;
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> + struct media_pad pad;
> +#endif
> };
>
> /*
> @@ -434,6 +437,8 @@ static void set_type(struct i2c_client *c, unsigned int type,
> t->name = analog_ops->info.name;
> }
>
> + t->sd.entity.name = t->name;
> +
> tuner_dbg("type set to %s\n", t->name);
>
> t->mode_mask = new_mode_mask;
> @@ -592,6 +597,7 @@ static int tuner_probe(struct i2c_client *client,
> struct tuner *t;
> struct tuner *radio;
> struct tuner *tv;
> + int ret;
This will emit a compiler warning if CONFIG_MEDIA_CONTROLLER isn't defined.
> t = kzalloc(sizeof(struct tuner), GFP_KERNEL);
> if (NULL == t)
> @@ -696,6 +702,15 @@ register_client:
> t->type,
> t->mode_mask & T_RADIO ? " Radio" : "",
> t->mode_mask & T_ANALOG_TV ? " TV" : "");
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> + t->pad.flags = MEDIA_PAD_FL_SOURCE;
> + t->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_TUNER;
> + t->sd.entity.name = t->name;
> +
> + ret = media_entity_init(&t->sd.entity, 1, &t->pad, 0);
> + if (ret < 0)
> + tuner_err("failed to initialize media entity!\n");
I might return the error back to the caller. The failing initialisation
of a media entity itself might not be a fatal problem, but someone later
assuming it has been initialised might be.
> +#endif
> return 0;
> }
>
> diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
> index 707db275f92b..5ffde035789b 100644
> --- a/include/uapi/linux/media.h
> +++ b/include/uapi/linux/media.h
> @@ -66,6 +66,8 @@ struct media_device_info {
> /* A converter of analogue video to its digital representation. */
> #define MEDIA_ENT_T_V4L2_SUBDEV_DECODER (MEDIA_ENT_T_V4L2_SUBDEV + 4)
>
> +#define MEDIA_ENT_T_V4L2_SUBDEV_TUNER (MEDIA_ENT_T_V4L2_SUBDEV + 5)
> +
> #define MEDIA_ENT_FL_DEFAULT (1 << 0)
>
> struct media_entity_desc {
>
--
Kind regards,
Sakari Ailus
sakari.ailus@linux.intel.com
next prev parent reply other threads:[~2015-01-04 0:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-03 20:09 [PATCH 0/7] add link graph to cx231xx using the media controller Mauro Carvalho Chehab
2015-01-03 20:09 ` [PATCH 1/7] tuner-core: properly initialize media controller subdev Mauro Carvalho Chehab
[not found] ` <4ff2de5fce002a6f6f87993440f45e0f198c57cb.1420315245.git.mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2015-01-04 0:39 ` Sakari Ailus [this message]
2015-01-04 0:39 ` Sakari Ailus
2015-01-11 14:02 ` Laurent Pinchart
2015-01-11 14:02 ` Laurent Pinchart
2015-01-11 14:25 ` Mauro Carvalho Chehab
2015-01-11 14:25 ` Mauro Carvalho Chehab
[not found] ` <20150111122553.76394653-+RedX5hVuTR+urZeOPWqwQ@public.gmane.org>
2015-01-13 16:35 ` Antti Palosaari
2015-01-13 16:35 ` Antti Palosaari
2015-01-03 20:09 ` [PATCH 2/7] cx25840: fill the media controller entity Mauro Carvalho Chehab
2015-01-04 0:13 ` Joe Perches
2015-01-03 20:09 ` [PATCH 3/7] cx231xx: initialize video/vbi pads Mauro Carvalho Chehab
2015-01-03 20:09 ` [PATCH 4/7] cx231xx: create media links for analog mode Mauro Carvalho Chehab
2015-01-03 20:09 ` [PATCH 5/7] dvbdev: represent frontend with two pads Mauro Carvalho Chehab
2015-01-03 20:09 ` [PATCH 6/7] dvbdev: add a function to create DVB media graph Mauro Carvalho Chehab
2015-01-03 20:09 ` [PATCH 7/7] cx231xx: create DVB graph 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=54A88BB5.1030103@linux.intel.com \
--to=sakari.ailus-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org \
--cc=mchehab-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=prabhakar.csengg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.