Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp79754rdg; Tue, 10 Oct 2023 05:02:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHP7eL0ToccUAbhi30gqnTSKkWdI7xIkmE+CKS3PuS+FiHtBE0TA4vn9ESlTitn+InC6GwN X-Received: by 2002:a05:6870:2198:b0:1c1:e6da:f88d with SMTP id l24-20020a056870219800b001c1e6daf88dmr20719080oae.56.1696939351516; Tue, 10 Oct 2023 05:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696939351; cv=none; d=google.com; s=arc-20160816; b=L2ELC+W4TvIdt6jcjxrI3mCAPMJ3SUN/qaIRVS5lwqJBe032mDOg7TGX2sx7lG7Zzv WNW/0WnEnYRLw0X/KRkSYBlWSQYtWjAS9Zak5hEXTzBEhT0z9bVbvI4m15MyVJbSsAxY yH8uekv8vltYgcdBam8sQS0GsmzXhk7vkW0899QtSKDYxVkiJtmRQeswvSoH+DaeRIKT pyg814HrAhE3dVHXU7tzehCu0jBlcdZMZstQ6LYH0utuQjOa0JZfWKPPV7wVMpBmMpOY Yb1thxBkqI/JQBPoLfLIcQ/EzZ7gnQ6uA5RZEJLEBgoOvchlCBpeL3nCYkozYT6YFz3n PXmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=URqL7nDWUnzyuM8apl7Oe6clHcQ+q18wy8Bzu+Hd0z8=; fh=7Ioboo5xv/jEjQWC1ygKONqFb7CKylUarnhcd3ugNCw=; b=V92NipPEzivSosCV3EjdmZexanKp1Dri3RmZOA+0gDzFR8Jjpt0vl0Prh0FEw7DgyU kkGzWPxslmkEXQtOTPZMUEDYjzuWjxXaxCPsUfwmejo5Kjxadg8QmSgX8dEOvCJYdAWp GdFfNNaEiTlGPFbEA+76CIJWnw4lZJp1Dt0aSd7AdO85vxWF5VMclZGsElxKAcMsOAKI ew/k04c9mINfOkrJCz/Gcb/SvwlIXK3wW1kydhqgIUHCMu9kcc0eIp9GlWMmK2KDX17R td/OVqadSyk3CzeWYhQpOarDTWZzVDjyiokX6DoN5tS4j7QB6XoPd3YbOHs+6G8I9cnC 63QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KZiCpfmA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id s190-20020a6377c7000000b0059b9ac47261si969440pgc.634.2023.10.10.05.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 05:02:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KZiCpfmA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 3B595801CFD2; Tue, 10 Oct 2023 05:02:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231432AbjJJMCQ (ORCPT + 99 others); Tue, 10 Oct 2023 08:02:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231950AbjJJMBo (ORCPT ); Tue, 10 Oct 2023 08:01:44 -0400 Received: from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com [IPv6:2607:f8b0:4864:20::1129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02226171B for ; Tue, 10 Oct 2023 05:00:52 -0700 (PDT) Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-5a7b92cd0ccso11505477b3.1 for ; Tue, 10 Oct 2023 05:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696939251; x=1697544051; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=URqL7nDWUnzyuM8apl7Oe6clHcQ+q18wy8Bzu+Hd0z8=; b=KZiCpfmApCbJ6HuyB2vfz2w2c0dYAxh7qq5doiDDsLV6B+96ePI90L+RjUmqtF22Xg Xg6Xj65l+uXOdWv+50EuYDjvbW2/57k82IgTqMg3eUukh7c2lwUXAd6NSI8sXKb+i+uU FEHFJW1NwGbw06hKJmQKQL0OcucL75wEMSRGBCjrxBZAnw0iDKZmKmihdFf5xPzcjhC/ UuKV1Ob0fI+Sxp9B3kiWYqa23qVtAVsj5JFNBwwFjtUsSBdLyCydvk9OCbqWBgNxoqfG 8FUsxuL25gshmVrbLMvOnoktX2/dBSYiqtw4aTleq03B3xhg/WDzadU4f0JcSPcxmWdz X0xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696939251; x=1697544051; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=URqL7nDWUnzyuM8apl7Oe6clHcQ+q18wy8Bzu+Hd0z8=; b=K0mDaJxo/d+hiDttRq0y7ZR/bBPf3i7yfZyICcKRNdKxdcAXc1Tps9BqlbRzdjiNKK IPTqU2WSrQk4EjU96bhkr9ue+75fxG5L/z60KWVthpiGLL5bMICONRiWoQ1MaHh7pjbx ilb8KhqWWNRfODt4BlnRsij556FYXnDoqf5QSHem6SWbb3GH4SzlWNDvkos91fdk8RFr J4XucVrciYF9tfME7Zs/DT0QMqsvuiFBTHQtPmpDx4ZPtGxSiosZUBk5MzWD4rUfA7d+ YJv3z/7hbeUMTj1+9DvceinwZD3Uw9p2WlDH7WGCPaT9PEhLx5zsH1XY8ol5R+uEsSKh C3ow== X-Gm-Message-State: AOJu0YxevOqFKhAUpX2qvD56IJKkJ/mwqHI5gNofxXdvsGL7oK3Bhgvc 7Jc+rSTnVWWo/r7Jr0/LSnO4ic4604fMt8nMBSfacQ== X-Received: by 2002:a81:7309:0:b0:59b:2458:f608 with SMTP id o9-20020a817309000000b0059b2458f608mr18960119ywc.30.1696939251412; Tue, 10 Oct 2023 05:00:51 -0700 (PDT) MIME-Version: 1.0 References: <20231005025843.508689-1-takahiro.akashi@linaro.org> <20231005025843.508689-5-takahiro.akashi@linaro.org> In-Reply-To: <20231005025843.508689-5-takahiro.akashi@linaro.org> From: Linus Walleij Date: Tue, 10 Oct 2023 14:00:40 +0200 Message-ID: Subject: Re: [RFC v2 4/5] gpio: add pinctrl based generic gpio driver To: AKASHI Takahiro , Bartosz Golaszewski Cc: sudeep.holla@arm.com, cristian.marussi@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, Oleksii_Moisieiev@epam.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 10 Oct 2023 05:02:24 -0700 (PDT) X-Spam-Level: ** On Thu, Oct 5, 2023 at 4:59=E2=80=AFAM AKASHI Takahiro wrote: > Some pin controllers provide not only a method to set up lines but > also gpio function. With this commit, a new generic gpio driver will > be provided. It is implemented purely by using pinctrl interfaces. > One of such pin controllers is Arm's SCMI. > > Signed-off-by: AKASHI Takahiro > --- > RFC v2 (Oct 5, 2023) RFC v2 looks very good to me, definitely something that can be merged as a starting point once the hardware has been tested. > +static int pin_control_gpio_direction_input(struct gpio_chip *chip, > + unsigned int offset) > +{ > + return pinctrl_gpio_direction_input(chip->gpiodev->base + offset)= ; > +} > + > +static int pin_control_gpio_direction_output(struct gpio_chip *chip, > + unsigned int offset, int val= ) > +{ > + return pinctrl_gpio_direction_output(chip->gpiodev->base + offset= ); > +} IIRC Bartosz is working on a patch set getting rid of this kludge having to call with base + offset in every driver, replacing it with generic calls th= at you can just assign in the gpio_chip. When this gets applied these changes will likely be in place so you will get rid of this too. Yours, Linus Walleij