From patchwork Wed Mar 10 12:54:48 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: 12128041 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 6FF39C433E0 for ; Wed, 10 Mar 2021 12:59:50 +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 E165864F74 for ; Wed, 10 Mar 2021 12:59:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E165864F74 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=Tr/ae8rVfIuQtTNDnf2qhwT/Cx+UDmLSZO0eF/Hp37M=; b=TjhLFapSTy7f0M geGJQbfAApwaLkC+HTZft11dRwYFKvnyjr2AYCulBulBYZp8lL+oFr7oW7b8aH2zbUqH5MFv13n6H X7y1GEh8+Ksosq+t3NqRwFHAGKsPwKiKD1tFmAP/bVxZ283CqHHenk8pK8HYAQxQr6sVB1Pox2jGB pPYXQOPu2A0FJzZSW9RqdxV43KhZboesBH1p+bIWk+r97d3vI31o3mYjjJDBaJNCf7u/ftPaGaGZC d0JGKsoEW8PDYdPAEdvVCjPhUVNcbPioctiHY4G03iEQ0jvcNXaSQwhxBTT/wLe10B77iREisL6ZF ImzKLnlQF9+JrebgOgug==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJyPg-006qAg-7C; Wed, 10 Mar 2021 12:58:08 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJyMo-006piH-4s for linux-arm-kernel@lists.infradead.org; Wed, 10 Mar 2021 12:57:14 +0000 Received: by mail-wm1-x32f.google.com with SMTP id l22so7044412wme.1 for ; Wed, 10 Mar 2021 04:55:07 -0800 (PST) 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=z9wafjPmliogQilYQ/SiuahhJr0k+q3femmouDI2IPQ=; b=GnGmjSvP81qVujYQaO8vAOoxvzoCz63Gh1OAU9amDWWXXY5Sh0s2+28ALqRcM0EJdX +x51MSt5umL6Y/B8rykylZqZ7nGwyzN/wWJZFfHIRs65gGDh+lsOkHH9WeKR9fdWCyRG HjyjPaY4W5cymyy2AvT5y3pElkpxoy+JWWj+yF9dhU9Mrx0OeBHBVSZPlSipS2xED+g0 wUQLXVCRvuHoNGawE02AQsPFBFRGdPKu0alNjrMiFoYBWH/D07xPTHe9Md0+L8QWhOmW 2GGl9BaU+XmxWoGry/9MdVm+AVRXxj/rwAMhAgvkpy6N2T2wuJXE/ccEKnBLVzH0om+4 trQw== 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=z9wafjPmliogQilYQ/SiuahhJr0k+q3femmouDI2IPQ=; b=g1eMTK1w5w7GISU9NAlRmyQMpcSJ2BLReOmROGWTLkER8ZYHP7mFujXKyej8LsP9n3 2VVAG5Gq5b2rothvotqXMYHpu4UHMYWnnIr2NAk032SUsa+7KuFyNYkFY/ioJRkriwEj PekRRaB64/+WKB6c0emPpIr9Sv0JXNkV1WqBtba/Kuu2JrSfEQSQUa3POKVsTRwuAKa9 NZNDJLmZhlpl464Bk2XePy28KhSA+WLaR45gowTUdLFbbRyTMUgPOmgEIU4tlsbKMmUH Lgc7YBZdf2+D2Q+6X+YdxdLBrmnsedPS2gGGQ80dgGa0f6ysDQ3n3zHcIM7vtdG3/Qdj oEHw== X-Gm-Message-State: AOAM532xfLaybMWUwAuiAyW3omwRo0M6B+Tz7s9EyukXU5kOgnVTeUd9 ysHluQPzGOB5Z/3Fz6qt6X4= X-Google-Smtp-Source: ABdhPJzPMNjl9Bu4OpYJp5hMRraEC7fFVMMjBS7mWnkqs4LpWC2CM7OSkjjm6ZR0azGS+TQMeraNOw== X-Received: by 2002:a1c:bc8a:: with SMTP id m132mr3156396wmf.6.1615380906998; Wed, 10 Mar 2021 04:55:06 -0800 (PST) Received: from skynet.lan ([80.31.204.166]) by smtp.gmail.com with ESMTPSA id v6sm29403398wrx.32.2021.03.10.04.55.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 04:55:06 -0800 (PST) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: Linus Walleij , Rob Herring , Michael Walle , Bartosz Golaszewski , 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 v6 00/15] pinctrl: add BCM63XX pincontrol support Date: Wed, 10 Mar 2021 13:54:48 +0100 Message-Id: <20210310125504.31886-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-20210310_125710_586558_1EB7D2D6 X-CRM114-Status: GOOD ( 18.15 ) 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. 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 (15): gpio: guard gpiochip_irqchip_add_domain() with GPIOLIB_IRQCHIP gpio: regmap: set gpio_chip of_node pinctrl: bcm: add bcm63xx base code dt-bindings: add BCM6328 pincontroller binding documentation pinctrl: add a pincontrol driver for BCM6328 dt-bindings: add BCM6358 pincontroller binding documentation pinctrl: add a pincontrol driver for BCM6358 dt-bindings: add BCM6362 pincontroller binding documentation pinctrl: add a pincontrol driver for BCM6362 dt-bindings: add BCM6368 pincontroller binding documentation pinctrl: add a pincontrol driver for BCM6368 dt-bindings: add BCM63268 pincontroller binding documentation pinctrl: add a pincontrol driver for BCM63268 dt-bindings: add BCM6318 pincontroller binding documentation pinctrl: add a pincontrol driver for BCM6318 .../pinctrl/brcm,bcm6318-pinctrl.yaml | 190 ++++++ .../pinctrl/brcm,bcm63268-pinctrl.yaml | 211 ++++++ .../pinctrl/brcm,bcm6328-pinctrl.yaml | 174 +++++ .../pinctrl/brcm,bcm6358-pinctrl.yaml | 140 ++++ .../pinctrl/brcm,bcm6362-pinctrl.yaml | 253 +++++++ .../pinctrl/brcm,bcm6368-pinctrl.yaml | 264 +++++++ drivers/gpio/gpio-regmap.c | 1 + 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 + 19 files changed, 4518 insertions(+) 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