From patchwork Wed Mar 3 14:22:56 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: 12113679 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 7EDD1C433DB for ; Wed, 3 Mar 2021 15:21:47 +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 EB45060231 for ; Wed, 3 Mar 2021 15:21:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB45060231 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=TQ4LhJ3jCQnU9OviQoYSi7buzmPrDMgGIvKOl1ru7Zs=; b=gC/jFlxAXDqWd4 ywUshmv3SxXfeGu9HjhpGct4i4bU7ydf3srt/Y84QzxtfElrpfPvRTww6HNg8UOzsnxrstcW1ekBt w7F3hitkrsBgNUTQLG/b4otD25T/KQPbZcxBs/JAF6BiRc2pS7c7I4EjXsSXSIHH+CzlQDjF/XIrl 7GNs5kC0esHw6CZGpLfK1eC0ZSLHCJfYx3nSRXrEFtuVL6EuVLN2baE/zRvRkHY8ne0enBisoBrE+ a4WkelfyQl/59e43VWCOJuNwOJc+SUKdv2ddrD9jizNrRGPBZYLUpTYPjsIqGZgR4qbh0K5sv/XuF zn/SBd1XPZKBf+j+HHZQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHTHk-005MFE-Dx; Wed, 03 Mar 2021 15:19:37 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHSPB-00572b-5t for linux-arm-kernel@lists.infradead.org; Wed, 03 Mar 2021 14:23:25 +0000 Received: by mail-wm1-x32a.google.com with SMTP id m1so6516820wml.2 for ; Wed, 03 Mar 2021 06:23:12 -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=uQpzwtJdI15ee25ztpxpJETWP0dJNKVRVUGEhzQbTYI=; b=tLeAOwAlFtvcX5c2nCq/k9O3FtmgphgjThDiMWdxKh4+RXRkeUGL1SGOUZskuVU7Zl +FUAiqYvZsUNrX6zwKagVxSG104vOJML+pKVA51ylzCuDUPaDK1qGtbLd/PsqL0fZij0 yXW5Bche84TdLZg1E4DgihEHAl2dYvtwH+FznHCjriaITN23uW97Co3Pmw4GyHWNU3jZ ltTXlmQNU7YURHr+XGqXN/h2vYWHqwHwqyOZtrTPF2U9YsA3VOwSCG6FNQNq7tUmfntd iTicznmkW2LFuV1NwnXMpI0QFx8KnUyHOAxu+41ILjLSn3viGneTsF4t/7dWtuTEmdvi A/bg== 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=uQpzwtJdI15ee25ztpxpJETWP0dJNKVRVUGEhzQbTYI=; b=LQrulCjpEbQ58nQYURxjpDWMcoZ1RaZoQBLpOMS3hU0M3MJNpBG/nECWc/BpU5AWxx huvvz1J0v4VL3ujHRC2Dkbmo3sQGRkg/VxM2fXNGPxZM/B/NOd8HvRKTMZtIqHMh7djk iUMLD2siNR5noSDcfRfWw1ZB5OLq6haFx6hKh/tp/axWRIHruLvJ+0aYPXqdT+YwGoIo fX3tTht3CDU3XeywsxW8fMg0y4oiBWw3Ywhj9oq3Dm1QSgLghN7QTwj22ds5fBXzwToF ItVtPjlBImaBq9PEJb2RXalEbJPt9fhmxW+Nbx6EY4qR9OAIg2v/JaY0J7SsMgeoGm0x 9L4Q== X-Gm-Message-State: AOAM532Fb/WCeyiyfdPBNyFpq/pYQwURLbdiY0ivbxuiXWNzpViDvs4o pEOJokg9X6q7jXEna23SMSA= X-Google-Smtp-Source: ABdhPJzrpjZpfCmMbWNWObjpHLr0fn9U5xaj9E7kkly1YyGsipfHMxvY/iCQ7eITQxauOzH+hNKzdQ== X-Received: by 2002:a1c:e041:: with SMTP id x62mr9070791wmg.95.1614781392247; Wed, 03 Mar 2021 06:23:12 -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 b15sm7876219wmd.41.2021.03.03.06.23.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 06:23:11 -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 , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 00/14] pinctrl: add BCM63XX pincontrol support Date: Wed, 3 Mar 2021 15:22:56 +0100 Message-Id: <20210303142310.6371-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. 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 (14): 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 | 57 ++ 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 | 113 +++ drivers/pinctrl/bcm/pinctrl-bcm63xx.h | 46 ++ include/linux/gpio/regmap.h | 3 + 18 files changed, 4492 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