regulator: cpr-regulator: add debugfs support for multiple devices
The cpr_enable module parameter is currently tied to a global
pointer, the_cpr, which corresponds to the last cpr-regulator
device probed. This means that it is not possible to enable or
disable the CPR controller for the cpr-regulator devices that
probed first.
Remove the the_cpr pointer and the cpr_enable module parameter.
Replace them with a debugfs node for each cpr-regulator device
which can be used to enable and disable CPR individually.
Also fix the callback for the existing debug_info debugfs node
since it depends upon the_cpr.
New Debug Interface:
/sys/module/cpr_regulator/parameters/debug_enable
Integer in which bit 0 enables kernel log messages
generated when handling CPR interrupts and bit 1 enables
other cpr-regulator log messages. This parameter affects
all cpr-regulator devices.
/sys/kernel/debug/regulator/<regulator-name>/cpr_enable
Integer which controls whether or not CPR is enabled for
a particular cpr-regulator device. A value of 0
corresponds to CPR disabled and a value of 1 corresponds
to CPR enabled. <regulator-name> corresponds to
the name of the cpr-regulator device which is specified
via the regulator-name device tree property.
/sys/kernel/debug/regulator/<regulator-name>/debug_info
CPR status information for a particular cpr-regulator
device. <regulator-name> corresponds to the name of the
cpr-regulator device which is specified via the
regulator-name device tree property.
Old Debug Interface:
/sys/module/cpr_regulator/parameters/debug_enable
Integer in which bit 0 enables kernel log messages
generated when handling CPR interrupts and bit 1 enables
other cpr-regulator log messages. This parameter affects
all cpr-regulator devices.
/sys/module/cpr_regulator/parameters/cpr_enable
Integer which controls whether or not CPR is enabled for
the last cpr-regulator device probed. A value of 0
corresponds to CPR disabled and a value of 1 corresponds
to CPR enabled. This parameter incorrectly does not
control the CPR enable state for the first cpr-regulator
devices probed.
/sys/kernel/debug/regulator/<regulator-name>/debug_info
CPR status information for the last cpr-regulator device
probed (regardless of which cpr-regulator device it seems
to be associated with). <regulator-name> corresponds to
the name of the cpr-regulator device which is specified
via the regulator-name device tree property.
Change-Id: I404ebdb3180f7dd9ae095867f7545d274be29e62
Signed-off-by:
David Collins <collinsd@codeaurora.org>
Loading
Please register or sign in to comment