FreeBSD/sys/mips/atheros/qca955x_chip.c
/*
 * Configure the GPIO output mux setup.
 *
 * The QCA955x has an output mux which allowed
 * certain functions to be configured on any pin.
 * Specifically, the switch PHY link LEDs and
 * WMAC external RX LNA switches are not limited to
 * a specific GPIO pin.
 */
Configure the GPIO output mux setup.
The QCA955x has an output mux which allowed
certain functions to be configured on any pin.
Specifically, the switch PHY link LEDs and
WMAC external RX LNA switches are not limited to
a specific GPIO pin.
Configure the GPIO output mux setup . The QCA955x has an output mux which allowed certain functions to be configured on any pin . Specifically the switch PHY link LEDs and WMAC external RX LNA switches are not limited to a specific GPIO pin .
static void
qca955x_chip_gpio_output_configure(int gpio, uint8_t func)
{
	uint32_t reg, s;
	uint32_t t;
	if (gpio > QCA955X_GPIO_COUNT)
		return;
	reg = QCA955X_GPIO_REG_OUT_FUNC0 + rounddown(gpio, 4);
	s = 8 * (gpio % 4);
	t = ATH_READ_REG(AR71XX_GPIO_BASE + reg);
	t &= ~(0xff << s);
	t |= func << s;
	ATH_WRITE_REG(AR71XX_GPIO_BASE + reg, t);
	ATH_READ_REG(AR71XX_GPIO_BASE + reg);
}
static void qca955x_chip_gpio_output_configure ( int gpio , uint8_t func ) { uint32_t reg , s ; uint32_t t ; if ( gpio > QCA955X_GPIO_COUNT ) return ; reg = QCA955X_GPIO_REG_OUT_FUNC0 + rounddown ( gpio , 4 ) ; s = 8 * ( gpio % 4 ) ; t = ATH_READ_REG ( AR71XX_GPIO_BASE + reg ) ; t &= ~ ( 0xff << s ) ; t |= func << s ; ATH_WRITE_REG ( AR71XX_GPIO_BASE + reg , t ) ; ATH_READ_REG ( AR71XX_GPIO_BASE + reg ) ; }
Configure the GPIO output mux setup.
Configure the GPIO output mux setup .
/* read-modify-write */ /* flush write */