From patchwork Wed Mar 17 14:37:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 12145895 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D860EC433E0 for ; Wed, 17 Mar 2021 14:40:21 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B6D364F50 for ; Wed, 17 Mar 2021 14:40:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B6D364F50 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MzPBVqSOBSH2+4EnUbuvdtnz4Li0r7k1UGdvfEM9vrg=; b=dwEe8kHInK4IlP aTzXJlhAdoPrONZFQfOTrmWXYDRD3LD6wOfQ6zPvgCytexUfOkMhQb9yEXWa85fstm1DRbHlFgGOv kzL8Xwobw/zZcA+uE64PLOD2yvDx45q1tj5+LiG5/fmXfH4vsHZHg3r5R1T2+5IDJeFfuOF1uETqX M8mMImuaK6Us5oYMkf5X6pvl9IviGQZv6Lr9rM5kLJOjig1NV16Ovod/rn7/AHYdtSHyevMcOU+x6 MSqmuq0Iehe09AirJWMNiNevpSdzWZxJdTadlcNS/ks8ZsKbcKU3BFRLndzmbX/RN6YEnrZrzOi31 qabcIfeo+3CHD3Nw+eyQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lMXJZ-003Hha-A4; Wed, 17 Mar 2021 14:38:25 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lMXJG-003HaU-8F for linux-arm-kernel@lists.infradead.org; Wed, 17 Mar 2021 14:38:09 +0000 Received: by mail-wm1-x333.google.com with SMTP id g8so1602863wmd.4 for ; Wed, 17 Mar 2021 07:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=2s5YbuhuWTd3ttLYVEHI3IRKeL8Zb/h8ik0U5PGagpM=; b=BtmQ8+nn2p4UpZo1NuZ9J5LoYrh0cUtNOWlV0ecqfesjM6Z1fRAyPzDLcoDdZy7H22 WghRx0g3K2YvJk8f7Oy/m+fu9FrHc9P26XlCtCEyykFx2fViu+HaxBRJ/Ep9TL5dIxfG NNLfxFZzzNnGd2sVtldNOmFK5HlC7K+W184sxETQklxkdkiwj1zrS/62mM1jsNa+UnI8 FFC1rh/6EyccAVUntNymj29YNJKKiDVwKoONofyNNSgLB8Xdh6z+y2SJ2ENYMsO3/R7P MdMGXc5cKj6zVGB2MYyRD0VyC5R8OHdLwlJejDQpCng7DfAFg19J0tlAcZ8O4WxfaCDg Wl6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=2s5YbuhuWTd3ttLYVEHI3IRKeL8Zb/h8ik0U5PGagpM=; b=JcxjsUYpw2pENT/ogJa6kP/p+7Icn9MatLWzVhyEsDAjMXgtX9oLafqxE2zQtyEcEn l5iqjLqiyI+/1JgNhiXIhbtXLkht/MhUR1deQRzxw3tA9hso0vo62u2YqdE3VwCee8m7 LbERSYNYKpzIjQoKAedm0WZPKq+d9JAO6uwjDrstQlIm1zRUk6t+GQ/ZJZ17nXG8bycN 1DuOm8MrdUjMg4pf3jc/kBkLJKgDThDQqw0UUIha4eXSkAJNIh2bUOLX7G6sERCHgYW4 8P5v4ZT5OhahPEcQVql12+pwiCZJgjN4sDnW8jl09fPFiA0ubi8Ej2DEWA/wxL7ZYkel W94A== X-Gm-Message-State: AOAM531fabEmXnDm4MpgnpNeYizEZGQtQXBEdFr5+wzVyG4j1PDGdeVo ieIoIu/Cg+B+wYldxm2PjRs= X-Google-Smtp-Source: ABdhPJyZ2ub5Tvxww9TKqSmYfzFSl5/KmZ+goALIY+lUfCr+y62XoN3Zmwm94kvsNFJUTB5KKifgsw== X-Received: by 2002:a1c:2587:: with SMTP id l129mr3955173wml.135.1615991885587; Wed, 17 Mar 2021 07:38:05 -0700 (PDT) Received: from skynet.lan ([80.31.204.166]) by smtp.gmail.com with ESMTPSA id a75sm2518948wme.10.2021.03.17.07.38.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 07:38:05 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Lee Jones , Michael Walle , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Jonas Gorski , =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= , Necip Fazil Yildiran , Andy Shevchenko , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v8 00/22] pinctrl: add BCM63XX pincontrol support Date: Wed, 17 Mar 2021 15:37:41 +0100 Message-Id: <20210317143803.26127-1-noltari@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210317_143806_394045_5D271887 X-CRM114-Status: GOOD ( 17.60 ) 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 Álvaro Fernández Rojas lun, 15 mar 12:42 (hace 2 días) para Linus, Bartosz, Rob, Florian, bcm-kernel-feedback-list, Lee, Michael, mí, Jonas, Necip, Andy, linux-gpio, devicetree, linux-arm-kernel, linux-kernel First of all, I've based this on the patches sent by Jonas Gorski back in 2016: https://www.spinics.net/lists/linux-gpio/msg15983.html http://patchwork.ozlabs.org/project/linux-gpio/patch/1471604025-21575-2-git-send-email-jonas.gorski@gmail.com/ I've tried to address all coments from Linus Walleij, but I know that this may still need some other modifications This patchset adds appropriate binding documentation and drivers for pin controller cores found in the BCM63XX MIPS SoCs currently supported. While the GPIO part is always the same, the pinmux part varies quite a lot between different SoCs. Sometimes they have defined groups which can be muxed into different functions, sometimes each function has a different group. Sometimes you can mux individual pins. Often it is a combination of single pins and groups. Some core versions require the GPIO direction to be set according to the function, most do not. Sometimes the mux register(s) contain bits for unrelated other functions. v8: introduce changes suggested by Rob Herring. v7: introduce changes suggested by Rob Herring. v6: introduce changes suggested by Rob Herring and Andy Shevchenko. v5: introduce changes suggested by Andy Shevchenko. v4: fix gpiochip_irqchip_add_domain(), remove IRQ Kconfig selections and add missing of_node_put(). v3: introduce new files for shared code and add more changes suggested by Linus Walleij. Also add a new patch needed for properly parsing gpio-ranges. v2: introduce changes suggested by Linus Walleij and remove interrupts - In order to use GPIO_REGMAP, the need to get gpio_chip from gpio_regmap and use it for pinctrl_add_gpio_range() and gpio_chip.direction_input() and gpio_chip.direction_output(). Álvaro Fernández Rojas (22): gpio: guard gpiochip_irqchip_add_domain() with GPIOLIB_IRQCHIP gpio: regmap: set gpio_chip of_node dt-bindings: improve BCM6345 GPIO binding documentation pinctrl: bcm: add bcm63xx base code dt-bindings: add BCM6328 pincontroller binding documentation dt-bindings: add BCM6328 GPIO sysctl binding documentation pinctrl: add a pincontrol driver for BCM6328 dt-bindings: add BCM6358 pincontroller binding documentation dt-bindings: add BCM6358 GPIO sysctl binding documentation pinctrl: add a pincontrol driver for BCM6358 dt-bindings: add BCM6362 pincontroller binding documentation dt-bindings: add BCM6362 GPIO sysctl binding documentation pinctrl: add a pincontrol driver for BCM6362 dt-bindings: add BCM6368 pincontroller binding documentation dt-bindings: add BCM6368 GPIO sysctl binding documentation pinctrl: add a pincontrol driver for BCM6368 dt-bindings: add BCM63268 pincontroller binding documentation dt-bindings: add BCM63268 GPIO sysctl binding documentation pinctrl: add a pincontrol driver for BCM63268 dt-bindings: add BCM6318 pincontroller binding documentation dt-bindings: add BCM6318 GPIO sysctl binding documentation pinctrl: add a pincontrol driver for BCM6318 .../bindings/gpio/brcm,bcm6345-gpio.txt | 46 -- .../bindings/gpio/brcm,bcm6345-gpio.yaml | 78 +++ .../mfd/brcm,bcm6318-gpio-sysctl.yaml | 177 +++++ .../mfd/brcm,bcm63268-gpio-sysctl.yaml | 194 ++++++ .../mfd/brcm,bcm6328-gpio-sysctl.yaml | 162 +++++ .../mfd/brcm,bcm6358-gpio-sysctl.yaml | 130 ++++ .../mfd/brcm,bcm6362-gpio-sysctl.yaml | 236 +++++++ .../mfd/brcm,bcm6368-gpio-sysctl.yaml | 246 +++++++ .../pinctrl/brcm,bcm6318-pinctrl.yaml | 145 ++++ .../pinctrl/brcm,bcm63268-pinctrl.yaml | 166 +++++ .../pinctrl/brcm,bcm6328-pinctrl.yaml | 127 ++++ .../pinctrl/brcm,bcm6358-pinctrl.yaml | 93 +++ .../pinctrl/brcm,bcm6362-pinctrl.yaml | 206 ++++++ .../pinctrl/brcm,bcm6368-pinctrl.yaml | 219 ++++++ drivers/gpio/gpio-regmap.c | 2 + drivers/pinctrl/bcm/Kconfig | 55 ++ drivers/pinctrl/bcm/Makefile | 7 + drivers/pinctrl/bcm/pinctrl-bcm6318.c | 498 ++++++++++++++ drivers/pinctrl/bcm/pinctrl-bcm63268.c | 643 ++++++++++++++++++ drivers/pinctrl/bcm/pinctrl-bcm6328.c | 404 +++++++++++ drivers/pinctrl/bcm/pinctrl-bcm6358.c | 369 ++++++++++ drivers/pinctrl/bcm/pinctrl-bcm6362.c | 617 +++++++++++++++++ drivers/pinctrl/bcm/pinctrl-bcm6368.c | 523 ++++++++++++++ drivers/pinctrl/bcm/pinctrl-bcm63xx.c | 109 +++ drivers/pinctrl/bcm/pinctrl-bcm63xx.h | 43 ++ include/linux/gpio/driver.h | 9 + include/linux/gpio/regmap.h | 4 + 27 files changed, 5462 insertions(+), 46 deletions(-) delete mode 100644 Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.txt create mode 100644 Documentation/devicetree/bindings/gpio/brcm,bcm6345-gpio.yaml create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm6318-gpio-sysctl.yaml create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm63268-gpio-sysctl.yaml create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm6328-gpio-sysctl.yaml create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm6358-gpio-sysctl.yaml create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm6362-gpio-sysctl.yaml create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm6368-gpio-sysctl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6318-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm63268-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6358-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6362-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6368-pinctrl.yaml create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm6318.c create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm63268.c create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm6328.c create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm6358.c create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm6362.c create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm6368.c create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm63xx.c create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm63xx.h