Messages in this thread Patch in this message | | | From | <> | Subject | [PATCH 2/2] mfd: rtsx: fix PM suspend for 5249 | Date | Thu, 11 Sep 2014 15:17:53 +0800 |
| |
From: Micky Ching <micky_ching@realsil.com.cn>
Fix rts5249 failed send buffer cmd after suspend, PM_CTRL3 should reset before send any buffer cmd after suspend. Otherwise, buffer cmd will failed, this will lead resume fail.
Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> --- drivers/mfd/rts5249.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/drivers/mfd/rts5249.c b/drivers/mfd/rts5249.c index 573de7b..d6cc546 100644 --- a/drivers/mfd/rts5249.c +++ b/drivers/mfd/rts5249.c @@ -126,10 +126,31 @@ static int rts5249_extra_init_hw(struct rtsx_pcr *pcr) return rtsx_pci_send_cmd(pcr, 100); }
+static int rts5249_pm_reset(struct rtsx_pcr *pcr) +{ + int err; + + /* init aspm */ + err = rtsx_pci_update_cfg_byte(pcr, LCTLR, 0xFC, 0); + if (err < 0) + return err; + + /* reset PM_CTRL3 before send buffer cmd */ + err = rtsx_pci_write_register(pcr, PM_CTRL3, 0x10, 0x00); + if (err < 0) + return err; + + return err; +} + static int rts5249_optimize_phy(struct rtsx_pcr *pcr) { int err;
+ err = rts5249_pm_reset(pcr); + if (err < 0) + return err; + err = rtsx_pci_write_phy_register(pcr, PHY_REG_REV, PHY_REG_REV_RESV | PHY_REG_REV_RXIDLE_LATCHED | PHY_REG_REV_P1_EN | PHY_REG_REV_RXIDLE_EN | -- 1.7.9.5
| |