From patchwork Wed Mar 24 08:19:01 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: 12160461 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,URIBL_BLOCKED,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 A99AFC433C1 for ; Wed, 24 Mar 2021 08:21:29 +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 0A78F619B6 for ; Wed, 24 Mar 2021 08:21:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A78F619B6 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=9YtJWr2QpK7Xeo4+dngcKyoLEXeizrssa7DihH6NdC8=; b=G6Ea+9cCkvzLp4 ox/l0dYwJ1CC1XjFYWB6Lc1S0POPlEbVrS5eu0MPWtW1NDc8ssy7pFXDIjYWXf0IazdiROEXjWMGv iC8rrjjMRyTsUmScUYHgtYrJxSEsEMEw5fYzK8hkEg6mCUnQ36ZUUJH6wesx1Dj9JG04BklIcivwk MR2A8lTcGdn9ie0MFGAyPeNd2YOlfmAZub8ucsJWkdVhCreSJN7jlvdTydfW8bRWkJ7XyZU6CA86s f+9qM9xO9OvtMFixi4IIdtQo5V4ylxuAzZiUoSLGtmS1WZtCymZTfWjcnDRFNZX6Du1K9YYfYUcG5 xuKtq6NlTCC3BXkIz8yg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOyjr-00GYsM-80; Wed, 24 Mar 2021 08:19:42 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lOyjf-00GYng-NV for linux-arm-kernel@lists.infradead.org; Wed, 24 Mar 2021 08:19:30 +0000 Received: by mail-wr1-x42f.google.com with SMTP id 14so240850wrz.12 for ; Wed, 24 Mar 2021 01:19:26 -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=7KTYRa1M2z/M7l2OycLEcjGE1R0wI+YbNxmKE4zI32E=; b=XNpoNoIG0eLshP8+I9tvxLPWtqLIy54nOG5uXq9K8zuG+F/spLeKcTncr6n3LUNYZ/ 5SF00wVdmpgmxKl3lhpZjo2VirB53h6Q8CtCJERgwy+bnev71owIim9EQYfqJt10ujZn 0B4eri7z9t7LynMEb7G/kCPR8SkH3h2ji9nSkVqq2eA34Vxh2B2qWtva+6+L1/9EVRTK gAjcMWZshBO4i1XOhpWBG0KLg7N3KPLhlWXrUiU0AAhmOM356N6TRD+tzhvHp13sVuny buNXO+B7dAKJuvgBDO1rPa+STIoQWexvFvQlYEYeczZgF7jrNOf6Ooq8TM3GcGHd3Ujt trmw== 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=7KTYRa1M2z/M7l2OycLEcjGE1R0wI+YbNxmKE4zI32E=; b=U7wsZVBkA0MIaDWpya33FbdbZo7OqfDJxB2mzZOx2Ky+olr0ejWqLr1EuR8JDrj3H/ fSB/1k2u9muk2cjhQKc44pFrh0imM6wuDG8ldtbbq+1Rt2UWIiDr5QPUY7lKN3Lq5a4l 8ZNZ4Oc95SDGTt2Z1tdEseynE0TS8F8oYCfyj48vkFo+G72q6N/xHZ36yzzn7s3FRInp 2kZtdiyenMaac9Mi+hnbVfdDOCHSIbT5GAPMWJ5+tWcfZeJDLHc0lUA6VhBoif6LAbDA RkstmVueLvvEPeNhS3/Y0YCRyJssR2x0H+78d+lMLAtauGHZcJ/IdX6pHT3orutwGm7q LMiw== X-Gm-Message-State: AOAM533cTEHJcQA2ln89OYgkOm7fWsyrC8CzT3DsOhZdxCRQCHH/3ftl 33ZCM7e/UTZxBqfnXVUvoS4= X-Google-Smtp-Source: ABdhPJzGz/Uces9lfJIfLy8CH8rb1WtOwV5mxqFN4U0BNPu6+6hDvV545FT4G90i0aFVsqTtDqa1eQ== X-Received: by 2002:adf:e791:: with SMTP id n17mr2109596wrm.322.1616573965690; Wed, 24 Mar 2021 01:19:25 -0700 (PDT) Received: from skynet.lan (51.red-83-44-13.dynamicip.rima-tde.net. [83.44.13.51]) by smtp.gmail.com with ESMTPSA id x25sm1498578wmj.14.2021.03.24.01.19.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 01:19:25 -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 v9 00/22] pinctrl: add BCM63XX pincontrol support Date: Wed, 24 Mar 2021 09:19:01 +0100 Message-Id: <20210324081923.20379-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-20210324_081927_916549_E0093B38 X-CRM114-Status: GOOD ( 18.16 ) 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. v9: introduce changes suggested by Rob Herring and Andy Shevchenko. 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 | 86 +++ .../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 | 143 ++++ .../pinctrl/brcm,bcm63268-pinctrl.yaml | 164 +++++ .../pinctrl/brcm,bcm6328-pinctrl.yaml | 127 ++++ .../pinctrl/brcm,bcm6358-pinctrl.yaml | 93 +++ .../pinctrl/brcm,bcm6362-pinctrl.yaml | 206 ++++++ .../pinctrl/brcm,bcm6368-pinctrl.yaml | 217 ++++++ drivers/gpio/gpio-regmap.c | 5 + 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, 5467 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