Right place for pmic powermeter code

From: Dzmitry Sankouski
Date: Fri Sep 22 2023 - 09:31:24 EST


I'm working on pmic s2dos05 driver. It's basically a voltage regulator
with ADC capable
of measuring current and power. It is used in portable electronic
devices, like smartphones,
for example powering display and touchscreen in Samsung Galaxy S9, so the phone
is able to estimate display power consumption. In the vendor kernel,
it just has a bunch of
sysfs attributes, and the measuring code in the regulator folder.

Where is the right place to put regulator power code, and where to
expose it in sysfs?