Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1525730rwb; Fri, 12 Aug 2022 02:23:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR5kHg6GFCg8GN+15SUJO7HFOIg+JkQ62yzMwsTKBjbSkxKGh+y19moUznp0L4l8uCC7DnKe X-Received: by 2002:a17:903:108b:b0:170:a3e7:b28 with SMTP id u11-20020a170903108b00b00170a3e70b28mr3169357pld.20.1660296205785; Fri, 12 Aug 2022 02:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660296205; cv=none; d=google.com; s=arc-20160816; b=rxLz9qnoXXktc75629ho//euWl10CKPEOQHjZEEIUKzksoBNSTts1GsqQY075JsgHL Ta7M1pTns+8ORAp2Y7PJ9KoCrApZwSeodoMut0sWEDHb10USjTtvqNEuBfN79IuBZHH0 lWkeBnl8mIL456D8WQlCs+LKldOfZoXVEjTxb0kbVIydBELYIDSICOoUUdoeilEOe60J UCd+VbrcS/o3nELan/hGVtcd/H6c4XdNW/gRxZ0G0xSi6p2do4RgWsHl3lEcnLNJuDPE ZDjTTzMCv0X88gfJvfo/Fus0tmKc6aLzXzcC2R0ZXW6THe6x7vQp91NPzVlOI0d8K77n q1Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=TCkIF0GWdtVumRrsit8cmvv3M3CadjcoIttU5jG4nU0=; b=eX6/+G8AT7H77Jxq9akz0v6eqcyTC0OXu+N1X9XeogQ0CxHjdWhl7Kaj2VYtkUzm6s 5OvVNBk+ZSlRQc/kktUoKPMWU/s8iKjYKMi9NKMSemMhg40QvZalc8wBBeqxtj16jwJa xYVQn+bDjSGJ3qntohxAn0TJLKXoWQ7HAfE8bx9pZIH7yY4IknEvnCwc1r2ebAJQbVNX wJYCuPl4NnawtifllJcLB1TMCJPzvNSwAiiGp3o3oPuebocV/+Od3WSEpVva8P+bd0Xv pR+YxRzu+wWkpsxmydMAGw/L4LqqnilABFjQZRo1rDApJzeCybQXRcYFgrTGTrnMbasg +bUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l14-20020a170903244e00b0016becaaa23csi2077228pls.434.2022.08.12.02.23.11; Fri, 12 Aug 2022 02:23:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237474AbiHLIoR (ORCPT + 99 others); Fri, 12 Aug 2022 04:44:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237127AbiHLIoO (ORCPT ); Fri, 12 Aug 2022 04:44:14 -0400 Received: from vm3.sequanux.org (static.55.155.9.5.clients.your-server.de [5.9.155.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D126CA8965; Fri, 12 Aug 2022 01:44:12 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by vm3.sequanux.org (Postfix) with ESMTP id EBDD2108095; Fri, 12 Aug 2022 10:43:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at vm3.sequanux.org Received: from vm3.sequanux.org ([127.0.0.1]) by localhost (vm3.sequanux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ryt02m_ZlS5e; Fri, 12 Aug 2022 10:43:14 +0200 (CEST) Received: from localhost (softwrestling.org [95.216.36.37]) by vm3.sequanux.org (Postfix) with ESMTPSA id 06647108752; Fri, 12 Aug 2022 10:43:13 +0200 (CEST) Date: Fri, 12 Aug 2022 10:43:03 +0200 From: simon.guinot@sequanux.org To: Henning Schild Cc: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Hans de Goede , Mark Gross , Andy Shevchenko , Lee Jones , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, platform-driver-x86@vger.kernel.org, Sheng-Yuan Huang , Tasanakorn Phaipool Subject: Re: [PATCH v3 1/4] gpio-f7188x: Add GPIO support for Nuvoton NCT6116 Message-ID: References: <20220811153908.31283-1-henning.schild@siemens.com> <20220811153908.31283-2-henning.schild@siemens.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ouneLSNkbbKTFRML" Content-Disposition: inline In-Reply-To: <20220811153908.31283-2-henning.schild@siemens.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ouneLSNkbbKTFRML Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 11, 2022 at 05:39:05PM +0200, Henning Schild wrote: > Add GPIO support for Nuvoton NCT6116 chip. Nuvoton SuperIO chips are > very similar to the ones from Fintek. In other subsystems they also > share drivers and are called a family of drivers. >=20 > For the GPIO subsystem the only difference is that the direction bit is > reversed and that there is only one data bit per pin. On the SuperIO > level the logical device is another one. >=20 > Signed-off-by: Henning Schild > --- > drivers/gpio/gpio-f7188x.c | 71 +++++++++++++++++++++++++++----------- > 1 file changed, 51 insertions(+), 20 deletions(-) >=20 > diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c > index 18a3147f5a42..7b05ecc611e9 100644 > --- a/drivers/gpio/gpio-f7188x.c > +++ b/drivers/gpio/gpio-f7188x.c > @@ -1,6 +1,7 @@ > // SPDX-License-Identifier: GPL-2.0-or-later > /* > * GPIO driver for Fintek Super-I/O F71869, F71869A, F71882, F71889 and = F81866 > + * and Nuvoton Super-I/O NCT6116D > * > * Copyright (C) 2010-2013 LaCie > * > @@ -22,13 +23,12 @@ > #define SIO_LDSEL 0x07 /* Logical device select */ > #define SIO_DEVID 0x20 /* Device ID (2 bytes) */ > #define SIO_DEVREV 0x22 /* Device revision */ > -#define SIO_MANID 0x23 /* Fintek ID (2 bytes) */ > =20 > -#define SIO_LD_GPIO 0x06 /* GPIO logical device */ > #define SIO_UNLOCK_KEY 0x87 /* Key to enable Super-I/O */ > #define SIO_LOCK_KEY 0xAA /* Key to disable Super-I/O */ > =20 > -#define SIO_FINTEK_ID 0x1934 /* Manufacturer ID */ > +#define SIO_LD_GPIO_FINTEK 0x06 /* GPIO logical device */ > +#define SIO_LD_GPIO_NUVOTON 0x07 /* GPIO logical device */ Please indulge me and add a new line here. > #define SIO_F71869_ID 0x0814 /* F71869 chipset ID */ > #define SIO_F71869A_ID 0x1007 /* F71869A chipset ID */ > #define SIO_F71882_ID 0x0541 /* F71882 chipset ID */ > @@ -37,7 +37,7 @@ > #define SIO_F81866_ID 0x1010 /* F81866 chipset ID */ > #define SIO_F81804_ID 0x1502 /* F81804 chipset ID, same for f81966 */ > #define SIO_F81865_ID 0x0704 /* F81865 chipset ID */ > - > +#define SIO_NCT6116D_ID 0xD283 /* NCT6116D chipset ID */ > =20 =2E.. snip ... > @@ -485,12 +516,8 @@ static int __init f7188x_find(int addr, struct f7188= x_sio *sio) > return err; > =20 > err =3D -ENODEV; > - devid =3D superio_inw(addr, SIO_MANID); > - if (devid !=3D SIO_FINTEK_ID) { > - pr_debug(DRVNAME ": Not a Fintek device at 0x%08x\n", addr); > - goto err; > - } Sorry for missing that at my first review. You can't remove this block of code. This driver is poking around on the I2C bus, which is not great. So we want to make sure as much as possible that we are speaking to the right device. Simon --ouneLSNkbbKTFRML Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEXW8DgovlR3VS5hA0zyg/RDPmszoFAmL2EpMACgkQzyg/RDPm szouqQ//Xm9sagJ+5NtJYyyq5s/U5oK5vxLAExQHpoto22qUjrB2E/30aiJt5v4N XzoV9Iqya8fOGFJeIwXwhKmoKdX/LW3XyOGK5Wp3jlBVsOw+551T6A6PxW2hH6SZ 5+2CkgOw3+PoCs5XAN4eU33k4uii31D8vtR0fGtQ0HvrtuPWjtNTawaXH2JFVC5h kBZF+o7vUYIv6RJJf1O3zQL9uWPtJl6QuHmLVw9+AfW0ndQjFWzpgxCcvb29VS9g sjGlgqyDLeoDODxP+0plqFa/Pb4n74Mi/Xlv9ygRT7xtc2Cz4U4VFaZqvo31yQ83 ogbwvsR+SW3KaB/GS4wPVg5ogYUmVLo+46HIvaiMxW61/GWYDUH5EE5T62EWOdMw B4+/FwUiZ6DMOvsSgHkkIztNswBMjZrOPPoYkrqs1thV0rXDQUzPXhJGTFGY8glw iDlF+FcQzBsxKQ3AAtLFAs4gNaPa1tNYcNhgneXpA2pv5c57GSmkJ15hEkwWO0qs p+shGzwecgkE3g1pKz+QoxGNtZBte4K+d2HpI67XxPi9W4/Fh8T3u3TeKVazXDN/ uudFsjYx31Njb/mDe6AbAgfo1TZF0xajk8PTjR+gMq94Y78cK2nxwKa486OqHVRw IEosfhp62UPWz6faNf1r/mkbC78NdVm5xFHkamv2PprSVGI6Dw0= =gt73 -----END PGP SIGNATURE----- --ouneLSNkbbKTFRML--