This patch adds multi-master and slave support to Linux's i2c-omap bus driver (for Texas Instruments' Sitara and OMAP SoCs), enabling full I2C support for the BeagleBone Black and many other SBCs/SoMs supported by this driver.
- Kernel Version 4.13+
- KConfig
- CONFIG_I2C_SLAVE
- CONFIG_ARCH_OMAP2PLUS 1
First, obtain a copy of the kernel sources from Linus' github or your BSP:
Now you can simply clone this repo, apply the patch file from the root of the
kernel source tree, add I2C_SLAVE
to the .config
, (re)build, and deploy the
kernel as normal.
git clone [email protected]:enndubyu/omap_i2c_slave.git
cd linux
# Apply patch
git apply ../omap_i2c_slave/0001-i2c-omap-add-slave-support.patch
# Select I2C_SLAVE=y and any desired backend drivers (e.g. I2C_SLAVE_EEPROM=m)
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- all
You can extend the kernel recipe
with a .bbappend
that applies this patch and adds the required options to your
.config
. See the yocto manual
for details.
Acting as a slave on an I2C bus requires slave support in the bus driver and a backend driver providing the actual functionality. This patch adds the former. For the backend driver, the kernel already includes a couple of existing drivers that might serve your needs, but most applications will require a custom driver. See the kernel documentation and the examples listed below for details on how to use the slave interface in a backend driver.
Footnotes
-
Rev. 1 IP (used in first-generation devices such as OMAP1510 and OMAP310) is not supported by this patch. ↩