From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (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 7BD4D2FD694 for ; Wed, 1 Jul 2026 03:50:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782877851; cv=none; b=SX1cBAxurjlURKWrpAzCXaBYP+UTJ282xSNErjd+P9ruxCaZFS2EDXcmL+pxjzD6vw/v2H9/GxZEGKYAQcIw9s8cVaw8pWgVIsN5g94ccMe8XQz0YbsfzywP6N+8qsqLkvVMRPlswOYtdu3R0YqyxhFz1i7ANMa7OurgJ0UBUwU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782877851; c=relaxed/simple; bh=MiTg6Y+RRd59fczpAx17JutMVfRQP7ONVhX5DgX/bkE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TU7nc0KBlN5GVU4WSWoBq8FXL7rJvaanFv8J4tkQ3lIVZbI+rCnFXIYON9Wb+GEcM+5tGuoOWHK3e6Fu3yLzUDc1fFZzz/xOMtrhZQi6QAu1CPAToUVYxcKt6/+nNevd/qakqgYjy8z7/ZHlcNilwTXNQn2e6G4k1mbkjE0bazc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hr6vbxjt; arc=none smtp.client-ip=209.85.215.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hr6vbxjt" Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-c96bfabc8d4so46317a12.3 for ; Tue, 30 Jun 2026 20:50:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782877850; x=1783482650; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pWfWLaWFeXW4S+14GD3Fklk/FPqTY7gkyc6H9F9Tr2w=; b=hr6vbxjtA5RhLXTWttiEMkOPX0ubqDjljsPg4Vt9JmzsU3W0wGWTOhxz3QEs5/g8s7 mahFe5XYIgEa2thcoJnwVkZApsMIljUzrzU0zJRlufAIIBZhKAlNwDZ2x2hRhTpx2PhB N+C1fE9/Pl4BXdI7K5BQg/QGv24k7MXAem2BkwUvtboGCPjsSvafjk2YvCqxrh8Vknbq nyqiQmnB6pXQ7HKOg66uzAd0aPeiJmSMfk33AZicF8NqF1Ar3C7I7EZQ3303rQQL0sgo JQBvfc5EB8DBYScggiR1wkqZ52U38NU17q0MBVk2q/80DtMUvTfMXCGJ4iwPldj1tXGI q9Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782877850; x=1783482650; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pWfWLaWFeXW4S+14GD3Fklk/FPqTY7gkyc6H9F9Tr2w=; b=Qcbed43xZbs7YkjRh0cOjl5kfiqcQwUGSiyOo/XIHqtqERVAeweQ/V4LZA08UpuMiX oGf5+/eQJNdzA3oM1MVCCn1bY0yhtSZl1dKMz88MM+lh4FuWc5lTaA4FC/ZKjxzYqYcd oHgFt6UpSwJClsrpxtfJF4F8Ot7LtK3nVbcxxiJ74uogWJMVqLo66An8tYbD91EpvyYA 6hRhUlUEsug9aQm3r/22MtdFATs7pK4QgnFzmaUdEYa5qZfh/MgXevniLcUlxIFI6Zkx PFHV40eJRcKkpc+x9HCx8MXMmUZyZGRgaGvBqlRM/4l3gROtcU+7kJ2FDaTRPPVdpyFU +QSg== X-Gm-Message-State: AOJu0YyRdsuVAzA09s58soZcBQ++eXcZDC54k85mGzbVid3D6v6RSsUj /e3hLhGNOit7/R9RdHfDQL6XQiyb76+nX98r/6skQkpMJl60bI6hmAQJcPja4w== X-Gm-Gg: AfdE7cmAC9HZdsWf/xiOc4SfRadAMTAPbVhcOU1OTe81BOgWZFuLgquneD9kFdqr13O bSaIQnMaGdP0yR+8sgt6vCVG1+4hbpatYbBLg08dJQ96YbA/+a11QSZQPUGO0qXvONknd/3Lz9P b/cJneN0UnZc2Rf6RNG3IwvWesCypnTzOlSnEQoroVhFa6F4mMMRmaMcOacQ7WWl4K8vehIr3Wv JYWKGQzR3AXcVSwKqnjiuhdAGQa3F/4Ayb5K0sjShmzgdORmbQ+uceoajMjFKyljOexOrFGV7pK TnXVo+ClA49NRAyTfENqkJLUPv27hoi/rBb22oCSPvqB2NdrZ5Hjbm48g1yMGIZYHhIlZYluflJ 2y8mHl5BhpHYj6qcf2yomG4eBuBbgYPJTJStH1UXOIFDEdmNkKbKHYknLpJUZlM7blIlgK2nPLt ZHOQFQW4+PF3PzS7VUq8qNNFKnoijHZuwxqf5+28ys+5+DcE29ipNthik= X-Received: by 2002:a05:6a21:3f92:b0:3bf:d487:4b41 with SMTP id adf61e73a8af0-3bfd48752fbmr3151298637.36.1782877849652; Tue, 30 Jun 2026 20:50:49 -0700 (PDT) Received: from hcdev-d520mt2.. (60-250-196-139.hinet-ip.hinet.net. [60.250.196.139]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c9bbd27a924sm2429089a12.14.2026.06.30.20.50.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 20:50:49 -0700 (PDT) From: a0282524688@gmail.com To: lee@kernel.org, Ming Yu Cc: linux-kernel@vger.kernel.org, Ming Yu Subject: [PATCH v6 3/7] mfd: nct6694: Rename USB transport functions with _usb_ prefix Date: Wed, 1 Jul 2026 11:50:21 +0800 Message-Id: <20260701035025.3082927-4-a0282524688@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260701035025.3082927-1-a0282524688@gmail.com> References: <20260701035025.3082927-1-a0282524688@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Ming Yu Rename nct6694_{read,write,err_handling}_msg() to carry an `_usb_` prefix, marking them as USB transport-specific. This prepares for the core layer and HIF (eSPI) transport added in later patches. Add transitional static inline wrappers nct6694_{read,write}_msg() in the shared header so sub-device drivers remain untouched in this commit; they will be replaced by the transport dispatch layer in a subsequent patch. No functional change. Signed-off-by: Ming Yu --- Changes in v6: - New patch replacing the v5 function-pointer transport abstraction: rename the exported I/O functions with an _usb_ prefix and add transitional inline nct6694_{read,write}_msg() wrappers in the shared header so sub-device drivers stay untouched in this commit. drivers/mfd/nct6694.c | 40 ++++++++++++++++++++----------------- include/linux/mfd/nct6694.h | 22 ++++++++++++++++++-- 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/drivers/mfd/nct6694.c b/drivers/mfd/nct6694.c index 58c1cbcbe3f2..7c6b986db7f7 100644 --- a/drivers/mfd/nct6694.c +++ b/drivers/mfd/nct6694.c @@ -43,7 +43,7 @@ struct nct6694_usb_data { __le32 *int_buffer; }; -static const struct mfd_cell nct6694_devs[] = { +static const struct mfd_cell nct6694_usb_devs[] = { MFD_CELL_NAME("nct6694-gpio"), MFD_CELL_NAME("nct6694-gpio"), MFD_CELL_NAME("nct6694-gpio"), @@ -79,7 +79,7 @@ static const struct mfd_cell nct6694_devs[] = { MFD_CELL_NAME("nct6694-rtc"), }; -static int nct6694_response_err_handling(struct nct6694 *nct6694, unsigned char err_status) +static int nct6694_usb_err_handling(struct nct6694 *nct6694, unsigned char err_status) { switch (err_status) { case NCT6694_NO_ERROR: @@ -104,7 +104,7 @@ static int nct6694_response_err_handling(struct nct6694 *nct6694, unsigned char } /** - * nct6694_read_msg() - Read message from NCT6694 device + * nct6694_usb_read_msg() - Read message from NCT6694 device * @nct6694: NCT6694 device pointer * @cmd_hd: command header structure * @buf: buffer to store the response data @@ -115,7 +115,9 @@ static int nct6694_response_err_handling(struct nct6694 *nct6694, unsigned char * * Return: Negative value on error or 0 on success. */ -int nct6694_read_msg(struct nct6694 *nct6694, const struct nct6694_cmd_header *cmd_hd, void *buf) +int nct6694_usb_read_msg(struct nct6694 *nct6694, + const struct nct6694_cmd_header *cmd_hd, + void *buf) { struct nct6694_usb_data *udata = nct6694->priv; union nct6694_usb_msg *msg = udata->usb_msg; @@ -151,12 +153,12 @@ int nct6694_read_msg(struct nct6694 *nct6694, const struct nct6694_cmd_header *c return -EIO; } - return nct6694_response_err_handling(nct6694, msg->response_header.sts); + return nct6694_usb_err_handling(nct6694, msg->response_header.sts); } -EXPORT_SYMBOL_GPL(nct6694_read_msg); +EXPORT_SYMBOL_GPL(nct6694_usb_read_msg); /** - * nct6694_write_msg() - Write message to NCT6694 device + * nct6694_usb_write_msg() - Write message to NCT6694 device * @nct6694: NCT6694 device pointer * @cmd_hd: command header structure * @buf: buffer containing the data to be sent @@ -166,7 +168,9 @@ EXPORT_SYMBOL_GPL(nct6694_read_msg); * * Return: Negative value on error or 0 on success. */ -int nct6694_write_msg(struct nct6694 *nct6694, const struct nct6694_cmd_header *cmd_hd, void *buf) +int nct6694_usb_write_msg(struct nct6694 *nct6694, + const struct nct6694_cmd_header *cmd_hd, + void *buf) { struct nct6694_usb_data *udata = nct6694->priv; union nct6694_usb_msg *msg = udata->usb_msg; @@ -208,11 +212,11 @@ int nct6694_write_msg(struct nct6694 *nct6694, const struct nct6694_cmd_header * return -EIO; } - return nct6694_response_err_handling(nct6694, msg->response_header.sts); + return nct6694_usb_err_handling(nct6694, msg->response_header.sts); } -EXPORT_SYMBOL_GPL(nct6694_write_msg); +EXPORT_SYMBOL_GPL(nct6694_usb_write_msg); -static void usb_int_callback(struct urb *urb) +static void nct6694_usb_int_callback(struct urb *urb) { struct nct6694 *nct6694 = urb->context; __le32 *status_le = urb->transfer_buffer; @@ -358,7 +362,7 @@ static int nct6694_usb_probe(struct usb_interface *iface, } usb_fill_int_urb(udata->int_in_urb, udev, usb_rcvintpipe(udev, NCT6694_INT_IN_EP), - udata->int_buffer, sizeof(*udata->int_buffer), usb_int_callback, + udata->int_buffer, sizeof(*udata->int_buffer), nct6694_usb_int_callback, nct6694, int_endpoint->bInterval); ret = usb_submit_urb(udata->int_in_urb, GFP_KERNEL); @@ -367,7 +371,7 @@ static int nct6694_usb_probe(struct usb_interface *iface, usb_set_intfdata(iface, nct6694); - ret = mfd_add_hotplug_devices(dev, nct6694_devs, ARRAY_SIZE(nct6694_devs)); + ret = mfd_add_hotplug_devices(dev, nct6694_usb_devs, ARRAY_SIZE(nct6694_usb_devs)); if (ret) goto err_mfd; @@ -401,20 +405,20 @@ static void nct6694_usb_disconnect(struct usb_interface *iface) usb_free_urb(udata->int_in_urb); } -static const struct usb_device_id nct6694_ids[] = { +static const struct usb_device_id nct6694_usb_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(NCT6694_VENDOR_ID, NCT6694_PRODUCT_ID, 0xFF, 0x00, 0x00) }, { } }; -MODULE_DEVICE_TABLE(usb, nct6694_ids); +MODULE_DEVICE_TABLE(usb, nct6694_usb_ids); static struct usb_driver nct6694_usb_driver = { - .name = "nct6694", - .id_table = nct6694_ids, + .name = "nct6694-usb", + .id_table = nct6694_usb_ids, .probe = nct6694_usb_probe, .disconnect = nct6694_usb_disconnect, }; module_usb_driver(nct6694_usb_driver); -MODULE_DESCRIPTION("Nuvoton NCT6694 core driver"); +MODULE_DESCRIPTION("Nuvoton NCT6694 USB transport driver"); MODULE_AUTHOR("Ming Yu "); MODULE_LICENSE("GPL"); diff --git a/include/linux/mfd/nct6694.h b/include/linux/mfd/nct6694.h index 3f5dd53f38de..43b51f243e8e 100644 --- a/include/linux/mfd/nct6694.h +++ b/include/linux/mfd/nct6694.h @@ -94,7 +94,25 @@ struct nct6694 { void *priv; }; -int nct6694_read_msg(struct nct6694 *nct6694, const struct nct6694_cmd_header *cmd_hd, void *buf); -int nct6694_write_msg(struct nct6694 *nct6694, const struct nct6694_cmd_header *cmd_hd, void *buf); +int nct6694_usb_read_msg(struct nct6694 *nct6694, + const struct nct6694_cmd_header *cmd_hd, + void *buf); +int nct6694_usb_write_msg(struct nct6694 *nct6694, + const struct nct6694_cmd_header *cmd_hd, + void *buf); + +static inline int nct6694_read_msg(struct nct6694 *nct6694, + const struct nct6694_cmd_header *cmd_hd, + void *buf) +{ + return nct6694_usb_read_msg(nct6694, cmd_hd, buf); +} + +static inline int nct6694_write_msg(struct nct6694 *nct6694, + const struct nct6694_cmd_header *cmd_hd, + void *buf) +{ + return nct6694_usb_write_msg(nct6694, cmd_hd, buf); +} #endif -- 2.34.1