From: "Nithin Nayak Sujir" <nsujir@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org,
"Nithin Nayak Sujir" <nsujir@broadcom.com>,
"Michael Chan" <mchan@broadcom.com>
Subject: [PATCH net-next 1/8] tg3: Add function tg3_phy_shdw_write()
Date: Fri, 20 Sep 2013 16:46:55 -0700 [thread overview]
Message-ID: <1379720822-6500-2-git-send-email-nsujir@broadcom.com> (raw)
In-Reply-To: <1379720822-6500-1-git-send-email-nsujir@broadcom.com>
For consistency with other register access functions, add shadow
register access function of the type (register/val).
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 5701f3d..d2bc391 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -1326,6 +1326,12 @@ static int tg3_phy_toggle_auxctl_smdsp(struct tg3 *tp, bool enable)
return err;
}
+static int tg3_phy_shdw_write(struct tg3 *tp, int reg, u32 val)
+{
+ return tg3_writephy(tp, MII_TG3_MISC_SHDW,
+ reg | val | MII_TG3_MISC_SHDW_WREN);
+}
+
static int tg3_bmcr_reset(struct tg3 *tp)
{
u32 phy_control;
@@ -2218,25 +2224,21 @@ static void tg3_phy_toggle_apd(struct tg3 *tp, bool enable)
return;
}
- reg = MII_TG3_MISC_SHDW_WREN |
- MII_TG3_MISC_SHDW_SCR5_SEL |
- MII_TG3_MISC_SHDW_SCR5_LPED |
+ reg = MII_TG3_MISC_SHDW_SCR5_LPED |
MII_TG3_MISC_SHDW_SCR5_DLPTLM |
MII_TG3_MISC_SHDW_SCR5_SDTL |
MII_TG3_MISC_SHDW_SCR5_C125OE;
if (tg3_asic_rev(tp) != ASIC_REV_5784 || !enable)
reg |= MII_TG3_MISC_SHDW_SCR5_DLLAPD;
- tg3_writephy(tp, MII_TG3_MISC_SHDW, reg);
+ tg3_phy_shdw_write(tp, MII_TG3_MISC_SHDW_SCR5_SEL, reg);
- reg = MII_TG3_MISC_SHDW_WREN |
- MII_TG3_MISC_SHDW_APD_SEL |
- MII_TG3_MISC_SHDW_APD_WKTM_84MS;
+ reg = MII_TG3_MISC_SHDW_APD_WKTM_84MS;
if (enable)
reg |= MII_TG3_MISC_SHDW_APD_ENABLE;
- tg3_writephy(tp, MII_TG3_MISC_SHDW, reg);
+ tg3_phy_shdw_write(tp, MII_TG3_MISC_SHDW_APD_SEL, reg);
}
static void tg3_phy_toggle_automdix(struct tg3 *tp, bool enable)
--
1.8.1.4
next prev parent reply other threads:[~2013-09-20 23:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-20 23:46 [PATCH net-next 0/8] tg3: Misc cleanups and fixes Nithin Nayak Sujir
2013-09-20 23:46 ` Nithin Nayak Sujir [this message]
2013-09-20 23:46 ` [PATCH net-next 2/8] tg3: Add support for new 577xx device ids Nithin Nayak Sujir
2013-09-20 23:46 ` [PATCH net-next 3/8] tg3: LED in shared mode does not blink during traffic Nithin Nayak Sujir
2013-09-20 23:46 ` [PATCH net-next 4/8] tg3: Remove if 0'd code Nithin Nayak Sujir
2013-09-20 23:46 ` [PATCH net-next 5/8] tg3: Remove redundant if check Nithin Nayak Sujir
2013-09-20 23:47 ` [PATCH net-next 6/8] tg3: Appropriately classify interrupts during request_irq Nithin Nayak Sujir
2013-09-20 23:47 ` [PATCH net-next 7/8] tg3: Remove unnecessary spinlock Nithin Nayak Sujir
2013-09-20 23:47 ` [PATCH net-next 8/8] tg3: Update version to 3.134 Nithin Nayak Sujir
2013-09-21 18:05 ` [PATCH net-next 0/8] tg3: Misc cleanups and fixes David Miller
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=1379720822-6500-2-git-send-email-nsujir@broadcom.com \
--to=nsujir@broadcom.com \
--cc=davem@davemloft.net \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).