Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2289048rwd; Wed, 17 May 2023 08:08:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6y0ezHOs3OIpqRyjNgxrACzoPNxSjoodI2TuxmVSjD35D4Zj6QU1fYR7ZfIlrCcD0/M2gM X-Received: by 2002:a05:6a20:8e0c:b0:106:dfc8:6f4e with SMTP id y12-20020a056a208e0c00b00106dfc86f4emr8339441pzj.32.1684336138728; Wed, 17 May 2023 08:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684336138; cv=none; d=google.com; s=arc-20160816; b=AMB2YCTeZMTDNmtyhWSEmO1/Mk8He2gMhcqtbh+TRT/Nb+72dowedpAasp5LaUta+W eZiFOG/LvxwJFV49YofGkhljOIgdAVcqfXz8PwnikWN99f4Ug3MLe+wHIbtC89CVMngu c/n6QSaMXs1mLsvJJOLVlwo2/cYa4VN4C0n2mvZF9dLa1lYAeHPZ0I5cNkyFR3ClX2FJ Uzq0TYVp9xcO3exgA3Fji/aC+WsNF+20ogJfkffEWWSyd/u1C2774LLQZEWjKMCCmb7f 5VjEHov665FetGHy8VvnbkVCkjYRfFZZV0Ot6LFbtKdRm/5xcHdn6L4njrQKuVRy3BZs S0cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:from:subject:cc:to :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=r4SNOGQNiXUm9Rm9DfrimxqrzH0Clgmb4qexx/tZZaE=; b=JMHRJFUbk3qh1Nd4rf+tm6766RCF1NfcIeoO9q80/Vn5QzUtbQv8TXcTygrWg6uxQ1 yFIlz1CMrYc9dMLyxrlpMH/avttX+DsfDskl8AfoGOwU/bQYXL54A5O7SB1tB64Wfsa7 bAdKYyGF03lRYiq7dRxof/1Ix39QK0w4PKBB0/pBU7wpCf6sAZbfEkjuM0X5+osE/+lB 3K3L9Pu50vcuzudL/QUC1t1ZhhWAO1BIbvhwumBI7MeGMIzJcagitBneDFS8NtKa+6wp CmcNlKK0k0aQI7FelpiLg9d1gmUA7zOlEDrItgueZhMgE5UN2hDGMr/vlBZxxuDHEzAu nzhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=MzulslZ5; 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 i24-20020a17090adc1800b00244883db2c7si1980901pjv.99.2023.05.17.08.08.44; Wed, 17 May 2023 08:08:58 -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; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=MzulslZ5; 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 S230041AbjEQOnU (ORCPT + 99 others); Wed, 17 May 2023 10:43:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbjEQOnT (ORCPT ); Wed, 17 May 2023 10:43:19 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E82132D73 for ; Wed, 17 May 2023 07:43:04 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-30636edb493so71325f8f.1 for ; Wed, 17 May 2023 07:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1684334583; x=1686926583; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=r4SNOGQNiXUm9Rm9DfrimxqrzH0Clgmb4qexx/tZZaE=; b=MzulslZ5umnE2BE9tC3QxO+hO8k2i4NUqTMTr9GSakhsiJ2Z5Z+RQJENFLTSRzIs3w 0VmAwtKZz3gNf2RVLYLK6MOaBfD3Yvd0lbCw0oPhSMN8HA4SprmF+Wrh13UjGxHaF4g+ XCKfYITyAWa/6E6yI38uDLr5Kx8N9Wt2BfXgvFjInxfXwidQeTH7JGtQ2+RT7CrEjIu5 KzsHOhO9kwBVmzn73JIE2/X8Gq9za6YiexjrS+R8OGSwDCIERq0kCZafqqeg4eC7E0Lm qyHQkj8fBou1ESemvE4deq5NVH1+eW7UttUaDEQAznQHo853ETWM9eQWYNuQrTyUNWW9 qMEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684334583; x=1686926583; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=r4SNOGQNiXUm9Rm9DfrimxqrzH0Clgmb4qexx/tZZaE=; b=bM1+bl1Vu4Auuq7sWW5jXpK6E7BwyVtLQvzeLpn8IZa7ykbF1BYYRrR2eYCRuNH5LR sLNlfDrMKE4oBPI/ZmU4+y/7wz4mOv3m8TAHOtTG4znzDUJQ2fsrKjXAoHUvY6+7GK2Y 05rItewBtfbSziBCtnvjsWTlLtixdFjDok4Rk5F2RiW6zJAxCJVPrtjHtiBs5ZeiBq/R DpViUQ94xuQeL/fz5GewWZHUbqeK0oXqYxNO6rPl00pDMaU393nJMPYQKorhmcbGAgfM zWP4w3Qbp7zOBBqyBMo3y4U147iZkQQASmZ2QMaB1jGwCmdF+jfovOUryXrMebl3z6Wg 538g== X-Gm-Message-State: AC+VfDyPfSKZ4l6nAbUknlW3OpKVVMWovGHdnwVio2il/qtRjEPPxNXy 9Y9YGGl4PLukepmJp1EGA3cXig== X-Received: by 2002:adf:ea8d:0:b0:2f0:583:44be with SMTP id s13-20020adfea8d000000b002f0058344bemr829973wrm.0.1684334583431; Wed, 17 May 2023 07:43:03 -0700 (PDT) Received: from localhost ([2a01:e0a:28d:66d0:5b2e:1428:59f1:44a4]) by smtp.gmail.com with ESMTPSA id o7-20020a5d62c7000000b003078354f774sm3375200wrv.36.2023.05.17.07.43.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 May 2023 07:43:02 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 17 May 2023 16:43:01 +0200 Message-Id: To: "Andy Shevchenko" Cc: , , , , , , , , , , , , Subject: Re: [PATCH v4 2/3] pinctrl: tps6594: Add driver for TPS6594 pinctrl and GPIOs From: "Esteban Blanc" X-Mailer: aerc 0.14.0 References: <20230512141755.1712358-1-eblanc@baylibre.com> <20230512141755.1712358-3-eblanc@baylibre.com> In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 On Wed May 17, 2023 at 3:51 PM CEST, Andy Shevchenko wrote: > On Wed, May 17, 2023 at 12:58=E2=80=AFPM Esteban Blanc wrote: > > On Tue May 16, 2023 at 6:48 PM CEST, Andy Shevchenko wrote: > > > On Tue, May 16, 2023 at 4:05=E2=80=AFPM Esteban Blanc wrote: > > > > On Fri May 12, 2023 at 7:07 PM CEST, wrote: > > > > > Fri, May 12, 2023 at 04:17:54PM +0200, Esteban Blanc kirjoitti: > > ... > > > > > > > -#define TPS6594_REG_GPIOX_CONF(gpio_inst) (0x31 + (gp= io_inst)) > > > > > > +#define TPS6594_REG_GPIO1_CONF 0x3= 1 > > > > > > +#define TPS6594_REG_GPIOX_CONF(gpio_inst) (TPS6594_REG_GPIO1_= CONF + (gpio_inst)) > > > > > > > > > > Why? The original code with parameter 0 will issue the same. > > > > > > > > I felt that replacing 0x31 with a constant would make the computati= on > > > > in TPS6594_REG_GPIOX_CONFIG more understandable. What do you think? > > > > > > The question is why that register is so special that you need to have > > > it as a constant explicitly? > > > > It is not special, it's just the first one of the serie of config > > registers. I felt like just having 0x31 without context was a bit weird > > I'm not sure I understand what 'context' you are talking about. I was trying to convey the fact that 0x31 was representing TPS6594_REG_GPIO1_CONF address. This way when looking at TPS6594_REG_GPIOX_CONF(...), one will better understand that this macro is just about offsetting from the first GPIO_CONF register. > This is pretty normal to have two kind of definitions (depending on the c= ase): > 1/ > > #define FOO_1 ... > #define FOO_2 ... > > and so on > > 2/ > > #define FOO(x) (... (x) ...) > > > Having a mix of them seems quite unusual. I did not know that. I will revert this change for next version then. Thanks again for your time. Best regards, --=20 Esteban Blanc BayLibre