Re: drivers/input/touchscreen/cyttsp_i2c.c:47:18: error: implicit declaration of function 'i2c_transfer'

From: Linus Walleij
Date: Wed Oct 02 2024 - 09:39:09 EST


On Wed, Oct 2, 2024 at 11:31 AM Dmitry Torokhov
<dmitry.torokhov@xxxxxxxxx> wrote:

> > drivers/input/touchscreen/cyttsp_i2c.c:118:26: warning: 'cyttsp_i2c_driver' defined but not used [-Wunused-variable]
> > 118 | static struct i2c_driver cyttsp_i2c_driver = {
> > | ^~~~~~~~~~~~~~~~~
> > cc1: some warnings being treated as errors
> >
>
> This is really weird: cyttsp_i2c.h includes linux/i2c.h, it has
> dependency in Kconfig on I2C and CONFIG_I2C is present in the .config
> referenced above, so all the declarations should be there.

I usually ask Arnd about all kind of Kconfig business when
things get weird.

But could it be one of these awful things:

config TOUCHSCREEN_CYTTSP_I2C
tristate "support I2C bus connection"
- depends on TOUCHSCREEN_CYTTSP_CORE && I2C
+ depends on TOUCHSCREEN_CYTTSP_CORE && (I2C=y ||
I2C=TOUCHSCREEN_CYTTSP_CORE)

Since I2C is tristate it could be a module and then this touchscreen
has to be a module too.

Yours,
Linus Walleij