aboutsummaryrefslogtreecommitdiff
path: root/drivers/power/axp818.c
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2016-05-02 10:28:12 +0800
committerHans de Goede <hdegoede@redhat.com>2016-05-25 17:52:39 +0200
commit15278ccb848dbcd8825874f943bc21afda987219 (patch)
tree98526b20799ef16c414bf990e99dc26899d4e967 /drivers/power/axp818.c
parenta696253c1daf3424408868fc76840c83a896acfe (diff)
downloadu-boot-15278ccb848dbcd8825874f943bc21afda987219.zip
u-boot-15278ccb848dbcd8825874f943bc21afda987219.tar.gz
u-boot-15278ccb848dbcd8825874f943bc21afda987219.tar.bz2
sunxi: power: axp818: Add support for switch SW
The AXP818 has a switchable output, SW. This is commonly used for controlling power to the LCD backlight. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/power/axp818.c')
-rw-r--r--drivers/power/axp818.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/power/axp818.c b/drivers/power/axp818.c
index 3ac05ff..bf6ecd6 100644
--- a/drivers/power/axp818.c
+++ b/drivers/power/axp818.c
@@ -225,6 +225,16 @@ int axp_set_fldo(int fldo_num, unsigned int mvolt)
AXP818_OUTPUT_CTRL3_FLDO1_EN << (fldo_num - 1));
}
+int axp_set_sw(bool on)
+{
+ if (on)
+ return pmic_bus_setbits(AXP818_OUTPUT_CTRL2,
+ AXP818_OUTPUT_CTRL2_SW_EN);
+
+ return pmic_bus_clrbits(AXP818_OUTPUT_CTRL2,
+ AXP818_OUTPUT_CTRL2_SW_EN);
+}
+
int axp_init(void)
{
u8 axp_chip_id;