The MDIO control bits are always mapped to the same bits of the same register
(PIR), so there's no need to store their masks in the 'struct bb_info'...
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
void (*set_gate)(void *addr);
struct mdiobb_ctrl ctrl;
void *addr;
void (*set_gate)(void *addr);
struct mdiobb_ctrl ctrl;
void *addr;
- u32 mmd_msk;/* MMD */
- u32 mdo_msk;
- u32 mdi_msk;
- u32 mdc_msk;
bitbang->set_gate(bitbang->addr);
if (bit)
bitbang->set_gate(bitbang->addr);
if (bit)
- bb_set(bitbang->addr, bitbang->mmd_msk);
+ bb_set(bitbang->addr, PIR_MMD);
- bb_clr(bitbang->addr, bitbang->mmd_msk);
+ bb_clr(bitbang->addr, PIR_MMD);
bitbang->set_gate(bitbang->addr);
if (bit)
bitbang->set_gate(bitbang->addr);
if (bit)
- bb_set(bitbang->addr, bitbang->mdo_msk);
+ bb_set(bitbang->addr, PIR_MDO);
- bb_clr(bitbang->addr, bitbang->mdo_msk);
+ bb_clr(bitbang->addr, PIR_MDO);
if (bitbang->set_gate)
bitbang->set_gate(bitbang->addr);
if (bitbang->set_gate)
bitbang->set_gate(bitbang->addr);
- return bb_read(bitbang->addr, bitbang->mdi_msk);
+ return bb_read(bitbang->addr, PIR_MDI);
bitbang->set_gate(bitbang->addr);
if (bit)
bitbang->set_gate(bitbang->addr);
if (bit)
- bb_set(bitbang->addr, bitbang->mdc_msk);
+ bb_set(bitbang->addr, PIR_MDC);
- bb_clr(bitbang->addr, bitbang->mdc_msk);
+ bb_clr(bitbang->addr, PIR_MDC);
}
/* mdio bus control struct */
}
/* mdio bus control struct */
/* bitbang init */
bitbang->addr = mdp->addr + mdp->reg_offset[PIR];
bitbang->set_gate = pd->set_mdio_gate;
/* bitbang init */
bitbang->addr = mdp->addr + mdp->reg_offset[PIR];
bitbang->set_gate = pd->set_mdio_gate;
- bitbang->mdi_msk = PIR_MDI;
- bitbang->mdo_msk = PIR_MDO;
- bitbang->mmd_msk = PIR_MMD;
- bitbang->mdc_msk = PIR_MDC;
bitbang->ctrl.ops = &bb_ops;
/* MII controller setting */
bitbang->ctrl.ops = &bb_ops;
/* MII controller setting */