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: 559548 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A9A3C433EF for ; Sat, 9 Apr 2022 10:05:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234860AbiDIKHn (ORCPT ); Sat, 9 Apr 2022 06:07:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240982AbiDIKHi (ORCPT ); Sat, 9 Apr 2022 06:07:38 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BF5929B7C1; Sat, 9 Apr 2022 03:05:30 -0700 (PDT) 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:VSTeunK1aR0=:HebRN2Cby++pbRxZpgL7f4 agqdxpzVz7M10/MfNnw+z2I9qjlfrKYDfG0quHedVFJglKhw9uRyS0i7XHK9ws3v3tehaTMJN oPVqKZyrSCcV+ounLicZSHT8vpZkD5bSjkVpeozQqycq10IW8dJwr5sykANxhaX3+ZnaTcq5H IPQcbFMYEEERE1CuN8RiNic7inmLQdtHomUfWmthQpvwJqdsxZ2W1qFzlfJrk0e3lBW+ITrPl 1OI/fa3pbdZb62pubJzzrtB2wKz1O7kNVsyuv+Ui9rZ14xlI/uUzj/4QMts+2yu7xmgPIumTy MVS/R3wdVboBbQguV5r5Q4wKaVYozCOr91Cx98G6uDrPDjQYteUsk15+K/pLkjQMEnaNcVmF7 AC8SSKbzmWN5WhH0k4ycenBHxYYW5raxQz/j0hwHH5fhZOtSF/qA8GuJG/KGfWqtU420XHX7I sn8NiBMaW6/aAutK67MbtKb31GTyh/9YLh/6Am2+PSwPMfnkZGIUOIVMmMnoADoWBOP8nEzJo h3j4rHaiFhxeyh484kPRuCGgLpBJzTYlVsjxQaF/UbVylra++nJ1ouTvAnISYcenADjwgL4vE b9cYfB0xQi1Po7aBmVSxgZTOxnQdH5+dz+ytExs0DgOHLYcrZyeEmPrgYun0Q9cQAKMFHez9L kfxxEbPN4xe1XqPR6A6vNjVzC8SznKPFcw2LQHhIBBGHSCr3yX0Jws0XD69idCnsdePzVFwr3 GZLVSbmrI8cIGpfs Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.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(+)