From patchwork Wed Apr 24 18:50:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Berger X-Patchwork-Id: 13642386 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6079BC19F4F for ; Wed, 24 Apr 2024 18:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=s0MZdEhu834rXiUQixELiRVzAzc6VOmyWduO/uBXC4s=; b=1loidVVReb3NjM pTOJEjERCnfVaDpuCs2YUbRGhnvQAjvth+M1q2QvCkT2kSUVSPWHaMKRiKJ4ANKcrsy9cn0tHbrMd V/WEZvNoFX0/NUdPQGxfazzRhv2/EvmiSZ0Tc90IdWVyHdOGd2MygW/ihnm2qN7M9J/2MCLEHUsYP MF7fMaLwfpM7Yz4lDrnmV9YqK8IzdiHSNaDmGcCV9VcmNM/vzYy2QwyWNiF8SqgUHgceQHLkl1Dq/ 3HzWereJdISFFVTndYCWRBvegP7ld7oZlltq7lFTHCqe+H/McNIOAly9XAWdpo8VFz4Gz9+8HEIGt QtkdPzpL6i0gH0n3RxbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzhiC-00000005U6E-46o9; Wed, 24 Apr 2024 18:51:20 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzhi9-00000005U3P-3aMQ for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2024 18:51:19 +0000 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2a7e19c440dso199655a91.3 for ; Wed, 24 Apr 2024 11:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713984671; x=1714589471; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vAbLEAVuW4sSbM42C7LJb1PPQ7uzIoK60RBbrjt4ULU=; b=TsPWhNOPW1uhVbes2Zo+jJ/L53dTQ9Zz+pH91xUa+Yfg5t5Ih58BTzVKvKxGLDkEf9 Oj8IxGPlMthaFWh+kIrrYFdlzL1MWyp69V4tz6wRL+osfqjL0hW91l9z+5BOzIs0Q0BA EN93/MoYNjBNvq1UcqQLB2dPBt/+zjajNojL/PAdIudpBmYi2cARDokLo3WK7a8r/GRa AAg6VlN60Jy8t251xLJkrOxf9kt21aptrgu7a86/gYG00HPmCFyZrDSbhS54hXRGa7A5 r6ILS/aDUVy1XwOFyfg6DpI3Ynxjx8I2A94wknNz67Um7By3trQIKA+PxioOBLC7qQ8c 8hQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713984671; x=1714589471; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vAbLEAVuW4sSbM42C7LJb1PPQ7uzIoK60RBbrjt4ULU=; b=U/hsBJwQ2G6HF1+AUKDLSXbIIHNQyf/5f7L19pOtvWgcMS4YPmUUi7CWRsAzYidke3 qA/IpyhOWlPIzXxdKKtN5FtscNu3Vr5puX3grqC0NJjZa1KzR8XJmJUswPV/QFo5sprd H+JLHJAQeA+eF+2PiPO0dlYkSEzHcx7JaEZJgX1z9SA55JlfALpVlYDa+genENDHTWD5 ytp72wDy1rhz4AfyVpUhZyVs8q/hQI+Xjxz75pYkchXKwKmYR6FlsKouOhdabTaoO67Z RoLovFJoBRaXSeMe+UdnkY21OINH9Lq/3lnBZWaOZs0/P35xDeJzxiila0WC5FtTw058 s+1w== X-Forwarded-Encrypted: i=1; AJvYcCXVEhflZRPRk+92nkgWt5O85NihemwhM+AEs+JsiBrZy1ID6QlXqkVkAsyHsMLGA9qURbEV6vyygZqE7aMKBv3g9pHpwnm6oK6gylr7+PXoMufD7d0= X-Gm-Message-State: AOJu0Ywaj4+jKJxG9kQefvExzsvYLl3oiW9oYk8GSY99DdWnSN00TYJn spUuUuSqjXBDtGFrWw7EyA4g5tnMl+NIT2rse1Kgm+7F+ueORDGQ X-Google-Smtp-Source: AGHT+IHl4DSRBBK5EU7FX+5Xap62TW85oFKwK3LiNNqa2nIFMaTpiwS5/2XjpkpWxLT5r1xxzB4UQA== X-Received: by 2002:a17:90a:d90f:b0:2ae:e22f:38f5 with SMTP id c15-20020a17090ad90f00b002aee22f38f5mr3107642pjv.10.1713984671079; Wed, 24 Apr 2024 11:51:11 -0700 (PDT) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id u8-20020a170902e5c800b001e425d86ad9sm12268728plf.151.2024.04.24.11.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 11:51:10 -0700 (PDT) From: Doug Berger To: Linus Walleij , Bartosz Golaszewski Cc: Phil Elwell , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Doug Berger Subject: [PATCH 1/3] dt-bindings: gpio: brcmstb: add gpio-ranges Date: Wed, 24 Apr 2024 11:50:37 -0700 Message-Id: <20240424185039.1707812-2-opendmb@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240424185039.1707812-1-opendmb@gmail.com> References: <20240424185039.1707812-1-opendmb@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240424_115117_987498_9EF0E42C X-CRM114-Status: UNSURE ( 9.76 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add optional gpio-ranges device-tree property to the Broadcom Set-Top-Box GPIO controller. Signed-off-by: Doug Berger Acked-by: Florian Fainelli Acked-by: Krzysztof Kozlowski Reviewed-by: Linus Walleij --- Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.yaml b/Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.yaml index a1e71c974e79..f096f286da19 100644 --- a/Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.yaml +++ b/Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.yaml @@ -62,6 +62,8 @@ properties: interrupt-controller: true + gpio-ranges: true + wakeup-source: type: boolean description: > @@ -88,6 +90,7 @@ examples: interrupt-parent = <&irq0_intc>; interrupts = <0x6>; brcm,gpio-bank-widths = <32 32 32 24>; + gpio-ranges = <&pinctrl 0 0 120>; }; upg_gio_aon: gpio@f04172c0 { From patchwork Wed Apr 24 18:50:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Berger X-Patchwork-Id: 13642389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6A8B7C10F15 for ; Wed, 24 Apr 2024 18:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vcldFd0vWH89koYNeR3n9gtHjVA6eS+okgyy49XMuuo=; b=GsjXeEI30AyztC 3w0eOyoj22NMpSSdKzEAxyqoY8IQIZc6ZL1iRAh8WXT5tK+/MvEiyMusprYROR4lowJcuIqAVmFUa jL6DnS0Ho+hOzZ+rgIs5uey1OTBVBBmrtxggM0fFbDl+b7TW77QVKEGzWQXJnT7ql9NNAQzwJad/t /VJ83Vzc+ehQTUefVX1Wi79UavVhnN6MaDzfZOqKcP4i/NPe8avaePRLtid1pmCW1DP7XgmrGjboB UmqO4xCP2AhwENW7desnQOysU2Tv87V+YpxmvgXDIExuCL+MN8gEFb5cN1FIpoaVR3BlpIH2y0nqK fY6RIIpZhwuaYIZNjB1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzhiP-00000005UCq-2L1T; Wed, 24 Apr 2024 18:51:33 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzhi9-00000005U3e-3ovg for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2024 18:51:20 +0000 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1e9451d8b71so1623815ad.0 for ; Wed, 24 Apr 2024 11:51:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713984673; x=1714589473; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aj2xwdnfxc+ze8SbiK+i5jZDgRNHrTg59d272CHxPl0=; b=NJTZPvwp8pXmgzsqyoiuT5xn5sZwjnkjlNwW59AfhrgcJTUqE4JsniD/SsMd55Kp+c XD46gRcHnU0QX5jbwog5vSbB4GY22VbaVnv/jbVDCHQkQJXBvenUiujEwjeIhfl1rerq mYeTNS/8/LtfV7jRAqCaw/ha9p03GJdLlKh0UsOVGNZXI7Szg7mjJaD6veRn/wB2IKiv lvN0STuwq0+Uj6Bk4v/GeQvLute2lD9E54C4tr5nKFYvH6SxuTC2EiDsxZ5CMvkgQGDK BdjbL0yYG7hvVaYN8f+qUWXElfHc0x8++yWsbEJYUp43R4acMor5B6qMjiMh+H2T72LD OoMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713984673; x=1714589473; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aj2xwdnfxc+ze8SbiK+i5jZDgRNHrTg59d272CHxPl0=; b=Yb3XuOG0N73Xc/zCyquuPgpyNFftZ5PxoIZJaqNc2OL+kkia6E/fXWb5xYLMxgGUfj JrHRKavR6WvSKanwnbJibMaOXnscyzgS3B3sOaYgcU9iOh/sVccmL+OLr5YcXEKttyeF C7nCq8xXam3fjcDGjQVJBnQUQMnNFZBqJAC/AGjRrgbZbdAhPbNcP0tphCmsT+b2rkL6 WgDFBkseGIqetIrbfi5E0lfVE0/WX9BDLwqLCRZVgXBZkV99VAbW/4TvoIHw6TqEWerV 8GCLh8rEwUwCeT6Xe3qnzRaiwYkWhEFfmLrQdIaKvDonb3E3OCsJtUl+SvitJ8V950I8 v46Q== X-Forwarded-Encrypted: i=1; AJvYcCVsnTFg4SV7AubeA0HV4nTKwaM2+kLQzufRQq3djYHvVE6EvrAn7iUUVKFXWxzv5AoTs98N/Sev9L6iKyZs6u9JpZO7h1QNT9ZqmN3txX592g08CVg= X-Gm-Message-State: AOJu0YyvRxOiTWPy5PHik5bev12VbzOXTXoa+MjXUxV5LVcBYjJc6+Pw F16yXhXG4LMlJzgRDg9Hr1pYJtFJoKOfrCN5+kNP1rxXHhC821DQ X-Google-Smtp-Source: AGHT+IHFsfd1jX7pOazkuawT08Lov2Gli5HIokS31G862grOZlEAa7XZMq3oEvPkdYQNBTJt+IaKqg== X-Received: by 2002:a17:902:6bc4:b0:1e8:b7fc:7f85 with SMTP id m4-20020a1709026bc400b001e8b7fc7f85mr3033829plt.31.1713984672683; Wed, 24 Apr 2024 11:51:12 -0700 (PDT) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id u8-20020a170902e5c800b001e425d86ad9sm12268728plf.151.2024.04.24.11.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 11:51:12 -0700 (PDT) From: Doug Berger To: Linus Walleij , Bartosz Golaszewski Cc: Phil Elwell , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Doug Berger Subject: [PATCH 2/3] gpio: of: support gpio-ranges for multiple gpiochip devices Date: Wed, 24 Apr 2024 11:50:38 -0700 Message-Id: <20240424185039.1707812-3-opendmb@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240424185039.1707812-1-opendmb@gmail.com> References: <20240424185039.1707812-1-opendmb@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240424_115118_013424_AAC89D5E X-CRM114-Status: GOOD ( 17.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some drivers (e.g. gpio-mt7621 and gpio-brcmstb) have multiple gpiochip banks within a single device. Unfortunately, the gpio-ranges property of the device node was being applied to every gpiochip of the device with device relative GPIO offset values rather than gpiochip relative GPIO offset values. This commit makes use of the gpio_chip offset value which can be non-zero for such devices to split the device node gpio-ranges property into GPIO offset ranges that can be applied to each of the relevant gpiochips of the device. Signed-off-by: Doug Berger Acked-by: Florian Fainelli --- drivers/gpio/gpiolib-of.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index cb0cefaec37e..d75f6ee37028 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -1037,7 +1037,7 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip) struct of_phandle_args pinspec; struct pinctrl_dev *pctldev; struct device_node *np; - int index = 0, ret; + int index = 0, ret, trim; const char *name; static const char group_names_propname[] = "gpio-ranges-group-names"; struct property *group_names; @@ -1059,7 +1059,14 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip) if (!pctldev) return -EPROBE_DEFER; + /* Ignore ranges outside of this GPIO chip */ + if (pinspec.args[0] >= (chip->offset + chip->ngpio)) + continue; + if (pinspec.args[0] + pinspec.args[2] <= chip->offset) + continue; + if (pinspec.args[2]) { + /* npins != 0: linear range */ if (group_names) { of_property_read_string_index(np, group_names_propname, @@ -1070,7 +1077,19 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip) break; } } - /* npins != 0: linear range */ + + /* Trim the range to fit this GPIO chip */ + if (chip->offset > pinspec.args[0]) { + trim = chip->offset - pinspec.args[0]; + pinspec.args[2] -= trim; + pinspec.args[1] += trim; + pinspec.args[0] = 0; + } else { + pinspec.args[0] -= chip->offset; + } + if ((pinspec.args[0] + pinspec.args[2]) > chip->ngpio) + pinspec.args[2] = chip->ngpio - pinspec.args[0]; + ret = gpiochip_add_pin_range(chip, pinctrl_dev_get_devname(pctldev), pinspec.args[0], From patchwork Wed Apr 24 18:50:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Berger X-Patchwork-Id: 13642388 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70A80C4345F for ; Wed, 24 Apr 2024 18:51:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CBgkwd+fsxxXSz0veW/vFQ0KGWKHDhy7J23EJmQYZOU=; b=bFkHeSvjjC+yru KBZPd8Mb6b5+LhVsS6w0YnfYSOCh+RWiWCtPp2X5EFyywJJABjXJLi+fNv3B2G4edUpwndezleJRH t5EhSbV42rXI+QWhh+xLSf5eRHzT8/KKJUvbj6S8pJA0KejHdJl/Ab8zM/qsgymQ+vdW3XHAPg2JT Zo7M0HBLeTg1CiUdrR+e6SzDtb8bqkn7RaNxbqWoYO8kyGommKCxd7xod6pQZQUyZ0WRFYVykgQZL jcy70y/G6EwWa2MiRlaDULe1rmGlwUqXLhUqoQGUZf7WGX6k4vvSxScjwnWXyvNnH94/GeQBomA9A 8TfxZ4RxbUef+9VoDUhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzhiN-00000005UBh-1hZj; Wed, 24 Apr 2024 18:51:31 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzhi9-00000005U3z-3lGC for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2024 18:51:20 +0000 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2a4b457769eso202641a91.2 for ; Wed, 24 Apr 2024 11:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713984674; x=1714589474; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M6X+5q1a247m8fqLqnCGs505zqCuuzBrbu8TFFgUqlA=; b=JKi6bWqPPMqW8wlE90eYs0G9+UsWbdiiY7IUrj60Hi4FCNQ7RweYaIsTRsBHNeZ8XI xMBykojGRPxefl6PPdqj7Qt8Xf/gNGGx/A4yxmf9jZ/Nd4K1vOdU9jVJIq5DcFa9aUu6 3lhzWYk5kUn2D/dMIR0cc5zM4fHdrAMw+/QFz9zD9qnaraMqFOd0h4UYu1DjcvOqcbOl /yyiRfG8Z/w14gQJ2dNJ3s58flZpt1l7+GViHlcq7uCbqcvc4NVjAkdfraexWOmD1i87 89UlGHI/HENe5NZiEF9DWcIVcqES1Py7xe5GT/tLwqX+Po9mgyeo6N9MEUe86mCHIaSI OC8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713984674; x=1714589474; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M6X+5q1a247m8fqLqnCGs505zqCuuzBrbu8TFFgUqlA=; b=lqKPDeaLvfrxwFznOMOGOHrfArKsSVmxH3iX2KhuXH4L9bB8dgqx4O0y65utEI0UJM MI22xMyWlADsDPw34QlJTgfaK6Q+bJkizqP7Do/u73XHsUcUAsG/z5hZNyocsAlgWK/P 5evDEDLcG5yHdEVK7zSaXLKleP3iouplU25l/1SvIvIZPVWSmtxQu2IVDOW//76R+69J TJWTFb9RclK7YkqyWYzga9zO6ksqlgv5XgMGC5KkNYi74hZY5L5i5/COT5F2ZaRvm+ZA EBotubjbEM86cZP/gbGndsOzcp9WybYiGCOBibPG1DRTtuUa3Quc800mTKiiFqz4OyhN BKyg== X-Forwarded-Encrypted: i=1; AJvYcCWxdqpVAa9kdiQE9mGuowgEMov257KlNEj5ckhFdIr++24PIlGN4lWPz9ZbEzp4Z17xqjVolEePaet4wlyDCge6GIMXbUQI4y5p1VcldJ8DR8xNUUQ= X-Gm-Message-State: AOJu0Yx/7WXFFxU6o43nI2CT3o8dyiTu5lzkefTSz86/SCui3wvs+tvU e113gAeUy1vAhasPtboiBVOzytb/tV7M6PDnZWaYpXTaQXzjz4W5 X-Google-Smtp-Source: AGHT+IG2S6ThdztYb6nuOhNHcsI2+OyS+uqKCdcFORMaUGu/yUaxmgf9JxNsSHJqm+2ECP5SHr4tZg== X-Received: by 2002:a17:90b:1d0e:b0:2a2:f284:5196 with SMTP id on14-20020a17090b1d0e00b002a2f2845196mr3224723pjb.45.1713984674335; Wed, 24 Apr 2024 11:51:14 -0700 (PDT) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id u8-20020a170902e5c800b001e425d86ad9sm12268728plf.151.2024.04.24.11.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 11:51:13 -0700 (PDT) From: Doug Berger To: Linus Walleij , Bartosz Golaszewski Cc: Phil Elwell , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Doug Berger Subject: [PATCH 3/3] gpio: brcmstb: add support for gpio-ranges Date: Wed, 24 Apr 2024 11:50:39 -0700 Message-Id: <20240424185039.1707812-4-opendmb@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240424185039.1707812-1-opendmb@gmail.com> References: <20240424185039.1707812-1-opendmb@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240424_115117_992794_FC4D3231 X-CRM114-Status: GOOD ( 12.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org A pin controller device mapped with the gpio-ranges property will need implementations of the .request and .free members of the gpiochip. Signed-off-by: Doug Berger Tested-by: Phil Elwell Acked-by: Florian Fainelli --- drivers/gpio/gpio-brcmstb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c index 790cb278b72a..8dce78ea7139 100644 --- a/drivers/gpio/gpio-brcmstb.c +++ b/drivers/gpio/gpio-brcmstb.c @@ -694,6 +694,8 @@ static int brcmstb_gpio_probe(struct platform_device *pdev) /* not all ngpio lines are valid, will use bank width later */ gc->ngpio = MAX_GPIO_PER_BANK; gc->offset = bank->id * MAX_GPIO_PER_BANK; + gc->request = gpiochip_generic_request; + gc->free = gpiochip_generic_free; if (priv->parent_irq > 0) gc->to_irq = brcmstb_gpio_to_irq;