aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorWei WANG <wei_wang@realsil.com.cn>2013-08-20 02:18:51 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2013-08-20 04:22:00 -0400
commit773ccdfd9cc6f9bf8ec75a59fa742d7a663a5903 (patch)
tree3e9ac1a210e718aaeb459dc8950666e928ca68b1 /include/linux/mfd
parent74d85e47ab8a7cdeffde6373cf1550bfbd2feaa6 (diff)
mfd: rtsx: Read vendor setting from config space
Normally OEMs will set vendor setting to the config space of Realtek card reader in BIOS stage. This patch reads the setting at the first, and configure the internal registers according to it, to improve card reader's compatibility condition. Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/rtsx_pci.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
index 7a9f7089435d..9cba73703704 100644
--- a/include/linux/mfd/rtsx_pci.h
+++ b/include/linux/mfd/rtsx_pci.h
@@ -184,11 +184,26 @@
184#define CARD_SHARE_BAROSSA_SD 0x01 184#define CARD_SHARE_BAROSSA_SD 0x01
185#define CARD_SHARE_BAROSSA_MS 0x02 185#define CARD_SHARE_BAROSSA_MS 0x02
186 186
187/* CARD_DRIVE_SEL */
188#define MS_DRIVE_8mA (0x01 << 6)
189#define MMC_DRIVE_8mA (0x01 << 4)
190#define XD_DRIVE_8mA (0x01 << 2)
191#define GPIO_DRIVE_8mA 0x01
192#define RTS5209_CARD_DRIVE_DEFAULT (MS_DRIVE_8mA | MMC_DRIVE_8mA |\
193 XD_DRIVE_8mA | GPIO_DRIVE_8mA)
194#define RTL8411_CARD_DRIVE_DEFAULT (MS_DRIVE_8mA | MMC_DRIVE_8mA |\
195 XD_DRIVE_8mA)
196#define RTSX_CARD_DRIVE_DEFAULT (MS_DRIVE_8mA | GPIO_DRIVE_8mA)
197
187/* SD30_DRIVE_SEL */ 198/* SD30_DRIVE_SEL */
188#define DRIVER_TYPE_A 0x05 199#define DRIVER_TYPE_A 0x05
189#define DRIVER_TYPE_B 0x03 200#define DRIVER_TYPE_B 0x03
190#define DRIVER_TYPE_C 0x02 201#define DRIVER_TYPE_C 0x02
191#define DRIVER_TYPE_D 0x01 202#define DRIVER_TYPE_D 0x01
203#define CFG_DRIVER_TYPE_A 0x02
204#define CFG_DRIVER_TYPE_B 0x03
205#define CFG_DRIVER_TYPE_C 0x01
206#define CFG_DRIVER_TYPE_D 0x00
192 207
193/* FPDCTL */ 208/* FPDCTL */
194#define SSC_POWER_DOWN 0x01 209#define SSC_POWER_DOWN 0x01
@@ -684,6 +699,8 @@
684 699
685#define DUMMY_REG_RESET_0 0xFE90 700#define DUMMY_REG_RESET_0 0xFE90
686 701
702#define AUTOLOAD_CFG_BASE 0xFF00
703
687/* Memory mapping */ 704/* Memory mapping */
688#define SRAM_BASE 0xE600 705#define SRAM_BASE 0xE600
689#define RBUF_BASE 0xF400 706#define RBUF_BASE 0xF400
@@ -726,6 +743,11 @@
726#define PHY_FLD4 0x1E 743#define PHY_FLD4 0x1E
727#define PHY_DUM_REG 0x1F 744#define PHY_DUM_REG 0x1F
728 745
746#define LCTLR 0x80
747#define PCR_SETTING_REG1 0x724
748#define PCR_SETTING_REG2 0x814
749#define PCR_SETTING_REG3 0x747
750
729#define rtsx_pci_init_cmd(pcr) ((pcr)->ci = 0) 751#define rtsx_pci_init_cmd(pcr) ((pcr)->ci = 0)
730 752
731struct rtsx_pcr; 753struct rtsx_pcr;
@@ -747,6 +769,7 @@ struct pcr_ops {
747 u8 voltage); 769 u8 voltage);
748 unsigned int (*cd_deglitch)(struct rtsx_pcr *pcr); 770 unsigned int (*cd_deglitch)(struct rtsx_pcr *pcr);
749 int (*conv_clk_and_div_n)(int clk, int dir); 771 int (*conv_clk_and_div_n)(int clk, int dir);
772 void (*fetch_vendor_settings)(struct rtsx_pcr *pcr);
750}; 773};
751 774
752enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN}; 775enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN};
@@ -788,7 +811,6 @@ struct rtsx_pcr {
788 struct completion *finish_me; 811 struct completion *finish_me;
789 812
790 unsigned int cur_clock; 813 unsigned int cur_clock;
791 bool ms_pmos;
792 bool remove_pci; 814 bool remove_pci;
793 bool msi_en; 815 bool msi_en;
794 816
@@ -806,6 +828,16 @@ struct rtsx_pcr {
806#define IC_VER_D 3 828#define IC_VER_D 3
807 u8 ic_version; 829 u8 ic_version;
808 830
831 u8 sd30_drive_sel_1v8;
832 u8 sd30_drive_sel_3v3;
833 u8 card_drive_sel;
834#define ASPM_L1_EN 0x02
835 u8 aspm_en;
836
837#define PCR_MS_PMOS (1 << 0)
838#define PCR_REVERSE_SOCKET (1 << 1)
839 u32 flags;
840
809 const u32 *sd_pull_ctl_enable_tbl; 841 const u32 *sd_pull_ctl_enable_tbl;
810 const u32 *sd_pull_ctl_disable_tbl; 842 const u32 *sd_pull_ctl_disable_tbl;
811 const u32 *ms_pull_ctl_enable_tbl; 843 const u32 *ms_pull_ctl_enable_tbl;