Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157554452
D20170.id57087.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D20170.id57087.diff
View Options
Index: sys/mips/atheros/ar71xx_gpio.c
===================================================================
--- sys/mips/atheros/ar71xx_gpio.c
+++ sys/mips/atheros/ar71xx_gpio.c
@@ -581,6 +581,30 @@
ar71xx_gpio_ouput_configure(i, gpiofunc);
}
+ for (i = 0; i <= maxpin; i++) {
+ char buf[32];
+ int gpiomux;
+ int muxoff, muxbit, outfunc;
+
+ snprintf(buf, 32, "func.%d.outmux", i);
+ if (resource_int_value(device_get_name(dev),
+ device_get_unit(dev),
+ buf,
+ &gpiomux) != 0)
+ continue;
+
+ device_printf(dev, "GPIO %d: mux=%d\n",
+ i,
+ gpiomux);
+
+ muxoff = (i / 4) * 4;
+ muxbit = (i % 4) * 8;
+ outfunc = GPIO_READ(sc, AR71XX_GPIO_OUT_FUNCTION + muxoff);
+ outfunc &= ~ (0xff < muxbit);
+ outfunc |= gpiomux << muxbit;
+ GPIO_WRITE(sc, AR71XX_GPIO_OUT_FUNCTION + muxoff, outfunc);
+ }
+
sc->busdev = gpiobus_attach_bus(dev);
if (sc->busdev == NULL) {
ar71xx_gpio_detach(dev);
Index: sys/mips/atheros/ar71xxreg.h
===================================================================
--- sys/mips/atheros/ar71xxreg.h
+++ sys/mips/atheros/ar71xxreg.h
@@ -164,6 +164,7 @@
#define GPIO_FUNC_UART_EN (1 << 8)
#define GPIO_FUNC_USB_OC_EN (1 << 4)
#define GPIO_FUNC_USB_CLK_EN (0)
+#define AR71XX_GPIO_OUT_FUNCTION 0x2c
#define AR71XX_BASE_FREQ 40000000
#define AR71XX_PLL_CPU_BASE 0x18050000
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 23, 6:42 PM (19 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33451912
Default Alt Text
D20170.id57087.diff (1 KB)
Attached To
Mode
D20170: Add GPIO MUX support on AR934x and AR1321
Attached
Detach File
Event Timeline
Log In to Comment