mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Icenowy Zheng <icenowy@aosc.io>
To: Jonathan Cameron <jic23@kernel.org>, Ondrej Jirman <megous@megous.com>
Cc: linux-kernel@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Luca Weiss <luca@z3ntu.xyz>,
	"open list:IIO SUBSYSTEM AND DRIVERS" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH] iio: light: stk3310: add chip id for STK3311-X variant
Date: Sun, 05 Jul 2020 01:09:37 +0800	[thread overview]
Message-ID: <d2df561c8db7e11eb6937f824f483e33be1db7bc.camel@aosc.io> (raw)
In-Reply-To: <20200704172916.7a8a7359@archlinux>

在 2020-07-04星期六的 17:29 +0100,Jonathan Cameron写道:
> On Fri,  3 Jul 2020 21:44:05 +0200
> Ondrej Jirman <megous@megous.com> wrote:
> 
> > From: Icenowy Zheng <icenowy@aosc.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@aosc.io>
> > Signed-off-by: Ondrej Jirman <megous@megous.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/

> 
> 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;

  reply	other threads:[~2020-07-04 17:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 19:44 Ondrej Jirman
2020-07-04 16:29 ` Jonathan Cameron
2020-07-04 17:09   ` Icenowy Zheng [this message]
2020-07-04 17:49     ` Ondřej Jirman
2020-07-14 10:44   ` Ondřej Jirman
2020-07-18 16:29     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2df561c8db7e11eb6937f824f483e33be1db7bc.camel@aosc.io \
    --to=icenowy@aosc.io \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca@z3ntu.xyz \
    --cc=megous@megous.com \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®