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] [day] [month] [year] [list]
Message-ID: <023807d33f122262f235712d7fc7af4ea9e5817b.camel@mailoo.org>
Date:   Thu, 21 Jan 2021 12:32:02 +0100
From:   Vincent Knecht <vincent.knecht@...loo.org>
To:     Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:     Rob Herring <robh+dt@...nel.org>,
        Henrik Rydberg <rydberg@...math.org>,
        Michael Srba <Michael.Srba@...nam.cz>,
        Linus Walleij <linus.walleij@...aro.org>,
        linux-input@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, ~postmarketos/upstreaming@...ts.sr.ht
Subject: Re: [PATCH 2/2] Input: add MStar msg26xx touchscreen driver

Hi Dmitry!

Le mercredi 20 janvier 2021 à 23:03 -0800, Dmitry Torokhov a écrit :
> Hi Vincent,
> 
> On Wed, Jan 20, 2021 at 07:01:08PM +0100, Vincent Knecht wrote:
> > +struct packet {
> > +       u8      y_high : 4;
> > +       u8      x_high : 4;
> 
> This will not work on big endian devices as order of bitfields changes.
> I'd recommended treating contact packet as sequence of bytes and parse,
> i.e.
> 
>         x = ((buf[0] & 0x0f) << 8) | buf[1];
>         x = ((buf[0] & 0xf0) << 4) | buf[2];
>         ...

Ok, will change in v2

> > +       u8      x_low;
> > +       u8      y_low;
> > +       u8      pressure;
> > +};
> > +
> > +
> > +static void mstar_power_on(struct msg26xx_ts_data *msg26xx)
> > +{
> > +       gpiod_set_value(msg26xx->reset_gpiod, 0);
> > +       mdelay(10);
> > +       gpiod_set_value(msg26xx->reset_gpiod, 1);
> > +       mdelay(FIRMWARE_ON_DELAY);
> 
> I am pretty sure this is incorrect. You are saying that you release the
> reset line, wait a bit, and then assert it. gpiod is a logical API, with
> 0 being inactive and 1 being active, and here you want to activate the
> reset line, wait appropriate time, release it, and wait for the device
> to initialize. What does the datasheet say about reset GPIO polarity?
> 
> Thanks.

I don't have any datasheet, only downstream code and dts for my device...
After changing this function to assert then deassert and also the reset gpio
polarity in my dts, it works as intended.
I'll send a v2 shortly, also changing the example section in bindings to
reflect the dts change I had to make (plus a minor change in title).

Thank you for the review!




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ