diff options
author | Mattias Nilsson <mattias.i.nilsson@stericsson.com> | 2012-01-13 10:21:00 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-03-06 12:46:34 -0500 |
commit | b4a6dbd5b7bad00ee4004443287468abddb96538 (patch) | |
tree | 25582b5e364976b6d7ab1c2f9faa031a4fae2a9d /include/linux/mfd/db8500-prcmu.h | |
parent | 6f53d10dda1323c17fb09063c4df2c22754bf8aa (diff) |
mfd: Add initial db8500 prcmu register access api
This patch adds an initial PRCMU register access API, which
for now should only be used for a very limited set of registers.
The idea about this API is that we split the PRCMU driver in
one part that deals with interaction with the PRCMU firmware
and one part that simply provide write accessors in the PRCMU
register range. The latter are just a collection of registers
exposed in the PRCMU register range for various purposes and
not related to the PRCMU firmware.
Currently we support some limited GPIO, SPI and UART settings
through this API.
Signed-off-by: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux/mfd/db8500-prcmu.h')
-rw-r--r-- | include/linux/mfd/db8500-prcmu.h | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h index 841342c55451..636423bd5111 100644 --- a/include/linux/mfd/db8500-prcmu.h +++ b/include/linux/mfd/db8500-prcmu.h | |||
@@ -11,6 +11,24 @@ | |||
11 | #define __MFD_DB8500_PRCMU_H | 11 | #define __MFD_DB8500_PRCMU_H |
12 | 12 | ||
13 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
14 | #include <linux/bitops.h> | ||
15 | |||
16 | /* | ||
17 | * Registers | ||
18 | */ | ||
19 | #define DB8500_PRCM_GPIOCR 0x138 | ||
20 | #define DB8500_PRCM_GPIOCR_DBG_UARTMOD_CMD0 BIT(0) | ||
21 | #define DB8500_PRCM_GPIOCR_DBG_STM_APE_CMD BIT(9) | ||
22 | #define DB8500_PRCM_GPIOCR_DBG_STM_MOD_CMD1 BIT(11) | ||
23 | #define DB8500_PRCM_GPIOCR_SPI2_SELECT BIT(23) | ||
24 | |||
25 | #define DB8500_PRCM_LINE_VALUE 0x170 | ||
26 | #define DB8500_PRCM_LINE_VALUE_HSI_CAWAKE0 BIT(3) | ||
27 | |||
28 | #define DB8500_PRCM_DSI_SW_RESET 0x324 | ||
29 | #define DB8500_PRCM_DSI_SW_RESET_DSI0_SW_RESETN BIT(0) | ||
30 | #define DB8500_PRCM_DSI_SW_RESET_DSI1_SW_RESETN BIT(1) | ||
31 | #define DB8500_PRCM_DSI_SW_RESET_DSI2_SW_RESETN BIT(2) | ||
14 | 32 | ||
15 | /* This portion previously known as <mach/prcmu-fw-defs_v1.h> */ | 33 | /* This portion previously known as <mach/prcmu-fw-defs_v1.h> */ |
16 | 34 | ||
@@ -552,8 +570,6 @@ int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | |||
552 | void prcmu_ac_wake_req(void); | 570 | void prcmu_ac_wake_req(void); |
553 | void prcmu_ac_sleep_req(void); | 571 | void prcmu_ac_sleep_req(void); |
554 | void db8500_prcmu_modem_reset(void); | 572 | void db8500_prcmu_modem_reset(void); |
555 | void prcmu_enable_spi2(void); | ||
556 | void prcmu_disable_spi2(void); | ||
557 | 573 | ||
558 | int db8500_prcmu_config_a9wdog(u8 num, bool sleep_auto_off); | 574 | int db8500_prcmu_config_a9wdog(u8 num, bool sleep_auto_off); |
559 | int db8500_prcmu_enable_a9wdog(u8 id); | 575 | int db8500_prcmu_enable_a9wdog(u8 id); |
@@ -582,6 +598,10 @@ int db8500_prcmu_get_ape_opp(void); | |||
582 | int db8500_prcmu_set_ddr_opp(u8 opp); | 598 | int db8500_prcmu_set_ddr_opp(u8 opp); |
583 | int db8500_prcmu_get_ddr_opp(void); | 599 | int db8500_prcmu_get_ddr_opp(void); |
584 | 600 | ||
601 | u32 db8500_prcmu_read(unsigned int reg); | ||
602 | void db8500_prcmu_write(unsigned int reg, u32 value); | ||
603 | void db8500_prcmu_write_masked(unsigned int reg, u32 mask, u32 value); | ||
604 | |||
585 | #else /* !CONFIG_MFD_DB8500_PRCMU */ | 605 | #else /* !CONFIG_MFD_DB8500_PRCMU */ |
586 | 606 | ||
587 | static inline void db8500_prcmu_early_init(void) {} | 607 | static inline void db8500_prcmu_early_init(void) {} |
@@ -703,16 +723,6 @@ static inline void db8500_prcmu_modem_reset(void) {} | |||
703 | 723 | ||
704 | static inline void db8500_prcmu_system_reset(u16 reset_code) {} | 724 | static inline void db8500_prcmu_system_reset(u16 reset_code) {} |
705 | 725 | ||
706 | static inline int prcmu_enable_spi2(void) | ||
707 | { | ||
708 | return 0; | ||
709 | } | ||
710 | |||
711 | static inline int prcmu_disable_spi2(void) | ||
712 | { | ||
713 | return 0; | ||
714 | } | ||
715 | |||
716 | static inline int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | 726 | static inline int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, |
717 | bool keep_ap_pll) | 727 | bool keep_ap_pll) |
718 | { | 728 | { |
@@ -805,6 +815,16 @@ static inline int db8500_prcmu_get_arm_opp(void) | |||
805 | return 0; | 815 | return 0; |
806 | } | 816 | } |
807 | 817 | ||
818 | static inline u32 db8500_prcmu_read(unsigned int reg) | ||
819 | { | ||
820 | return 0; | ||
821 | } | ||
822 | |||
823 | static inline void db8500_prcmu_write(unsigned int reg, u32 value) {} | ||
824 | |||
825 | static inline void db8500_prcmu_write_masked(unsigned int reg, u32 mask, | ||
826 | u32 value) {} | ||
827 | |||
808 | #endif /* !CONFIG_MFD_DB8500_PRCMU */ | 828 | #endif /* !CONFIG_MFD_DB8500_PRCMU */ |
809 | 829 | ||
810 | #endif /* __MFD_DB8500_PRCMU_H */ | 830 | #endif /* __MFD_DB8500_PRCMU_H */ |