rockchip: gru: pass the gpio power supply enable pin to bl31
we need to disable some regulator when device into suspend, it mean we need to pass some gpio to bl31, and disable these gpios when bl31 run suspend function. BRANCH=None BUG=chrome-os-partner:56423 TEST=enter suspend, measure suspend gpio go to low Change-Id: I03d0407e0ef035823519a997534dcfea078a7ccd Signed-off-by: Lin Huang <hl@rock-chips.com> Reviewed-on: https://chromium-review.googlesource.com/374046 Commit-Ready: Caesar Wang <wxt@rock-chips.com> Tested-by: Caesar Wang <wxt@rock-chips.com> Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
parent
703559d5dd
commit
0f3332ef21
2 changed files with 46 additions and 0 deletions
|
|
@ -25,6 +25,9 @@
|
|||
#define GPIO_POWEROFF GPIO(1, A, 6)
|
||||
#define GPIO_RESET GPIO(0, B, 3)
|
||||
#define GPIO_WP GPIO(1, C, 2)
|
||||
#define GPIO_P15V_EN GPIO(0, B, 2)
|
||||
#define GPIO_P30V_EN GPIO(0, B, 4)
|
||||
#define GPIO_P18V_AUDIO_PWREN GPIO(0, A, 2)
|
||||
|
||||
void setup_chromeos_gpios(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,48 @@ static void configure_emmc(void)
|
|||
rkclk_configure_emmc();
|
||||
}
|
||||
|
||||
static void register_gpio_suspend(void)
|
||||
{
|
||||
/*
|
||||
* these 3 pin to disable gpio2 ~ gpio4 1.5v, 1.8v, 3.3v power supply
|
||||
* so need to shut down the power supply from high voltage to
|
||||
* low voltage, and consider register_bl31() appends to the front off
|
||||
* the list, we should register 1.5v enable pin to 3.3v enable pin
|
||||
*/
|
||||
static struct bl31_gpio_param param_p15_en = {
|
||||
.h = {
|
||||
.type = PARAM_SUSPEND_GPIO,
|
||||
},
|
||||
.gpio = {
|
||||
.polarity = BL31_GPIO_LEVEL_LOW,
|
||||
},
|
||||
};
|
||||
param_p15_en.gpio.index = GET_GPIO_NUM(GPIO_P15V_EN);
|
||||
register_bl31_param(¶m_p15_en.h);
|
||||
|
||||
static struct bl31_gpio_param param_p18_audio_en = {
|
||||
.h = {
|
||||
.type = PARAM_SUSPEND_GPIO,
|
||||
},
|
||||
.gpio = {
|
||||
.polarity = BL31_GPIO_LEVEL_LOW,
|
||||
},
|
||||
};
|
||||
param_p18_audio_en.gpio.index = GET_GPIO_NUM(GPIO_P18V_AUDIO_PWREN);
|
||||
register_bl31_param(¶m_p18_audio_en.h);
|
||||
|
||||
static struct bl31_gpio_param param_p30_en = {
|
||||
.h = {
|
||||
.type = PARAM_SUSPEND_GPIO,
|
||||
},
|
||||
.gpio = {
|
||||
.polarity = BL31_GPIO_LEVEL_LOW,
|
||||
},
|
||||
};
|
||||
param_p30_en.gpio.index = GET_GPIO_NUM(GPIO_P30V_EN);
|
||||
register_bl31_param(¶m_p30_en.h);
|
||||
}
|
||||
|
||||
static void register_reset_to_bl31(void)
|
||||
{
|
||||
static struct bl31_gpio_param param_reset = {
|
||||
|
|
@ -184,6 +226,7 @@ static void mainboard_init(device_t dev)
|
|||
setup_usb();
|
||||
register_reset_to_bl31();
|
||||
register_poweroff_to_bl31();
|
||||
register_gpio_suspend();
|
||||
}
|
||||
|
||||
static void enable_backlight_booster(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue