Skip to contentSkip to conversation

ARM: w1-gpio: fix erroneous gpio requests

PATCH In review Johan Hovold 3 participants 4 messages Mar 12, 2013

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: w1-gpio: fix erroneous gpio requests

Fix regression introduced by commit d2323cf773 ("onewire: w1-gpio: add ext_pullup_enable pin in platform data") which added a gpio entry to the platform data, but did not add the required initialisers to the board files using it. Consequently, the driver would request gpio 0 at probe, which could break other uses of the corresponding pin.

On AT91 requesting gpio 0 changes the pin muxing for PIOA0, which, for instance, breaks SPI0 on at91sam9g20.

---

Not sure whose tree this should go in through, so adding relevant maintainers and authors as CC.

/Johan

 arch/arm/mach-at91/board-foxg20.c    | 1 +
 arch/arm/mach-at91/board-stamp9g20.c | 1 +
 arch/arm/mach-ixp4xx/vulcan-setup.c  | 1 +
 arch/arm/mach-pxa/raumfeld.c         | 1 +
 4 files changed, 4 insertions(+)
arch/arm/mach-at91/board-foxg20.c +1 -0
index 191d37c..1478294 100644
@@ -176,6 +176,7 @@ static struct w1_gpio_platform_data w1_gpio_pdata = {
 	/* If you choose to use a pin other than PB16 it needs to be 3.3V */
 	.pin		= AT91_PIN_PB16,
 	.is_open_drain  = 1,
+	.ext_pullup_enable_pin	= -EINVAL,
 };
 
 static struct platform_device w1_device = {
arch/arm/mach-at91/board-stamp9g20.c +1 -0
index 48a962b..58a6758 100644
@@ -188,6 +188,7 @@ static struct spi_board_info portuxg20_spi_devices[] = {
 static struct w1_gpio_platform_data w1_gpio_pdata = {
 	.pin		= AT91_PIN_PA29,
 	.is_open_drain	= 1,
+	.ext_pullup_enable_pin	= -EINVAL,
 };
 
 static struct platform_device w1_device = {
arch/arm/mach-ixp4xx/vulcan-setup.c +1 -0
index 2798f43..1dddc1b 100644
@@ -163,6 +163,7 @@ static struct platform_device vulcan_max6369 = {
 
 static struct w1_gpio_platform_data vulcan_w1_gpio_pdata = {
 	.pin			= 14,
+	.ext_pullup_enable_pin	= -EINVAL,
 };
 
 static struct platform_device vulcan_w1_gpio = {
arch/arm/mach-pxa/raumfeld.c +1 -0
index 25b08bfa..6283fcb 100644
@@ -505,6 +505,7 @@ static struct w1_gpio_platform_data w1_gpio_platform_data = {
 	.pin			= GPIO_ONE_WIRE,
 	.is_open_drain		= 0,
 	.enable_external_pullup	= w1_enable_external_pullup,
+	.ext_pullup_enable_pin	= -EINVAL,
 };
 
 struct platform_device raumfeld_w1_gpio_device = {
Signature · 1 line
1.8.1.5
#1 lore raw
Quoted 9 lines · Johan Hovold

Fix regression introduced by commit d2323cf773 ("onewire: w1-gpio: add ext_pullup_enable pin in platform data") which added a gpio entry to the platform data, but did not add the required initialisers to the board files using it. Consequently, the driver would request gpio 0 at probe, which could break other uses of the corresponding pin.

On AT91 requesting gpio 0 changes the pin muxing for PIOA0, which, for instance, breaks SPI0 on at91sam9g20.

Quoted 6 lines

---

Not sure whose tree this should go in through, so adding relevant maintainers and authors as CC.

As I took the offending patch, I might as well take this fix for it as well.

Unless anyone else objects?

thanks,

greg k-h

#2 lore raw
Quoted 9 lines · Greg Kroah-Hartman
Quoted 8 lines · Johan Hovold

Fix regression introduced by commit d2323cf773 ("onewire: w1-gpio: add ext_pullup_enable pin in platform data") which added a gpio entry to the platform data, but did not add the required initialisers to the board files using it. Consequently, the driver would request gpio 0 at probe, which could break other uses of the corresponding pin.

On AT91 requesting gpio 0 changes the pin muxing for PIOA0, which, for instance, breaks SPI0 on at91sam9g20.

not only on AT91, 0 is a valid gpio

Quoted 5 lines
Quoted 5 lines

---

Quoted 7 lines
Quoted 2 lines

Not sure whose tree this should go in through, so adding relevant maintainers and authors as CC.

As I took the offending patch, I might as well take this fix for it as well.

Unless anyone else objects?

Best Regards,
J.

#3 lore raw
Quoted 8 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 7 lines · Greg Kroah-Hartman
Quoted 6 lines · Johan Hovold

Fix regression introduced by commit d2323cf773 ("onewire: w1-gpio: add ext_pullup_enable pin in platform data") which added a gpio entry to the platform data, but did not add the required initialisers to the board files using it. Consequently, the driver would request gpio 0 at probe, which could break other uses of the corresponding pin.

Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

On AT91 requesting gpio 0 changes the pin muxing for PIOA0, which, for instance, breaks SPI0 on at91sam9g20.

not only on AT91, 0 is a valid gpio

AT91 (and 9g20) was just an example of what the implications could be like.

I discovered the change after having debugged broken MMC on a custom at91sam9g45 board.

Johan