From: sashiko-bot@kernel.org
To: "Michael Zaidman" <michael.zaidman@gmail.com>
Cc: linux-input@vger.kernel.org, linux-serial@vger.kernel.org,
linux-gpio@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH v4 03/16] HID: ft260: add GPIO support
Date: Tue, 17 Nov 2026 20:23:52 +0000 [thread overview]
Message-ID: <sashiko-outbox-219595@kernel.org> (raw)
In-Reply-To: <20261117200423.19561-4-michael.zaidman@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] HID: ft260: unused gpio state field and macros in
ft260_gpio_init()
--
commit 8d81adc5ba43eb8c745172cf336bbd09bc7bc28f
Author: Michael Zaidman <michael.zaidman@gmail.com>
HID: ft260: add GPIO support
This commit adds gpiochip support for the FT260 multifunctional pins,
exposes pin function selection via sysfs, and tracks enabled GPIOs across
UART modes.
> diff --git a/drivers/hid/hid-ft260.c b/drivers/hid/hid-ft260.c
> index 869e7b924b30a..acd92248256f9 100644
> --- a/drivers/hid/hid-ft260.c
> +++ b/drivers/hid/hid-ft260.c
[ ... ]
> @@ -57,6 +59,11 @@ MODULE_PARM_DESC(debug, "Toggle FT260 debugging messages");
> #define FT260_RD_DATA_MAX 180
> #define FT260_WR_I2C_DATA_MAX 60
> #define FT260_WR_UART_DATA_MAX 60
> +#define FT260_GPIOCHIP "ft260_gpio"
> +#define FT260_GPIO_0_5_COUNT 6
> +#define FT260_GPIO_A_H_COUNT 8
> +#define FT260_GPIO_TOTAL (FT260_GPIO_0_5_COUNT + FT260_GPIO_A_H_COUNT)
> +#define FT260_GPIO_MASK GENMASK(FT260_GPIO_TOTAL - 1, 0)
[ ... ]
> +/* GPIO groups */
> +#define FT260_GPIO_WAKEUP FT260_GPIO_3
> +#define FT260_GPIO_I2C_DEFAULT (FT260_GPIO_0 | FT260_GPIO_1)
[ ... ]
> @@ -359,6 +470,11 @@ struct ft260_device {
> u16 read_idx;
> u16 read_len;
> u16 clock;
> + u16 gpio_en;
> + struct gpio_chip gc;
> + struct ft260_gpio_state gpio;
> + u16 gpio_uart_mode[FT260_GPIO_UART_MODES];
> + bool uart_dcd_ri;
> };
[ ... ]
> +static int ft260_gpio_init(struct ft260_device *dev,
> + struct ft260_get_system_status_report *cfg)
> +{
[ ... ]
> + /* Wakeup chip */
> + (void)ft260_hid_feature_report_get(dev->hdev, FT260_CHIP_VERSION,
> + (u8 *)&ver, sizeof(ver));
> +
> + ret = ft260_hid_feature_report_get(hdev, FT260_GPIO, (u8 *)&gbuf,
> + sizeof(gbuf));
> + if (ret < 0)
> + hid_warn(hdev, "cannot read GPIO state: %d\n", ret);
> + else
> + dev->gpio = gbuf.gpio;
[Severity: Low]
Is dev->gpio (along with this FT260_GPIO feature report read in
ft260_gpio_init()) still needed now that ft260_gpio_set() and
ft260_gpio_direction_set() read FT260_GPIO from the chip before modifying a
pin?
dev->gpio is written in ft260_gpio_init(), ft260_gpio_set(), and
ft260_gpio_direction_set(), but never read in this commit. Although commit
"HID: ft260: uart: add modem pins control via ioctl" briefly reads
port->gpio in ft260_uart_tiocmset(), commit "HID: ft260: i2c: recover a bus
held by a slave" changes ft260_uart_tiocmset() to read FT260_GPIO directly
from the chip as well, leaving dev->gpio write-only at the end of the
series.
Also, FT260_GPIOCHIP and FT260_GPIO_WAKEUP are unused because
ft260_gpio_init() formats dev->gc.label with devm_kasprintf() and checks
enable_wakeup_int with FT260_GPIO_3 directly.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261117200423.19561-1-michael.zaidman@gmail.com?part=3
next prev parent reply other threads:[~2026-11-17 20:23 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 20:04 [PATCH v4 00/16] HID: ft260: add UART and GPIO support, plus I2C fixes Michael Zaidman
2026-11-17 20:04 ` [PATCH v4 01/16] HID: ft260: add serial driver Michael Zaidman
2026-11-17 20:32 ` sashiko-bot
2026-11-18 7:21 ` Jiri Slaby
2026-11-17 20:04 ` [PATCH v4 02/16] HID: ft260: uart: fix " Michael Zaidman
2026-11-17 20:49 ` sashiko-bot
2026-11-17 20:04 ` [PATCH v4 03/16] HID: ft260: add GPIO support Michael Zaidman
2026-11-17 20:23 ` sashiko-bot [this message]
2026-11-17 20:04 ` [PATCH v4 04/16] HID: ft260: i2c: reduce driver module loading time Michael Zaidman
2026-11-17 20:11 ` sashiko-bot
2026-11-17 20:04 ` [PATCH v4 05/16] HID: ft260: fix sysfs store failure notice for big numbers Michael Zaidman
2026-11-17 20:12 ` sashiko-bot
2026-11-17 20:04 ` [PATCH v4 06/16] HID: ft260: i2c: reduce bus-error message severity Michael Zaidman
2026-11-17 20:13 ` sashiko-bot
2026-11-17 20:04 ` [PATCH v4 07/16] HID: ft260: uart: enable flow control Michael Zaidman
2026-11-17 20:21 ` sashiko-bot
2026-11-17 20:04 ` [PATCH v4 08/16] HID: ft260: uart: add modem pins control via ioctl Michael Zaidman
2026-11-17 20:24 ` sashiko-bot
2026-11-17 23:56 ` Maarten Brock
2026-11-17 20:04 ` [PATCH v4 09/16] HID: ft260: group sysfs attrs per HID interface Michael Zaidman
2026-11-17 20:30 ` sashiko-bot
2026-11-17 20:04 ` [PATCH v4 10/16] HID: ft260: i2c: fix large write transaction failure Michael Zaidman
2026-11-17 20:30 ` sashiko-bot
2026-11-17 20:04 ` [PATCH v4 11/16] HID: ft260: workaround for TN_189 errata endpoint STALL after enumeration Michael Zaidman
2026-11-17 20:50 ` sashiko-bot
2026-11-17 20:04 ` [PATCH v4 12/16] HID: ft260: i2c: abort in-flight transfers with STOP before reset Michael Zaidman
2026-11-17 20:33 ` sashiko-bot
2026-11-17 20:04 ` [PATCH v4 13/16] HID: ft260: i2c: reject an I2C clock outside the supported range Michael Zaidman
2026-11-17 20:34 ` sashiko-bot
2026-11-17 20:04 ` [PATCH v4 14/16] HID: ft260: i2c: fix i2c_reset sysfs store return value Michael Zaidman
2026-11-17 20:35 ` sashiko-bot
2026-11-17 20:04 ` [PATCH v4 15/16] HID: ft260: i2c: recover a bus held by a slave Michael Zaidman
2026-11-17 20:44 ` sashiko-bot
2026-11-17 20:04 ` [PATCH v4 16/16] HID: ft260: use lock guards Michael Zaidman
2026-11-17 20:36 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-219595@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=michael.zaidman@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.