summaryrefslogtreecommitdiff
path: root/board/gateworks/gw_ventana/common.c
diff options
context:
space:
mode:
authorTim Harvey <tharvey@gateworks.com>2016-05-24 11:03:55 -0700
committerStefano Babic <sbabic@denx.de>2016-05-31 17:25:31 +0200
commitf17a9af84645f5b820da2e7d017b014923ce1b88 (patch)
treec3ba568cd60d1b3525c8774140a43021ed5b3d60 /board/gateworks/gw_ventana/common.c
parent83e00f193e766337254c490c2b28118b75cc575a (diff)
downloadu-boot-imx-f17a9af84645f5b820da2e7d017b014923ce1b88.zip
u-boot-imx-f17a9af84645f5b820da2e7d017b014923ce1b88.tar.gz
u-boot-imx-f17a9af84645f5b820da2e7d017b014923ce1b88.tar.bz2
imx: ventana: enable pwm device-tree property based on hwconfig
Most Ventana boards have a connector with off-board digital-I/O signals including some that can be pinmuxed as either a PWM or a GPIO. The hwconfig env variable is used to configure these and they will be pinmuxed according to this configuration in the bootloader. This patch adds a device-tree fixup that will enable the pwm controller nodes appropriately for digital-I/O's that are configured as pwm via hwconfig so that the pin can be used with the Linux kernel /sys/class/pwm API. Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'board/gateworks/gw_ventana/common.c')
-rw-r--r--board/gateworks/gw_ventana/common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index 7610381..44ee73f 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -762,6 +762,11 @@ void setup_board_gpio(int board, struct ventana_board_info *info)
gpio_direction_input(cfg->gpio_param);
} else if (hwconfig_subarg_cmp(arg, "mode", "pwm") &&
cfg->pwm_padmux) {
+ if (!cfg->pwm_param) {
+ printf("DIO%d: Error: pwm config invalid\n",
+ i);
+ continue;
+ }
if (!quiet)
printf("DIO%d: pwm%d\n", i, cfg->pwm_param);
imx_iomux_v3_setup_pad(cfg->pwm_padmux[cputype] |