Remove an old mistake of mine. This has sneak in the code i sent to gonzo
at that time, but AFAIK it is only used on routerboards. Enabling GPIO_FUNC_SPI_CS[1|2]_EN will claim the use of gpio pins 0 and 1 respectivelly for use as SPI CS pins. When really needed, this can still be enabled on kernel hints using the function_set and function_clear knobs.
This commit is contained in:
parent
dd75f2c5eb
commit
9cce5d9339
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=265814
@ -352,7 +352,6 @@ ar71xx_gpio_attach(device_t dev)
|
||||
int error = 0;
|
||||
int i, j, maxpin;
|
||||
int mask, pinon;
|
||||
int old = 0;
|
||||
|
||||
KASSERT((device_get_unit(dev) == 0),
|
||||
("ar71xx_gpio: Only one gpio module supported"));
|
||||
@ -391,19 +390,12 @@ ar71xx_gpio_attach(device_t dev)
|
||||
"function_set", &mask) == 0) {
|
||||
device_printf(dev, "function_set: 0x%x\n", mask);
|
||||
ar71xx_gpio_function_enable(sc, mask);
|
||||
old = 1;
|
||||
}
|
||||
/* Disable function bits that are required */
|
||||
if (resource_int_value(device_get_name(dev), device_get_unit(dev),
|
||||
"function_clear", &mask) == 0) {
|
||||
device_printf(dev, "function_clear: 0x%x\n", mask);
|
||||
ar71xx_gpio_function_disable(sc, mask);
|
||||
old = 1;
|
||||
}
|
||||
/* Handle previous behaviour */
|
||||
if (old == 0) {
|
||||
ar71xx_gpio_function_enable(sc, GPIO_FUNC_SPI_CS1_EN);
|
||||
ar71xx_gpio_function_enable(sc, GPIO_FUNC_SPI_CS2_EN);
|
||||
}
|
||||
|
||||
/* Configure all pins as input */
|
||||
@ -457,8 +449,6 @@ ar71xx_gpio_detach(device_t dev)
|
||||
|
||||
KASSERT(mtx_initialized(&sc->gpio_mtx), ("gpio mutex not initialized"));
|
||||
|
||||
ar71xx_gpio_function_disable(sc, GPIO_FUNC_SPI_CS1_EN);
|
||||
ar71xx_gpio_function_disable(sc, GPIO_FUNC_SPI_CS2_EN);
|
||||
bus_generic_detach(dev);
|
||||
|
||||
if (sc->gpio_mem_res)
|
||||
|
Loading…
Reference in New Issue
Block a user