From patchwork Mon Mar 15 11:41:52 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: 12139009 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 5EBC4C43333 for ; Mon, 15 Mar 2021 11:49:48 +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 CA4B064EBD for ; Mon, 15 Mar 2021 11:49:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA4B064EBD 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=2tLev2UbfvhsXTEKOJZNuOO6BksKiWXEc11zLKrwVV8=; b=Dn8NP5aAgV0oCp iU3XxCZ4kk+Aa+y4caf/n6UOr43sn4LtxNwYAcWaurVKvsDQr/tzVrVG7AymZHq5u1uwYRF60ef5F 9+B75dDqX91PMa4zs7VLOBCSRETXWy12tJtvDnYfUdc0znM/VKoWqXKcGxXmvEP/cGVOI/A8jjpz8 GjjVCmglzR06DZZi92x6JvSB+DvDRJNht+siF9IXsre//NnddTxML/lDExen/vQwra5PbnRo0cD1X gDRkvmqH7rp2xwKEp/X6+oPOdmbSdusSfHGXHSu8WHD38pPNvbju/ij3xosTVOxHhgPcyUC66Dj65 YtMfH+ebb9kEQzOMZEgg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLlfE-00FhIt-E2; Mon, 15 Mar 2021 11:45:36 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLlc2-00FgoJ-QA for linux-arm-kernel@lists.infradead.org; Mon, 15 Mar 2021 11:42:23 +0000 Received: by mail-wm1-x334.google.com with SMTP id w203-20020a1c49d40000b029010c706d0642so2151968wma.0 for ; Mon, 15 Mar 2021 04:42:17 -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=CZ4o44VN67SngoagcuOsHI3wdJFUzIRPY1Jka8gdm00=; b=OLR/pPqJwWErDKHhxpklSMpwDpjG+8mMVjxCWj1MlDFUR1RdzPCwNe1KEQ3kDM5J/l YZbqzgA5Jq72GIVGEBi5rXOW2y0KeBu9Z1kO/dryyOXKjP+ncGOQWg+uCP+j2v3Aek1i +8gZnvTcMRLc/wSZZY1tS+8E6ZQyWd7XePQZ2xKjnNPu1G02FijdIlaWq1b6SisKw80Y c85YWPHdfmaMkjT9O8i22Yk7oKV53RRmQw0YYWmh7Zq9s/17X5thdOhpZ6aBinJOdgF4 BG3BjTF2vfhY5I+YFkD3cpAS2PbhmccvcfF4GyEexPtQ3/FQibBG5cfbi7vLe6P087eL +U5Q== 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=CZ4o44VN67SngoagcuOsHI3wdJFUzIRPY1Jka8gdm00=; b=B15lel58HpP/Nr2gvCd9UWM+m3SxjXWR7JjVBX7psgDAFlK5F98Wre9v+OBA9NUZes idiZV0jx0OEDChGgZVjcMZ9WRXVtRWIDN8thJQAylsw02/rRiLzxGEkgnxM6hQnZ3S/J 8bbwkN+gqVt90TE56GvGuAqWad7tU0eaDP7rgLXg4a5g9oBbpb4bbww5yn0yRUVWgP3w eVaH2WZlyZK1k9ZlDggIP6YWT8V3d7bqZ7xX7uf70vk0QdDs02eRbLOrJZMoMdmCEKpb qdqbra+EixLC+7KNXNrUJ9cXUUz61jdGfuRaJd3HmjjLC23KovXIEGPaOT8vrjSFmTlY OibA== X-Gm-Message-State: AOAM530dZT0HyowOKvc/fZM77dA4F99KCWn8BstCpihqEywsTE2GHiSG GXxznGu6PbSnareH0G4rYGQ= X-Google-Smtp-Source: ABdhPJyIb2L+D5GFNzesGuoKgblo8rS1r0ZQZGKEu8TCFf7bO2Z3ep9sgLZ5nHyiOOkgPwHi3EolsQ== X-Received: by 2002:a7b:c3c1:: with SMTP id t1mr25326625wmj.47.1615808536906; Mon, 15 Mar 2021 04:42:16 -0700 (PDT) Received: from skynet.lan ([80.31.204.166]) by smtp.gmail.com with ESMTPSA id v189sm12648187wme.39.2021.03.15.04.42.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 04:42:16 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Lee Jones , Michael Walle , =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Roja?= =?utf-8?q?s?= , Jonas Gorski , Necip Fazil Yildiran , Andy Shevchenko , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 00/22] pinctrl: add BCM63XX pincontrol support Date: Mon, 15 Mar 2021 12:41:52 +0100 Message-Id: <20210315114214.3096-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-20210315_114220_066790_B4EE8DFA X-CRM114-Status: GOOD ( 17.97 ) 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 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. 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: add BCM63XX 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,bcm63xx-gpio.yaml | 83 +++ .../mfd/brcm,bcm6318-gpio-sysctl.yaml | 179 +++++ .../mfd/brcm,bcm63268-gpio-sysctl.yaml | 196 ++++++ .../mfd/brcm,bcm6328-gpio-sysctl.yaml | 164 +++++ .../mfd/brcm,bcm6358-gpio-sysctl.yaml | 132 ++++ .../mfd/brcm,bcm6362-gpio-sysctl.yaml | 238 +++++++ .../mfd/brcm,bcm6368-gpio-sysctl.yaml | 248 +++++++ .../pinctrl/brcm,bcm6318-pinctrl.yaml | 148 ++++ .../pinctrl/brcm,bcm63268-pinctrl.yaml | 169 +++++ .../pinctrl/brcm,bcm6328-pinctrl.yaml | 132 ++++ .../pinctrl/brcm,bcm6358-pinctrl.yaml | 98 +++ .../pinctrl/brcm,bcm6362-pinctrl.yaml | 211 ++++++ .../pinctrl/brcm,bcm6368-pinctrl.yaml | 222 ++++++ 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 | 113 +++ drivers/pinctrl/bcm/pinctrl-bcm63xx.h | 43 ++ include/linux/gpio/driver.h | 9 + include/linux/gpio/regmap.h | 4 + 26 files changed, 5507 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/brcm,bcm63xx-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