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]
Date:   Sat, 4 Jul 2020 19:49:45 +0200
From:   Ondřej Jirman <megous@...ous.com>
To:     Icenowy Zheng <icenowy@...c.io>
Cc:     Jonathan Cameron <jic23@...nel.org>, linux-kernel@...r.kernel.org,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        Luca Weiss <luca@...tu.xyz>,
        "open list:IIO SUBSYSTEM AND DRIVERS" <linux-iio@...r.kernel.org>
Subject: Re: [PATCH] iio: light: stk3310: add chip id for STK3311-X variant

Hi,

On Sun, Jul 05, 2020 at 01:09:37AM +0800, Icenowy Zheng wrote:
> 在 2020-07-04星期六的 17:29 +0100,Jonathan Cameron写道:
> > On Fri,  3 Jul 2020 21:44:05 +0200
> > Ondrej Jirman <megous@...ous.com> wrote:
> > 
> > > From: Icenowy Zheng <icenowy@...c.io>
> > > 
> > > The STK3311 chip has a variant called STK3311-X, which has a
> > > different
> > > chip id of 0x12.
> > > 
> > > Add the chip id to the driver.
> > > 
> > > Signed-off-by: Icenowy Zheng <icenowy@...c.io>
> > > Signed-off-by: Ondrej Jirman <megous@...ous.com>
> > 
> > Given this is clearly not quite compatible with the stk3311 probably
> > best to also add a an id to the of id table.  Any idea what else
> > is different?
> 
> By the way, STK3311 seems to have many variants lying around, and all
> of them have different IDs. The pinouts seem to be different but the
> registers are compatible.
> 
> [1] is a datasheet of STK3311-S34 with ID 0x1e.
> [2] is a datasheet of STK3311-A with ID 0x15.
> 
> I cannot find the datasheet of STK3311-X, 0x12 is read from the device.
> The model number itself is mentioned at [3], the official website of
> sensortek.
> 
> [1] 
> http://pro0fc108.hkpic1.websiteonline.cn/upload/STK3311-S34Datasheetv1.pdf
> 
> [2] 
> http://pro0fc108.hkpic1.websiteonline.cn/upload/STK3311-ADatasheetv1.pdf
> 
> [3] 
> http://www.sensortek.com.tw/index.php/en/products/proximity-sensor-with-als/

Yeah, it looks like it's the only one of stk3111-* variants that sensortek
lists on their website. I also didn't find the *-x datasheet despite trying
really hard.

All the functionality seems to work with the current driver and this patch.

regards,
	o.

> > 
> > Thanks,
> > 
> > Jonathan
> > 
> > > ---
> > >  drivers/iio/light/stk3310.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/iio/light/stk3310.c
> > > b/drivers/iio/light/stk3310.c
> > > index 185c24a75ae6..1a8401d198a4 100644
> > > --- a/drivers/iio/light/stk3310.c
> > > +++ b/drivers/iio/light/stk3310.c
> > > @@ -37,6 +37,7 @@
> > >  
> > >  #define STK3310_CHIP_ID_VAL			0x13
> > >  #define STK3311_CHIP_ID_VAL			0x1D
> > > +#define STK3311X_CHIP_ID_VAL			0x12
> > >  #define STK3335_CHIP_ID_VAL			0x51
> > >  #define STK3310_PSINT_EN			0x01
> > >  #define STK3310_PS_MAX_VAL			0xFFFF
> > > @@ -453,6 +454,7 @@ static int stk3310_init(struct iio_dev
> > > *indio_dev)
> > >  
> > >  	if (chipid != STK3310_CHIP_ID_VAL &&
> > >  	    chipid != STK3311_CHIP_ID_VAL &&
> > > +	    chipid != STK3311X_CHIP_ID_VAL &&
> > >  	    chipid != STK3335_CHIP_ID_VAL) {
> > >  		dev_err(&client->dev, "invalid chip id: 0x%x\n",
> > > chipid);
> > >  		return -ENODEV;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ