Re: [PATCH 08/10] pinctrl: cs42l43: Add support for the cs42l43

From: Charles Keepax
Date: Fri May 12 2023 - 11:54:49 EST


On Fri, May 12, 2023 at 05:30:37PM +0200, Krzysztof Kozlowski wrote:
> On 12/05/2023 14:28, Charles Keepax wrote:
> > + priv->gpio_chip.fwnode = dev_fwnode(cs42l43->dev);
> > +
> > + if (is_of_node(dev_fwnode(cs42l43->dev))) {
> > + device_set_node(priv->dev,
> > + fwnode_get_named_child_node(dev_fwnode(cs42l43->dev),
> > + "pinctrl"));
>
> That's something unusual. It seems you want to bind to a DT node because
> you miss compatible in DT node?
>

Kinda, I don't really want to add multiple compatibles for the
device. This is just a CODEC device, even in device tree it
seems a little weird to have multiple compatibles for a single
I2C device. On ACPI I am pretty sure it would be considered flat
out right wrong. The fact Linux supports the device using multiple
drivers is seemed to be a Linux implementation detail, rather than
describing the hardware.

The original (internal) version of the patches just had a single
firmware node, but the DT schema would not verify because the
node is both a pinctrl node and a spi node. And the pinctrl
schema requires the node to be called "pinctrl" and the spi
requires it to be called "spi", it is impossible to satisfy both.

Any advice/guidance you had on this one would be greatly
appreciated?

> > + } else {
> > + device_set_node(priv->dev, dev_fwnode(cs42l43->dev));
> > + }
> > +
> > + pm_runtime_enable(priv->dev);
> > + pm_runtime_idle(priv->dev);
> > +
>
> > +MODULE_DESCRIPTION("CS42L43 Pinctrl Driver");
> > +MODULE_AUTHOR("Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>");
> > +MODULE_LICENSE("GPL");
> > +MODULE_ALIAS("platform:cs42l43-pinctrl");
>
> Same comment, so I guess you have this pattern everywhere.

Yeah this is not problem to fix up, I was just unaware using the
id_table was preferrable for MFD components, there are a lot of
devices doing it both ways.

Thanks,
Charles