Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1546242

Re: [PATCH v5] media: Driver for Toshiba et8ek8 5MP sensor

From Pavel Machek <pavel@ucw.cz>
Newsgroups linux.kernel
Subject Re: [PATCH v5] media: Driver for Toshiba et8ek8 5MP sensor
Date 2016-12-22 10:40 +0100
Message-ID <sR80W-7Ir-13@gated-at.bofh.it> (permalink)
References (1 earlier) <sFnoJ-35g-21@gated-at.bofh.it> <sOhap-6vv-11@gated-at.bofh.it> <sQPrk-47h-1@gated-at.bofh.it> <sQXRU-UV-19@gated-at.bofh.it> <sQYEi-1tG-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi!

> > > Thanks for the update.
> > > 
> > > On Wed, Dec 14, 2016 at 01:24:51PM +0100, Pavel Machek wrote:
> > > ...
> > > > +static int et8ek8_set_ctrl(struct v4l2_ctrl *ctrl)
> > > > +{
> > > > +	struct et8ek8_sensor *sensor =
> > > > +		container_of(ctrl->handler, struct et8ek8_sensor, ctrl_handler);
> > > > +
> > > > +	switch (ctrl->id) {
> > > > +	case V4L2_CID_GAIN:
> > > > +		return et8ek8_set_gain(sensor, ctrl->val);
> > > > +
> > > > +	case V4L2_CID_EXPOSURE:
> > > > +	{
> > > > +		int rows;
> > > > +		struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev);
> > > > +		rows = ctrl->val;
> > > > +		return et8ek8_i2c_write_reg(client, ET8EK8_REG_16BIT, 0x1243,
> > > > +					    swab16(rows));
> > > 
> > > Why swab16()? Doesn't the et8ek8_i2c_write_reg() already do the right thing?
> > > 
> > > 16-bit writes aren't used elsewhere... and the register address and value
> > > seem to have different endianness there, it looks like a bug to me in that
> > > function.
> > 
> > I'm pretty sure I did not invent that swab16(). I checked, and
> > exposure seems to work properly. I tried swapping the bytes, but then
> > exposure did not seem to work. So this one seems to be correct.
> 
> I can fix that too, but I have no device to test. In terms of how the
> hardware is controlled there should be no difference anyway.

Aha, now I understand; you want me to fix write_reg. I can do that. It
seems read_reg has similar problem, but as noone is using 16-bit
reads, so it is dormant. Ok, let me fix that.

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH v5] media: Driver for Toshiba et8ek8 5MP sensor Sakari Ailus <sakari.ailus@iki.fi> - 2016-12-21 14:50 +0100
  Re: [PATCH v5] media: Driver for Toshiba et8ek8 5MP sensor Pavel Machek <pavel@ucw.cz> - 2016-12-21 23:50 +0100
    Re: [PATCH v5] media: Driver for Toshiba et8ek8 5MP sensor Sakari Ailus <sakari.ailus@iki.fi> - 2016-12-22 00:40 +0100
      Re: [PATCH v5] media: Driver for Toshiba et8ek8 5MP sensor Pavel Machek <pavel@ucw.cz> - 2016-12-22 10:40 +0100

csiph-web