[{"id":3672667,"web_url":"http://patchwork.ozlabs.org/comment/3672667/","msgid":"<20260402-warping-chameleon-of-prowess-9df780-mkl@pengutronix.de>","list_archive_url":null,"date":"2026-04-02T11:05:43","subject":"Re: [PATCH v1 2/2] mfd: Add Host Interface (HIF) support for Nuvoton\n NCT6694","submitter":{"id":2822,"url":"http://patchwork.ozlabs.org/api/people/2822/","name":"Marc Kleine-Budde","email":"mkl@pengutronix.de"},"content":"On 02.04.2026 13:14:42, a0282524688@gmail.com wrote:\n> From: Ming Yu <a0282524688@gmail.com>\n>\n> The Nuvoton NCT6694 also provides a Host Interface (HIF) via eSPI\n> to the host to access its features.\n>\n> Sub-devices can use the common functions nct6694_read_msg() and\n> nct6694_write_msg() to issue a command. They can also request\n> interrupts that will be called when the HIF device triggers a\n> shared memory interrupt.\n>\n> To support multiple transports, the driver configuration is\n> updated to allow selecting between the USB and HIF interfaces.\n>\n> Signed-off-by: Ming Yu <a0282524688@gmail.com>\n> ---\n>  MAINTAINERS                         |   1 +\n>  drivers/gpio/gpio-nct6694.c         |   7 -\n>  drivers/hwmon/nct6694-hwmon.c       |  21 -\n>  drivers/i2c/busses/i2c-nct6694.c    |   7 -\n>  drivers/mfd/Kconfig                 |  47 +-\n>  drivers/mfd/Makefile                |   3 +-\n>  drivers/mfd/nct6694-hif.c           | 649 ++++++++++++++++++++++++++++\n>  drivers/mfd/nct6694.c               |  97 +++--\n>  drivers/net/can/usb/nct6694_canfd.c |   6 -\n>  drivers/rtc/rtc-nct6694.c           |   7 -\n>  drivers/watchdog/nct6694_wdt.c      |   7 -\n>  include/linux/mfd/nct6694.h         |  51 ++-\n>  12 files changed, 787 insertions(+), 116 deletions(-)\n>  create mode 100644 drivers/mfd/nct6694-hif.c\n>\n> diff --git a/MAINTAINERS b/MAINTAINERS\n> index c3fe46d7c4bc..7b6241faa6df 100644\n> --- a/MAINTAINERS\n> +++ b/MAINTAINERS\n> @@ -18899,6 +18899,7 @@ S:\tSupported\n>  F:\tdrivers/gpio/gpio-nct6694.c\n>  F:\tdrivers/hwmon/nct6694-hwmon.c\n>  F:\tdrivers/i2c/busses/i2c-nct6694.c\n> +F:\tdrivers/mfd/nct6694-hif.c\n>  F:\tdrivers/mfd/nct6694.c\n>  F:\tdrivers/net/can/usb/nct6694_canfd.c\n>  F:\tdrivers/rtc/rtc-nct6694.c\n> diff --git a/drivers/gpio/gpio-nct6694.c b/drivers/gpio/gpio-nct6694.c\n> index 3703a61209e6..a279510ece89 100644\n> --- a/drivers/gpio/gpio-nct6694.c\n> +++ b/drivers/gpio/gpio-nct6694.c\n> @@ -12,13 +12,6 @@\n>  #include <linux/module.h>\n>  #include <linux/platform_device.h>\n>\n> -/*\n> - * USB command module type for NCT6694 GPIO controller.\n> - * This defines the module type used for communication with the NCT6694\n> - * GPIO controller over the USB interface.\n> - */\n> -#define NCT6694_GPIO_MOD\t0xFF\n> -\n>  #define NCT6694_GPIO_VER\t0x90\n>  #define NCT6694_GPIO_VALID\t0x110\n>  #define NCT6694_GPI_DATA\t0x120\n> diff --git a/drivers/hwmon/nct6694-hwmon.c b/drivers/hwmon/nct6694-hwmon.c\n> index 6dcf22ca5018..581451875f2c 100644\n> --- a/drivers/hwmon/nct6694-hwmon.c\n> +++ b/drivers/hwmon/nct6694-hwmon.c\n> @@ -15,13 +15,6 @@\n>  #include <linux/platform_device.h>\n>  #include <linux/slab.h>\n>\n> -/*\n> - * USB command module type for NCT6694 report channel\n> - * This defines the module type used for communication with the NCT6694\n> - * report channel over the USB interface.\n> - */\n> -#define NCT6694_RPT_MOD\t\t\t0xFF\n> -\n>  /* Report channel */\n>  /*\n>   * The report channel is used to report the status of the hardware monitor\n> @@ -38,13 +31,6 @@\n>  #define NCT6694_TIN_STS(x)\t\t(0x6A + (x))\n>  #define NCT6694_FIN_STS(x)\t\t(0x6E + (x))\n>\n> -/*\n> - * USB command module type for NCT6694 HWMON controller.\n> - * This defines the module type used for communication with the NCT6694\n> - * HWMON controller over the USB interface.\n> - */\n> -#define NCT6694_HWMON_MOD\t\t0x00\n> -\n>  /* Command 00h - Hardware Monitor Control */\n>  #define NCT6694_HWMON_CONTROL\t\t0x00\n>  #define NCT6694_HWMON_CONTROL_SEL\t0x00\n> @@ -53,13 +39,6 @@\n>  #define NCT6694_HWMON_ALARM\t\t0x02\n>  #define NCT6694_HWMON_ALARM_SEL\t\t0x00\n>\n> -/*\n> - * USB command module type for NCT6694 PWM controller.\n> - * This defines the module type used for communication with the NCT6694\n> - * PWM controller over the USB interface.\n> - */\n> -#define NCT6694_PWM_MOD\t\t\t0x01\n> -\n>  /* PWM Command - Manual Control */\n>  #define NCT6694_PWM_CONTROL\t\t0x01\n>  #define NCT6694_PWM_CONTROL_SEL\t\t0x00\n> diff --git a/drivers/i2c/busses/i2c-nct6694.c b/drivers/i2c/busses/i2c-nct6694.c\n> index 7d8ad997f6d2..7ee209a04d16 100644\n> --- a/drivers/i2c/busses/i2c-nct6694.c\n> +++ b/drivers/i2c/busses/i2c-nct6694.c\n> @@ -11,13 +11,6 @@\n>  #include <linux/module.h>\n>  #include <linux/platform_device.h>\n>\n> -/*\n> - * USB command module type for NCT6694 I2C controller.\n> - * This defines the module type used for communication with the NCT6694\n> - * I2C controller over the USB interface.\n> - */\n> -#define NCT6694_I2C_MOD\t\t\t0x03\n> -\n>  /* Command 00h - I2C Deliver */\n>  #define NCT6694_I2C_DELIVER\t\t0x00\n>  #define NCT6694_I2C_DELIVER_SEL\t\t0x00\n> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig\n> index 7192c9d1d268..8a715ec2f79f 100644\n> --- a/drivers/mfd/Kconfig\n> +++ b/drivers/mfd/Kconfig\n> @@ -1164,19 +1164,46 @@ config MFD_MENF21BMC\n>  \t  will be called menf21bmc.\n>\n>  config MFD_NCT6694\n> -\ttristate \"Nuvoton NCT6694 support\"\n> +\ttristate\n>  \tselect MFD_CORE\n> +\thelp\n> +\t  Core MFD support for the Nuvoton NCT6694 peripheral expander.\n> +\t  This provides the common APIs and shared structures used by all\n> +\t  interfaces (USB, HIF) to access the NCT6694 hardware features\n> +\t  such as GPIO, I2C, CAN-FD, Watchdog, ADC, PWM, and RTC.\n> +\n> +\t  It is selected automatically by the transport interface drivers.\n> +\n> +config MFD_NCT6694_HIF\n> +\ttristate \"Nuvoton NCT6694 HIF (eSPI) interface support\"\n> +\tdepends on HAS_IOPORT && ACPI\n> +\tselect MFD_NCT6694\n> +\tselect REGMAP_MMIO\n> +\thelp\n> +\t  This enables support for the Nuvoton NCT6694 peripheral expander\n> +\t  connected via the Host Interface (HIF) using eSPI transport.\n> +\n> +\t  The transport driver uses Super-I/O mapping and shared memory to\n> +\t  communicate with the NCT6694 firmware. Enable this option if you\n> +\t  are using the NCT6694 over an eSPI interface on an ACPI platform.\n> +\n> +\t  To compile this driver as a module, choose M here: the module\n> +\t  will be called nct6694-hif.\n> +\n> +config MFD_NCT6694_USB\n> +\ttristate \"Nuvoton NCT6694 USB interface support\"\n> +\tselect MFD_NCT6694\n>  \tdepends on USB\n>  \thelp\n> -\t  This enables support for the Nuvoton USB device NCT6694, which shares\n> -\t  peripherals.\n> -\t  The Nuvoton NCT6694 is a peripheral expander with 16 GPIO chips,\n> -\t  6 I2C controllers, 2 CANfd controllers, 2 Watchdog timers, ADC,\n> -\t  PWM, and RTC.\n> -\t  This driver provides core APIs to access the NCT6694 hardware\n> -\t  monitoring and control features.\n> -\t  Additional drivers must be enabled to utilize the specific\n> -\t  functionalities of the device.\n> +\t  This enables support for the Nuvoton NCT6694 peripheral expander\n> +\t  connected via the USB interface.\n> +\n> +\t  The transport driver uses USB bulk and interrupt transfers to\n> +\t  communicate with the NCT6694 firmware. Enable this option if you\n> +\t  are using the NCT6694 via a USB connection.\n> +\n> +\t  To compile this driver as a module, choose M here: the module\n> +\t  will be called nct6694.\n>\n>  config MFD_OCELOT\n>  \ttristate \"Microsemi Ocelot External Control Support\"\n> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile\n> index e75e8045c28a..4cee9b74978c 100644\n> --- a/drivers/mfd/Makefile\n> +++ b/drivers/mfd/Makefile\n> @@ -124,7 +124,8 @@ obj-$(CONFIG_MFD_MC13XXX_I2C)\t+= mc13xxx-i2c.o\n>\n>  obj-$(CONFIG_MFD_PF1550)\t+= pf1550.o\n>\n> -obj-$(CONFIG_MFD_NCT6694)\t+= nct6694.o\n> +obj-$(CONFIG_MFD_NCT6694_HIF)\t+= nct6694-hif.o\n> +obj-$(CONFIG_MFD_NCT6694_USB)\t+= nct6694.o\n>\n>  obj-$(CONFIG_MFD_CORE)\t\t+= mfd-core.o\n>\n> diff --git a/drivers/mfd/nct6694-hif.c b/drivers/mfd/nct6694-hif.c\n> new file mode 100644\n> index 000000000000..a5953c951eb5\n> --- /dev/null\n> +++ b/drivers/mfd/nct6694-hif.c\n> @@ -0,0 +1,649 @@\n> +// SPDX-License-Identifier: GPL-2.0\n> +/*\n> + * Copyright (C) 2026 Nuvoton Technology Corp.\n> + *\n> + * Nuvoton NCT6694 host-interface (eSPI) transport driver.\n> + */\n> +\n> +#include <linux/acpi.h>\n> +#include <linux/bits.h>\n> +#include <linux/interrupt.h>\n> +#include <linux/io.h>\n> +#include <linux/iopoll.h>\n> +#include <linux/irq.h>\n> +#include <linux/irqdomain.h>\n> +#include <linux/kernel.h>\n> +#include <linux/mfd/core.h>\n> +#include <linux/mfd/nct6694.h>\n> +#include <linux/module.h>\n> +#include <linux/platform_device.h>\n> +#include <linux/regmap.h>\n> +#include <linux/unaligned.h>\n> +\n> +#define DRVNAME \"nct6694-hif\"\n> +\n> +#define NCT6694_POLL_INTERVAL_US\t10\n> +#define NCT6694_POLL_TIMEOUT_US\t\t10000\n> +\n> +/*\n> + * Super-I/O registers\n> + */\n> +#define SIO_REG_LDSEL\t\t0x07\t/* Logical device select */\n> +#define SIO_REG_DEVID\t\t0x20\t/* Device ID (2 bytes) */\n> +#define SIO_REG_LD_SHM\t\t0x0F\t/* Logical device shared memory control */\n> +\n> +#define SIO_REG_SHM_ENABLE\t0x30\t/* Enable shared memory */\n> +#define SIO_REG_SHM_BASE_ADDR\t0x60\t/* Shared memory base address (2 bytes) */\n> +#define SIO_REG_SHM_IRQ_NR\t0x70\t/* Shared memory interrupt number */\n> +\n> +#define SIO_REG_UNLOCK_KEY\t0x87\t/* Key to enable Super-I/O */\n> +#define SIO_REG_LOCK_KEY\t0xAA\t/* Key to disable Super-I/O */\n> +\n> +#define SIO_NCT6694B_ID\t\t0xD029\n> +#define SIO_NCT6694D_ID\t\t0x5832\n> +\n> +/*\n> + * Super-I/O Shared Memory Logical Device registers\n> + */\n> +#define NCT6694_SHM_COFS_STS\t\t\t0x2E\n> +#define NCT6694_SHM_COFS_STS_COFS4W\t\tBIT(7)\n> +\n> +#define NCT6694_SHM_COFS_CTL2\t\t\t0x3B\n> +#define NCT6694_SHM_COFS_CTL2_COFS4W_IE\t\tBIT(3)\n> +\n> +#define NCT6694_SHM_INTR_STATUS\t\t\t0x9C\t/* Interrupt status register (4 bytes) */\n> +\n> +enum nct6694_chips {\n> +\tNCT6694B = 0,\n> +\tNCT6694D,\n> +};\n> +\n> +enum nct6694_module_id {\n> +\tNCT6694_GPIO0 = 0,\n> +\tNCT6694_GPIO1,\n> +\tNCT6694_GPIO2,\n> +\tNCT6694_GPIO3,\n> +\tNCT6694_GPIO4,\n> +\tNCT6694_GPIO5,\n> +\tNCT6694_GPIO6,\n> +\tNCT6694_GPIO7,\n> +\tNCT6694_GPIO8,\n> +\tNCT6694_GPIO9,\n> +\tNCT6694_GPIOA,\n> +\tNCT6694_GPIOB,\n> +\tNCT6694_GPIOC,\n> +\tNCT6694_GPIOD,\n> +\tNCT6694_GPIOE,\n> +\tNCT6694_GPIOF,\n> +\tNCT6694_I2C0,\n> +\tNCT6694_I2C1,\n> +\tNCT6694_I2C2,\n> +\tNCT6694_I2C3,\n> +\tNCT6694_I2C4,\n> +\tNCT6694_I2C5,\n> +\tNCT6694_CAN0,\n> +\tNCT6694_CAN1,\n> +};\n> +\n> +struct __packed nct6694_msg {\n> +\tstruct nct6694_cmd_header cmd_header;\n> +\tstruct nct6694_response_header response_header;\n> +\tunsigned char *data;\n> +};\n> +\n> +struct nct6694_sio_data {\n> +\tenum nct6694_chips chip;\n> +\tint sioreg;\t/* Super-I/O index port */\n> +\n> +\t/* Super-I/O access functions */\n> +\tint (*sio_enter)(struct nct6694_sio_data *sio_data);\n> +\tvoid (*sio_exit)(struct nct6694_sio_data *sio_data);\n> +\tvoid (*sio_select)(struct nct6694_sio_data *sio_data, int ld);\n> +\tint (*sio_inb)(struct nct6694_sio_data *sio_data, int reg);\n> +\tint (*sio_inw)(struct nct6694_sio_data *sio_data, int reg);\n> +\tvoid (*sio_outb)(struct nct6694_sio_data *sio_data, int reg, int val);\n\nThe signatures of the function look a bit strange. I expect functions\nreading/writing bytes use u8 not int, register offsets should probably\nbe an unsigned int.\n\nWhy do you have pointers to the access functions? Why not use them\ndirectly?\n\nMarc\n\n--\nPengutronix e.K.                 | Marc Kleine-Budde          |\nEmbedded Linux                   | https://www.pengutronix.de |\nVertretung Nürnberg              | Phone: +49-5121-206917-129 |\nAmtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |","headers":{"Return-Path":"\n <linux-i2c+bounces-16929-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-i2c@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.232.135.74; helo=sto.lore.kernel.org;\n envelope-from=linux-i2c+bounces-16929-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=185.203.201.7","smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=pengutronix.de","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=pengutronix.de"],"Received":["from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmfHX1K7nz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 22:08:56 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 9B0CC308EFD3\n\tfor <incoming@patchwork.ozlabs.org>; Thu,  2 Apr 2026 11:06:58 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 892A43C0625;\n\tThu,  2 Apr 2026 11:06:29 +0000 (UTC)","from metis.whiteo.stw.pengutronix.de\n (metis.whiteo.stw.pengutronix.de [185.203.201.7])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 4673B3B8BD4\n\tfor <linux-i2c@vger.kernel.org>; Thu,  2 Apr 2026 11:06:24 +0000 (UTC)","from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2])\n\tby metis.whiteo.stw.pengutronix.de with esmtps\n (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)\n\t(Exim 4.92)\n\t(envelope-from <mkl@pengutronix.de>)\n\tid 1w8Fru-0004ZY-BZ; Thu, 02 Apr 2026 13:05:46 +0200","from moin.white.stw.pengutronix.de ([2a0a:edc0:0:b01:1d::7b]\n helo=bjornoya.blackshift.org)\n\tby drehscheibe.grey.stw.pengutronix.de with esmtps  (TLS1.3) tls\n TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\n\t(Exim 4.96)\n\t(envelope-from <mkl@pengutronix.de>)\n\tid 1w8Frs-003MQs-2L;\n\tThu, 02 Apr 2026 13:05:44 +0200","from pengutronix.de (p4ffb2dc6.dip0.t-ipconnect.de [79.251.45.198])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(Client did not present a certificate)\n\t(Authenticated sender: mkl-all@blackshift.org)\n\tby smtp.blackshift.org (Postfix) with ESMTPSA id 57352514511;\n\tThu, 02 Apr 2026 11:05:44 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775127988; cv=none;\n b=OZ/qUmjl0OYMoHBsNg9h7IXOHJTrE1hPKC0bZMrzufn4iEEOSFi5WOslt0c05HtXP4rPE54ak0kqSr42t0/4vFisRHn3gSFO9ji/6g2kS0iCgnJMmmyN2nJgErEsMcbZhhyLk3SvTj4AAcG9ynXzcWlWwdOdYdp2lIEhCawTdcw=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775127988; c=relaxed/simple;\n\tbh=Yd/6Pc5loOp6q2Ae4swq/Wc1w/fliWxGIpt5pwIb6ZE=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=jjyV7O66W8Je8PIhEv0d+0B/jkgqsXJscCjX37EqzDTxxuWMUNjej63a1RPAWys2xjscXGNE1EeEJyc6B0iOYHDSYcf0saQt6/Hl4Ld5Hw5EVABAIyg3tew7YJYzzg/OKjFdDGZhcW1Lu/4b0KBqBPNEpJ6/2Dj0DQsOeWwEs+A=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=pengutronix.de;\n spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7","Date":"Thu, 2 Apr 2026 13:05:43 +0200","From":"Marc Kleine-Budde <mkl@pengutronix.de>","To":"a0282524688@gmail.com","Cc":"tmyu0@nuvoton.com, linusw@kernel.org, brgl@kernel.org,\n\tlinux@roeck-us.net, andi.shyti@kernel.org, lee@kernel.org,\n mailhol@kernel.org,\n\talexandre.belloni@bootlin.com, wim@linux-watchdog.org,\n linux-kernel@vger.kernel.org,\n\tlinux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org,\n linux-can@vger.kernel.org,\n\tnetdev@vger.kernel.org, linux-watchdog@vger.kernel.org,\n linux-hwmon@vger.kernel.org,\n\tlinux-rtc@vger.kernel.org, linux-usb@vger.kernel.org","Subject":"Re: [PATCH v1 2/2] mfd: Add Host Interface (HIF) support for Nuvoton\n NCT6694","Message-ID":"<20260402-warping-chameleon-of-prowess-9df780-mkl@pengutronix.de>","X-AI":"stop_reason: \"refusal\"","References":"<20260402051442.1426672-1-a0282524688@gmail.com>\n <20260402051442.1426672-3-a0282524688@gmail.com>","Precedence":"bulk","X-Mailing-List":"linux-i2c@vger.kernel.org","List-Id":"<linux-i2c.vger.kernel.org>","List-Subscribe":"<mailto:linux-i2c+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-i2c+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha512;\n\tprotocol=\"application/pgp-signature\"; boundary=\"eduyjgnvxkh2zrsd\"","Content-Disposition":"inline","In-Reply-To":"<20260402051442.1426672-3-a0282524688@gmail.com>","X-SA-Exim-Connect-IP":"2a0a:edc0:0:c01:1d::a2","X-SA-Exim-Mail-From":"mkl@pengutronix.de","X-SA-Exim-Scanned":"No (on metis.whiteo.stw.pengutronix.de);\n SAEximRunCond expanded to false","X-PTX-Original-Recipient":"linux-i2c@vger.kernel.org"}},{"id":3672987,"web_url":"http://patchwork.ozlabs.org/comment/3672987/","msgid":"<CAOoeyxVp2dY=XrujkCbWHjX4bVu4-H2=k0JHxL6akC6KwY+rVA@mail.gmail.com>","list_archive_url":null,"date":"2026-04-03T04:46:22","subject":"Re: [PATCH v1 2/2] mfd: Add Host Interface (HIF) support for Nuvoton\n NCT6694","submitter":{"id":89578,"url":"http://patchwork.ozlabs.org/api/people/89578/","name":"Ming Yu","email":"a0282524688@gmail.com"},"content":"Dear Marc,\n\nThanks for the review.\n\nMarc Kleine-Budde <mkl@pengutronix.de> 於 2026年4月2日週四 下午7:05寫道：\n>\n> > +struct nct6694_sio_data {\n> > +     enum nct6694_chips chip;\n> > +     int sioreg;     /* Super-I/O index port */\n> > +\n> > +     /* Super-I/O access functions */\n> > +     int (*sio_enter)(struct nct6694_sio_data *sio_data);\n> > +     void (*sio_exit)(struct nct6694_sio_data *sio_data);\n> > +     void (*sio_select)(struct nct6694_sio_data *sio_data, int ld);\n> > +     int (*sio_inb)(struct nct6694_sio_data *sio_data, int reg);\n> > +     int (*sio_inw)(struct nct6694_sio_data *sio_data, int reg);\n> > +     void (*sio_outb)(struct nct6694_sio_data *sio_data, int reg, int val);\n>\n> The signatures of the function look a bit strange. I expect functions\n> reading/writing bytes use u8 not int, register offsets should probably\n> be an unsigned int.\n>\n> Why do you have pointers to the access functions? Why not use them\n> directly?\n>\n\nThese helpers were originally meant to be used by sub-drivers for SIO\naccess, but the implementation later converged so that all SIO access\nis done in the MFD driver itself. In the next version, I will remove\nthe function pointers and simplify the interface accordingly.\n\nI will also adjust the types as suggested.\n\n\nRegards,\nMing","headers":{"Return-Path":"\n <linux-i2c+bounces-16944-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-i2c@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=DidQGWOK;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-i2c+bounces-16944-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"DidQGWOK\"","smtp.subspace.kernel.org;\n arc=pass smtp.client-ip=209.85.128.182","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fn5m92lnJz1yDH\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 15:46:49 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 9E648303DD21\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  3 Apr 2026 04:46:05 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 0D675359A61;\n\tFri,  3 Apr 2026 04:46:04 +0000 (UTC)","from mail-yw1-f182.google.com (mail-yw1-f182.google.com\n [209.85.128.182])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D520358372\n\tfor <linux-i2c@vger.kernel.org>; Fri,  3 Apr 2026 04:46:02 +0000 (UTC)","by mail-yw1-f182.google.com with SMTP id\n 00721157ae682-78fc4425b6bso15626507b3.1\n        for <linux-i2c@vger.kernel.org>; Thu, 02 Apr 2026 21:46:02 -0700 (PDT)"],"ARC-Seal":["i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775191563; cv=pass;\n b=pKQW3BtvPYROUvFOTrjdkcFc5luBbOuZdWlBXMMkYRS224HODn1YOME8zW+Y6E2B8/YbbF49LlO8nG8ACCqTH/UTVfSiM5IIwjJxefpPWYMPOBf0Wb6rDrO74BGBT6znRnD8Rqa/NcINav0BiwyMMpmD5UlXzmKZ3ZsgoZ+caWM=","i=1; a=rsa-sha256; t=1775191561; cv=none;\n        d=google.com; s=arc-20240605;\n        b=ICmrcvTLGTZYWFcA1ZUQUztOYx4ms3/RAnHoqpYvlQGzG72mztNR6Tg2aGvQW1mn0P\n         XB02/71CPEE/t3vddrtK2EHpCYzavgjp06A7l3q3jNw3Pol0eCjRrynJIqTHSehTCiKf\n         Z1Q46AwHPMVVVLD2PAm/pXZ6QQjH+iypU7sl4L65OC3EOw9GdvmSqoKuw9g3hxVYJSxa\n         50ymK67LMprMoLvMZld5MjRnQK45VPzeqZbN9MWqmOIshpb19HcMwIcBqCjB/+dxmnBx\n         kwVpwYAdGacoP33hHlY5NclFBQE7gFiwHyVYzWpb4Z0eIPV32Zg0F468cFy5w0eXb4gu\n         4VEg=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775191563; c=relaxed/simple;\n\tbh=groc3VAnH15CVUVhNhE5OtlEsDNXM/uA7VeW8vaOMTY=;\n\th=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:\n\t To:Cc:Content-Type;\n b=ACKaTnYAYBS/uu9YyUTU+ecdfLe7YBKDq3PjSyb2EROa0xzcLAq3phmJ13Nq6Pxux0f45eHXaOf3kHY3vG/nauUOxQ5vrO9PmQzMHvDfTPFboLV+v9GxpMopFBdHxozB+H5EvvWu/whn4l+13uYk2nLQeF7pB7ejVcEXaej8I5s=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n        h=content-transfer-encoding:cc:to:subject:message-id:date:from\n         :in-reply-to:references:mime-version:dkim-signature;\n        bh=udWmikDfTPoYOznLAWVnBq6+fVtMa2LFJrslNkdcn48=;\n        fh=LYT1ZkWMcuH65+n8gQhrFiyYo6OLK0tz30y1599OChQ=;\n        b=LF8RHA8gqzYDvlYZr/Y0/sCJETkibtuwWhPlq0kLtA+hdOWkcUerOKi/OeguClNGUo\n         g6nwzBEc4nCHpiwTc3/uHbkYJst+ErVSpk6b9FSNHQGI1EE1Nht7VxHjfG1DkGsyyFII\n         4BQs+Gr3rSP+/YO9P1Kuh7Q7dJcfOZClmm50ct6uigDjNzhK0zbxjjGGj/kSSvx9Na9x\n         FqNhLHDZ+paHuQZiW89Zux+0ZHJ+iJjuYkIJTE7aeD4u5kxmuCUTWAAUIjlYPzZVD27T\n         nVEgTA8vLX5iZ/j7KSb0ibgCO7rqXGR/QnJTo9o5sw+FiOwNb4vid8b+wZpOncUQblaa\n         eC8g==;\n        darn=vger.kernel.org"],"ARC-Authentication-Results":["i=2; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=DidQGWOK; arc=pass smtp.client-ip=209.85.128.182","i=1; mx.google.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1775191561; x=1775796361;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:cc:to:subject:message-id:date:from\n         :in-reply-to:references:mime-version:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=udWmikDfTPoYOznLAWVnBq6+fVtMa2LFJrslNkdcn48=;\n        b=DidQGWOKrm72zYGNfTnKQ9IcnJWZNioKN73o236MElVFzyQKQ8qb/l+soctZqFpFYR\n         KhdKkKO4KWfPBZssLoFqJJaoQDXfr0ubxMRtcYnbkp4Aw6n+hEGhzMD/e6M1vs9Vctn7\n         F7uzUA9y1Hc8Am0AiyTcsudzX2bQmqDVaIRAHRwR1H1Mdwqeulzb+nkNolrXNE6n+lnA\n         5zZ6mhLg+931xo6+ZY56HBf57G3FpKAkbPbK1guAlEH/oool84UFse8KKG4/MulU3zjW\n         kOZ0D+JZfXdmrH7t4ojZVoyu6NPL6R7//xVc/4ow33xoSCayriKVfXDNF+A2xeU4fM2L\n         OvxA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1775191561; x=1775796361;\n        h=content-transfer-encoding:cc:to:subject:message-id:date:from\n         :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=udWmikDfTPoYOznLAWVnBq6+fVtMa2LFJrslNkdcn48=;\n        b=GnGtT/YlI9mKz6a1xXBRPYFNRD82bvncGsrrt/+bL+3FGCdaIAOJUFXY06WCLX/M8+\n         HY/Afr3I9hDqTKEe83h4wNh/ly3OchMrc6F9Ui0G+K8kABw54HACzCSVgP9th2xoHAkp\n         0TZtUqC26zO4x6jKeKNqcrXRCWCLqHobuMswKWt8PKUQfmt7qxs0r1eETP8irJWovZP1\n         iNp9/UjV21mXlDkKauutojR5+p0BfT9k/dafjBRbbDiJeIBKQolODX1XDUes6Vl3ZjjK\n         460KpBZaNK5iMTZBoxY1NIfZwZGkKsmmwehP6eI7sMlZTN/VLSsKS42G+aXkHyqtFGX8\n         7EWQ==","X-Forwarded-Encrypted":"i=1;\n AJvYcCV+L/qpXyn8u5D48kq/xDsRIOkHOk1ByBsTmB5VR40zgk/GrwDlSR7BYXUh+0uwpt0eWhutnHxVJeo=@vger.kernel.org","X-Gm-Message-State":"AOJu0Yx+U0QgyVAZTqK1OpKTH1S7T2J58eagkN/ANr8qjSTXBLnCDMWM\n\toJnMJxZxUiaw2+QAasse6adphY47Mf7LzFh4ZaD58/l4sq6/6jXquYSlWjHdW5hnDCIZfxIIqkO\n\t9yUDmJpRcHpRxPGnVpeQpg0NukcpRk2I=","X-Gm-Gg":"AeBDievIN51JgOEwArGKzsbo09THirEpdrWtUJGZAH55Adm4eQAi0xlj/d9wfJwgNXD\n\t7lfTIP8tqfhJF5qg8pQx7bgHsH57sxpwv8+rTKdNCoWZkcB2peiswKoQsBcE56duJWu0dQSv/th\n\tMTZVpwwAJtOHFiBl9RLuqWj5c5GpmTNkS4KWecpaPNttwHwxH0894id9E+h5Vp/SMxa3nw2NFhQ\n\tpvEW/OlqF1ZONrrIt9fN9DajCLWej99RE4H4xwTcbUsb4+I8Zb6dQRXbP5dZK8IGh8m9EAcQLTn\n\tsKazHQ==","X-Received":"by 2002:a05:690c:6987:b0:799:198d:8c5a with SMTP id\n 00721157ae682-7a4d585f69dmr19958067b3.34.1775191561252; Thu, 02 Apr 2026\n 21:46:01 -0700 (PDT)","Precedence":"bulk","X-Mailing-List":"linux-i2c@vger.kernel.org","List-Id":"<linux-i2c.vger.kernel.org>","List-Subscribe":"<mailto:linux-i2c+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-i2c+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","References":"<20260402051442.1426672-1-a0282524688@gmail.com>\n <20260402051442.1426672-3-a0282524688@gmail.com>\n <20260402-warping-chameleon-of-prowess-9df780-mkl@pengutronix.de>","In-Reply-To":"<20260402-warping-chameleon-of-prowess-9df780-mkl@pengutronix.de>","From":"Ming Yu <a0282524688@gmail.com>","Date":"Fri, 3 Apr 2026 12:46:22 +0800","X-Gm-Features":"AQROBzC_c6Pz91vTEwJZ5AXR_5dXzfojiP7V5Wmo6LnqG_6F9RBzJL09w08myjU","Message-ID":"\n <CAOoeyxVp2dY=XrujkCbWHjX4bVu4-H2=k0JHxL6akC6KwY+rVA@mail.gmail.com>","Subject":"Re: [PATCH v1 2/2] mfd: Add Host Interface (HIF) support for Nuvoton\n NCT6694","To":"Marc Kleine-Budde <mkl@pengutronix.de>","Cc":"tmyu0@nuvoton.com, linusw@kernel.org, brgl@kernel.org, linux@roeck-us.net,\n\tandi.shyti@kernel.org, lee@kernel.org, mailhol@kernel.org,\n\talexandre.belloni@bootlin.com, wim@linux-watchdog.org,\n\tlinux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,\n\tlinux-i2c@vger.kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org,\n\tlinux-watchdog@vger.kernel.org, linux-hwmon@vger.kernel.org,\n\tlinux-rtc@vger.kernel.org, linux-usb@vger.kernel.org","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable"}}]