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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200414170547.GB3334@Mani-XPS-13-9360>
Date:   Tue, 14 Apr 2020 22:35:47 +0530
From:   Manivannan Sadhasivam <mani@...nel.org>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Jonathan Cameron <jic23@...nel.org>,
        Rob Herring <robh+dt@...nel.org>, narcisaanamaria12@...il.com,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald <pmeerw@...erw.net>,
        linux-iio <linux-iio@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/3] iio: chemical: Add support for external Reset and
 Wakeup in CCS811

On Tue, Apr 14, 2020 at 07:42:24PM +0300, Andy Shevchenko wrote:
> On Tue, Apr 14, 2020 at 6:34 PM <mani@...nel.org> wrote:
> >
> > From: Manivannan Sadhasivam <mani@...nel.org>
> >
> > CCS811 VOC sensor exposes nRESET and nWAKE pins which can be connected
> > to GPIO pins of the host controller. These pins can be used to externally
> > release the device from reset and also to wake it up before any I2C
> > transaction. The initial driver support assumed that the nRESET pin is not
> > connected and the nWAKE pin is tied to ground.
> >
> > This commit improves it by adding support for controlling those two pins
> > externally using a host controller. For the case of reset, if the hardware
> > reset is not available, the mechanism to do software reset is also added.
> >
> > As a side effect of doing this, the IIO device allocation needs to be
> > slightly moved to top of probe to make use of priv data early.
> 
> Thank you for an update, my comments below.
> 
> ...
> 
> > +       reset_gpio = devm_gpiod_get_optional(&client->dev, "reset",
> > +                                            GPIOD_OUT_LOW);
> > +       if (IS_ERR(reset_gpio)) {
> 
> > +               dev_err(&client->dev, "Failed to acquire reset gpio\n");
> 
> If it's a deferred probe, it would spam the log.
> 

Hmm. But error is an error isn't it? Would you recommend doing a debug print
or completely removing the logging?

> > +               return PTR_ERR(reset_gpio);
> > +       }
> 
> ...
> 
> > +               static const u8 reset_seq[] = {
> > +                       0xFF, 0x11, 0xE5, 0x72, 0x8A,
> > +               };
> 
> I would suggest to comment above from where you got this and the
> meaning of the numbers.
> 

The datasheet doesn't specify the meaning of these values. But will add a
comment. Btw, just noticed that 0xFF is not needed and only 4 values are
sufficient for SW reset.

Thanks,
Mani

> ...
> 
> > +       data->wakeup_gpio = devm_gpiod_get_optional(&client->dev, "wakeup",
> > +                                                   GPIOD_OUT_HIGH);
> > +       if (IS_ERR(data->wakeup_gpio)) {
> 
> > +               dev_err(&client->dev, "Failed to acquire wakeup gpio\n");
> 
> Ditto.
> 
> > +               return PTR_ERR(data->wakeup_gpio);
> > +       }
> 
> -- 
> With Best Regards,
> Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ