Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4065003rwd; Tue, 23 May 2023 02:33:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6QA092Aa/Wjy61o/LADAR0ipHEJxuqFfkdo8bR2zepzeen1Ds3QyTO9XI/PHTrLZMehf79 X-Received: by 2002:a05:6a21:33a6:b0:10b:91c5:45a8 with SMTP id yy38-20020a056a2133a600b0010b91c545a8mr6225765pzb.15.1684834407373; Tue, 23 May 2023 02:33:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684834407; cv=none; d=google.com; s=arc-20160816; b=M0JMMiBb6uvM/lDS1WUJiLtDfQTk+b29WBXpLCYFW30to5UECxyYyvc2gTE1Ylj99+ HJi44WexYhvfOn/iT6LvhqTVmdOyNS/148wBQS2UEe2cUVfNC27VMseyLqoRkCpR+BXM leIlVhnbUlL6YDDvSrm/y9pMGH2k8xg4HqvK6cH7xSTZpQSlTpE2c5gKZNytZUwo42qV 9HkgUGp/dpVwzO5p53GQuFgZFGHQ0o67YFCeb5G+h9mFGBzxEHM7N2VrMUisdJ9BkgV/ MQPEYRoOmTXYHar3lWgy4SWkh5ygIyFKL4u3m9ioC3P2U5Scsqx64l0tlH2nyRU82RPY yw+Q== 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:cc:to:from:subject :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=8F5s7KNQ8pR0l7gVQkr0wi0q05FJrKQ/4O2Ot0cPFmo=; b=so/g4EtZbh9NEt5Q0lxAwlKtzC1mPCIByrpocJwJWa0SqIjAdcbE0v9oddoXvjgYA+ zSYwfhbSWmUyUHTRPcwd71orG4dLSyYqREaemQYsdwvh4n+1n1aURmAWGCZWgar7bm9r t06mXvBrorR1HCixc730j1yrMTOdufsxeWr+iabdKTs+R9PdX9q3/vTJ0HMf+FAAeEu6 DJDfnIZR2sgGG/YHdFU1w8bgYoV2CnrPX2qN8s7Wrw7abi4IUAbWeDD3dhkGxZyWOrL+ zw9fZFatxHRvOGrerp7xvTxmh7NiffXcGpqGWcDmSXZTApUkYsxMvf9hzMm1n7+u/DVI aD+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=bkb1ITlR; 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 q186-20020a632ac3000000b0052c8d4d0d1esi6193456pgq.364.2023.05.23.02.33.12; Tue, 23 May 2023 02:33:27 -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=bkb1ITlR; 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 S235175AbjEWJ0g (ORCPT + 99 others); Tue, 23 May 2023 05:26:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231709AbjEWJ0f (ORCPT ); Tue, 23 May 2023 05:26:35 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32510102 for ; Tue, 23 May 2023 02:26:30 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-96fb1642b09so440501866b.0 for ; Tue, 23 May 2023 02:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1684833988; x=1687425988; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8F5s7KNQ8pR0l7gVQkr0wi0q05FJrKQ/4O2Ot0cPFmo=; b=bkb1ITlRNG6DYkPUwBGpIQCQlJBS64KcKl7OcxEhlDKQU0+X8WKtxMNEKF8ddlVep1 Qn2Oq4taRlVPpzuJdBdHwMyzXmwG3l6U2ljLciexshvbqv0B9cY0AikK3nB/kwJLqUfV KiVLxulUyVSEkjIkH9Dx4xj4CnFOnmPhFXgQzVuw44mKiPF9J5/i3GxdKYRmvZdlSxxg ubDmVn4dyaSsOs/jgmurwsjM0/lnsCf+376OhsQCiXvDkykEyyvhGnGAS3tXpgZyNqzC noCdtscq3Ni3JGtEBesgwDqyuA+my0a3gtZqWpuKQsSVqIcTm5yN1pZIUcMfdAYEtg+t h29A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684833988; x=1687425988; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=8F5s7KNQ8pR0l7gVQkr0wi0q05FJrKQ/4O2Ot0cPFmo=; b=PfWfv63eA79kpjsbTG2ksUwEo1Jj5WEYJ1VJwP1xI9YxQVaG2+iptKyDvGnobXau2r wnGNTF/Io+J1Bd6E8YGyJHmP7pccPc5ZhhDp/cRG5hVI0kBDWimxnYRmFE87Hu5YMUYa 4sNw8XD+/JdO2KU5kkb1rXW929Xl5Cy63edzPZBA5mAYygatxSTnRGLCGbr99eiPcDrG rBLc7M1S0U8WGijk7O21lkhC1jT0xx5VWmV95F6s63c2xtvaX2+lUaGbw+WYT2z39Hw6 wQugnzcw5fxpqkQkOxVPV7oFWKgJ1YU3mj6VbphlklIewlQ0jhjLDltffWggUBI1hq0Z PaUw== X-Gm-Message-State: AC+VfDzDI7KAZy6/5sEvhe4G3HwXVrmHmI9XOc6ec8XyY2ESNJggOFMc TW6arMz6+tw3yHQMf//lhGHVr/OfqtRETipZZljOeg== X-Received: by 2002:a17:906:fd8e:b0:96a:f688:db6e with SMTP id xa14-20020a170906fd8e00b0096af688db6emr11577426ejb.74.1684833988681; Tue, 23 May 2023 02:26:28 -0700 (PDT) Received: from localhost (abordeaux-655-1-129-86.w90-5.abo.wanadoo.fr. [90.5.10.86]) by smtp.gmail.com with ESMTPSA id x8-20020a1709064a8800b00965f5d778e3sm4194556eju.120.2023.05.23.02.26.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 May 2023 02:26:28 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 23 May 2023 11:26:26 +0200 Message-Id: Subject: Re: [PATCH v4 2/3] pinctrl: tps6594: Add driver for TPS6594 pinctrl and GPIOs From: "Esteban Blanc" To: "Andy Shevchenko" Cc: , , , , , , , , , , , , 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=unavailable 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 5:04 PM CEST, Andy Shevchenko wrote: > On Wed, May 17, 2023 at 5:43=E2=80=AFPM Esteban Blanc wrote: > > 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 kirjoitt= i: > > ... > > > > > > > > > -#define TPS6594_REG_GPIOX_CONF(gpio_inst) (0x31 += (gpio_inst)) > > > > > > > > +#define TPS6594_REG_GPIO1_CONF = 0x31 > > > > > > > > +#define TPS6594_REG_GPIOX_CONF(gpio_inst) (TPS6594_REG_GP= IO1_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 compu= tation > > > > > > in TPS6594_REG_GPIOX_CONFIG more understandable. What do you th= ink? > > > > > > > > > > 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 w= eird > > > > > > 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. > > You can add a comment on top of the macro, so anybody can read and see > what this macro is doing. > > > This is pretty normal to have two kind of definitions (depending on t= he case): > > > 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. > > Don't get me wrong, it's possible to have, but since it's unusual it > needs to be well justified. In the change you proposed you have > changed that, but I haven't seen where the new definition is used (in > *.c files). Actualy it used in 2 places: - In the switch case of `tps6594_gpio_regmap_xlate` - In `tps6594_pinctrl_probe` when setting `reg_dir_out_base` I already sent a v5 with this change but I managed to fail my .config and this driver was not compiled... and it is not compiling... I feel so stupid. I need to send a v6 now anyway. Should I convert all TPS6594_REG_GPIO1_CONF to TPS6594_REG_GPIOX_CONF(0)?