lkml.org 
[lkml]   [2018]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v9 15/27] pwm: jz4740: Allow selection of PWM channels 0 and 1
Date
The TCU channels 0 and 1 were previously reserved for system tasks, and
thus unavailable for PWM.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---

Notes:
v6: New patch

v7: No change

v8: ingenic_tcu_[request,release]_channel are dropped. We now use
the memory resources provided to the driver to detect whether
or not we are allowed to use the TCU channel.

v9: Drop previous system. Call a API function provided by the
clocksource driver to know if we can use the channel as PWM.

drivers/pwm/pwm-jz4740.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/pwm/pwm-jz4740.c b/drivers/pwm/pwm-jz4740.c
index dd80a2cf6528..b6e105e774bd 100644
--- a/drivers/pwm/pwm-jz4740.c
+++ b/drivers/pwm/pwm-jz4740.c
@@ -44,11 +44,7 @@ static int jz4740_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
char clk_name[16];
int ret;

- /*
- * Timers 0 and 1 are used for system tasks, so they are unavailable
- * for use as PWMs.
- */
- if (pwm->hwpwm < 2)
+ if (!ingenic_tcu_pwm_can_use_chn(pwm->hwpwm))
return -EBUSY;

snprintf(clk_name, sizeof(clk_name), "timer%u", pwm->hwpwm);
--
2.11.0
\
 
 \ /
  Last update: 2018-12-27 19:16    [W:0.157 / U:27.652 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site