diff options
Diffstat (limited to 'drivers/mfd/rtl8411.c')
-rw-r--r-- | drivers/mfd/rtl8411.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mfd/rtl8411.c b/drivers/mfd/rtl8411.c index 5058ba8dec3b..3d3b4addf81a 100644 --- a/drivers/mfd/rtl8411.c +++ b/drivers/mfd/rtl8411.c | |||
@@ -178,6 +178,18 @@ static unsigned int rtl8411_cd_deglitch(struct rtsx_pcr *pcr) | |||
178 | return card_exist; | 178 | return card_exist; |
179 | } | 179 | } |
180 | 180 | ||
181 | static int rtl8411_conv_clk_and_div_n(int input, int dir) | ||
182 | { | ||
183 | int output; | ||
184 | |||
185 | if (dir == CLK_TO_DIV_N) | ||
186 | output = input * 4 / 5 - 2; | ||
187 | else | ||
188 | output = (input + 2) * 5 / 4; | ||
189 | |||
190 | return output; | ||
191 | } | ||
192 | |||
181 | static const struct pcr_ops rtl8411_pcr_ops = { | 193 | static const struct pcr_ops rtl8411_pcr_ops = { |
182 | .extra_init_hw = rtl8411_extra_init_hw, | 194 | .extra_init_hw = rtl8411_extra_init_hw, |
183 | .optimize_phy = NULL, | 195 | .optimize_phy = NULL, |
@@ -189,6 +201,7 @@ static const struct pcr_ops rtl8411_pcr_ops = { | |||
189 | .card_power_off = rtl8411_card_power_off, | 201 | .card_power_off = rtl8411_card_power_off, |
190 | .switch_output_voltage = rtl8411_switch_output_voltage, | 202 | .switch_output_voltage = rtl8411_switch_output_voltage, |
191 | .cd_deglitch = rtl8411_cd_deglitch, | 203 | .cd_deglitch = rtl8411_cd_deglitch, |
204 | .conv_clk_and_div_n = rtl8411_conv_clk_and_div_n, | ||
192 | }; | 205 | }; |
193 | 206 | ||
194 | /* SD Pull Control Enable: | 207 | /* SD Pull Control Enable: |