diff options
author | Wei WANG <wei_wang@realsil.com.cn> | 2013-08-20 02:18:52 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-08-20 04:22:00 -0400 |
commit | 5947c167d145f32d4475d647a87e2af2699efe45 (patch) | |
tree | b75c7a66d0c946c714ed141aff8f66839cd01f6a /drivers/mfd/rts5227.c | |
parent | 773ccdfd9cc6f9bf8ec75a59fa742d7a663a5903 (diff) |
mfd: rtsx: Add shutdown callback in rtsx_pci_driver
Some actions to clear power state should be handled in .shutdown
callback in rtsx_pci_driver. This patch adopts the following measures to
catch this goal:
1. Add a function rtsx_pci_power_off to abstract the common ops in
.shutdown and .suspend
2. Add pcr->ops->force_power_down to fulfill the individual action for
each reader model
Signed-off-by: Wei WANG <wei_wang@realsil.com.cn>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/rts5227.c')
-rw-r--r-- | drivers/mfd/rts5227.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mfd/rts5227.c b/drivers/mfd/rts5227.c index c3181d71fedd..42ebf5c050c1 100644 --- a/drivers/mfd/rts5227.c +++ b/drivers/mfd/rts5227.c | |||
@@ -83,6 +83,16 @@ static void rts5227_fetch_vendor_settings(struct rtsx_pcr *pcr) | |||
83 | pcr->flags |= PCR_REVERSE_SOCKET; | 83 | pcr->flags |= PCR_REVERSE_SOCKET; |
84 | } | 84 | } |
85 | 85 | ||
86 | static void rts5227_force_power_down(struct rtsx_pcr *pcr) | ||
87 | { | ||
88 | /* Set relink_time to 0 */ | ||
89 | rtsx_pci_write_register(pcr, AUTOLOAD_CFG_BASE + 1, 0xFF, 0); | ||
90 | rtsx_pci_write_register(pcr, AUTOLOAD_CFG_BASE + 2, 0xFF, 0); | ||
91 | rtsx_pci_write_register(pcr, AUTOLOAD_CFG_BASE + 3, 0x01, 0); | ||
92 | |||
93 | rtsx_pci_write_register(pcr, FPDCTL, 0x03, 0x03); | ||
94 | } | ||
95 | |||
86 | static int rts5227_extra_init_hw(struct rtsx_pcr *pcr) | 96 | static int rts5227_extra_init_hw(struct rtsx_pcr *pcr) |
87 | { | 97 | { |
88 | u16 cap; | 98 | u16 cap; |
@@ -218,6 +228,7 @@ static const struct pcr_ops rts5227_pcr_ops = { | |||
218 | .switch_output_voltage = rts5227_switch_output_voltage, | 228 | .switch_output_voltage = rts5227_switch_output_voltage, |
219 | .cd_deglitch = NULL, | 229 | .cd_deglitch = NULL, |
220 | .conv_clk_and_div_n = NULL, | 230 | .conv_clk_and_div_n = NULL, |
231 | .force_power_down = rts5227_force_power_down, | ||
221 | }; | 232 | }; |
222 | 233 | ||
223 | /* SD Pull Control Enable: | 234 | /* SD Pull Control Enable: |