Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp812460rdb; Wed, 1 Nov 2023 03:43:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXmudneNzoG+Zi7/2PXFVu8vd0TLYlAebplwWZzhiDZ+9fQJuxTaBjrnXzL1m6XOoWZdIa X-Received: by 2002:a05:6e02:1a08:b0:34a:a4a5:3f93 with SMTP id s8-20020a056e021a0800b0034aa4a53f93mr20839154ild.5.1698835407784; Wed, 01 Nov 2023 03:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698835407; cv=none; d=google.com; s=arc-20160816; b=NIyC/zsgmZB1kbCThfqPE9bQcV3uojxJ9WDP2NtrOC5NehwSRNNqwzk+I/ZAe1539I 1cVxBnFOJfLfIYVcZc/zKngK2HB9fns+c5jCRR8lsemqZTPbktMZ8x/NGZ3+WfFhwHUN qr8Yhqq3DemMdycCZ3xbcPKnAhYq4FwxAWo9AH/IHQ7ZfIeQSG8EkogxTfISqXzsgI7A 1fzHZ5DOHRNtkkVqeFLcPeJes3BTzfFHH4CYvNrg3FBHKrQrMe80KKMG1DTqqJPLxBEa 6c8hL1Qwf/OlDb6Ll5yA+D2Kh0qubyf5XkDQCXVNCXjrj6H7vcYskhMt74hEkJkRlJ9m TN0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=bu0ENTkJEUmegv4Jzwkn8fIpWW9tZdiTXSBgHedfv4c=; fh=AVxFP4OEYlrPnZIRQLJ2tEtUp42+r7wDrVdq0+xiBRU=; b=WHcPBNWgjdZhbu3XCjRsSXQEANWcNdXIWRyZXiy+o+MD0pE9uHXQ1O71/CvBDEcVup qqVHjifaK7IsaGDlMyYfKV4APSS7jdDQo2FdlxlS0DyBfKdE2RHxjnR4spFURHHokXhK VmCvIl0zDLfdyUKP11su2RW0Uf3i/PtUbx9vYmR6jqbVEWEvxSmUisknMjEqaB8iIP9C EC91shRQx1WuIHpaQ5HAtoT02foLOE6us2FyHUGHzsRkiNTFL/12Mx4KjG3REdzvyDdX zGGo/AZpTRTHWZTSJdttbmjpSKx4Q7bRr8FfkONoG30qr+jIphjy81ycW9m2t9AAQrcX dL/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TezNJ+i7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id q125-20020a632a83000000b005b7fb04f1f9si2746154pgq.734.2023.11.01.03.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 03:43:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TezNJ+i7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D97648051B43; Wed, 1 Nov 2023 03:43:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230337AbjKAKnG (ORCPT + 99 others); Wed, 1 Nov 2023 06:43:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbjKAKnF (ORCPT ); Wed, 1 Nov 2023 06:43:05 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59324E8; Wed, 1 Nov 2023 03:43:00 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA19FC433C7; Wed, 1 Nov 2023 10:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698835380; bh=oM0sd9v9BqX6WjMkw6XdpEQIFa2aVFOZ4k+P+0WfIoY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=TezNJ+i7kS52MwFDCUasJC1CuVUe7Efdyo87wFVedsHqMFrOU8YLDh8sQVCGjXKw+ WE6vkMJfR5Nhsvik+e4PyFSvI0AK2iLCCmx+YUcH8UCyc9HaW8EBFcKr/6VslbCAnO X6RWwY2L4WTLnxWjYjUANjkL5fmgrWW7ZAJi7jNqkdHMchu/YdkbWTEwJB7CaAsoCV Midm50dHAnd2LZHyg2NbgaT97Axb/x5Mb4h9MvVVdqmGZYWDkkwJtTHgxykEO1ZRGB DYVsky4JwpveoX5borrwxOJp2kJ5yHiBqY+3Tfv55i2d31MMrg4Kay6nsRqYVnwII4 BJOUWoiq8g+WA== Message-ID: <4a000265-6f92-439c-bb2c-66fbafa5c76c@kernel.org> Date: Wed, 1 Nov 2023 11:42:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V7 2/3] pinctrl: Add support pin control for UP board CPLD/FPGA Content-Language: en-US To: "larry.lai" , lee@kernel.org, andriy.shevchenko@linux.intel.com, linus.walleij@linaro.org, pavel@ucw.cz Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-leds@vger.kernel.org, GaryWang@aaeon.com.tw, musa.lin@yunjingtech.com, jack.chang@yunjingtech.com, noah.hung@yunjingtech.com References: <20231031015119.29756-1-larry.lai@yunjingtech.com> <20231031015119.29756-3-larry.lai@yunjingtech.com> From: Krzysztof Kozlowski Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE FgIDAQIeAQIXgBYhBJvQfg4MUfjVlne3VBuTQ307QWKbBQJgPO8PBQkUX63hAAoJEBuTQ307 QWKbBn8P+QFxwl7pDsAKR1InemMAmuykCHl+XgC0LDqrsWhAH5TYeTVXGSyDsuZjHvj+FR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Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 01 Nov 2023 03:43:23 -0700 (PDT) On 31/10/2023 02:51, larry.lai wrote: > The UP Squared board implements certain > features (pin control) through an on-board FPGA. > > Reported-by: kernel test robot Drop, LKP did not report this patch. > Signed-off-by: Gary Wang > Signed-off-by: larry.lai > --- > PATCH V6 -> V7: There's no change. > PATCH V5 -> PATCH V6 > (1) Refer 2023/08/10 Linus Walleij review, cleaned up coding style and > addressed review comments. > PATCH V4 -> PATCH V5 > (1) Fixed kernel test robot compiler warning. > (2) Synchronizing upboard github to v1.0.5 tag. > RFC 2023/04/25 -> PATCH V4 > (1) Fixed kernel test robot compiler warning. > (2) Remove mistakes with wrong Reviewed-by tags. > RFC 2022/11/23 -> RFC 2023/04/25 > (1) Refer 2022/12/08 Andy Shevchenko review, cleaned up coding style and > addressed review comments. > PATCH V3 -> RFC 2022/11/23: > (1) Refer 2022/11/09 Linus Walleij review, cleaned up coding style and > addressed review comments. > PATCH V2 -> V3: > There's no change. > PATCH V1 -> V2: > (1) Synchronized with upboard github to rc2 > (2) Refer 2022/10/19 Mark Brown and Andy Shevchenko review, we removed > the regmap and acpi patches and implement in upboard pinctrl driver. > (3) Refer 2022/10/19 Andy Shevchenko review, fixed the coding style > issues, removed using gpio_xxxx API and removed including . > --- > drivers/pinctrl/Kconfig | 14 + > drivers/pinctrl/Makefile | 1 + > drivers/pinctrl/pinctrl-upboard.c | 1390 +++++++++++++++++++++++++++++ > 3 files changed, 1405 insertions(+) > create mode 100644 drivers/pinctrl/pinctrl-upboard.c > > diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig > index 1cf74b0c42e5..cc8dae75289b 100644 > --- a/drivers/pinctrl/Kconfig > +++ b/drivers/pinctrl/Kconfig > @@ -483,6 +483,20 @@ config PINCTRL_THUNDERBAY > rate control and direction control. This module will be > called as pinctrl-thunderbay. > > +config PINCTRL_UPBOARD > + tristate "UP board FPGA pin controller" > + depends on (X86 && ACPI) || COMPILE_TEST > + depends on MFD_INTEL_UPBOARD_FPGA > + select GENERIC_PINCONF > + select PINMUX > + select PINCONF > + help > + Pin controller for the FPGA GPIO lines on UP boards. Due to the > + hardware layout, these are meant to be controlled in tandem with their > + corresponding Intel SoC GPIOs. > + To compile this driver as a module, choose M here: the module > + will be called pinctrl-upboard. > + > config PINCTRL_ZYNQ > bool "Pinctrl driver for Xilinx Zynq" > depends on ARCH_ZYNQ > diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile > index e76f5cdc64b0..c366706d36e7 100644 > --- a/drivers/pinctrl/Makefile > +++ b/drivers/pinctrl/Makefile > @@ -48,6 +48,7 @@ obj-$(CONFIG_PINCTRL_STMFX) += pinctrl-stmfx.o > obj-$(CONFIG_PINCTRL_SX150X) += pinctrl-sx150x.o > obj-$(CONFIG_PINCTRL_TB10X) += pinctrl-tb10x.o > obj-$(CONFIG_PINCTRL_THUNDERBAY) += pinctrl-thunderbay.o > +obj-$(CONFIG_PINCTRL_UPBOARD) += pinctrl-upboard.o > obj-$(CONFIG_PINCTRL_ZYNQMP) += pinctrl-zynqmp.o > obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o > > diff --git a/drivers/pinctrl/pinctrl-upboard.c b/drivers/pinctrl/pinctrl-upboard.c > new file mode 100644 > index 000000000000..73d50a695aab > --- /dev/null > +++ b/drivers/pinctrl/pinctrl-upboard.c > @@ -0,0 +1,1390 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * UP Board HAT pin controller driver > + * remapping native pin to RPI pin and set CPLD pin dir > + * > + * Copyright (c) AAEON. All rights reserved. > + * > + * Authors: Gary Wang > + * > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "core.h" > +#include "intel/pinctrl-intel.h" > + ... > + { > + .ident = BOARD_UP_ADLN01, > + .matches = { /* UP 7000 */ > + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AAEON"), > + DMI_EXACT_MATCH(DMI_BOARD_NAME, "UP-ADLN01"), > + }, > + }, > + { } /* Terminating entry */ > +}; > + > +static int __init upboard_pinctrl_probe(struct platform_device *pdev) Probe functions are not __init. Also, this isn't even used. > +{ > + struct upboard_fpga * const fpga = dev_get_drvdata(pdev->dev.parent); > + struct pinctrl_desc *pctldesc; > + struct upboard_pinctrl *pctrl; > + struct upboard_pin *pins; > + const struct dmi_system_id *system_id; > + const unsigned int *rpi_mapping; > + unsigned int ngpio; > + int ret; ... > + /* add acpi pin mapping according to external-gpios key */ > + ret = upboard_acpi_node_pin_mapping(fpga, pctrl, > + "external", > + dev_name(&pdev->dev), > + 0); > + if (ret) > + return ret; > + > + upboard_alt_func_enable(&pctrl->chip, "I2C", pctrl->ident); > + upboard_alt_func_enable(&pctrl->chip, "SPI", pctrl->ident); > + upboard_alt_func_enable(&pctrl->chip, "UART", pctrl->ident); > + upboard_alt_func_enable(&pctrl->chip, "I2S", pctrl->ident); > + upboard_alt_func_enable(&pctrl->chip, "PWM", pctrl->ident); > + upboard_alt_func_enable(&pctrl->chip, "ADC", pctrl->ident); > + upboard_alt_func_enable(&pctrl->chip, "PINMUX", pctrl->ident); > + > + return ret; > +} > + > +static struct platform_driver upboard_pinctrl_driver = { > + .driver = { > + .name = "upboard-pinctrl", > + }, > +}; > +module_platform_driver_probe(upboard_pinctrl_driver, upboard_pinctrl_probe); > + > +MODULE_AUTHOR("Gary Wang "); > +MODULE_DESCRIPTION("UP Board HAT pin controller driver"); > +MODULE_LICENSE("GPL v2"); > +MODULE_ALIAS("platform:upboard-pinctrl"); You should not need MODULE_ALIAS() in normal cases. If you need it, usually it means your device ID table is wrong (e.g. misses either entries or MODULE_DEVICE_TABLE()). MODULE_ALIAS() is not a substitute for incomplete ID table. Best regards, Krzysztof