diff mbox

[U-Boot] pwm: imx: increase support up to PWM8

Message ID 1476291708.17741.11.camel@googlemail.com
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Christoph Fritz Oct. 12, 2016, 5:01 p.m. UTC
This patch increases number of supported PWMs from previously
4 now up to 8.

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
---
 drivers/pwm/pwm-imx-util.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Stefano Babic Oct. 17, 2016, 7:21 a.m. UTC | #1
On 12/10/2016 19:01, Christoph Fritz wrote:
> This patch increases number of supported PWMs from previously
> 4 now up to 8.
> 
> Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic
Stefano Babic Oct. 17, 2016, 7:24 a.m. UTC | #2
On 17/10/2016 09:21, Stefano Babic wrote:
> On 12/10/2016 19:01, Christoph Fritz wrote:
>> This patch increases number of supported PWMs from previously
>> 4 now up to 8.
>>
>> Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
>> ---
> 
> Applied to u-boot-imx, thanks !


No, it is not. Not all i.MX (even MX6, the only user for PWM_IMX) has 8
PWMs. This patch breaks several boards aqnd must be fixed before applying.

Best regards,
Stefano Babic
diff mbox

Patch

diff --git a/drivers/pwm/pwm-imx-util.c b/drivers/pwm/pwm-imx-util.c
index f92c370..f030b44 100644
--- a/drivers/pwm/pwm-imx-util.c
+++ b/drivers/pwm/pwm-imx-util.c
@@ -27,6 +27,14 @@  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;
+	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;
 	default:
 		printf("unknown pwm_id: %d\n", pwm_id);
 		break;