summaryrefslogtreecommitdiff
path: root/drivers/pwm
diff options
context:
space:
mode:
authorChristoph Fritz <chf.fritz@googlemail.com>2016-11-22 12:01:28 +0100
committerStefano Babic <sbabic@denx.de>2016-11-29 16:34:27 +0100
commitde19773535d4eb4e698aec4ab0cdfe86d51a4696 (patch)
tree628991ebc3eb2b7109255839da263646057cd840 /drivers/pwm
parent84a62ca85d559c94779e985ea5e071aec3395bc5 (diff)
pwm: imx: increase support up to PWM8 for i.MX6SX
This patch increases supported PWMs from previously PWM4 now up to PWM8 if i.MX6SX is in use. Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/pwm-imx-util.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-imx-util.c b/drivers/pwm/pwm-imx-util.c
index 285564a6db..534dd8eece 100644
--- a/drivers/pwm/pwm-imx-util.c
+++ b/drivers/pwm/pwm-imx-util.c
@@ -15,7 +15,7 @@
#include <div64.h>
#include <asm/arch/imx-regs.h>
-/* pwm_id from 0..3 */
+/* pwm_id from 0..7 */
struct pwm_regs *pwm_id_to_reg(int pwm_id)
{
switch (pwm_id) {
@@ -27,6 +27,16 @@ struct pwm_regs *pwm_id_to_reg(int pwm_id)
return (struct pwm_regs *)PWM3_BASE_ADDR;
case 3:
return (struct pwm_regs *)PWM4_BASE_ADDR;
+#ifdef CONFIG_MX6SX
+ case 4:
+ return (struct pwm_regs *)PWM5_BASE_ADDR;
+ case 5:
+ return (struct pwm_regs *)PWM6_BASE_ADDR;
+ case 6:
+ return (struct pwm_regs *)PWM7_BASE_ADDR;
+ case 7:
+ return (struct pwm_regs *)PWM8_BASE_ADDR;
+#endif
default:
printf("unknown pwm_id: %d\n", pwm_id);
break;