From b3319339387d65ece69f32df050f906cfcef2a4a Mon Sep 17 00:00:00 2001 From: Petter Mabäcker Date: Sun, 28 Feb 2016 14:46:10 +0100 Subject: rpi-config: I2C support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With newer kernels (>=3.18) that supports device-trees I2C should be enabled with device-trees. This is now support by adding: ENABLE_I2C = "1" in local.conf This will enable the dtparams: i2c1 i2c_arm Signed-off-by: Petter Mabäcker Signed-off-by: Andrei Gherzan --- README | 7 +++++++ recipes-bsp/bootfiles/rpi-config_git.bb | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/README b/README index 5798e61..3e879dd 100644 --- a/README +++ b/README @@ -27,6 +27,7 @@ Contents: 3.J. Image with Initramfs 3.K. Device tree support 3.L. Enable SPI bus + 3.M. Enable I2C 4. Extra apps 4.A. omxplayer 5. Board Configuration @@ -207,6 +208,12 @@ NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disable When using device tree kernels, set this variable to enable the SPI bus ENABLE_SPI_BUS = "1" +3.M. Enable I2C +=============== +When using device tree kernels, set this variable to enable I2C +ENABLE_I2C = "1" + + 4. Extra apps ============= diff --git a/recipes-bsp/bootfiles/rpi-config_git.bb b/recipes-bsp/bootfiles/rpi-config_git.bb index 4cdffca..138cb37 100644 --- a/recipes-bsp/bootfiles/rpi-config_git.bb +++ b/recipes-bsp/bootfiles/rpi-config_git.bb @@ -75,6 +75,12 @@ do_deploy() { echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt fi + + if [ -n "${ENABLE_I2C}" ]; then + echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi } addtask deploy before do_package after do_install -- cgit v1.2.3-54-g00ecf