All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Tomasz Figa <tomasz.figa@gmail.com>
Cc: linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org,
	"Kukjin Kim" <kgene.kim@samsung.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Olof Johansson" <olof@lixom.net>,
	"Sylwester Nawrocki" <sylvester.nawrocki@gmail.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Mark Brown" <broonie@kernel.org>,
	"Thierry Reding" <thierry.reding@gmail.com>
Subject: Re: [PATCH v4 04/20] clocksource: samsung_pwm_timer: Do not use clocksource_mmio
Date: Mon, 22 Jul 2013 05:56:16 +0200	[thread overview]
Message-ID: <51ECAD60.1000109@linaro.org> (raw)
In-Reply-To: <1374278673-25615-6-git-send-email-tomasz.figa@gmail.com>

On 07/20/2013 02:04 AM, Tomasz Figa wrote:
> In case of Samsung PWM timer, clocksource MMIO can not be used, because
> custom suspend/resume callbacks are required.
> 
> Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
> ---

Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Please in the future Cc me and Thomas Gleixner (clocksource/clockevent
maintainers).

Thanks
  -- Daniel

>  drivers/clocksource/Kconfig             |  1 -
>  drivers/clocksource/samsung_pwm_timer.c | 19 +++++++++++++++----
>  2 files changed, 15 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> index b7b9b04..41c6946 100644
> --- a/drivers/clocksource/Kconfig
> +++ b/drivers/clocksource/Kconfig
> @@ -99,7 +99,6 @@ config CLKSRC_EXYNOS_MCT
>  
>  config CLKSRC_SAMSUNG_PWM
>  	bool
> -	select CLKSRC_MMIO
>  	help
>  	  This is a new clocksource driver for the PWM timer found in
>  	  Samsung S3C, S5P and Exynos SoCs, replacing an earlier driver
> diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c
> index 823279b..753ffec 100644
> --- a/drivers/clocksource/samsung_pwm_timer.c
> +++ b/drivers/clocksource/samsung_pwm_timer.c
> @@ -288,6 +288,18 @@ static void __init samsung_clockevent_init(void)
>  	}
>  }
>  
> +static cycle_t samsung_clocksource_read(struct clocksource *c)
> +{
> +	return ~readl_relaxed(pwm.source_reg);
> +}
> +
> +static struct clocksource samsung_clocksource = {
> +	.name		= "samsung_clocksource_timer",
> +	.rating		= 250,
> +	.read		= samsung_clocksource_read,
> +	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
> +};
> +
>  /*
>   * Override the global weak sched_clock symbol with this
>   * local implementation which uses the clocksource to get some
> @@ -297,7 +309,7 @@ static void __init samsung_clockevent_init(void)
>   */
>  static u32 notrace samsung_read_sched_clock(void)
>  {
> -	return ~__raw_readl(pwm.source_reg);
> +	return samsung_clocksource_read(NULL);
>  }
>  
>  static void __init samsung_clocksource_init(void)
> @@ -324,9 +336,8 @@ static void __init samsung_clocksource_init(void)
>  	setup_sched_clock(samsung_read_sched_clock,
>  						pwm.variant.bits, clock_rate);
>  
> -	ret = clocksource_mmio_init(pwm.source_reg, "samsung_clocksource_timer",
> -					clock_rate, 250, pwm.variant.bits,
> -					clocksource_mmio_readl_down);
> +	samsung_clocksource.mask = CLOCKSOURCE_MASK(pwm.variant.bits);
> +	ret = clocksource_register_hz(&samsung_clocksource, clock_rate);
>  	if (ret)
>  		panic("samsung_clocksource_timer: can't register clocksource\n");
>  }
> 


-- 
 <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

WARNING: multiple messages have this Message-ID (diff)
From: daniel.lezcano@linaro.org (Daniel Lezcano)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 04/20] clocksource: samsung_pwm_timer: Do not use clocksource_mmio
Date: Mon, 22 Jul 2013 05:56:16 +0200	[thread overview]
Message-ID: <51ECAD60.1000109@linaro.org> (raw)
In-Reply-To: <1374278673-25615-6-git-send-email-tomasz.figa@gmail.com>

On 07/20/2013 02:04 AM, Tomasz Figa wrote:
> In case of Samsung PWM timer, clocksource MMIO can not be used, because
> custom suspend/resume callbacks are required.
> 
> Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
> ---

Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Please in the future Cc me and Thomas Gleixner (clocksource/clockevent
maintainers).

Thanks
  -- Daniel

>  drivers/clocksource/Kconfig             |  1 -
>  drivers/clocksource/samsung_pwm_timer.c | 19 +++++++++++++++----
>  2 files changed, 15 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> index b7b9b04..41c6946 100644
> --- a/drivers/clocksource/Kconfig
> +++ b/drivers/clocksource/Kconfig
> @@ -99,7 +99,6 @@ config CLKSRC_EXYNOS_MCT
>  
>  config CLKSRC_SAMSUNG_PWM
>  	bool
> -	select CLKSRC_MMIO
>  	help
>  	  This is a new clocksource driver for the PWM timer found in
>  	  Samsung S3C, S5P and Exynos SoCs, replacing an earlier driver
> diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c
> index 823279b..753ffec 100644
> --- a/drivers/clocksource/samsung_pwm_timer.c
> +++ b/drivers/clocksource/samsung_pwm_timer.c
> @@ -288,6 +288,18 @@ static void __init samsung_clockevent_init(void)
>  	}
>  }
>  
> +static cycle_t samsung_clocksource_read(struct clocksource *c)
> +{
> +	return ~readl_relaxed(pwm.source_reg);
> +}
> +
> +static struct clocksource samsung_clocksource = {
> +	.name		= "samsung_clocksource_timer",
> +	.rating		= 250,
> +	.read		= samsung_clocksource_read,
> +	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
> +};
> +
>  /*
>   * Override the global weak sched_clock symbol with this
>   * local implementation which uses the clocksource to get some
> @@ -297,7 +309,7 @@ static void __init samsung_clockevent_init(void)
>   */
>  static u32 notrace samsung_read_sched_clock(void)
>  {
> -	return ~__raw_readl(pwm.source_reg);
> +	return samsung_clocksource_read(NULL);
>  }
>  
>  static void __init samsung_clocksource_init(void)
> @@ -324,9 +336,8 @@ static void __init samsung_clocksource_init(void)
>  	setup_sched_clock(samsung_read_sched_clock,
>  						pwm.variant.bits, clock_rate);
>  
> -	ret = clocksource_mmio_init(pwm.source_reg, "samsung_clocksource_timer",
> -					clock_rate, 250, pwm.variant.bits,
> -					clocksource_mmio_readl_down);
> +	samsung_clocksource.mask = CLOCKSOURCE_MASK(pwm.variant.bits);
> +	ret = clocksource_register_hz(&samsung_clocksource, clock_rate);
>  	if (ret)
>  		panic("samsung_clocksource_timer: can't register clocksource\n");
>  }
> 


-- 
 <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:[~2013-07-22  3:56 UTC|newest]

Thread overview: 124+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-20  0:04 [PATCH v4 00/20] Samsung PWM support cleanup Tomasz Figa
2013-07-20  0:04 ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 01/20] clocksource: samsung_pwm_timer: Do not request PWM mem region Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 02/20] clocksource: samsung_pwm_timer: Correct definition of AUTORELOAD bit Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-20  0:04 ` Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-22  3:50   ` Daniel Lezcano
2013-07-22  3:50     ` Daniel Lezcano
2013-07-22  7:43     ` Tomasz Figa
2013-07-22  7:43       ` Tomasz Figa
2013-07-22 20:56       ` Daniel Lezcano
2013-07-22 20:56         ` Daniel Lezcano
2013-07-22 21:11         ` Tomasz Figa
2013-07-22 21:11           ` Tomasz Figa
2013-07-22 21:28           ` Daniel Lezcano
2013-07-22 21:28             ` Daniel Lezcano
2013-07-23 23:32             ` [PATCH v6 " Tomasz Figa
2013-07-23 23:32               ` Tomasz Figa
2013-07-29 13:08               ` Daniel Lezcano
2013-07-29 13:08                 ` Daniel Lezcano
2013-07-22 20:54   ` [PATCH v5 " Tomasz Figa
2013-07-22 20:54     ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 03/20] clocksource: samsung_pwm_timer: Cache clocksource register address Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 04/20] clocksource: samsung_pwm_timer: Do not use clocksource_mmio Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-22  3:56   ` Daniel Lezcano [this message]
2013-07-22  3:56     ` Daniel Lezcano
2013-07-22  7:47     ` Tomasz Figa
2013-07-22  7:47       ` Tomasz Figa
2013-07-22 20:13       ` Daniel Lezcano
2013-07-22 20:13         ` Daniel Lezcano
2013-07-22 20:17         ` Tomasz Figa
2013-07-22 20:17           ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 05/20] clocksource: samsung_pwm_timer: Handle suspend/resume correctly Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-22  3:57   ` Daniel Lezcano
2013-07-22  3:57     ` Daniel Lezcano
2013-07-20  0:04 ` [PATCH v4 06/20] ARM: SAMSUNG: Unify base address definitions of timer block Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 07/20] ARM: SAMSUNG: Add new PWM platform device Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-21 19:46   ` Sylwester Nawrocki
2013-07-21 19:46     ` Sylwester Nawrocki
2013-07-21 21:51     ` Tomasz Figa
2013-07-21 21:51       ` Tomasz Figa
2013-07-21 22:24       ` Tomasz Figa
2013-07-21 22:24         ` Tomasz Figa
2013-07-22 20:52   ` [PATCH v5 " Tomasz Figa
2013-07-22 20:52     ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 08/20] ARM: SAMSUNG: Set PWM platform data Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 09/20] ARM: SAMSUNG: Move all platforms to new clocksource driver Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-22  3:59   ` Daniel Lezcano
2013-07-22  3:59     ` Daniel Lezcano
2013-07-20  0:04 ` [PATCH v4 10/20] ARM: SAMSUNG: Remove old samsung-time driver Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 11/20] ARM: SAMSUNG: Remove unused PWM timer IRQ chip code Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 12/20] pwm: samsung: Rename to pwm-samsung-legacy Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-29 11:44   ` Thierry Reding
2013-07-29 11:44     ` Thierry Reding
2013-07-20  0:04 ` [PATCH v4 13/20] pwm: Add new pwm-samsung driver Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-21 19:50   ` Sylwester Nawrocki
2013-07-21 19:50     ` Sylwester Nawrocki
2013-07-21 21:58     ` Tomasz Figa
2013-07-21 21:58       ` Tomasz Figa
2013-07-22 20:50   ` [PATCH v5 " Tomasz Figa
2013-07-22 20:50     ` Tomasz Figa
2013-07-23 23:43     ` [PATCH v6 " Tomasz Figa
2013-07-23 23:43       ` Tomasz Figa
2013-08-07 19:35       ` Andrew Bresticker
2013-08-07 19:35         ` Andrew Bresticker
2013-08-07 19:49         ` Tomasz Figa
2013-08-07 19:49           ` Tomasz Figa
2013-08-08 17:13           ` Andrew Bresticker
2013-08-08 17:13             ` Andrew Bresticker
2013-08-08 21:27             ` Tomasz Figa
2013-08-08 21:27               ` Tomasz Figa
2013-07-29 11:44   ` [PATCH v4 " Thierry Reding
2013-07-29 11:44     ` Thierry Reding
2013-07-20  0:04 ` [PATCH v4 14/20] ARM: SAMSUNG: Rework private data handling in dev-backlight Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 15/20] ARM: SAMSUNG: Modify board files to use new PWM platform device Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 16/20] pwm: Remove superseded pwm-samsung-legacy driver Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-29 11:45   ` Thierry Reding
2013-07-29 11:45     ` Thierry Reding
2013-07-20  0:04 ` [PATCH v4 17/20] ARM: SAMSUNG: Remove old PWM timer platform devices Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 18/20] ARM: SAMSUNG: Remove pwm-clock infrastructure Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 19/20] ARM: SAMSUNG: Remove remaining uses of plat/regs-timer.h header Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-20  0:04 ` [PATCH v4 20/20] ARM: SAMSUNG: Remove " Tomasz Figa
2013-07-20  0:04   ` Tomasz Figa
2013-07-21 22:22 ` [PATCH v4 00/20] Samsung PWM support cleanup Sylwester Nawrocki
2013-07-21 22:22   ` Sylwester Nawrocki
2013-07-21 22:25   ` Tomasz Figa
2013-07-21 22:25     ` Tomasz Figa
2013-07-22  1:55     ` Kukjin Kim
2013-07-22  1:55       ` Kukjin Kim
2013-07-22  2:01     ` Kukjin Kim
2013-07-22  2:01       ` Kukjin Kim
2013-07-22  7:49       ` Tomasz Figa
2013-07-22  7:49         ` Tomasz Figa
2013-07-23 15:30         ` Thierry Reding
2013-07-23 15:30           ` Thierry Reding
2013-07-22 19:34       ` Olof Johansson
2013-07-22 19:34         ` Olof Johansson
2013-07-28 12:22 ` Mark Brown
2013-07-28 12:22   ` Mark Brown
2013-07-31 19:03 ` Tomasz Figa
2013-07-31 19:03   ` Tomasz Figa
2013-08-04 19:28   ` Olof Johansson
2013-08-04 19:28     ` Olof Johansson
2013-08-05 16:51     ` Kukjin Kim
2013-08-05 16:51       ` Kukjin Kim

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=51ECAD60.1000109@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=heiko@sntech.de \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=sylvester.nawrocki@gmail.com \
    --cc=thierry.reding@gmail.com \
    --cc=tomasz.figa@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.