power: bq24257: Allow input current limit sysfs access
authorAndreas Dannenberg <dannenberg@ti.com>
Mon, 28 Sep 2015 22:33:59 +0000 (17:33 -0500)
committerSebastian Reichel <sre@kernel.org>
Tue, 29 Sep 2015 14:54:52 +0000 (16:54 +0200)
commit0cfbfde65aec4cd9ae4e7971f8a3e42c69e8e24f
tree5f0b0cc925d6b0b9b778c52dfbfe1f85bd4ca56c
parent138606ffe45511fa774e51df04f6da562ff9c44d
power: bq24257: Allow input current limit sysfs access

This patch allows reading and writing of the input current limit through
the power supply's input_current_limit sysfs property. This allows
userspace to see what charger was detected (if the D+/D- USB signal-
based charger type detection is enabled) and to re-configure the maximum
current drawn from the external supply at runtime based on system-level
knowledge or user input. Note that upon charger disconnection and
re-connection the limit configured through firmware becomes active again
(or the D+/D- USB signal-based charger detection will be run again).

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/bq24257_charger.c