devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Stanley Chu <stanley.chu@mediatek.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Rob Herring <robh+dt@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	devicetree@vger.kernel.org, wsd_upstream@mediatek.com
Subject: Re: [PATCH v3 4/5] clocksource/drivers/timer-mediatek: Convert the driver to timer-of
Date: Thu, 28 Jun 2018 16:03:18 +0200	[thread overview]
Message-ID: <5cdfbfdf-4d6e-de18-0f20-2f3b50129b87@linaro.org> (raw)
In-Reply-To: <1530182744-10731-5-git-send-email-stanley.chu@mediatek.com>

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@mediatek.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

  reply	other threads:[~2018-06-28 14:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-28 10:45 [PATCH v3 0/5] Add system timer driver for Mediatek SoCs Stanley Chu
     [not found] ` <1530182744-10731-1-git-send-email-stanley.chu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-06-28 10:45   ` [PATCH v3 1/5] clocksource/drivers/timer-mediatek: Add system timer bindings Stanley Chu
2018-06-28 14:08     ` Daniel Lezcano
2018-06-29  0:15       ` Stanley Chu
2018-06-28 10:45   ` [PATCH v3 2/5] clocksource/drivers/timer-mediatek: Rename mtk_timer to timer-mediatek Stanley Chu
2018-06-28 10:45   ` [PATCH v3 5/5] clocksource/drivers/timer-mediatek: Add support for system timer Stanley Chu
2018-06-28 14:08     ` Daniel Lezcano
2018-06-29  0:16       ` Stanley Chu
2018-06-28 10:45 ` [PATCH v3 3/5] clocksource/drivers/timer-mediatek: Rename function prefix Stanley Chu
2018-06-28 10:45 ` [PATCH v3 4/5] clocksource/drivers/timer-mediatek: Convert the driver to timer-of Stanley Chu
2018-06-28 14:03   ` Daniel Lezcano [this message]
2018-06-29  0:10     ` Stanley Chu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5cdfbfdf-4d6e-de18-0f20-2f3b50129b87@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=stanley.chu@mediatek.com \
    --cc=tglx@linutronix.de \
    --cc=wsd_upstream@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).