Skip to content

Commit 705368d

Browse files
committed
only check kernel overlays if u-boot overlays are not being used
1 parent 095a9c1 commit 705368d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

source/c_pwm.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,9 @@ BBIO_err pwm_setup(const char *key, __attribute__ ((unused)) float duty, __attri
336336
}
337337

338338
// Make sure that one of the universal capes is loaded
339-
if (!( device_tree_loaded("cape-univ-audio") // from cdsteinkuehler/beaglebone-universal-io
339+
if( !uboot_overlay_enabled() // only check kernel overlays if u-boot overlays are not being used
340+
&&
341+
!( device_tree_loaded("cape-univ-audio") // from cdsteinkuehler/beaglebone-universal-io
340342
|| device_tree_loaded("cape-univ-emmc") // ""
341343
|| device_tree_loaded("cape-univ-hdmi") // ""
342344
|| device_tree_loaded("cape-universal") // ""
@@ -349,8 +351,7 @@ BBIO_err pwm_setup(const char *key, __attribute__ ((unused)) float duty, __attri
349351
|| device_tree_loaded("univ-nhdmi"))) // ""
350352
{
351353
syslog(LOG_ERR, "Adafruit_BBIO: pwm_setup: %s no suitable cape loaded", key);
352-
//FIXME; Assume U-Boot did the work...
353-
//return BBIO_CAPE;
354+
return BBIO_CAPE;
354355
}
355356
// Do pinmuxing
356357
if(!strcmp(key, "P9_28")) {

source/common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,10 @@ int uboot_overlay_enabled(void) {
560560
pclose(file);
561561

562562
if(uboot_overlay == '1') {
563+
syslog(LOG_DEBUG, "Adafruit_BBIO: uboot_overlay_enabled() is true\n");
563564
return 1;
564565
} else {
566+
syslog(LOG_DEBUG, "Adafruit_BBIO: uboot_overlay_enabled() is false\n");
565567
return 0;
566568
}
567569
}

0 commit comments

Comments
 (0)