On Tuesday, June 14, 2016 at 9:49:47 PM UTC+3, Maxime Ripard wrote: > > Hi, > > On Tue, Jun 14, 2016 at 04:33:38PM +0200, Ene Alexandru wrote: > > Add detailed documentation regarding the new axp20x_usb_power parameters > > > > Signed-off-by: Ene Alexandru <[email protected] <javascript:>> > > --- > > .../bindings/power_supply/axp20x_usb_power.txt | 32 > ++++++++++++++++++++ > > 1 file changed, 32 insertions(+) > > > > diff --git > a/Documentation/devicetree/bindings/power_supply/axp20x_usb_power.txt > b/Documentation/devicetree/bindings/power_supply/axp20x_usb_power.txt > > index 862f4a4..ebce8ca 100644 > > --- > a/Documentation/devicetree/bindings/power_supply/axp20x_usb_power.txt > > +++ > b/Documentation/devicetree/bindings/power_supply/axp20x_usb_power.txt > > @@ -5,6 +5,35 @@ Required Properties: > > > > This node is a subnode of the axp20x PMIC. > > > > +The following 3 parameters are configurable from the device-tree: > > + - vhold-enable > > + - this field, if present will enable the VBUS protection > feature > > + - the protection feature will disconnect V_USB is the > input voltage is under the vhold-set limit > > + and / or the current is over the ibus-limit > > + - accepted values: > > + - 0 : disabled > > + - 1 : enabled > > + > > + - vhold-set > > + - this field configures the V_USB undervoltage limit > > + - if this power path is enabled and V_USB falls bellow > the configured values, the power path will be disabled > > + - available values are from 4000000uV to 4700000uV in > 100000uV increments > > + - the default value is 4400000uV > > + - values out of range are ignored > > + > > + - ibus-limit > > + - this field configures the maximum current the board is > allowed to draw from V_USB > > + - available values are: > > + - 100000uA > > + - 500000uA > > + - 900000uA > > + - any other value will disable the ibus-limit > check > > + > > +If any of the above fields it's not present, then it's corresponding > hardware setting is not altered. > > +For example, if you want to enable the protection feature but keep the > hardware default values you can leave only "vhold-enable = <0x01>" in the > configuration field. > > +If you want to keep the current settings you can ommit all 3 > parameters. > > There's already everything needed in the power_supply framework to > change that, why would you want to do this in the device tree? > > Maxime > > -- > Maxime Ripard, Free Electrons > Embedded Linux, Kernel and Android engineering > http://free-electrons.com >
Hello I know that this can be implemented by providing proper write interfaces via the power supply class but I am not aware of any application that will properly configure the power supply to board specific values once the system is up. The reason behind this patch and some other that i have in mind is that one of my boards and psu got damaged after switching from the 3.4 allwinner kernel to the mainline one: the axp chip was properly configured in the .fex file but it's left to the default values that might not be safe in the linux-sunxi drivers ( and were not in my set-up ) This patch is intended to provide a way to configure some of the AXP20x registers to a proper state as fast as possible after boot. Some of the boards might have hardware limitation regarding the maximum power the board can draw from the USB VCC line ( connector / layout / protection circuits in line, etc). If it gets approved then board vendors / users can add proper limits for each hardware implementation. Adding write support via the /sys/class/... interface is the next step i have planned, but i decided to go with this one first. Best regards, Alexandru -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
