Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3233194ybt; Sat, 4 Jul 2020 10:11:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytfa+PG4F+B18NCDOqc9Hsoz/M9BDOSUAM7Zw7EbpyYgAHxa+iaoCqyHL/XZsJGg9GN+dU X-Received: by 2002:a50:fd07:: with SMTP id i7mr12674287eds.221.1593882664559; Sat, 04 Jul 2020 10:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593882664; cv=none; d=google.com; s=arc-20160816; b=ZpViw60Jbd1HI1R/CwNHuQqIxcHRlxmOK+UyUh2rd9bjyFu70zKi1mPht0PZmQun0U qUOo2AZdhPmSOhCVZP46NBKaXwfqH1vjidXSBUfebB/NWlPruyFVdu9owBSHliMdrZZu 6IokLEPcaoT1zJuYms8wsQ4sQgWPjWrTQKno5wwjFPaT3ey/AY6VGW8h431hznT+4GZO FDGhUBFcShIDDVRnE0F8Y57mHrDt2JYQjBaCCSczfeJa2vcn4CrXPlWSCD3liqFNsrpb I+uTtCh92xIxBQ51dFkr3GE4kcAAhuUUfX4vZ3quFXG0xMY6gkgmOdv/zN0UL7iT3RZh Kh9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature:ai-spam-status:dkim-signature; bh=76sx/mbVrtXUfhDoSVTF2MMzXfwZJ3/c8GR5Aauh2TI=; b=U6NxKc4UsnaTwIP4ruqvve/xASS0nVI/TvszFMtRcxBRQ1ugrPsKQeFrLD7AmHzFv3 3yk3uRE0RBVxvmKCxjGlTd3/fdlkilchL3WMzQXbv61TkSL5HfVPwypelquDiia8p6eQ 7NTQ0E1cfnRu2tMMrTsgm0YEFnjieTHOfTs9qFWAc2GdmquJIeZRfAzfX1sx1+UvZV8t 6gpC1CzrnKMb4LFDZUQqHSAD7GjRLQn9lN6v8pylurzJg0zu5ZJ2FBGnK7Gvj6fyqhJz 2mQroHujx22XwHsxPw33FEzYb/2p1g+diMm7XMADJJ0VRiZHVptog/hnRpyU5oKbOpbX buZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mymailcheap.com header.s=default header.b=jQPvRMER; dkim=fail header.i=@aosc.io header.s=default header.b=Ndl0uG5U; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b4si10657793edk.454.2020.07.04.10.10.31; Sat, 04 Jul 2020 10:11:04 -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=fail header.i=@mymailcheap.com header.s=default header.b=jQPvRMER; dkim=fail header.i=@aosc.io header.s=default header.b=Ndl0uG5U; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726766AbgGDRKK (ORCPT + 99 others); Sat, 4 Jul 2020 13:10:10 -0400 Received: from relay5.mymailcheap.com ([159.100.248.207]:39053 "EHLO relay5.mymailcheap.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726669AbgGDRKJ (ORCPT ); Sat, 4 Jul 2020 13:10:09 -0400 Received: from relay2.mymailcheap.com (relay2.mymailcheap.com [217.182.66.162]) by relay5.mymailcheap.com (Postfix) with ESMTPS id F0645262A8; Sat, 4 Jul 2020 17:10:05 +0000 (UTC) Received: from filter2.mymailcheap.com (filter2.mymailcheap.com [91.134.140.82]) by relay2.mymailcheap.com (Postfix) with ESMTPS id 8A11E3EDBF; Sat, 4 Jul 2020 19:10:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by filter2.mymailcheap.com (Postfix) with ESMTP id 6A12B2A471; Sat, 4 Jul 2020 19:10:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mymailcheap.com; s=default; t=1593882604; bh=Oh89PeufN+3MyJsfzfSuPCx1RHymIRgAAncoA5AuOco=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=jQPvRMERojRiKHXXS5VsZ2FdputuBBgGb/ivmH/yq4eS4XZ54BMIfx2djLrtaRrCq deT2nGKg6h1b+RNYt7WuQ5opReYyw6KIyO6BJZGY/cYWoIVD9DQ6aQLWUI86w6xSaz xdxtRBMUEGKSGfBFFYUV0yRZaAQZh6f/bCBmnT5U= X-Virus-Scanned: Debian amavisd-new at filter2.mymailcheap.com Received: from filter2.mymailcheap.com ([127.0.0.1]) by localhost (filter2.mymailcheap.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fj_ruD_uNVqs; Sat, 4 Jul 2020 19:10:02 +0200 (CEST) Received: from mail20.mymailcheap.com (mail20.mymailcheap.com [51.83.111.147]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by filter2.mymailcheap.com (Postfix) with ESMTPS; Sat, 4 Jul 2020 19:10:02 +0200 (CEST) Received: from [148.251.23.173] (ml.mymailcheap.com [148.251.23.173]) by mail20.mymailcheap.com (Postfix) with ESMTP id 1C63F41AE2; Sat, 4 Jul 2020 17:10:01 +0000 (UTC) Authentication-Results: mail20.mymailcheap.com; dkim=pass (1024-bit key; unprotected) header.d=aosc.io header.i=@aosc.io header.b="Ndl0uG5U"; dkim-atps=neutral AI-Spam-Status: Not processed Received: from ice-e5v2.lan (unknown [59.41.163.119]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail20.mymailcheap.com (Postfix) with ESMTPSA id 663EA41AE2; Sat, 4 Jul 2020 17:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=aosc.io; s=default; t=1593882594; bh=Oh89PeufN+3MyJsfzfSuPCx1RHymIRgAAncoA5AuOco=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Ndl0uG5UzmdNKSLEFghArUx2osSyHvOAXbigKPqF5aUOSyfQ9XFpBm/sJ21VzxJbL Q+jlcjSY/4eOTP7TX0EKJHB+w0B+DWwL0fHEBWNnNol+Sbu8wgLFR0V9+7K4L9lp1M DzwLbjhCqdqUPwjvxpRaqBBrQ7CpVToXOvMIr33U= Message-ID: Subject: Re: [PATCH] iio: light: stk3310: add chip id for STK3311-X variant From: Icenowy Zheng To: Jonathan Cameron , Ondrej Jirman Cc: linux-kernel@vger.kernel.org, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Luca Weiss , "open list:IIO SUBSYSTEM AND DRIVERS" Date: Sun, 05 Jul 2020 01:09:37 +0800 In-Reply-To: <20200704172916.7a8a7359@archlinux> References: <20200703194406.110855-1-megous@megous.com> <20200704172916.7a8a7359@archlinux> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C63F41AE2 X-Spamd-Result: default: False [-0.10 / 10.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(0.00)[aosc.io:s=default]; HFILTER_HELO_BAREIP(3.00)[148.251.23.173,1]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmx.de]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[aosc.io]; R_SPF_SOFTFAIL(0.00)[~all]; RECEIVED_SPAMHAUS_PBL(0.00)[59.41.163.119:received]; ML_SERVERS(-3.10)[148.251.23.173]; DKIM_TRACE(0.00)[aosc.io:+]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:148.251.0.0/16, country:DE]; FREEMAIL_CC(0.00)[vger.kernel.org,gmx.de,metafoo.de,pmeerw.net,z3ntu.xyz]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mail20.mymailcheap.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 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/ > > 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;