mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <wei_wang@realsil.com.cn>
To: <sameo@linux.intel.com>
Cc: <devel@linuxdriverproject.org>, <linux-kernel@vger.kernel.org>,
	<gregkh@linuxfoundation.org>, <rogerable@realtek.com>,
	<micky_ching@realsil.com.cn>, Wei WANG <wei_wang@realsil.com.cn>
Subject: [PATCH] mfd: rtsx: Modify rts5249_optimize_phy
Date: Thu, 5 Sep 2013 17:45:38 +0800	[thread overview]
Message-ID: <1378374338-11455-1-git-send-email-wei_wang@realsil.com.cn> (raw)

From: Wei WANG <wei_wang@realsil.com.cn>

In some platforms, specially Thinkpad series, rts5249 won't be
initialized properly. So we need adjust some phy parameters to
improve the compatibility issue.

Signed-off-by: Wei WANG <wei_wang@realsil.com.cn>
---
 drivers/mfd/rts5249.c |   25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/rts5249.c b/drivers/mfd/rts5249.c
index 3b835f5..e3c6dc1 100644
--- a/drivers/mfd/rts5249.c
+++ b/drivers/mfd/rts5249.c
@@ -130,13 +130,34 @@ static int rts5249_optimize_phy(struct rtsx_pcr *pcr)
 {
 	int err;
 
-	err = rtsx_pci_write_phy_register(pcr, PHY_REG_REV, 0xFE46);
+	err = rtsx_pci_write_phy_register(pcr, PHY_REG_REV, 0xFC6C);
 	if (err < 0)
 		return err;
 
 	msleep(1);
 
-	return rtsx_pci_write_phy_register(pcr, PHY_BPCR, 0x05C0);
+	err = rtsx_pci_write_phy_register(pcr, PHY_BPCR, 0x05C0);
+	if (err < 0)
+		return err;
+	err = rtsx_pci_write_phy_register(pcr, PHY_PCR, 0xBA42);
+	if (err < 0)
+		return err;
+	err = rtsx_pci_write_phy_register(pcr, PHY_RCR2, 0xC56A);
+	if (err < 0)
+		return err;
+	err = rtsx_pci_write_phy_register(pcr, PHY_FLD4, 0x78EB);
+	if (err < 0)
+		return err;
+	err = rtsx_pci_write_phy_register(pcr, PHY_RDR, 0x4000);
+	if (err < 0)
+		return err;
+	err = rtsx_pci_write_phy_register(pcr, PHY_RCR1, 0x011F);
+	if (err < 0)
+		return err;
+	err = rtsx_pci_write_phy_register(pcr, PHY_FLD3, 0x78E4);
+	if (err < 0)
+		return err;
+	return rtsx_pci_write_phy_register(pcr, PHY_TUNE, 0x4FE4);
 }
 
 static int rts5249_turn_on_led(struct rtsx_pcr *pcr)
-- 
1.7.9.5


             reply	other threads:[~2013-09-05  9:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-05  9:45 wei_wang [this message]
2013-09-05 10:48 ` Dan Carpenter
2013-09-05 11:16   ` wwang
2013-09-05 11:47     ` Dan Carpenter
2013-09-10  9:09 wei_wang
2013-09-10  9:11 ` wwang
2013-09-10  9:45   ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378374338-11455-1-git-send-email-wei_wang@realsil.com.cn \
    --to=wei_wang@realsil.com.cn \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=micky_ching@realsil.com.cn \
    --cc=rogerable@realtek.com \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®