From patchwork Thu Mar 4 08:56:55 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: 12115673 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 A158AC433E0 for ; Thu, 4 Mar 2021 08:59: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 06A9764F20 for ; Thu, 4 Mar 2021 08:59:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06A9764F20 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=PldbUdIkRvk8PEc/9ONsdRDorOfoTDPL92BWe+lCCyk=; b=kSglbsY9MdLQ2Z Q1cRcl5is1rXwqnCutfjg5tuz/doRRLUW/19I20qkVbjzy5DEIiSBI9MyvVSejjkVtBMYJ/iw+GIm EwgPi1qxkwQMfLQbguJ7SjJl6rQcMLFJ6m8EuQMqn85dGOy6SUbdUOd1IqwUwUWGCvUSTktf0NZrI 2KVOJObTkAGMfncUxLtk+mdNvG0V1cQNGkhs+W3Y0K9bvdbtUz8+ZhS3rSWZ2YtFI55Q7Iwl9XSJL 9Sm0rt//c42ZySB2QWxL3uoEAuZnA5HFpa63V0hskJ9ND97lVGD9r2/qHZNg9P+VLq34cXSWW+M8t 6P/xRc0hk7CoyVLEwyHQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHjnk-008C7E-1q; Thu, 04 Mar 2021 08:57:44 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHjnH-008C1r-2y for linux-arm-kernel@lists.infradead.org; Thu, 04 Mar 2021 08:57:20 +0000 Received: by mail-wr1-x434.google.com with SMTP id d11so26709243wrj.7 for ; Thu, 04 Mar 2021 00:57:14 -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=3oAkVo4bUtNk2syG2eiAd8DZ4+uW2EV8B2cJWAv57Ag=; b=GeMyvmQRKZlrFF90QBFnajKEbIHsYBI8CLj2+kSS1IBdt13fiZzsYN8uietG0xhMPC sUQ4tpEgccZ/VPlRLGbtP7PzwTg2y6CN1nzeDi2dhyUPs/hIUQWxbB/YpxqlxLbZCcI7 k2FLidUzJnOzPCwsJr9oEXyQSZRCTtDK6P/Ys7TSFjRtDlIa6/G4vpzRBgTHVKcJpwr4 Igw6ITx5rQPWrXvSucEXgszSQOTn+q2Cqpb5dIy93L6tgl7UkVrlPIOJetum9+hM6hq9 p7LqtD+x7nLkXZXYo7T/YTnt1msiDJeXJuJf55kXRBCcW3Ge4RKBk1QMiaXwndd0ypF4 eibQ== 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=3oAkVo4bUtNk2syG2eiAd8DZ4+uW2EV8B2cJWAv57Ag=; b=JXM5Odr93G5kz2U+qVSOnUPR8oT1PnzvIGQ8S3Y5/Co1zHtEVx96oYJouG2YGm61kw ly90w5uIkBAp472CobC7jwBA3HZD9VOcc1a5hnzbq8KhLQbG6cGrMbyXg6KDv+oG5quF JNS/J44Op1gd1TEdL1yA9NDQmnDIdz3iDp26oWi62PScrb+Qq36KZua9KwoQKwvwh1Ph aYTetX5OwLy+HRO/D4DfGgFt7AbLp+SR1K7UIySZXuVbe0ii8qm4DxIRfbwoHYkTVGBI ZlLibjEKQyrIUZRwMgzitg4vlDfPVsFMQtx96map0n74bYH2Oqd/kDvE4nZO1IGA85Vu 45Uw== X-Gm-Message-State: AOAM530IV0qx6N4MUgUhNfF9607VVjWGfz6EHcVzvuBO0gfq9jpzcTCT 6nW4EBcZZU5EHT4Zp4Rhxqo= X-Google-Smtp-Source: ABdhPJzhhFXAcqSR3705Zmi79MHosJpFzYBI9ZYcopjAY65Ndai/9yPIGhEbPhGRjACOTZO4pi/Jsg== X-Received: by 2002:adf:ea8d:: with SMTP id s13mr2879947wrm.32.1614848234550; Thu, 04 Mar 2021 00:57:14 -0800 (PST) Received: from skynet.lan (170.red-88-1-105.dynamicip.rima-tde.net. [88.1.105.170]) by smtp.gmail.com with ESMTPSA id q15sm2828976wrx.56.2021.03.04.00.57.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 00:57:14 -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, =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez?= =?utf-8?q?_Rojas?= , Jonas Gorski , 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 v4 00/15] pinctrl: add BCM63XX pincontrol support Date: Thu, 4 Mar 2021 09:56:55 +0100 Message-Id: <20210304085710.7128-1-noltari@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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. 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 Documentation: add BCM6328 pincontroller binding documentation pinctrl: add a pincontrol driver for BCM6328 Documentation: add BCM6358 pincontroller binding documentation pinctrl: add a pincontrol driver for BCM6358 Documentation: add BCM6362 pincontroller binding documentation pinctrl: add a pincontrol driver for BCM6362 Documentation: add BCM6368 pincontroller binding documentation pinctrl: add a pincontrol driver for BCM6368 Documentation: add BCM63268 pincontroller binding documentation pinctrl: add a pincontrol driver for BCM63268 Documentation: add BCM6318 pincontroller binding documentation pinctrl: add a pincontrol driver for BCM6318 .../pinctrl/brcm,bcm6318-pinctrl.yaml | 187 +++++ .../pinctrl/brcm,bcm63268-pinctrl.yaml | 208 ++++++ .../pinctrl/brcm,bcm6328-pinctrl.yaml | 171 +++++ .../pinctrl/brcm,bcm6358-pinctrl.yaml | 137 ++++ .../pinctrl/brcm,bcm6362-pinctrl.yaml | 250 +++++++ .../pinctrl/brcm,bcm6368-pinctrl.yaml | 261 +++++++ drivers/gpio/gpio-regmap.c | 1 + drivers/pinctrl/bcm/Kconfig | 55 ++ drivers/pinctrl/bcm/Makefile | 7 + drivers/pinctrl/bcm/pinctrl-bcm6318.c | 496 ++++++++++++++ drivers/pinctrl/bcm/pinctrl-bcm63268.c | 643 ++++++++++++++++++ drivers/pinctrl/bcm/pinctrl-bcm6328.c | 403 +++++++++++ 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 | 114 ++++ drivers/pinctrl/bcm/pinctrl-bcm63xx.h | 46 ++ include/linux/gpio/driver.h | 9 + include/linux/gpio/regmap.h | 3 + 19 files changed, 4500 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