/* Returns 0, unless there's a write error */ staticint qs6612_config_init(struct phy_device *phydev)
{ /* The PHY powers up isolated on the RPX, * so send a command to allow operation. * XXX - My docs indicate this should be 0x0940 * ...or something. The current value sets three * reserved bits, bit 11, which specifies it should be * set to one, bit 10, which specifies it should be set * to 0, and bit 7, which doesn't specify. However, my * docs are preliminary, and I will leave it like this * until someone more knowledgable corrects me or it. * -- Andy Fleming
*/ return phy_write(phydev, MII_QS6612_PCR, 0x0dc0);
}
staticint qs6612_ack_interrupt(struct phy_device *phydev)
{ int err;
/* The Interrupt Source register is not self-clearing, bits 4 and 5 are * cleared when MII_BMSR is read and bits 1 and 3 are cleared when * MII_EXPANSION is read
*/
err = phy_read(phydev, MII_QS6612_ISR);
if (err < 0) return err;
err = phy_read(phydev, MII_BMSR);
if (err < 0) return err;
err = phy_read(phydev, MII_EXPANSION);
if (err < 0) return err;
return 0;
}
staticint qs6612_config_intr(struct phy_device *phydev)
{ int err;
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { /* clear any interrupts before enabling them */
err = qs6612_ack_interrupt(phydev); if (err) return err;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.