From 1866f03b0addb931f0334fc52cace7b4d5bec05a Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 29 Oct 2013 18:13:52 +0100 Subject: [PATCH] meta-digi: do not enable spidev when touch is enabled They conflict. Warn the user about the problem and let they change the device tree manually. https://jira.digi.com/browse/DEL-840 Signed-off-by: Javier Viguera --- meta-digi-arm/recipes-kernel/linux/linux-dey_3.10.bb | 11 +++++++---- .../recipes-digi/dey-examples/dey-examples-spidev.bb | 7 +++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey_3.10.bb b/meta-digi-arm/recipes-kernel/linux/linux-dey_3.10.bb index 26f2a9a0c..515d74b19 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-dey_3.10.bb +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey_3.10.bb @@ -65,10 +65,13 @@ do_update_dts() { config_dts disable '_ssp1_' config_dts disable '_auart1_4wires' config_dts disable '_ethernet0_leds' - fi - if [ -n "${HAVE_EXAMPLE}" ]; then - config_dts enable 'ssp1_spi_gpio.dtsi' - config_dts enable 'ssp1_spi_gpio_spidev.dtsi' + else + # spidev conflicts with touchscreen, thus enable it only + # when touch is disabled + if [ -n "${HAVE_EXAMPLE}" ]; then + config_dts enable 'ssp1_spi_gpio.dtsi' + config_dts enable 'ssp1_spi_gpio_spidev.dtsi' + fi fi } addtask update_dts before do_install after do_sizecheck diff --git a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-spidev.bb b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-spidev.bb index e6da7a2ee..f24e80eec 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/dey-examples-spidev.bb +++ b/meta-digi-dey/recipes-digi/dey-examples/dey-examples-spidev.bb @@ -11,6 +11,13 @@ SRC_URI = "file://spidev_test" S = "${WORKDIR}/spidev_test" +# Warn the user in case we cannot enable spidev in the device tree +python do_warning_spidev() { + if d.getVar('HAVE_GUI', True) and not d.getVar('IS_KERNEL_2X', True): + bb.warn("SPIDEV conflicts with touchscreen so it was not enabled in the device tree") +} +addtask warning_spidev before do_compile + do_compile() { ${CC} -O2 -Wall spidev_test.c -o spidev_test }