mbox series

[0/4] clocksource: Add ast2600 support to fttmr010

Message ID 20191106060301.17408-1-joel@jms.id.au
Headers show
Series clocksource: Add ast2600 support to fttmr010 | expand

Message

Joel Stanley Nov. 6, 2019, 6:02 a.m. UTC
This series adds support for the AST2600 timer.

Joel Stanley (4):
  clocksource: fttmr010: Parametrise shutdown
  clocksource: fttmr010: Set interrupt and shutdown
  clocksource: fttmr010: Add support for ast2600
  dt-bindings: fttmr010: Add ast2600 compatible

 .../bindings/timer/faraday,fttmr010.txt       |  1 +
 drivers/clocksource/timer-fttmr010.c          | 68 +++++++++++++++----
 2 files changed, 54 insertions(+), 15 deletions(-)

Comments

Linus Walleij Nov. 7, 2019, 7:47 a.m. UTC | #1
On Wed, Nov 6, 2019 at 7:03 AM Joel Stanley <joel@jms.id.au> wrote:

> In preparation for supporting the ast2600 which uses a different method
> to clear bits in the control register, use a callback for performing the
> shutdown sequence.
>
> Signed-off-by: Joel Stanley <joel@jms.id.au>

Nice refactoring!

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Linus Walleij Nov. 7, 2019, 7:48 a.m. UTC | #2
On Wed, Nov 6, 2019 at 7:03 AM Joel Stanley <joel@jms.id.au> wrote:

> In preparation for supporting the ast2600, pass the shutdown and
> interrupt functions to the common init callback.
>
> Signed-off-by: Joel Stanley <joel@jms.id.au>

Provided the latter patches making use of it are OKed;
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Linus Walleij Nov. 7, 2019, 7:50 a.m. UTC | #3
On Wed, Nov 6, 2019 at 7:03 AM Joel Stanley <joel@jms.id.au> wrote:

> The ast2600 has some minor differences to previous versions. The
> interrupt handler must acknowledge the timer interrupt in a status
> register. Secondly the control register becomes write to set only,
> requiring the use of a separate set to clear register.
>
> Signed-off-by: Joel Stanley <joel@jms.id.au>

> +/*
> +  Control register set to clear for ast2600 only.
> + */
> +#define TIMER_CR_CLR           (0x3c)

If it is AST2600-specific then please add some AST2600 prefix such as
AST2600_TIMER_CR_CLR (0x3c)

With that:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Joel Stanley Nov. 7, 2019, 9:43 a.m. UTC | #4
On Thu, 7 Nov 2019 at 07:47, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Wed, Nov 6, 2019 at 7:03 AM Joel Stanley <joel@jms.id.au> wrote:
>
> > In preparation for supporting the ast2600 which uses a different method
> > to clear bits in the control register, use a callback for performing the
> > shutdown sequence.
> >
> > Signed-off-by: Joel Stanley <joel@jms.id.au>
>
> Nice refactoring!

Cheers. Thank you for the prompt review!

> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> Yours,
> Linus Walleij