Re: [PATCH v7 07/10] phy: qualcomm: eusb2-repeater: Migrate to devm_spmi_subdevice_alloc_and_add()

From: AngeloGioacchino Del Regno

Date: Wed Jan 14 2026 - 04:26:45 EST


Il 14/01/26 09:59, Andy Shevchenko ha scritto:
On Wed, Jan 14, 2026 at 09:39:54AM +0100, AngeloGioacchino Del Regno wrote:
Some Qualcomm PMICs integrate an USB Repeater device, used to
convert between eUSB2 and USB 2.0 signaling levels, reachable
in a specific address range over SPMI.

Instead of using the parent SPMI device (the main PMIC) as a kind
of syscon in this driver, register a new SPMI sub-device for EUSB2
and initialize its own regmap with this sub-device's specific base
address, retrieved from the devicetree.

This allows to stop manually adding the register base address to
every R/W call in this driver, as this can be, and is now, handled
by the regmap API instead.

Same comments and actually one more.

...

+ struct regmap_config eusb2_regmap_config = {
+ .reg_bits = 16,
+ .val_bits = 8,
+ .max_register = 0x100,
+ .fast_io = true,
+ };

This is third time of the same. Make it part of SPMI core and export to
the users. Or are they semantically different like different slices?
In that case you can export it under generic name like

spmi_default_slice_regmap_config


There are more complicated devices around that I didn't port to the new
spmi subdevices, and I really don't want to make a default for now.

At least some of those need different params (including some MediaTek ones
that are not upstream yet).

Can we please let this in and *then* see how much can be commonized after
the majority of more complicated drivers are migrated in the future?

Regards,
Angelo