Re: [PATCH 06/10] mfd: cs42l43: Add support for cs42l43 core driver

From: Pierre-Louis Bossart
Date: Thu May 18 2023 - 11:53:30 EST



>>> + ret = regmap_register_patch(cs42l43->regmap, cs42l43_reva_patch,
>>> + ARRAY_SIZE(cs42l43_reva_patch));
>>> + if (ret) {
>>> + dev_err(cs42l43->dev, "Failed to apply register patch: %d\n", ret);
>>> + goto err;
>>> + }
>>> +
>>> + pm_runtime_mark_last_busy(cs42l43->dev);
>>> + pm_runtime_put_autosuspend(cs42l43->dev);
>>> +
>>> + ret = devm_mfd_add_devices(cs42l43->dev, PLATFORM_DEVID_NONE,
>>> + cs42l43_devs, ARRAY_SIZE(cs42l43_devs),
>>
>> I don't why adding devices is not in probe. They use the same regmap
>> right? So there will be no problem in probing them from MFD probe.
>
> Well except SoundWire is a bit of a special boy, the hardware is
> not necessarily available in probe, the hardware is only available
> at some point later when the device attaches. Doing it this way all
> of the attaching (and various detach/attach cycles the device needs
> during configuration) are over by the time the child drivers bind, so
> they don't all need special code to handle that.

if the devices are added in the probe, then the regmap needs to be moved
to cache-only and another special API would be needed to tell the MFD
framework to turn the regmap cache-only off.

But if it's the same regmap, the regmap cache is handled in the
SoundWire update_status callback so maybe Krzysztof's proposal does work?