lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161221232930.GI16630@valkosipuli.retiisi.org.uk>
Date:   Thu, 22 Dec 2016 01:29:31 +0200
From:   Sakari Ailus <sakari.ailus@....fi>
To:     Pavel Machek <pavel@....cz>
Cc:     ivo.g.dimitrov.75@...il.com, sre@...nel.org, pali.rohar@...il.com,
        linux-media@...r.kernel.org, galak@...eaurora.org,
        mchehab@....samsung.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5] media: Driver for Toshiba et8ek8 5MP sensor

On Wed, Dec 21, 2016 at 11:42:16PM +0100, Pavel Machek wrote:
> 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.

-- 
Sakari Ailus
e-mail: sakari.ailus@....fi	XMPP: sailus@...iisi.org.uk

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ