Skip to contentSkip to conversation

i2c: mux: pca954x needs gpiolib

PATCH New Arnd Bergmann 2 participants 4 messages Jun 5, 2014

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

PATCH 1/1 i2c: mux: pca954x needs gpiolib

commit 4807e8459bce ("i2c: mux: pca954x: Use the descriptor-based GPIO API") moved this driver over to the gpio descriptor API, which means we now have a dependency on GPIOLIB and get this build error when it is disabled:

i2c/muxes/i2c-mux-pca954x.c: In function 'pca954x_probe':
i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration of function 'devm_gpiod_get' [-Werror=implicit-function-declaration]
gpio = devm_gpiod_get(&client->dev, "reset");
^
i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes pointer from integer without a cast [enabled by default]

  gpio = devm_gpiod_get(&client->dev, "reset");
       ^

i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration of function 'gpiod_direction_output' [-Werror=implicit-function-declaration]
gpiod_direction_output(gpio, 0);
^

This adds the dependency in Kconfig as we do for other similar drivers.

Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Wolfram Sang <[email protected]>
drivers/i2c/muxes/Kconfig +1 -0
index f7f9865b..f6d313e 100644
@@ -40,6 +40,7 @@ config I2C_MUX_PCA9541
 
 config I2C_MUX_PCA954x
 	tristate "Philips PCA954x I2C Mux/switches"
+	depends on GPIOLIB
 	help
 	  If you say yes here you get support for the Philips PCA954x
 	  I2C mux/switch devices.
#1 lore raw

PATCH 1/1 i2c: mux: pca954x needs gpiolib

Hi Arnd,

Quoted 12 lines · On Thursday 05 June 2014 12:44:47 Arnd Bergmann wrote:

commit 4807e8459bce ("i2c: mux: pca954x: Use the descriptor-based GPIO API") moved this driver over to the gpio descriptor API, which means we now have a dependency on GPIOLIB and get this build error when it is disabled:

i2c/muxes/i2c-mux-pca954x.c: In function 'pca954x_probe':
i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration of function 'devm_gpiod_get' [-Werror=implicit-function-declaration] gpio = devm_gpiod_get(&client->dev, "reset");
^
i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes pointer from integer without a cast [enabled by default] gpio =

Quoted 8 lines
devm_gpiod_get(&client->dev, "reset");
       ^
i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration of function
'gpiod_direction_output' [-Werror=implicit-function-declaration]
gpiod_direction_output(gpio, 0);
   ^

This adds the dependency in Kconfig as we do for other similar drivers.

I've sent "i2c: pca954x: Fix compilation without CONFIG_GPIOLIB" yesterday, which fixes the compilation issue by including <linux/gpio/consumer.h>. When CONFIG_GPIOLIB isn't set the header defines stub functions, keeping the driver usable without GPIOLIB support.

Quoted 17 lines
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Wolfram Sang <[email protected]>
drivers/i2c/muxes/Kconfig +1 -0
index f7f9865b..f6d313e 100644
@@ -40,6 +40,7 @@ config I2C_MUX_PCA9541
 
 config I2C_MUX_PCA954x
 	tristate "Philips PCA954x I2C Mux/switches"
+	depends on GPIOLIB
 	help
 	  If you say yes here you get support for the Philips PCA954x
 	  I2C mux/switch devices.
Signature · 3 lines
Regards,

Laurent Pinchart
#2 lore raw

PATCH 1/1 i2c: mux: pca954x needs gpiolib

Quoted 21 lines · On Thursday 05 June 2014 12:56:08 Laurent Pinchart wrote:
Quoted 19 lines · On Thursday 05 June 2014 12:44:47 Arnd Bergmann wrote:

commit 4807e8459bce ("i2c: mux: pca954x: Use the descriptor-based GPIO API") moved this driver over to the gpio descriptor API, which means we now have a dependency on GPIOLIB and get this build error when it is disabled:

i2c/muxes/i2c-mux-pca954x.c: In function 'pca954x_probe':
i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration of function 'devm_gpiod_get' [-Werror=implicit-function-declaration] gpio = devm_gpiod_get(&client->dev, "reset");
^
i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes pointer from integer without a cast [enabled by default] gpio =

devm_gpiod_get(&client->dev, "reset");
       ^
i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration of function
'gpiod_direction_output' [-Werror=implicit-function-declaration]
gpiod_direction_output(gpio, 0);
   ^
Quoted 6 lines
Quoted 1 line

This adds the dependency in Kconfig as we do for other similar drivers.

I've sent "i2c: pca954x: Fix compilation without CONFIG_GPIOLIB" yesterday, which fixes the compilation issue by including <linux/gpio/consumer.h>. When CONFIG_GPIOLIB isn't set the header defines stub functions, keeping the driver usable without GPIOLIB support.

Ok, makes sense. Should we remove the 'depends on GPIOLIB' from other drivers doing the same, too?

Arnd

#3 lore raw

PATCH 1/1 i2c: mux: pca954x needs gpiolib

Hi Arnd,

Quoted 28 lines · On Thursday 05 June 2014 13:24:16 Arnd Bergmann wrote:
Quoted 27 lines · On Thursday 05 June 2014 12:56:08 Laurent Pinchart wrote:
Quoted 25 lines · On Thursday 05 June 2014 12:44:47 Arnd Bergmann wrote:

commit 4807e8459bce ("i2c: mux: pca954x: Use the descriptor-based GPIO API") moved this driver over to the gpio descriptor API, which means we now have a dependency on GPIOLIB and get this build error when it is disabled:

i2c/muxes/i2c-mux-pca954x.c: In function 'pca954x_probe':
i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration of function
'devm_gpiod_get' [-Werror=implicit-function-declaration] gpio = devm_gpiod_get(&client->dev, "reset");
^

i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes pointer from
integer without a cast [enabled by default] gpio =

devm_gpiod_get(&client->dev, "reset");
       ^

i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration of function
'gpiod_direction_output' [-Werror=implicit-function-declaration]

gpiod_direction_output(gpio, 0);
   ^

This adds the dependency in Kconfig as we do for other similar drivers.

Quoted 7 lines
Quoted 4 lines

I've sent "i2c: pca954x: Fix compilation without CONFIG_GPIOLIB" yesterday, which fixes the compilation issue by including <linux/gpio/consumer.h>. When CONFIG_GPIOLIB isn't set the header defines stub functions, keeping the driver usable without GPIOLIB support.

Ok, makes sense. Should we remove the 'depends on GPIOLIB' from other drivers doing the same, too?

When the GPIO is optional I think so.

Signature · 3 lines
Regards,

Laurent Pinchart