From patchwork Sat Apr 9 09:51:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12807815 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 AAB73C433F5 for ; Sat, 9 Apr 2022 09:53:32 +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: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:In-Reply-To:References: List-Owner; bh=l8T5jSaNxTjzLaqHIHCObqr52J/dQ5PEDFJncNr5bfs=; b=AhyPqdN2WSYfeg DxgPIwgkGL2HumG6UXPQpjFDjUBNpy1t4+YzhO6TCyYR4EPl9V1SmUEarNS2PpAfYRFHFSiXvSfvp k/3s5oQZRmGTzn3zk83UUjU0tGPnYANPlgOX2Jj9Jw6+iHcP3oHsk1hIF/tc0kLaQS8Ks08hV4vR9 rvwOpkH1gMukdehUc+DniyjC/SF3M2sQ+yYlLOYhH8YgLYKlgvMLOEhnK0e4dJRCjJLSOOyEKlDnG wtaPWUYAUOdCmpKcmNggGtSSHKnornhK/xLWEa1pq+BUquYSzUnkLXMiGmWMMGBKm59jPLVSk3khN 9stxXE37Fp9R9MNMFFWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nd7lU-002jnQ-03; Sat, 09 Apr 2022 09:52:20 +0000 Received: from mout.kundenserver.de ([217.72.192.73]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nd7lQ-002jlh-4k; Sat, 09 Apr 2022 09:52:17 +0000 Received: from localhost.localdomain ([37.4.249.94]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MvaO8-1nwR4B47S2-00sfL5; Sat, 09 Apr 2022 11:52:10 +0200 From: Stefan Wahren To: Linus Walleij , Bartosz Golaszewski , Florian Fainelli , Ray Jui , Scott Branden Cc: bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , Phil Elwell , Krzysztof Kozlowski , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH 0/2] gpiolib: of: Introduce hook for missing gpio-ranges Date: Sat, 9 Apr 2022 11:51:27 +0200 Message-Id: <20220409095129.45786-1-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:Oa5fkx4bjn2+J48sY8Hx7pETzPyWykaUGf3Qsqu1texR7OHUIj8 Ix9/syXJABqqE6e0/uGyBnt5FAGQFyTMEuJ/tv28VNrW5DCUHxuxmS2Pj37Co5Bzq21sdUi /9LTYrGPsHHgyo/NJ8NVvwpc3zOvqlUFwbs0zqb6TkQIZEW3v1mej2Cx/cCtlR0D9NQM8yA oE3pYIHa3MMKCsvF40qmw== X-UI-Out-Filterresults: notjunk:1;V03:K0:1kyH6IQ4Buw=:d3OFplw8Z2+f4h/HIjeo0o YzGxPPriuhJQ1v4YafbhnOzDEx8jCeb9yY5DZfwPqOl3Klxa6Vpo6AG3w3LOYfzj9eZQELDOg UoYH/GuWtht4GOSxKhoZ2WPAgSGKyUN1bZLm1kxi/WoNDCuJT0k22q4km73EpMvugJ9hIZQDp xTvDtXpS8ROS8X09fI7Vq4LKExYgckSuicwRqapHy+iuZNpfMd/Fprmv7eLd+1baHsPXNg2sy sWt3Sm5XgOuP1DXFRrgbGfG36I4q2HSRfbx+zbjMS6FqgFJ5FQiwzWa/j4/DUtMegTlLTVniz mxRoDD/9hjiF/4LWfHtoDcp7/a4msN/BREHNSCSMOFjJsONGqHxjzlz8ublN8f4er1eH7+Bgi CFE+3Pt6P8UQ9tDexid8kthl54+HYsLy5nGEJ+OSSWW+ROKM9aELSnqssiAd+WUGQ0m8sOB+C u0pfTz5o1xGyIo0fSt5bpEk+w0mxjTfc9COcMQhhHONVnCwsXhfEcrJ8xExoKRToJh/kK28yl jLty5mLekktM6kosI7CPglJc5FMNq1mS0eE1qA4kUOwlpx7+bTMxkF1W6NgRSG8zccde1e3hg YuHKvbR/mOSuMFXpsiy/MFDl3BEcpUkEx1im2XrKZfvrhk43hbsGer4qTMVfUeiOxUsk8gZaN 8ZW91OH24l3Vwbxms6Q2neelY4Sqo9xtST4HVOXtEmWnZSuMatjSmX1/mskBOHxCuvvpEgd1R W/91We8GoxTvNVjM X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220409_025216_515151_1BD3B45A X-CRM114-Status: GOOD ( 11.65 ) 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 This patch series tries to provide backward compatibility for DTB which lacks the gpio-ranges property. The commit ("pinctrl: msm: fix gpio-hog related boot issues") by Christian Lamparter already contains a fallback in case the gpio-ranges property is missing. But this approach doesn't work on BCM2835 with a gpio-hog defined for the SoC GPIOs. Based Christian's on explanation i conclude that the fallback must happen during the gpiochip_add() call and not afterwards. So the approach is to call an optional hook, which can be implemented in the platform driver. This series has been tested on Raspberry Pi 3 B Plus. Changes since RFC: - just add all collected Fixes, Reviewed-by, Tested-by and Acked-by Stefan Wahren (2): gpiolib: of: Introduce hook for missing gpio-ranges pinctrl: bcm2835: implement hook for missing gpio-ranges drivers/gpio/gpiolib-of.c | 5 +++++ drivers/pinctrl/bcm/pinctrl-bcm2835.c | 18 ++++++++++++++++++ include/linux/gpio/driver.h | 12 ++++++++++++ 3 files changed, 35 insertions(+)