On Tue, Nov 05, 2024 at 10:07:51AM +0100, Marek Behún wrote: > On Mon, Nov 04, 2024 at 04:51:24PM +0200, Andy Shevchenko wrote: > > On Mon, Nov 04, 2024 at 03:19:14PM +0100, Marek Behún wrote: ... > > I'm wondering why the MCU driver (and node) is not represented as syscon > > (with some regmap beneath it). > > > > In such a case it would be something like > > > > foo = syscon_regmap_lookup_by_compatible(); > > > > here instead of all these dances. > > Hi Andy, > > the MCU interface is command-reply oriented. It is incompatible with > regmap. I'm not sure I understand the impediment here. There are plenty of hardware that uses the similar approach and well compatible with regmap (assuming custom ->read*() / ->write*() callbacks)... > I investigated this back in 2019 and explained to Jacek why it > is not possible, but can't find the e-mail on mailing lists, so I am > attaching it. ...but I'm not insisting you to revisit this right now, just maybe you can think more about this again at some point. > So regmap is most probably not possible, unless things changed. > > It is possible to add MCU node to the DT binding and find the device > that way. But if the device-tree does not contain the MCU node, the > driver would still have to fall back to this dance, for backwards > compatibility. Otherwise it would not be able to determine whether gamma > correction is supported with old device tree, as it does currently. > > I guess I could break backwards compatibility with old device tree with > this small feature. I don't think there are any users that don't use > TurrisOS, do upgrade the kernel, but don't upgrade the device-tree... -- With Best Regards, Andy Shevchenko