linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Marek Vasut <marex@denx.de>
Cc: linux-media@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH 2/2] media: i2c: isl7998x: Add driver for Intersil ISL7998x
Date: Mon, 1 Jul 2019 11:46:38 +0300	[thread overview]
Message-ID: <20190701084638.kt3bdyzfumk6ujgu@paasikivi.fi.intel.com> (raw)
In-Reply-To: <20190520201812.7937-2-marex@denx.de>

One more comment...

On Mon, May 20, 2019 at 10:18:12PM +0200, Marek Vasut wrote:
...
> +static int isl7998x_set_fmt(struct v4l2_subdev *sd,
> +		struct v4l2_subdev_pad_config *cfg,
> +		struct v4l2_subdev_format *format)
> +{
> +	struct isl7998x *isl7998x = sd_to_isl7998x(sd);
> +	struct v4l2_mbus_framefmt *mf = &format->format;
> +	int ret;
> +
> +	if (format->pad != 0)
> +		return -EINVAL;
> +
> +	if (format->format.width != 720 ||
> +	    (format->format.height != 480 && format->format.height != 576))
> +		return -EINVAL;
> +
> +	if (format->format.code != MEDIA_BUS_FMT_YUYV8_2X8)
> +		return -EINVAL;
> +
> +	mf->width	= format->format.width;
> +	mf->height	= format->format.height;
> +	mf->code	= format->format.code;
> +	mf->field	= V4L2_FIELD_INTERLACED;
> +	mf->colorspace	= 0;
> +
> +	if (format->which != V4L2_SUBDEV_FORMAT_TRY) {
> +		ret = isl7998x_update_std(isl7998x);
> +		if (ret)
> +			return ret;
> +		mf->width = isl7998x->width;
> +		mf->height = isl7998x->height;
> +		isl7998x->fmt = &isl7998x_colour_fmts[0];
> +	}

Note that as the driver exposes a sub-device node to the user space, it's
responsible for serialising the access to its own data structures that are
accessed by other drivers or through its uAPI nodes. Most drivers use the
same mutex as the control handler, as controls usually deal with at least
some of the same data.

-- 
Regards,

Sakari Ailus
sakari.ailus@linux.intel.com

  parent reply	other threads:[~2019-07-01  9:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20 20:18 [PATCH 1/2] media: dt-bindings: Add Intersil ISL7998x DT bindings Marek Vasut
2019-05-20 20:18 ` [PATCH 2/2] media: i2c: isl7998x: Add driver for Intersil ISL7998x Marek Vasut
2019-07-01  7:58   ` Jacopo Mondi
2019-08-06 14:03     ` Marek Vasut
2019-08-12 15:39       ` Jacopo Mondi
2019-07-01  8:43   ` Sakari Ailus
2019-08-06 14:25     ` Marek Vasut
2019-07-01  8:46   ` Sakari Ailus [this message]
2019-05-28 11:47 ` [PATCH 1/2] media: dt-bindings: Add Intersil ISL7998x DT bindings Jacopo Mondi
2019-05-28 14:36   ` Marek Vasut
2019-05-28 15:10     ` Jacopo Mondi
2019-05-28 17:49       ` Marek Vasut
2019-05-29  6:28         ` Jacopo Mondi
2019-05-29 10:41           ` Marek Vasut
2019-05-29 11:04             ` Ian Arkver
2019-05-29 11:09               ` Marek Vasut
2019-05-29 11:15                 ` Ian Arkver
2019-08-06 13:35                   ` Marek Vasut
2019-05-29 13:43                 ` Jacopo Mondi
2019-08-06 13:35                   ` Marek Vasut
2019-07-01  8:04 ` Sakari Ailus
2019-08-06 13:35   ` Marek Vasut

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=20190701084638.kt3bdyzfumk6ujgu@paasikivi.fi.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=mchehab+samsung@kernel.org \
    --cc=robh+dt@kernel.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 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).