Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1026000lqp; Sun, 14 Apr 2024 10:16:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUuFr3G8AzA6HnKpniY98sB3jCnZ0Q2nMLTo17d0CngAftKwKuaw7/K464w30Jk9/zjeie+JS/P2cQimAw+nSKX4iTenps0/aHMjeNMGg== X-Google-Smtp-Source: AGHT+IH/B9FyB7u0/5CUB3S/N/RhJKPQJDQrDIuDCBvFNurfeAOM00wnUBgATV00M+OOMmiTEt6r X-Received: by 2002:a50:8a90:0:b0:56b:9025:44a5 with SMTP id j16-20020a508a90000000b0056b902544a5mr6588516edj.11.1713114984684; Sun, 14 Apr 2024 10:16:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713114984; cv=pass; d=google.com; s=arc-20160816; b=WDduSfJcAoX0sXgS9WV73E0XEDUYThC3isd78xwCgr8ocK/br562/4i5PwioSi7wHC WS1Vj6frSXjqEXUju2BC4Qcd2wq78zYo7jDsN+3uvfJHc60rKosgp60CY9yTcdVgZGFq +9mopxewa0dvKu1VFCl7qcOCXXHVIda21q2yAwfTfomhZfBP9ISWgaz5aqTlycQFXgSm XdZ++3FYeAtm6KS0CYUcVuF80jiHGGLErlCBEdEZIPTglKpwYwePSkd6e68awNvR+/t0 4fueclYgr2Gj2HnKS2aQO4z1qKP177TFRRIUiygLdNi+6FHuQq0XYpTBRq9fmiuXaTk/ /K1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:autocrypt:from:references:to:subject:user-agent :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=PoPfiPxcZuhBh2NYjX5b1F0Xb/4plDnfDKqCA0vGNrg=; fh=HScIcwRXpGyKsMV3haR2RfqAdCl8vvNQ/1Qr99mZzqI=; b=eZ3VsqSkHzpIxgxPGQOSkdMqM0jetd6/ZTX0PswKcty1COOqwmH30y7ZfgUZZzjdYR HNtPMCCeWo1Xvt7SMLxhrj3r2kAspq8tkO7S75VzcrTXk9NoKcvP9f21Xa9A3HC5lkuH GPfz9eja9EgfxbigfvkGTtfCzOGLuPq3Nc7d3hi90F4gQT0YT8ANhJL8IVK5xEdpDeW3 MzwO8TmyCArrUAOsIBiyW4KNWnHsFsJJo7sG+NPx6w8cF0KzfbqznBMFg6Knf55Mhifk CLTrNOZ+iPJ/2EUQEgGirbPk6PtlcOjtkbyLbHN+LHmE0eKPUbO9JSrP9aE2Urtsqj7E XUVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b="gzOlH90/"; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-144256-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144256-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id et8-20020a056402378800b0056df5ba6dd6si3688421edb.461.2024.04.14.10.16.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Apr 2024 10:16:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144256-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b="gzOlH90/"; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-144256-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144256-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F282A1F21F0A for ; Sun, 14 Apr 2024 16:01:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A5EB1350CC; Sun, 14 Apr 2024 16:00:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="gzOlH90/" Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DFCC134CCA for ; Sun, 14 Apr 2024 16:00:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713110449; cv=none; b=rr7AfFAjHhEap2W1MDLw3FpjR5CL/V3KU3Bbo2O20vQ/q5KPQhtyX+G5DHObGcLAf6ybHP/QEseCIWFn8olUZIEndDeWEX9mlj/hz3osZ4qoAQGxx/Npre1bbEIZQSOtH1Bb5ztlk88jL44gQyoNXZ9gbpRBAGk/U/ommYd3a0E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713110449; c=relaxed/simple; bh=AIiqf7djlShN+J1mD1JUQCkT4ifWVG2qwE3fvwX6eBk=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=FP/ppL+1KVkVSQFpLGmYEKSTrMHq7mGurD8gXp+PIKSQ6fsMtqAyYeNnbWZ5+6PYhezlHyMePcTnhv6x0kL/vih8KSrKG1QnQr+U1880W95+90Vy+CYZAwHxf1jC5jBudI/qqhXvtpiY5pQnDfE+xjn9GRys2ZpEi2eNieixgcY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=gzOlH90/; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1e419d203bdso14284875ad.1 for ; Sun, 14 Apr 2024 09:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1713110447; x=1713715247; darn=vger.kernel.org; h=in-reply-to:autocrypt:from:references:to:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=PoPfiPxcZuhBh2NYjX5b1F0Xb/4plDnfDKqCA0vGNrg=; b=gzOlH90/6mq55kbPSe4zuH8a2lp1Y375oiN5qN1bbCooYaCDPZ7uKqmvlebUO+e932 zo+ELWxVjBu8/lk+eU8Ms+ZmQKrj7CX5r0RLqb2dhq4qsB/AnHrLWZsIqiOz0FS/o3AN mqIyFFatV0aNX9J5uK2VWQpjO0IZFr/0k4kKY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713110447; x=1713715247; h=in-reply-to:autocrypt:from:references:to:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=PoPfiPxcZuhBh2NYjX5b1F0Xb/4plDnfDKqCA0vGNrg=; b=sbuFtxDuadSQ5q/oTQSHHF65hQW3qys1cXdod0HZbW6m4Ndpf5Rae6OdXxFLGyjCUb Mr38AC1Y6C0qGdSlTJkAMlAkJ1A1gaQbhsvUhp8oqhyFrlthCHrfMOWunR4cfvFSYwwT vIJNyn+Nh5+NgfrCRtRSbS0IPDO75Jo0CiYVHFrgZydAO1A5/LKCKwHfNufYloyVljCg VsxMkdrJbAWe9zUyJReR84W2jwzIAjGex8GXwEp8KyPvzcQbTrN10l7m0/7Wuq2eCeIH 0QCE9VfWYo60HNFaqrHF9E0K7hUmW4Ao4FS4IRsfqBdm/F4KMB71qR8tBmSPS5xFDGuL CuOw== X-Forwarded-Encrypted: i=1; AJvYcCXI250odETinj+Xq8hhAtNW/Y8vAnbLMKnzK2i1v6tq0eVyRN/kG03qJopHlkBQxR3ZvjL0PEEX1Vl2cuFOpvc123079XpcdiYhlOav X-Gm-Message-State: AOJu0Yy2wUZOXyVHrU5RD8lcNt9aPQlw33SyIpC/1eGnavdPhn8nfnv9 XWQ8wBzD0Zd8tlg43b3Mff1UCsSp3je4ehMgkyJj+z1u6rWI6ELKBjWEYtMr8w== X-Received: by 2002:a17:902:9a48:b0:1e5:4f49:4036 with SMTP id x8-20020a1709029a4800b001e54f494036mr6645050plv.66.1713110446724; Sun, 14 Apr 2024 09:00:46 -0700 (PDT) Received: from [10.230.29.214] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id l6-20020a170902d34600b001def175bbbfsm6176609plk.251.2024.04.14.09.00.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Apr 2024 09:00:45 -0700 (PDT) Message-ID: Date: Sun, 14 Apr 2024 09:00:39 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/6] pinctrl: bcm: Add pinconf/pinmux controller driver for BCM2712 To: Andrea della Porta , Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Broadcom internal kernel review list , Linus Walleij , Adrian Hunter , Kamal Dasu , Al Cooper , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Jonathan Bell , Phil Elwell References: <8fb5dde9404875777587c867e7bdb4f691ab83f2.1713036964.git.andrea.porta@suse.com> From: Florian Fainelli Autocrypt: addr=florian.fainelli@broadcom.com; keydata= xsBNBFPAG8ABCAC3EO02urEwipgbUNJ1r6oI2Vr/+uE389lSEShN2PmL3MVnzhViSAtrYxeT M0Txqn1tOWoIc4QUl6Ggqf5KP6FoRkCrgMMTnUAINsINYXK+3OLe7HjP10h2jDRX4Ajs4Ghs JrZOBru6rH0YrgAhr6O5gG7NE1jhly+EsOa2MpwOiXO4DE/YKZGuVe6Bh87WqmILs9KvnNrQ PcycQnYKTVpqE95d4M824M5cuRB6D1GrYovCsjA9uxo22kPdOoQRAu5gBBn3AdtALFyQj9DQ KQuc39/i/Kt6XLZ/RsBc6qLs+p+JnEuPJngTSfWvzGjpx0nkwCMi4yBb+xk7Hki4kEslABEB AAHNMEZsb3JpYW4gRmFpbmVsbGkgPGZsb3JpYW4uZmFpbmVsbGlAYnJvYWRjb20uY29tPsLB IQQQAQgAywUCZWl41AUJI+Jo+hcKAAG/SMv+fS3xUQWa0NryPuoRGjsA3SAUAAAAAAAWAAFr ZXktdXNhZ2UtbWFza0BwZ3AuY29tjDAUgAAAAAAgAAdwcmVmZXJyZWQtZW1haWwtZW5jb2Rp bmdAcGdwLmNvbXBncG1pbWUICwkIBwMCAQoFF4AAAAAZGGxkYXA6Ly9rZXlzLmJyb2FkY29t Lm5ldAUbAwAAAAMWAgEFHgEAAAAEFQgJChYhBNXZKpfnkVze1+R8aIExtcQpvGagAAoJEIEx tcQpvGagWPEH/2l0DNr9QkTwJUxOoP9wgHfmVhqc0ZlDsBFv91I3BbhGKI5UATbipKNqG13Z TsBrJHcrnCqnTRS+8n9/myOF0ng2A4YT0EJnayzHugXm+hrkO5O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xvjqSiSvam0Ms3QrLidCtantcGT2Wz/2PlbZqkoJxMQc40rb fXa4xQSvJYj0GWpadrDJUvUu3LEsunDCxdWrmbmwGRKqZraV2oG7YEddmDqOe0Xm/NxeSobc MIlnaE6V0U8f5zNHB7Y46yJjjYT/Ds1TJo3pvwevDWPvv6rdBeV07D9s43frUS6xYd1uFxHC 7dZYWJjZmyUf5evr1W1gCgwLXG0PEi9n3qmz1lelQ8lSocmvxBKtMbX/OKhAfuP/iIwnTsww 95A2SaPiQZA51NywV8OFgsN0ITl2PlZ4Tp9hHERDe6nQCsNI/Us= In-Reply-To: <8fb5dde9404875777587c867e7bdb4f691ab83f2.1713036964.git.andrea.porta@suse.com> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000aab1120616109b4e" --000000000000aab1120616109b4e Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/13/2024 3:14 PM, Andrea della Porta wrote: > Add a pincontrol driver for BCM2712. BCM2712 allows muxing GPIOs > and setting configuration on pads. > > Originally-by: Jonathan Bell > Originally-by: Phil Elwell Is that a new tag in a comment message? Signed-off-by maybe? > Signed-off-by: Andrea della Porta > --- Was not pinctrl-single usable somehow that we had to go through a dedicated pinctrl driver? > drivers/pinctrl/bcm/Kconfig | 9 + > drivers/pinctrl/bcm/Makefile | 1 + > drivers/pinctrl/bcm/pinctrl-bcm2712.c | 1247 +++++++++++++++++++++++++ > 3 files changed, 1257 insertions(+) > create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm2712.c > > diff --git a/drivers/pinctrl/bcm/Kconfig b/drivers/pinctrl/bcm/Kconfig > index 35b51ce4298e..62ede44460bc 100644 > --- a/drivers/pinctrl/bcm/Kconfig > +++ b/drivers/pinctrl/bcm/Kconfig > @@ -3,6 +3,15 @@ > # Broadcom pinctrl drivers > # > > +config PINCTRL_BCM2712 > + bool "Broadcom BCM2712 PINCONF driver" > + depends on OF && (ARCH_BCM2835 || ARCH_BRCMSTB || COMPILE_TEST) > + select PINMUX > + select PINCONF > + select GENERIC_PINCONF Rename to PINCTRL_BRCMSTB sicne this is not BCM2712 specific at all. > + help > + Say Y here to enable the Broadcom BCM2712 PINCONF driver. > + > config PINCTRL_BCM281XX > bool "Broadcom BCM281xx pinctrl driver" > depends on OF && (ARCH_BCM_MOBILE || COMPILE_TEST) > diff --git a/drivers/pinctrl/bcm/Makefile b/drivers/pinctrl/bcm/Makefile > index 82b868ec1471..d298e4785829 100644 > --- a/drivers/pinctrl/bcm/Makefile > +++ b/drivers/pinctrl/bcm/Makefile > @@ -1,6 +1,7 @@ > # SPDX-License-Identifier: GPL-2.0 > # Broadcom pinctrl support > > +obj-$(CONFIG_PINCTRL_BCM2712) += pinctrl-bcm2712.o Likewise. > obj-$(CONFIG_PINCTRL_BCM281XX) += pinctrl-bcm281xx.o > obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o > obj-$(CONFIG_PINCTRL_BCM4908) += pinctrl-bcm4908.o > diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2712.c b/drivers/pinctrl/bcm/pinctrl-bcm2712.c > new file mode 100644 > index 000000000000..f9359e9eff14 > --- /dev/null > +++ b/drivers/pinctrl/bcm/pinctrl-bcm2712.c > @@ -0,0 +1,1247 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * Driver for Broadcom BCM2712 GPIO units (pinctrl only) > + * > + * Copyright (C) 2021-3 Raspberry Pi Ltd. > + * Copyright (C) 2012 Chris Boot, Simon Arlott, Stephen Warren > + * > + * Based heavily on the BCM2835 GPIO & pinctrl driver, which was inspired by: > + * pinctrl-nomadik.c, please see original file for copyright information > + * pinctrl-tegra.c, please see original file for copyright information > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define MODULE_NAME "pinctrl-bcm2712" > + > +/* Register offsets */ > + > +#define BCM2712_PULL_NONE 0 > +#define BCM2712_PULL_DOWN 1 > +#define BCM2712_PULL_UP 2 > +#define BCM2712_PULL_MASK 0x3 > + > +#define BCM2712_FSEL_COUNT 9 > +#define BCM2712_FSEL_MASK 0xf > + > +#define FUNC(f) \ > + [func_##f] = #f > +#define PIN(i, f1, f2, f3, f4, f5, f6, f7, f8) \ > + [i] = { \ > + .funcs = { \ > + func_##f1, \ > + func_##f2, \ > + func_##f3, \ > + func_##f4, \ > + func_##f5, \ > + func_##f6, \ > + func_##f7, \ > + func_##f8, \ > + }, \ > + } > + > +#define MUX_BIT_VALID 0x8000 > +#define REG_BIT_INVALID 0xffff > + > +#define BIT_TO_REG(b) (((b) >> 5) << 2) > +#define BIT_TO_SHIFT(b) ((b) & 0x1f) > + > +#define MUX_BIT(mr, mb) (MUX_BIT_VALID + ((mr)*4)*8 + (mb)*4) > +#define GPIO_REGS(n, mr, mb, pr, pb) \ > + [n] = { MUX_BIT(mr, mb), ((pr)*4)*8 + (pb)*2 } > + > +#define EMMC_REGS(n, pr, pb) \ > + [n] = { 0, ((pr)*4)*8 + (pb)*2 } > + > +#define AGPIO_REGS(n, mr, mb, pr, pb) \ > + [n] = { MUX_BIT(mr, mb), ((pr)*4)*8 + (pb)*2 } > + > +#define SGPIO_REGS(n, mr, mb) \ > + [n+32] = { MUX_BIT(mr, mb), REG_BIT_INVALID } > + > +#define GPIO_PIN(a) PINCTRL_PIN(a, "gpio" #a) > +#define AGPIO_PIN(a) PINCTRL_PIN(a, "aon_gpio" #a) > +#define SGPIO_PIN(a) PINCTRL_PIN(a+32, "aon_sgpio" #a) > + > +struct pin_regs { > + u16 mux_bit; > + u16 pad_bit; > +}; > + > +struct bcm2712_pinctrl { > + struct device *dev; > + void __iomem *base; > + struct pinctrl_dev *pctl_dev; > + struct pinctrl_desc pctl_desc; > + const struct pin_regs *pin_regs; > + const struct bcm2712_pin_funcs *pin_funcs; > + const char *const *gpio_groups; > + struct pinctrl_gpio_range gpio_range; > + spinlock_t lock; > +}; Please s/bcm2712/brcmstb/ throughout the driver's structures and any declaration that is not inherently 2712 specific and just make 2712 the first instance using this driver. > + > +struct bcm_plat_data { > + const struct pinctrl_desc *pctl_desc; > + const struct pinctrl_gpio_range *gpio_range; > + const struct pin_regs *pin_regs; > + const struct bcm2712_pin_funcs *pin_funcs; > +}; > + > +struct bcm2712_pin_funcs { > + u8 funcs[BCM2712_FSEL_COUNT - 1]; > +}; > + [snip] > +static int bcm2712_pinctrl_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + //struct device_node *np = dev->of_node; > + const struct bcm_plat_data *pdata; > + //const struct of_device_id *match; > + struct bcm2712_pinctrl *pc; > + const char **names; > + int num_pins, i; > + > + pdata = device_get_match_data(&pdev->dev); > + if (!pdata) > + return -EINVAL; > + > + pc = devm_kzalloc(dev, sizeof(*pc), GFP_KERNEL); > + if (!pc) > + return -ENOMEM; > + > + platform_set_drvdata(pdev, pc); > + pc->dev = dev; > + spin_lock_init(&pc->lock); > + > + //pc->base = devm_of_iomap(dev, np, 0, NULL); Remove stray commented lines. > + pc->base = devm_platform_ioremap_resource(pdev, 0); > + if (WARN_ON(IS_ERR(pc->base))) { > + //dev_err(dev, "could not get IO memory\n"); > + return PTR_ERR(pc->base); > + } > + > + pc->pctl_desc = *pdata->pctl_desc; > + num_pins = pc->pctl_desc.npins; > + names = devm_kmalloc_array(dev, num_pins, sizeof(const char *), > + GFP_KERNEL); > + if (!names) > + return -ENOMEM; > + for (i = 0; i < num_pins; i++) > + names[i] = pc->pctl_desc.pins[i].name; > + pc->gpio_groups = names; > + pc->pin_regs = pdata->pin_regs; > + pc->pin_funcs = pdata->pin_funcs; > + pc->pctl_dev = devm_pinctrl_register(dev, &pc->pctl_desc, pc); > + if (IS_ERR(pc->pctl_dev)) > + return PTR_ERR(pc->pctl_dev); > + > + pc->gpio_range = *pdata->gpio_range; > + pinctrl_add_gpio_range(pc->pctl_dev, &pc->gpio_range); > + > + return 0; > +} > + > +static struct platform_driver bcm2712_pinctrl_driver = { > + .probe = bcm2712_pinctrl_probe, > + .driver = { > + .name = MODULE_NAME, > + .of_match_table = bcm2712_pinctrl_match, > + .suppress_bind_attrs = true, > + }, > +}; > +builtin_platform_driver(bcm2712_pinctrl_driver); There is no MODULE_LICENSE(), MODULE_AUTHOR() or MODULE_DESCRIPTION(), please provide some. -- Florian --000000000000aab1120616109b4e Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQeQYJKoZIhvcNAQcCoIIQajCCEGYCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg3QMIIFDTCCA/WgAwIBAgIQeEqpED+lv77edQixNJMdADANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA5MTYwMDAwMDBaFw0yODA5MTYwMDAwMDBaMFsxCzAJBgNVBAYT AkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTEwLwYDVQQDEyhHbG9iYWxTaWduIEdDQyBS MyBQZXJzb25hbFNpZ24gMiBDQSAyMDIwMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA vbCmXCcsbZ/a0fRIQMBxp4gJnnyeneFYpEtNydrZZ+GeKSMdHiDgXD1UnRSIudKo+moQ6YlCOu4t rVWO/EiXfYnK7zeop26ry1RpKtogB7/O115zultAz64ydQYLe+a1e/czkALg3sgTcOOcFZTXk38e aqsXsipoX1vsNurqPtnC27TWsA7pk4uKXscFjkeUE8JZu9BDKaswZygxBOPBQBwrA5+20Wxlk6k1 e6EKaaNaNZUy30q3ArEf30ZDpXyfCtiXnupjSK8WU2cK4qsEtj09JS4+mhi0CTCrCnXAzum3tgcH cHRg0prcSzzEUDQWoFxy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