diff options
| author | Micky Ching <micky_ching@realsil.com.cn> | 2014-12-05 00:54:26 -0500 |
|---|---|---|
| committer | Lee Jones <lee.jones@linaro.org> | 2014-12-08 05:05:39 -0500 |
| commit | a3b63979f8a32af9e975a793fd0f612d42072740 (patch) | |
| tree | 8500a941a9118723082fd8efd1b4936da20f5669 /include/linux/mfd | |
| parent | 292aabb1da506b53eed904330add3dabfffd96e5 (diff) | |
mfd: rtsx: Add func to split u32 into register
Add helper function to write u32 to registers, if we want to put u32
value to 4 continuous register, this can help us reduce tedious work.
Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'include/linux/mfd')
| -rw-r--r-- | include/linux/mfd/rtsx_pci.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h index 1604dda4edcf..0c12628e91c6 100644 --- a/include/linux/mfd/rtsx_pci.h +++ b/include/linux/mfd/rtsx_pci.h | |||
| @@ -558,6 +558,7 @@ | |||
| 558 | #define SD_SAMPLE_POINT_CTL 0xFDA7 | 558 | #define SD_SAMPLE_POINT_CTL 0xFDA7 |
| 559 | #define SD_PUSH_POINT_CTL 0xFDA8 | 559 | #define SD_PUSH_POINT_CTL 0xFDA8 |
| 560 | #define SD_CMD0 0xFDA9 | 560 | #define SD_CMD0 0xFDA9 |
| 561 | #define SD_CMD_START 0x40 | ||
| 561 | #define SD_CMD1 0xFDAA | 562 | #define SD_CMD1 0xFDAA |
| 562 | #define SD_CMD2 0xFDAB | 563 | #define SD_CMD2 0xFDAB |
| 563 | #define SD_CMD3 0xFDAC | 564 | #define SD_CMD3 0xFDAC |
| @@ -995,4 +996,12 @@ static inline int rtsx_pci_update_cfg_byte(struct rtsx_pcr *pcr, int addr, | |||
| 995 | return pci_write_config_byte(pcr->pci, addr, (val & mask) | append); | 996 | return pci_write_config_byte(pcr->pci, addr, (val & mask) | append); |
| 996 | } | 997 | } |
| 997 | 998 | ||
| 999 | static inline void rtsx_pci_write_be32(struct rtsx_pcr *pcr, u16 reg, u32 val) | ||
| 1000 | { | ||
| 1001 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg, 0xFF, val >> 24); | ||
| 1002 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 1, 0xFF, val >> 16); | ||
| 1003 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 2, 0xFF, val >> 8); | ||
| 1004 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 3, 0xFF, val); | ||
| 1005 | } | ||
| 1006 | |||
| 998 | #endif | 1007 | #endif |
