Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3253819ybt; Sat, 4 Jul 2020 10:51:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoeYrFCh7yk0ctzvaSeoxOXmZb2CoMfjWGRjeF58ijoRSuhxmmmuks3oIGFrs56y9TVr5+ X-Received: by 2002:a17:906:4a44:: with SMTP id a4mr29328489ejv.486.1593885107584; Sat, 04 Jul 2020 10:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593885107; cv=none; d=google.com; s=arc-20160816; b=QjmOUo8zmCDLf7V23v1lptBfjbWn44wVUCjxDjOMNLHaQXItHkMIh8fx7SK6TGW3/e WyeApYLoEn1n70hhgZX7ojyjZoQ52EDKEL4RxwHYDk4JwP/z8BrUnnMXknwvsXjZDhZe pP9vLEPUr/qepB7pGhngwJvF7cnhkf7EX9z2hgCjG3RyRcn3IOlAavqsaRlC+TZtai8u iJ7UZm4QEwYC32Y+8kL2kMz6V6BvYBWjh2XrDC9A3TBCwgLJw0Sk89pbDZtLN+UDSZg4 an8vQ/n/TK/C124ajaBuMPwNJcL3MBDAx67asN0tLIgNosegVK7b61K72WUVHbrWIHi9 JNzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=AFt91fl3UtPjZaU96lVqjJRopzjSOnFkwB07J6iGhr0=; b=u87T/LNcVbLtaD5AMnYkbXCGjaVOGOZxqQF3qnCZih4ZwPh/7WilM+d0LrJDuiBfAh OeJTRZD9SyZ2sBtWpUWkAsOoPqTA5458L4w8ofqGcNVa2j8QlhPBPTtWE5he2lnwH5kC LF7Am5AJcQJEtOIS4ftM23H9eVuh8917MKXQ+NKgKGwzHz2kiXbSE+4tMuHd1VJxKpRy yu2bcWbW808nxUPXxFbWLI+a0efBWch3a7uU3ZV8/gnw7co7iB7eweXSd7OHUz4MCAfB i6n3yBVyVyQCctYaGN2wDUeMwtMQjPq7hPagJUqjfbe3KvtUMwiWxG6QBiVMFz6z+YvJ Uobg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=UuSnZzK3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn21si10462135edb.48.2020.07.04.10.51.25; Sat, 04 Jul 2020 10:51:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=UuSnZzK3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727878AbgGDRts (ORCPT + 99 others); Sat, 4 Jul 2020 13:49:48 -0400 Received: from vps.xff.cz ([195.181.215.36]:37448 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726739AbgGDRts (ORCPT ); Sat, 4 Jul 2020 13:49:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1593884986; bh=gePBFYf0OKwf1JpwnwFGo1PMkHdisVfSx93M0nTaPuI=; h=Date:From:To:Cc:Subject:References:X-My-GPG-KeyId:From; b=UuSnZzK3XJ0gjlIYs5Ptf2B7J9R2IGupn0VhzieqhJCc5T2031FdrEQxyCdD0v6F4 IjDs6Z0Vo7UJZo5H5mFJkwtNmzb2xK1oHOVBxSvxCGoHJHYX/H3TC5qYn9NfGf4aIE YWVMEZm9rmSeyPGZ6EXL9nzTAzuZPcupEB2xGsLY= Date: Sat, 4 Jul 2020 19:49:45 +0200 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Icenowy Zheng Cc: Jonathan Cameron , linux-kernel@vger.kernel.org, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Luca Weiss , "open list:IIO SUBSYSTEM AND DRIVERS" Subject: Re: [PATCH] iio: light: stk3310: add chip id for STK3311-X variant Message-ID: <20200704174945.knawjt2yg52ejx2n@core.my.home> Mail-Followup-To: =?utf-8?Q?Ond=C5=99ej?= Jirman , Icenowy Zheng , Jonathan Cameron , linux-kernel@vger.kernel.org, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Luca Weiss , "open list:IIO SUBSYSTEM AND DRIVERS" References: <20200703194406.110855-1-megous@megous.com> <20200704172916.7a8a7359@archlinux> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 wrote: > > > > > From: Icenowy Zheng > > > > > > 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 > > > Signed-off-by: Ondrej Jirman > > > > 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;