diff options
author | Biao Huang <biao.huang@mediatek.com> | 2015-09-03 17:39:12 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-12-04 21:52:54 +0100 |
commit | 0dd8315bcc9bd31f30eb011a9845969a438eedd9 (patch) | |
tree | 17a68a8e347e76c759237843729ffc3e39acea1c /src/soc/mediatek/mt8173/include | |
parent | 31ae314f0fa3c06d8dcc9d830b8844acd2299ed4 (diff) | |
download | coreboot-0dd8315bcc9bd31f30eb011a9845969a438eedd9.tar.xz |
mediatek/mt8173: Add APIs for PMIC GPIO control
BRANCH=chromeos-2015.07
BUG=none
TEST=verified on Oak rev3
Change-Id: Ied991f13b73e70b91cc267222f351b588df8df66
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 4bc08ce28611d8b940642483c09614d2b8205c1f
Original-Change-Id: If78e154ff7f553f65aa44d370820cc8c7f829c96
Original-Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/297224
Original-Commit-Ready: Yidi Lin <yidi.lin@mediatek.com>
Original-Tested-by: Yidi Lin <yidi.lin@mediatek.com>
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/12609
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/soc/mediatek/mt8173/include')
-rw-r--r-- | src/soc/mediatek/mt8173/include/soc/mt6391.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8173/include/soc/mt6391.h b/src/soc/mediatek/mt8173/include/soc/mt6391.h index 304ef229d0..5a073552e3 100644 --- a/src/soc/mediatek/mt8173/include/soc/mt6391.h +++ b/src/soc/mediatek/mt8173/include/soc/mt6391.h @@ -308,4 +308,39 @@ void mt6391_write(u16 reg, u16 val, u32 mask, u32 shift); void mt6391_enable_reset_when_ap_resets(void); void mt6391_init(void); +/* + * PMIC GPIO REGISTER DEFINITION + */ +enum { + MT6391_GPIO_DIR_BASE = 0xC000, + MT6391_GPIO_PULLEN_BASE = 0xC020, + MT6391_GPIO_PULLSEL_BASE = 0xC040, + MT6391_GPIO_DOUT_BASE = 0xC080, + MT6391_GPIO_DIN_BASE = 0xC0A0, + MT6391_GPIO_MODE_BASE = 0xC0C0, +}; + +enum mt6391_pull_enable { + MT6391_GPIO_PULL_DISABLE = 0, + MT6391_GPIO_PULL_ENABLE = 1, +}; + +enum mt6391_pull_select { + MT6391_GPIO_PULL_DOWN = 0, + MT6391_GPIO_PULL_UP = 1, +}; + +/* + * PMIC GPIO Exported Function + */ +int mt6391_gpio_get(u32 gpio); +void mt6391_gpio_set(u32 gpio, int value); +void mt6391_gpio_input_pulldown(u32 gpio); +void mt6391_gpio_input_pullup(u32 gpio); +void mt6391_gpio_input(u32 gpio); +void mt6391_gpio_output(u32 gpio, int value); +void mt6391_gpio_set_pull(u32 gpio, enum mt6391_pull_enable enable, + enum mt6391_pull_select select); +void mt6391_gpio_set_mode(u32 gpio, int mode); + #endif /* __SOC_MEDIATEK_MT8173_MT6391_H__ */ |