mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Tissoires <bentiss@kernel.org>
To: Michael Zaidman <michael.zaidman@gmail.com>
Cc: lee@kernel.org, linusw@kernel.org, jikos@kernel.org,
	brgl@kernel.org,  linux-input@vger.kernel.org,
	linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH 00/13] HID: ft260: add UART and GPIO support, plus I2C fixes
Date: Tue, 1 Sep 2026 16:02:53 +0200	[thread overview]
Message-ID: <apaLLD4ZXhNV-Dph@beelink> (raw)
In-Reply-To: <20260827222550.24634-1-michael.zaidman@gmail.com>

On Aug 28 2026, Michael Zaidman wrote:
> On Thu, 27 Aug 2026 at 21:51 +0100, Lee Jones wrote:
> > That's precisely what MFD is.  It's one chip, usually with a shared and
> > overlapping register spaces, that conducts multiple functions.  This is
> > no different to any other single-chip device or SoC.
> >
> > Shoving everything into a single driver isn't how things are done in
> > Linux.  This should be divided up into the associated sub-systems where
> > each part can be reviewed and looked after by the appropriate SMEs.
> 
> Understood, and I am not going to argue MFD scope with you. But this
> is not specific to my series, so I would rather not decide it here on
> my own.
> 
> drivers/hid already registers other subsystems' devices from a
> hid_driver: hid-cp2112 adds an i2c_adapter and a gpiochip, hid-mcp2221
> adds an i2c_adapter, a gpiochip and an IIO device, and hid-ft260 has
> hosted the I2C adapter since v5.13, commit 6a82582d9fa4 ("HID: ft260:
> add usb hid to i2c host bridge driver").
> 
> So the split you are asking for is not a change to this series. It
> means moving code that has been in drivers/hid since v5.13 into an MFD
> parent with cells, and the same reasoning would apply to cp2112 and
> mcp2221. I am willing to discuss that as its own conversion, but it
> needs the HID maintainers to agree on the direction first, and I do
> not think the UART and GPIO support should wait behind it.

I don't think Lee or Linus ever asked you to do any conversion of
existing drivers. Just show the example on how things should be done :)

If moving to MFD gives real benefits, these other drivers can be done
later.

> 
> It would also spread the driver over four trees, so a fix touching the
> shared chip state becomes a cross-tree series with coordinated merges
> between four maintainers - a cost the single driver does not have.
> 
> Jiri, Benjamin - this is your call. Do you want FT260 functionality to
> keep growing inside hid-ft260, as cp2112 and mcp2221 do today, or do
> you want a drivers/hid to MFD conversion for this class of USB HID
> bridge chips?

TBH, I'm not a big fan of having multiple subsystems children into HID.
Mostly because I can't review the best practive in each of them. However,
for quite a long time, HID was mostly for input devices, and input is a
different subsystem.

That being said, there are 2 types of HID devices:
- ones with defined standard usages (keyboards, mice, touchscreen,
	battery, etc) and using MFD for those would certainly be overthinking
- others use raw HID device with a custom protocol (cp2112, mcp2221,
	ft260), these could be MFD candidates

And of course, we have the exception with the standardly defined sensors
through hid-sensor-hub.c which goes through MFD :)

TL;DR: I'm not opposed to a MFD conversion of hid-ft260.c, nor I'm not
formally pushing towards it. I think we need to take the pragmatic
approach and see if the benefits for it are worth it.

From the description on how the ft260 works and the intrications between
all functions, this seems like a lot of pain to maintain a single core
MFD chip, but not having to maintain I2C, UART, GPIO is appealing.

The question about the cross tree merging is something that can't really
be discussed without having seen the code. Assuming you can split all
the drivers into their own subsystem + MFD HID parent, we could very
well merge the newly additions independently, assuming the MFD HID
parent API is stable enough. The only cross subsystem we need to take
care of today is the existing functionality, but that can be sorted out
by splitting the i2c_adapter part into its own file, and then let the
I2C maintainer move the file into their tree later.

It is maybe a lot to ask, but Michael, can you demo the MFD split on
one/two functionality so we can check which approach is the best?
Ideally 2 features that would be intricating well enough to demonstrate
how hard/easy it would be.

Cheers,
Benjamin

      reply	other threads:[~2026-09-01 14:02 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-22 21:39 Michael Zaidman
2026-08-22 21:39 ` [PATCH 01/13] HID: ft260: add serial driver Michael Zaidman
2026-08-25  7:49   ` Linus Walleij
2026-08-25  8:12   ` Linus Walleij
2026-08-27 19:16     ` Michael Zaidman
2026-08-22 21:39 ` [PATCH 02/13] HID: ft260: uart: bring-up fixes Michael Zaidman
2026-08-22 21:39 ` [PATCH 03/13] HID: ft260: add GPIO support on top of UART Michael Zaidman
2026-08-25  7:44   ` Linus Walleij
2026-08-27 20:39     ` Michael Zaidman
2026-08-22 21:39 ` [PATCH 04/13] HID: ft260: i2c: reduce driver module loading time Michael Zaidman
2026-08-22 21:39 ` [PATCH 05/13] HID: ft260: i2c: silence sysfs store big-numbers Michael Zaidman
2026-08-22 21:39 ` [PATCH 06/13] HID: ft260: i2c: reduce bus-error message severity Michael Zaidman
2026-08-22 21:39 ` [PATCH 07/13] HID: ft260: uart: enable flow control Michael Zaidman
2026-08-22 21:39 ` [PATCH 08/13] HID: ft260: uart: add modem pins control via ioctl Michael Zaidman
2026-08-25  8:08   ` Linus Walleij
2026-08-27 22:08     ` Michael Zaidman
2026-08-22 21:39 ` [PATCH 09/13] HID: ft260: gpio: group sysfs attrs per HID interface Michael Zaidman
2026-08-25  8:13   ` Linus Walleij
2026-08-27 20:50     ` Michael Zaidman
2026-08-22 21:39 ` [PATCH 10/13] HID: ft260: uart: fix active-low RTS/CTS/DTR/DSR polarity Michael Zaidman
2026-08-25  8:16   ` Linus Walleij
2026-08-27 21:08     ` Michael Zaidman
2026-08-22 21:39 ` [PATCH 11/13] HID: ft260: i2c: fix large write transaction failure Michael Zaidman
2026-08-22 21:39 ` [PATCH 12/13] HID: ft260: workaround for TN_189 errata endpoint STALL after enumeration Michael Zaidman
2026-08-22 21:39 ` [PATCH 13/13] HID: ft260: i2c: abort in-flight transfers with STOP before reset Michael Zaidman
2026-08-25  8:21 ` [PATCH 00/13] HID: ft260: add UART and GPIO support, plus I2C fixes Linus Walleij
2026-08-27 13:27   ` Lee Jones
2026-08-27 18:53     ` Michael Zaidman
2026-08-27 20:51       ` Lee Jones
2026-08-27 22:25         ` Michael Zaidman
2026-09-01 14:02           ` Benjamin Tissoires [this message]

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=apaLLD4ZXhNV-Dph@beelink \
    --to=bentiss@kernel.org \
    --cc=brgl@kernel.org \
    --cc=jikos@kernel.org \
    --cc=lee@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.zaidman@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®