Skip to content
Snippets Groups Projects
Forked from Reform / reform-boundary-uboot
24341 commits behind the upstream repository.
  • Hans de Goede's avatar
    6c727e09
    sunxi: gpio: Add support for gpio pins on the AXP209 pmic · 6c727e09
    Hans de Goede authored
    
    Some boards use GPIO-s on the pmic, one example of this is the A13-OLinuXino
    board, which uses gpio0 of the axp209 for the lcd-power signal.
    
    This commit adds support for gpio pins on the AXP209 pmic, the sunxi_gpio.c
    changes are universal, adding gpio support for the other AXP pmics (when
    necessary) should be a matter of adding the necessary axp_gpio_foo functions
    to their resp. drivers, and add "#define AXP_GPIO" to their header file.
    
    Note this commit only adds support for the non device-model version of the
    gpio code, patches for adding support to the device-model version are very
    welcome.
    
    The string representation for these gpio-s is AXP0-#, the 0 in the AXP0 prefix
    is there in case we need to support gpio-s on more then 1 pmic in the future.
    At least A80 boards have 2 pmics, and we may end up needing to support gpio-s
    on both.
    
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Acked-by: default avatarIan Campbell <ijc@hellion.org.uk>
    6c727e09
    History
    sunxi: gpio: Add support for gpio pins on the AXP209 pmic
    Hans de Goede authored
    
    Some boards use GPIO-s on the pmic, one example of this is the A13-OLinuXino
    board, which uses gpio0 of the axp209 for the lcd-power signal.
    
    This commit adds support for gpio pins on the AXP209 pmic, the sunxi_gpio.c
    changes are universal, adding gpio support for the other AXP pmics (when
    necessary) should be a matter of adding the necessary axp_gpio_foo functions
    to their resp. drivers, and add "#define AXP_GPIO" to their header file.
    
    Note this commit only adds support for the non device-model version of the
    gpio code, patches for adding support to the device-model version are very
    welcome.
    
    The string representation for these gpio-s is AXP0-#, the 0 in the AXP0 prefix
    is there in case we need to support gpio-s on more then 1 pmic in the future.
    At least A80 boards have 2 pmics, and we may end up needing to support gpio-s
    on both.
    
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Acked-by: default avatarIan Campbell <ijc@hellion.org.uk>
axp209.h 684 B
/*
 * (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
 *
 * SPDX-License-Identifier:	GPL-2.0+
 */

#define AXP_GPIO

extern int axp209_set_dcdc2(int mvolt);
extern int axp209_set_dcdc3(int mvolt);
extern int axp209_set_ldo2(int mvolt);
extern int axp209_set_ldo3(int mvolt);
extern int axp209_set_ldo4(int mvolt);
extern int axp209_init(void);
extern int axp209_poweron_by_dc(void);
extern int axp209_power_button(void);

extern int axp_gpio_direction_input(unsigned int pin);
extern int axp_gpio_direction_output(unsigned int pin, unsigned int val);
extern int axp_gpio_get_value(unsigned int pin);
extern int axp_gpio_set_value(unsigned int pin, unsigned int val);