Re: [PATCH v1 2/5] dt-bindings: soc: hpe: Add hpe,gxp-plreg
From: Krzysztof Kozlowski
Date: Tue Oct 25 2022 - 14:55:31 EST
On 25/10/2022 14:44, Hawkins, Nick wrote:
>> I understand what you want to achieve, but Devicetree does not seem a tool for that. DT describes the hardware characteristics, but not is exact memory map.
>
>> Although your goal differs than for example goal of some developer of I2C or MMIO device drivers, but essentially devices are similar. We do not describe memory map of MMIO or register map of I2C devices in DT.
>
>
>>> If this is not acceptable to do through the device tree, should we rely on having an include file for each platform instead?
>
>> I would say use rather standard Linux subsystems and problem is gone.
>> You have fan? Sure, we have subsystem for fans. You have power supply or battery - we have stuff for this as well.
>
> Greetings Krzysztof,
>
> Thanks for your feedback. In this case for something like fans as you suggest above would it be acceptable for the fans to call into plreg(the proposed driver) just to read the fan related registers with the fan driver knowing what offset to use? Multiple drivers will need to access registers in this memory range so I am trying to determine if they all need to map this area or all goto one source to read/write to it.
I don't know exactly what type of devices you represent in that plreg,
but in general the fan device would be the respective plreg. The same
with other pieces like hwmon, power supply.
Best regards,
Krzysztof