[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5cdfbfdf-4d6e-de18-0f20-2f3b50129b87@linaro.org>
Date: Thu, 28 Jun 2018 16:03:18 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Stanley Chu <stanley.chu@...iatek.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Rob Herring <robh+dt@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
devicetree@...r.kernel.org, wsd_upstream@...iatek.com
Subject: Re: [PATCH v3 4/5] clocksource/drivers/timer-mediatek: Convert the
driver to timer-of
On 28/06/2018 12:45, Stanley Chu wrote:
> Convert the driver to use the timer_of helpers.
> This allows to remove custom proprietary structure,
> factors out and simplifies the code.
>
> Signed-off-by: Stanley Chu <stanley.chu@...iatek.com>
> ---
> drivers/clocksource/timer-mediatek.c | 222 ++++++++++++++++------------------
> 1 file changed, 104 insertions(+), 118 deletions(-)
>
> diff --git a/drivers/clocksource/timer-mediatek.c b/drivers/clocksource/timer-mediatek.c
> index ff284f2..d94d8e1 100644
> --- a/drivers/clocksource/timer-mediatek.c
> +++ b/drivers/clocksource/timer-mediatek.c
> @@ -18,16 +18,13 @@
>
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> -#include <linux/clk.h>
> #include <linux/clockchips.h>
> +#include <linux/clocksource.h>
> #include <linux/interrupt.h>
> -#include <linux/irq.h>
> #include <linux/irqreturn.h>
> -#include <linux/of.h>
> -#include <linux/of_address.h>
> -#include <linux/of_irq.h>
> #include <linux/sched_clock.h>
> #include <linux/slab.h>
> +#include "timer-of.h"
>
> #define GPT_IRQ_EN_REG 0x00
> #define GPT_IRQ_ENABLE(val) BIT((val) - 1)
> @@ -56,49 +53,57 @@
> #define GPT_CLK_EVT 1
> #define GPT_CLK_SRC 2
>
> -struct mtk_clock_event_device {
> - void __iomem *gpt_base;
> - u32 ticks_per_jiffy;
> - struct clock_event_device dev;
> +struct mtk_timer_private {
> + unsigned long ticks_per_jiffy;
> };
This private structure is not needed. There is timer_of_clk->period
cf.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/clocksource/timer-of.c#n144
--
<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
Powered by blists - more mailing lists