Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp263074rdb; Thu, 21 Dec 2023 08:29:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IGAPGMZtAi+LkT0bGn30Enz5NnljZG56R/vnd8ztR8GzbiNzSvs4EQEYU4rK6QRjnuVBzip X-Received: by 2002:a05:6870:d627:b0:1fb:75a:c41b with SMTP id a39-20020a056870d62700b001fb075ac41bmr49433oaq.68.1703176141566; Thu, 21 Dec 2023 08:29:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703176141; cv=none; d=google.com; s=arc-20160816; b=HlWfrDZA168LxByebGugGvzfKOmTKZb3A1w1LY87t6Z29URuMh4xp2hPo6kPyP/UgN 4Hllfoj5r5gXhBCcvZxO0lYgBObVximQXFqUzflEw+I1FXnNRinDCCr3mT7ZJv76JH2L ZSCY5PkfNEiHFgh+E5Q7lMVkDi3CKmyzMG28tWkR6m9gB6VgwK7g6taV9AVbVPDUdYWB spMUv6u1S5jydoDMHgC4iBJQoWAPErX6OuYg0/4ha6TByYiHukKedUfNDS4AkqipUxyb f6tOYzg0eZ01FpTNWJhgSvM9ybbI9CUtA0g32I6eJHt6ayfNbiYGVI1f0RoM94U3q9O1 oFyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=PFN2a3KyYI48ftY4lsQ7pwCOtfX19Yj/X5cK3wsh61I=; fh=sIDH0BZKBi3oHKYrdJ+8n6mmXg3nqwZKa5GoA/Ned9k=; b=qGwrhpdCTfXKNGW9uqr/8Ba5EbfbcHdIPD7DC2i8n7Cnyv9EA5ANPUFANWU5KqNJis b/ZY8JJhEr1LuEUTDP9Csr1ThgXElauMgCYqy66MLI4M+x2ujCNA+xd1xnI8K3muxveO An/tt5kGteP+/sTdTB5s7rxk/zU9rRZf/OyWZPG/32bdklZK0H8qlsHE66s2vnttNcRT yFErbwWM1iWJKbYYl3p2voVShiCPxNGGpexqkz66UX+2N302W1CuDXTiuBwUzad/Jxnt 88DHXh/oDq62F1u7HPCzzq7ChoOwRAP7yc7SLhNkm0z45MBZJnp+r0H4EY08tqvBxigB 3sAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h2-20020a0cb4c2000000b0067aa68574b3si2457604qvf.100.2023.12.21.08.29.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 08:29:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 518681C24496 for ; Thu, 21 Dec 2023 16:29:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF7F058214; Thu, 21 Dec 2023 16:28:52 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 163DC55E63; Thu, 21 Dec 2023 16:28:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=kernel.org X-IronPort-AV: E=McAfee;i="6600,9927,10931"; a="394889620" X-IronPort-AV: E=Sophos;i="6.04,293,1695711600"; d="scan'208";a="394889620" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2023 08:28:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10931"; a="920377335" X-IronPort-AV: E=Sophos;i="6.04,293,1695711600"; d="scan'208";a="920377335" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2023 08:28:47 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rGLue-00000007tW2-1EUm; Thu, 21 Dec 2023 18:28:44 +0200 Date: Thu, 21 Dec 2023 18:28:43 +0200 From: Andy Shevchenko To: Jim Liu Cc: JJLIU0@nuvoton.com, KWLIU@nuvoton.com, linus.walleij@linaro.org, brgl@bgdev.pl, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org Subject: Re: [PATCH v9 3/3] gpio: nuvoton: Add Nuvoton NPCM sgpio driver Message-ID: References: <20231212065147.3475413-1-jim.t90615@gmail.com> <20231212065147.3475413-4-jim.t90615@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Thu, Dec 21, 2023 at 02:27:13PM +0800, Jim Liu wrote: ... > > > + in_port = GPIO_BANK(gpio->nin_sgpio); > > > + if (GPIO_BIT(gpio->nin_sgpio) > 0) > > > + in_port += 1; > > > > This is strange... So, you are telling that offsets start from 1 and not 0? > > > > > + out_port = GPIO_BANK(gpio->nout_sgpio); > > > + if (GPIO_BIT(gpio->nout_sgpio) > 0) > > > + out_port += 1; > > > > Ditto. > > > Yes, if the customer has defined the in/out pins the offsets start from 1. Why? > The NPCM_IOXCFG2_PORT register is the set number of in/out ports. > NPCM_IOXCFG2_PORT register define as below: > 0~3 bit is the number of input ports > 4~7 bit is the number of output ports > Each module can support 8 input ports and 8 output ports. Right, this doesn't answer why. -- With Best Regards, Andy Shevchenko