Beispiel #1
0
/* Marvell 88E1510 */
static int m88e1510_config(struct phy_device *phydev)
{
	/* Select page 3 */
	phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1118_PHY_PAGE,
		  MIIM_88E1118_PHY_LED_PAGE);

	/* Enable INTn output on LED[2] */
	m88e1518_phy_writebits(phydev, MIIM_88E151x_LED_TIMER_CTRL,
			       MIIM_88E151x_INT_EN_OFFS, 1, 1);

	/* Configure LEDs */
	/* LED[0]:0011 (ACT) */
	m88e1518_phy_writebits(phydev, MIIM_88E151x_LED_FUNC_CTRL,
			       MIIM_88E151x_LED0_OFFS, MIIM_88E151x_LED_FLD_SZ,
			       MIIM_88E151x_LED0_ACT);
	/* LED[1]:0110 (LINK 100/1000 Mbps) */
	m88e1518_phy_writebits(phydev, MIIM_88E151x_LED_FUNC_CTRL,
			       MIIM_88E151x_LED1_OFFS, MIIM_88E151x_LED_FLD_SZ,
			       MIIM_88E151x_LED1_100_1000_LINK);

	/* Reset page selection */
	phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E1118_PHY_PAGE, 0);

	return m88e1518_config(phydev);
}
/* Marvell 88E1510 */
static int m88e1510_config(struct phy_device *phydev)
{
	/* Select page 3 */
	phy_write(phydev, MDIO_DEVAD_NONE, 22, 3);

	/* Enable INTn output on LED[2] */
	m88e1518_phy_writebits(phydev, 18, 7, 1, 1);

	/* Configure LEDs */
	m88e1518_phy_writebits(phydev, 16, 0, 4, 3); /* LED[0]:0011 (ACT) */
	m88e1518_phy_writebits(phydev, 16, 4, 4, 6); /* LED[1]:0110 (LINK) */

	/* Reset page selection */
	phy_write(phydev, MDIO_DEVAD_NONE, 22, 0);

	return m88e1518_config(phydev);
}