diff mbox series

[1/3] clocksource/drivers/timer-milbeaut: Fix to enable one-shot timer

Message ID 1553483149-8922-2-git-send-email-sugaya.taichi@socionext.com
State Superseded
Headers show
Series Bugfix and cleanup the timer driver for Milbeaut M10V | expand

Commit Message

Sugaya Taichi March 25, 2019, 3:05 a.m. UTC
Fix mlb_set_oneshot_state() to enable one-shot timer.
The function should stop and start a timer, but "start" statement was
dropped. Kick the register to start one-shot timer.

Signed-off-by: Sugaya Taichi <sugaya.taichi@socionext.com>

---
 drivers/clocksource/timer-milbeaut.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
1.9.1

Comments

Daniel Lezcano April 11, 2019, 8:08 p.m. UTC | #1
On 25/03/2019 04:05, Sugaya Taichi wrote:
> Fix mlb_set_oneshot_state() to enable one-shot timer.

> The function should stop and start a timer, but "start" statement was

> dropped. Kick the register to start one-shot timer.


Can you add the "Fixes" tag please.



> Signed-off-by: Sugaya Taichi <sugaya.taichi@socionext.com>

> ---

>  drivers/clocksource/timer-milbeaut.c | 2 ++

>  1 file changed, 2 insertions(+)

> 

> diff --git a/drivers/clocksource/timer-milbeaut.c b/drivers/clocksource/timer-milbeaut.c

> index f2019a8..9fd5d08 100644

> --- a/drivers/clocksource/timer-milbeaut.c

> +++ b/drivers/clocksource/timer-milbeaut.c

> @@ -80,6 +80,8 @@ static int mlb_set_state_oneshot(struct clock_event_device *clk)

>  	u32 val = MLB_TMR_TMCSR_CSL_DIV2;

>  

>  	writel_relaxed(val, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS);

> +	val |= MLB_TMR_TMCSR_CNTE | MLB_TMR_TMCSR_TRG | MLB_TMR_TMCSR_INTE;

> +	writel_relaxed(val, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS);

>  	return 0;

>  }

>  

> 



-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Sugaya Taichi April 12, 2019, 4:32 a.m. UTC | #2
Hi,

Thank you for your comment.

On 2019/04/12 5:08, Daniel Lezcano wrote:
> On 25/03/2019 04:05, Sugaya Taichi wrote:

>> Fix mlb_set_oneshot_state() to enable one-shot timer.

>> The function should stop and start a timer, but "start" statement was

>> dropped. Kick the register to start one-shot timer.

> 

> Can you add the "Fixes" tag please.

> 

I got it, will resend with correct form.

Thanks,
Sugaya Taichi

> 

> 

>> Signed-off-by: Sugaya Taichi <sugaya.taichi@socionext.com>

>> ---

>>   drivers/clocksource/timer-milbeaut.c | 2 ++

>>   1 file changed, 2 insertions(+)

>>

>> diff --git a/drivers/clocksource/timer-milbeaut.c b/drivers/clocksource/timer-milbeaut.c

>> index f2019a8..9fd5d08 100644

>> --- a/drivers/clocksource/timer-milbeaut.c

>> +++ b/drivers/clocksource/timer-milbeaut.c

>> @@ -80,6 +80,8 @@ static int mlb_set_state_oneshot(struct clock_event_device *clk)

>>   	u32 val = MLB_TMR_TMCSR_CSL_DIV2;

>>   

>>   	writel_relaxed(val, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS);

>> +	val |= MLB_TMR_TMCSR_CNTE | MLB_TMR_TMCSR_TRG | MLB_TMR_TMCSR_INTE;

>> +	writel_relaxed(val, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS);

>>   	return 0;

>>   }

>>   

>>

> 

>
diff mbox series

Patch

diff --git a/drivers/clocksource/timer-milbeaut.c b/drivers/clocksource/timer-milbeaut.c
index f2019a8..9fd5d08 100644
--- a/drivers/clocksource/timer-milbeaut.c
+++ b/drivers/clocksource/timer-milbeaut.c
@@ -80,6 +80,8 @@  static int mlb_set_state_oneshot(struct clock_event_device *clk)
 	u32 val = MLB_TMR_TMCSR_CSL_DIV2;
 
 	writel_relaxed(val, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS);
+	val |= MLB_TMR_TMCSR_CNTE | MLB_TMR_TMCSR_TRG | MLB_TMR_TMCSR_INTE;
+	writel_relaxed(val, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS);
 	return 0;
 }