[I2C] Kernel 4.19 | i2c-gpio-custom

I tried to use I2C for Kernel 4.19 and found this:

make menuconfig (line with Depends on: !LINUX_4_19 [=y] && GPIO_SUPPORT [=y])

Symbol: PACKAGE_kmod-i2c-gpio-custom [=n]
Type  : tristate
Prompt: kmod-i2c-gpio-custom   Custom GPIO-based I2C device
  Location:
    -> Kernel modules
(1)   -> I2C support
  Defined at tmp/.config-package.in:10447
  Depends on: !LINUX_4_19 [=y] && GPIO_SUPPORT [=y]
  Selects: PACKAGE_kmod-i2c-gpio [=y] && PACKAGE_kmod-i2c-core [=y]
  Selected by: MODULE_DEFAULT_kmod-i2c-gpio-custom [=n] && TARGET_PER_DEVICE_ROOTFS [=n] && m && MODULES [=y]

How to resolve that?

As I understand the Kernel 4.14 makes it possible to work with arbitrary i2s sensors via i2c-gpio-custom driver using raw GPIO numbers. And for the Kernel 4.19 this options has been removed:

How can I work with i2s sensors in the Kernel 4.19?

Which device?

Some already have I2C driver support.

Banana Pi BPI-R64. It has mt7622 CPU.

Do you mean i2c-gpio-custom or just i2c-gpio?

I have not found a solution yet how to work with custom l2c sensors at 4.19 Kernel.
Can anyone to suggest a workaround/solution?

Add I2C definitions to the DTS and build an image. Either the bit-bang or, if adventurous, a hardware-specific driver.

Documentation for the bit-bang driver (typically good for the at least the standard, 100 kHz rate) is at https://www.kernel.org/doc/Documentation/devicetree/bindings/i2c/i2c-gpio.txt

As a specific example for a different board

        i2c: i2c {
                compatible = "i2c-gpio";

                sda-gpios = <&gpio  5 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
                scl-gpios = <&gpio 21 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
        };
1 Like