Commit 31c03552 authored by Grant Grundler's avatar Grant Grundler Committed by David S. Miller

[TG3]: Clean up grc_local_ctrl usage.

Make the code more readable by only flipping the specific
bits that need to change each register write.

Signed-off-by: Grant Grundler (grundler@parisc-linux.org)
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e75276ad
...@@ -893,7 +893,7 @@ static void tg3_frob_aux_power(struct tg3 *tp) ...@@ -893,7 +893,7 @@ static void tg3_frob_aux_power(struct tg3 *tp)
GRC_LCLCTRL_GPIO_OUTPUT1)); GRC_LCLCTRL_GPIO_OUTPUT1));
udelay(100); udelay(100);
} else { } else {
int no_gpio2; u32 no_gpio2;
u32 grc_local_ctrl; u32 grc_local_ctrl;
if (tp_peer != tp && if (tp_peer != tp &&
...@@ -901,8 +901,8 @@ static void tg3_frob_aux_power(struct tg3 *tp) ...@@ -901,8 +901,8 @@ static void tg3_frob_aux_power(struct tg3 *tp)
return; return;
/* On 5753 and variants, GPIO2 cannot be used. */ /* On 5753 and variants, GPIO2 cannot be used. */
no_gpio2 = (tp->nic_sram_data_cfg & no_gpio2 = tp->nic_sram_data_cfg &
NIC_SRAM_DATA_CFG_NO_GPIO2) != 0; NIC_SRAM_DATA_CFG_NO_GPIO2;
grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 | grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 |
GRC_LCLCTRL_GPIO_OE1 | GRC_LCLCTRL_GPIO_OE1 |
...@@ -917,26 +917,14 @@ static void tg3_frob_aux_power(struct tg3 *tp) ...@@ -917,26 +917,14 @@ static void tg3_frob_aux_power(struct tg3 *tp)
grc_local_ctrl); grc_local_ctrl);
udelay(100); udelay(100);
grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 | grc_local_ctrl |= GRC_LCLCTRL_GPIO_OUTPUT0;
GRC_LCLCTRL_GPIO_OE1 |
GRC_LCLCTRL_GPIO_OE2 |
GRC_LCLCTRL_GPIO_OUTPUT0 |
GRC_LCLCTRL_GPIO_OUTPUT1 |
GRC_LCLCTRL_GPIO_OUTPUT2;
if (no_gpio2) {
grc_local_ctrl &= ~(GRC_LCLCTRL_GPIO_OE2 |
GRC_LCLCTRL_GPIO_OUTPUT2);
}
tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
grc_local_ctrl); grc_local_ctrl);
udelay(100); udelay(100);
grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 |
GRC_LCLCTRL_GPIO_OE1 |
GRC_LCLCTRL_GPIO_OE2 |
GRC_LCLCTRL_GPIO_OUTPUT0 |
GRC_LCLCTRL_GPIO_OUTPUT1;
if (!no_gpio2) { if (!no_gpio2) {
grc_local_ctrl &= ~GRC_LCLCTRL_GPIO_OUTPUT2;
tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
grc_local_ctrl); grc_local_ctrl);
udelay(100); udelay(100);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment