| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
#include <drivers/delay_timer.h> |
| 8 |
|
| 9 |
#include <qti_plat.h> |
| 10 |
#include <spmi_arb.h> |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#define RESET_TYPE_WARM_RESET 1 |
| 18 |
#define RESET_TYPE_SHUTDOWN 4 |
| 19 |
|
| 20 |
#define S2_RESET_EN BIT(7) |
| 21 |
|
| 22 |
static void configure_ps_hold(uint32_t reset_type) |
| 23 |
{ |
| 24 |
|
| 25 |
spmi_arb_write8(PON_PS_HOLD_RESET_CTL2, 0); |
| 26 |
mdelay(1); |
| 27 |
|
| 28 |
spmi_arb_write8(PON_PS_HOLD_RESET_CTL, reset_type); |
| 29 |
spmi_arb_write8(PON_PS_HOLD_RESET_CTL2, S2_RESET_EN); |
| 30 |
mdelay(1); |
| 31 |
} |
| 32 |
|
| 33 |
void qti_pmic_prepare_reset(void) |
| 34 |
{ |
| 35 |
configure_ps_hold(RESET_TYPE_WARM_RESET); |
| 36 |
} |
| 37 |
|
| 38 |
void qti_pmic_prepare_shutdown(void) |
| 39 |
{ |
| 40 |
configure_ps_hold(RESET_TYPE_SHUTDOWN); |
| 41 |
} |