mirror of
https://github.com/CTCaer/hekate.git
synced 2024-12-27 02:16:02 +00:00
regulators: Enable 5V to missing GPIO AO IO rails
This commit is contained in:
parent
2c4d6552e9
commit
aadb88eeea
1 changed files with 9 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "../soc/gpio.h"
|
||||
#include "../soc/pinmux.h"
|
||||
#include "../soc/pmc.h"
|
||||
#include "../soc/t210.h"
|
||||
#include "../utils/types.h"
|
||||
|
||||
|
@ -37,6 +38,11 @@ void regulator_enable_5v(u8 dev)
|
|||
gpio_config(GPIO_PORT_CC, GPIO_PIN_4, GPIO_MODE_GPIO);
|
||||
gpio_output_enable(GPIO_PORT_CC, GPIO_PIN_4, GPIO_OUTPUT_ENABLE);
|
||||
gpio_write(GPIO_PORT_CC, GPIO_PIN_4, GPIO_HIGH);
|
||||
|
||||
// Make sure GPIO power is enabled.
|
||||
PMC(APBDEV_PMC_NO_IOPOWER) &= ~PMC_NO_IOPOWER_GPIO_IO_EN;
|
||||
// Override power detect for GPIO AO IO rails.
|
||||
PMC(APBDEV_PMC_PWR_DET_VAL) &= ~PMC_PWR_DET_GPIO_IO_EN;
|
||||
}
|
||||
reg_5v_dev |= dev;
|
||||
}
|
||||
|
@ -58,6 +64,9 @@ void regulator_disable_5v(u8 dev)
|
|||
gpio_output_enable(GPIO_PORT_CC, GPIO_PIN_4, GPIO_OUTPUT_DISABLE);
|
||||
gpio_config(GPIO_PORT_CC, GPIO_PIN_4, GPIO_MODE_SPIO);
|
||||
PINMUX_AUX(PINMUX_AUX_USB_VBUS_EN0) = PINMUX_IO_HV | PINMUX_LPDR | PINMUX_PARKED | PINMUX_INPUT_ENABLE;
|
||||
|
||||
// GPIO AO IO rails.
|
||||
PMC(APBDEV_PMC_PWR_DET_VAL) |= PMC_PWR_DET_GPIO_IO_EN;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue