Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1203938 > unrolled thread

[PULL] clockevents changes for 4.3

Started byDaniel Lezcano <daniel.lezcano@linaro.org>
First post2015-08-10 11:50 +0200
Last post2015-08-11 17:40 +0200
Articles 19 on this page of 79 — 5 participants

Back to article view | Back to linux.kernel


Contents

  [PULL] clockevents changes for 4.3 Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 11:50 +0200
    [PATCH 66/74] s390/time: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
    [PATCH 43/74] clockevents/drivers/prima2: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
    [PATCH 41/74] clockevents/drivers/integrator: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
    [PATCH 74/74] cris/time: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
    [PATCH 67/74] score/time: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      Re: [PATCH 67/74] score/time: Migrate to new 'set-state' interface Lennox Wu <lennox.wu@gmail.com> - 2015-08-16 19:10 +0200
    [PATCH 61/74] c6x/timer64: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
    [PATCH 31/74] clockevents/drivers/sh_tmu: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
    [PATCH 69/74] sparc/time: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
    [PATCH 72/74] xtensa/time: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
    [PATCH 08/74] clockevents/drivers/exynos_mct: Remove unneeded container_of() Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
    [PATCH 42/74] clockevents/drivers/keystone: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      Re: [PATCH 42/74] clockevents/drivers/keystone: Migrate to new 'set-state'  interface "santosh.shilimkar@oracle.com" <santosh.shilimkar@oracle.com> - 2015-08-10 19:00 +0200
    [PATCH 52/74] clockevents/drivers/dw_apb_timer: Add dynamic irq flag to the timer Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
    [PATCH 11/74] clockevents/drivers/asm9260: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
    [PATCH 23/74] clockevents/drivers/mxs: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
    [PATCH 01/74] clockevents/drivers/arm_arch_timer: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 51/74] clockevents/drivers/exynos_mct: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 70/74] um/time: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 12/74] clockevents/drivers/cadence_ttc: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 71/74] unicore/time: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 27/74] clockevents/drivers/rockchip: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 68/74] sh/localtimer: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 62/74] microblaze/timer: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 55/74] clockevents/drivers/timer-sp804: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 65/74] powerpc/time: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 73/74] kernel: broadcast-hrtimer: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 24/74] clockevents/drivers/nomadik-mtu: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 60/74] blackfin/time-ts: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 05/74] clockevents/drivers/cs5535: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 63/74] mn10300/cevt-mn10300: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 02/74] clockevents/drivers/arm_global_timer: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 64/74] openrisc/time: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 10/74] clockevents/drivers/sh_cmt: Remove obsolete sh-cmt-48-gen2 platform_device_id entry Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 47/74] clockevents/drivers/vf_pit: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:00 +0200
      [PATCH 32/74] clockevents/drivers/sun4i: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 25/74] clockevents/drivers/pxa: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 17/74] clockevents/drivers/i8253: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 49/74] clockevents/drivers/zevio: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 34/74] clockevents/drivers/time-armada-370-xp: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 44/74] clockevents/drivers/stm32: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 33/74] clockevents/drivers/tegra20: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 56/74] clockevents/drivers/timer-atmel-pit: Fix typo in structure initialization Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 30/74] clockevents/drivers/sh_mtu2: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 28/74] clockevents/drivers/samsung_pwm: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 38/74] clockevents/drivers/atmel: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 29/74] clockevents/drivers/sh_cmt: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 57/74] clocksource/drivers/sh_tmu: Fix traceback spotted in -next Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 22/74] clockevents/drivers/mtk: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 36/74] clockevents/drivers/orion: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 39/74] clockevents/drivers/atmel-st: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 37/74] clockevents/drivers/atlas7: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 53/74] clockevents/drivers/sh_cmt: Remove obsolete sh-cmt-48 platform_device_id entry Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 58/74] clockevents/drivers/h8300_timer8: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 45/74] clockevents/drivers/sun5i: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 54/74] clockevents/drivers/timer-imx-gpt: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 35/74] clockevents/drivers/efm32: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 46/74] clockevents/drivers/u300: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 20/74] clockevents/drivers/mips-gic: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 26/74] clockevents/drivers/qcom: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 40/74] clockevents/drivers/digicolor: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 48/74] clockevents/drivers/vt8500: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 50/74] clockevents/drivers/tcb_clksrc: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 21/74] clockevents/drivers/moxart: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 59/74] alpha/time: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 19/74] clockevents/drivers/metag_generic: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:10 +0200
      [PATCH 09/74] clockevents/drivers/sh_cmt: Remove obsolete sh-cmt-32-fast platform_device_id entry Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:20 +0200
      [PATCH 13/74] clockevents/drivers/clps711x: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:20 +0200
      [PATCH 14/74] clockevents/drivers/dummy_timer: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:20 +0200
      [PATCH 07/74] clockevents/drivers/Kconfig: Replace USE_OF with OF Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:20 +0200
      [PATCH 15/74] clockevents/drivers/dw_apb: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:20 +0200
      [PATCH 18/74] clockevents/drivers/meson6: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:20 +0200
      [PATCH 06/74] clockevents/drivers/em_sti: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:20 +0200
      [PATCH 16/74] clockevents/drivers/fsl_ftm: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:20 +0200
      [PATCH 04/74] clockevents/drivers/bcm_kona: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:20 +0200
        Re: [PATCH 04/74] clockevents/drivers/bcm_kona: Migrate to new 'set-state'  interface Scott Branden <sbranden@broadcom.com> - 2015-08-12 21:40 +0200
      [PATCH 03/74] clockevents/drivers/bcm2835: Migrate to new 'set-state' interface Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-10 12:20 +0200
        Re: [PATCH 03/74] clockevents/drivers/bcm2835: Migrate to new  'set-state' interface Lee Jones <lee@kernel.org> - 2015-08-11 17:40 +0200

Page 4 of 4 — ← Prev page 1 2 3 [4]


#1204016 — [PATCH 26/74] clockevents/drivers/qcom: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:10 +0200
Subject[PATCH 26/74] clockevents/drivers/qcom: Migrate to new 'set-state' interface
Message-ID<pVSbP-2Zz-93@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate qcom driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

Periodic mode isn't supported by the driver and so the callback isn't
provided anymore.

Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: Andy Gross <agross@codeaurora.org>
Cc: David Brown <davidb@codeaurora.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
---
 drivers/clocksource/qcom-timer.c | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/clocksource/qcom-timer.c b/drivers/clocksource/qcom-timer.c
index cba2d01..f8e09f9 100644
--- a/drivers/clocksource/qcom-timer.c
+++ b/drivers/clocksource/qcom-timer.c
@@ -47,7 +47,7 @@ static irqreturn_t msm_timer_interrupt(int irq, void *dev_id)
 {
 	struct clock_event_device *evt = dev_id;
 	/* Stop the timer tick */
-	if (evt->mode == CLOCK_EVT_MODE_ONESHOT) {
+	if (clockevent_state_oneshot(evt)) {
 		u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE);
 		ctrl &= ~TIMER_ENABLE_EN;
 		writel_relaxed(ctrl, event_base + TIMER_ENABLE);
@@ -75,26 +75,14 @@ static int msm_timer_set_next_event(unsigned long cycles,
 	return 0;
 }
 
-static void msm_timer_set_mode(enum clock_event_mode mode,
-			      struct clock_event_device *evt)
+static int msm_timer_shutdown(struct clock_event_device *evt)
 {
 	u32 ctrl;
 
 	ctrl = readl_relaxed(event_base + TIMER_ENABLE);
 	ctrl &= ~(TIMER_ENABLE_EN | TIMER_ENABLE_CLR_ON_MATCH_EN);
-
-	switch (mode) {
-	case CLOCK_EVT_MODE_RESUME:
-	case CLOCK_EVT_MODE_PERIODIC:
-		break;
-	case CLOCK_EVT_MODE_ONESHOT:
-		/* Timer is enabled in set_next_event */
-		break;
-	case CLOCK_EVT_MODE_UNUSED:
-	case CLOCK_EVT_MODE_SHUTDOWN:
-		break;
-	}
 	writel_relaxed(ctrl, event_base + TIMER_ENABLE);
+	return 0;
 }
 
 static struct clock_event_device __percpu *msm_evt;
@@ -126,7 +114,9 @@ static int msm_local_timer_setup(struct clock_event_device *evt)
 	evt->name = "msm_timer";
 	evt->features = CLOCK_EVT_FEAT_ONESHOT;
 	evt->rating = 200;
-	evt->set_mode = msm_timer_set_mode;
+	evt->set_state_shutdown = msm_timer_shutdown;
+	evt->set_state_oneshot = msm_timer_shutdown;
+	evt->tick_resume = msm_timer_shutdown;
 	evt->set_next_event = msm_timer_set_next_event;
 	evt->cpumask = cpumask_of(cpu);
 
@@ -147,7 +137,7 @@ static int msm_local_timer_setup(struct clock_event_device *evt)
 
 static void msm_local_timer_stop(struct clock_event_device *evt)
 {
-	evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
+	evt->set_state_shutdown(evt);
 	disable_percpu_irq(evt->irq);
 }
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204018 — [PATCH 40/74] clockevents/drivers/digicolor: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:10 +0200
Subject[PATCH 40/74] clockevents/drivers/digicolor: Migrate to new 'set-state' interface
Message-ID<pVSbP-2Zz-95@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate digicolor driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

Cc: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Tested-by: Baruch Siach <baruch@tkos.co.il>
---
 drivers/clocksource/timer-digicolor.c | 41 +++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 19 deletions(-)

diff --git a/drivers/clocksource/timer-digicolor.c b/drivers/clocksource/timer-digicolor.c
index 7f8388c..e73947f0f 100644
--- a/drivers/clocksource/timer-digicolor.c
+++ b/drivers/clocksource/timer-digicolor.c
@@ -87,27 +87,27 @@ static inline void dc_timer_set_count(struct clock_event_device *ce,
 	writel(count, dt->base + COUNT(dt->timer_id));
 }
 
-static void digicolor_clkevt_mode(enum clock_event_mode mode,
-				  struct clock_event_device *ce)
+static int digicolor_clkevt_shutdown(struct clock_event_device *ce)
+{
+	dc_timer_disable(ce);
+	return 0;
+}
+
+static int digicolor_clkevt_set_oneshot(struct clock_event_device *ce)
+{
+	dc_timer_disable(ce);
+	dc_timer_enable(ce, CONTROL_MODE_ONESHOT);
+	return 0;
+}
+
+static int digicolor_clkevt_set_periodic(struct clock_event_device *ce)
 {
 	struct digicolor_timer *dt = dc_timer(ce);
 
-	switch (mode) {
-	case CLOCK_EVT_MODE_PERIODIC:
-		dc_timer_disable(ce);
-		dc_timer_set_count(ce, dt->ticks_per_jiffy);
-		dc_timer_enable(ce, CONTROL_MODE_PERIODIC);
-		break;
-	case CLOCK_EVT_MODE_ONESHOT:
-		dc_timer_disable(ce);
-		dc_timer_enable(ce, CONTROL_MODE_ONESHOT);
-		break;
-	case CLOCK_EVT_MODE_UNUSED:
-	case CLOCK_EVT_MODE_SHUTDOWN:
-	default:
-		dc_timer_disable(ce);
-		break;
-	}
+	dc_timer_disable(ce);
+	dc_timer_set_count(ce, dt->ticks_per_jiffy);
+	dc_timer_enable(ce, CONTROL_MODE_PERIODIC);
+	return 0;
 }
 
 static int digicolor_clkevt_next_event(unsigned long evt,
@@ -125,7 +125,10 @@ static struct digicolor_timer dc_timer_dev = {
 		.name = "digicolor_tick",
 		.rating = 340,
 		.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
-		.set_mode = digicolor_clkevt_mode,
+		.set_state_shutdown = digicolor_clkevt_shutdown,
+		.set_state_periodic = digicolor_clkevt_set_periodic,
+		.set_state_oneshot = digicolor_clkevt_set_oneshot,
+		.tick_resume = digicolor_clkevt_shutdown,
 		.set_next_event = digicolor_clkevt_next_event,
 	},
 	.timer_id = TIMER_C,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204019 — [PATCH 48/74] clockevents/drivers/vt8500: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:10 +0200
Subject[PATCH 48/74] clockevents/drivers/vt8500: Migrate to new 'set-state' interface
Message-ID<pVSbP-2Zz-101@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate vt8500 driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

Cc: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/vt8500_timer.c | 29 ++++++++++-------------------
 1 file changed, 10 insertions(+), 19 deletions(-)

diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c
index 1098ed3..a92e94b 100644
--- a/drivers/clocksource/vt8500_timer.c
+++ b/drivers/clocksource/vt8500_timer.c
@@ -88,29 +88,20 @@ static int vt8500_timer_set_next_event(unsigned long cycles,
 	return 0;
 }
 
-static void vt8500_timer_set_mode(enum clock_event_mode mode,
-			      struct clock_event_device *evt)
+static int vt8500_shutdown(struct clock_event_device *evt)
 {
-	switch (mode) {
-	case CLOCK_EVT_MODE_RESUME:
-	case CLOCK_EVT_MODE_PERIODIC:
-		break;
-	case CLOCK_EVT_MODE_ONESHOT:
-	case CLOCK_EVT_MODE_UNUSED:
-	case CLOCK_EVT_MODE_SHUTDOWN:
-		writel(readl(regbase + TIMER_CTRL_VAL) | 1,
-			regbase + TIMER_CTRL_VAL);
-		writel(0, regbase + TIMER_IER_VAL);
-		break;
-	}
+	writel(readl(regbase + TIMER_CTRL_VAL) | 1, regbase + TIMER_CTRL_VAL);
+	writel(0, regbase + TIMER_IER_VAL);
+	return 0;
 }
 
 static struct clock_event_device clockevent = {
-	.name           = "vt8500_timer",
-	.features       = CLOCK_EVT_FEAT_ONESHOT,
-	.rating         = 200,
-	.set_next_event = vt8500_timer_set_next_event,
-	.set_mode       = vt8500_timer_set_mode,
+	.name			= "vt8500_timer",
+	.features		= CLOCK_EVT_FEAT_ONESHOT,
+	.rating			= 200,
+	.set_next_event		= vt8500_timer_set_next_event,
+	.set_state_shutdown	= vt8500_shutdown,
+	.set_state_oneshot	= vt8500_shutdown,
 };
 
 static irqreturn_t vt8500_timer_interrupt(int irq, void *dev_id)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204020 — [PATCH 50/74] clockevents/drivers/tcb_clksrc: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:10 +0200
Subject[PATCH 50/74] clockevents/drivers/tcb_clksrc: Migrate to new 'set-state' interface
Message-ID<pVSbQ-2Zz-105@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate tcb_clksrc driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/tcb_clksrc.c | 93 ++++++++++++++++++++++------------------
 1 file changed, 51 insertions(+), 42 deletions(-)

diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c
index 8bdbc45..d28d2fe 100644
--- a/drivers/clocksource/tcb_clksrc.c
+++ b/drivers/clocksource/tcb_clksrc.c
@@ -91,55 +91,62 @@ static struct tc_clkevt_device *to_tc_clkevt(struct clock_event_device *clkevt)
  */
 static u32 timer_clock;
 
-static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
+static int tc_shutdown(struct clock_event_device *d)
 {
 	struct tc_clkevt_device *tcd = to_tc_clkevt(d);
 	void __iomem		*regs = tcd->regs;
 
-	if (tcd->clkevt.mode == CLOCK_EVT_MODE_PERIODIC
-			|| tcd->clkevt.mode == CLOCK_EVT_MODE_ONESHOT) {
-		__raw_writel(0xff, regs + ATMEL_TC_REG(2, IDR));
-		__raw_writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR));
-		clk_disable(tcd->clk);
-	}
+	__raw_writel(0xff, regs + ATMEL_TC_REG(2, IDR));
+	__raw_writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR));
+	clk_disable(tcd->clk);
 
-	switch (m) {
+	return 0;
+}
 
-	/* By not making the gentime core emulate periodic mode on top
-	 * of oneshot, we get lower overhead and improved accuracy.
-	 */
-	case CLOCK_EVT_MODE_PERIODIC:
-		clk_enable(tcd->clk);
+static int tc_set_oneshot(struct clock_event_device *d)
+{
+	struct tc_clkevt_device *tcd = to_tc_clkevt(d);
+	void __iomem		*regs = tcd->regs;
 
-		/* slow clock, count up to RC, then irq and restart */
-		__raw_writel(timer_clock
-				| ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO,
-				regs + ATMEL_TC_REG(2, CMR));
-		__raw_writel((32768 + HZ/2) / HZ, tcaddr + ATMEL_TC_REG(2, RC));
+	if (clockevent_state_oneshot(d) || clockevent_state_periodic(d))
+		tc_shutdown(d);
 
-		/* Enable clock and interrupts on RC compare */
-		__raw_writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER));
+	clk_enable(tcd->clk);
 
-		/* go go gadget! */
-		__raw_writel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG,
-				regs + ATMEL_TC_REG(2, CCR));
-		break;
+	/* slow clock, count up to RC, then irq and stop */
+	__raw_writel(timer_clock | ATMEL_TC_CPCSTOP | ATMEL_TC_WAVE |
+		     ATMEL_TC_WAVESEL_UP_AUTO, regs + ATMEL_TC_REG(2, CMR));
+	__raw_writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER));
 
-	case CLOCK_EVT_MODE_ONESHOT:
-		clk_enable(tcd->clk);
+	/* set_next_event() configures and starts the timer */
+	return 0;
+}
 
-		/* slow clock, count up to RC, then irq and stop */
-		__raw_writel(timer_clock | ATMEL_TC_CPCSTOP
-				| ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO,
-				regs + ATMEL_TC_REG(2, CMR));
-		__raw_writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER));
+static int tc_set_periodic(struct clock_event_device *d)
+{
+	struct tc_clkevt_device *tcd = to_tc_clkevt(d);
+	void __iomem		*regs = tcd->regs;
 
-		/* set_next_event() configures and starts the timer */
-		break;
+	if (clockevent_state_oneshot(d) || clockevent_state_periodic(d))
+		tc_shutdown(d);
 
-	default:
-		break;
-	}
+	/* By not making the gentime core emulate periodic mode on top
+	 * of oneshot, we get lower overhead and improved accuracy.
+	 */
+	clk_enable(tcd->clk);
+
+	/* slow clock, count up to RC, then irq and restart */
+	__raw_writel(timer_clock | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO,
+		     regs + ATMEL_TC_REG(2, CMR));
+	__raw_writel((32768 + HZ / 2) / HZ, tcaddr + ATMEL_TC_REG(2, RC));
+
+	/* Enable clock and interrupts on RC compare */
+	__raw_writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER));
+
+	/* go go gadget! */
+	__raw_writel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG, regs +
+		     ATMEL_TC_REG(2, CCR));
+	return 0;
 }
 
 static int tc_next_event(unsigned long delta, struct clock_event_device *d)
@@ -154,13 +161,15 @@ static int tc_next_event(unsigned long delta, struct clock_event_device *d)
 
 static struct tc_clkevt_device clkevt = {
 	.clkevt	= {
-		.name		= "tc_clkevt",
-		.features	= CLOCK_EVT_FEAT_PERIODIC
-					| CLOCK_EVT_FEAT_ONESHOT,
+		.name			= "tc_clkevt",
+		.features		= CLOCK_EVT_FEAT_PERIODIC |
+					  CLOCK_EVT_FEAT_ONESHOT,
 		/* Should be lower than at91rm9200's system timer */
-		.rating		= 125,
-		.set_next_event	= tc_next_event,
-		.set_mode	= tc_mode,
+		.rating			= 125,
+		.set_next_event		= tc_next_event,
+		.set_state_shutdown	= tc_shutdown,
+		.set_state_periodic	= tc_set_periodic,
+		.set_state_oneshot	= tc_set_oneshot,
 	},
 };
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204021 — [PATCH 21/74] clockevents/drivers/moxart: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:10 +0200
Subject[PATCH 21/74] clockevents/drivers/moxart: Migrate to new 'set-state' interface
Message-ID<pVSbQ-2Zz-107@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate moxart driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

Cc: Jonas Jensen <jonas.jensen@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/moxart_timer.c | 49 ++++++++++++++++++++------------------
 1 file changed, 26 insertions(+), 23 deletions(-)

diff --git a/drivers/clocksource/moxart_timer.c b/drivers/clocksource/moxart_timer.c
index 5eb2c35..19857af 100644
--- a/drivers/clocksource/moxart_timer.c
+++ b/drivers/clocksource/moxart_timer.c
@@ -58,25 +58,24 @@
 static void __iomem *base;
 static unsigned int clock_count_per_tick;
 
-static void moxart_clkevt_mode(enum clock_event_mode mode,
-			       struct clock_event_device *clk)
+static int moxart_shutdown(struct clock_event_device *evt)
 {
-	switch (mode) {
-	case CLOCK_EVT_MODE_RESUME:
-	case CLOCK_EVT_MODE_ONESHOT:
-		writel(TIMER1_DISABLE, base + TIMER_CR);
-		writel(~0, base + TIMER1_BASE + REG_LOAD);
-		break;
-	case CLOCK_EVT_MODE_PERIODIC:
-		writel(clock_count_per_tick, base + TIMER1_BASE + REG_LOAD);
-		writel(TIMER1_ENABLE, base + TIMER_CR);
-		break;
-	case CLOCK_EVT_MODE_UNUSED:
-	case CLOCK_EVT_MODE_SHUTDOWN:
-	default:
-		writel(TIMER1_DISABLE, base + TIMER_CR);
-		break;
-	}
+	writel(TIMER1_DISABLE, base + TIMER_CR);
+	return 0;
+}
+
+static int moxart_set_oneshot(struct clock_event_device *evt)
+{
+	writel(TIMER1_DISABLE, base + TIMER_CR);
+	writel(~0, base + TIMER1_BASE + REG_LOAD);
+	return 0;
+}
+
+static int moxart_set_periodic(struct clock_event_device *evt)
+{
+	writel(clock_count_per_tick, base + TIMER1_BASE + REG_LOAD);
+	writel(TIMER1_ENABLE, base + TIMER_CR);
+	return 0;
 }
 
 static int moxart_clkevt_next_event(unsigned long cycles,
@@ -95,11 +94,15 @@ static int moxart_clkevt_next_event(unsigned long cycles,
 }
 
 static struct clock_event_device moxart_clockevent = {
-	.name		= "moxart_timer",
-	.rating		= 200,
-	.features	= CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
-	.set_mode	= moxart_clkevt_mode,
-	.set_next_event	= moxart_clkevt_next_event,
+	.name			= "moxart_timer",
+	.rating			= 200,
+	.features		= CLOCK_EVT_FEAT_PERIODIC |
+				  CLOCK_EVT_FEAT_ONESHOT,
+	.set_state_shutdown	= moxart_shutdown,
+	.set_state_periodic	= moxart_set_periodic,
+	.set_state_oneshot	= moxart_set_oneshot,
+	.tick_resume		= moxart_set_oneshot,
+	.set_next_event		= moxart_clkevt_next_event,
 };
 
 static irqreturn_t moxart_timer_interrupt(int irq, void *dev_id)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204022 — [PATCH 59/74] alpha/time: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:10 +0200
Subject[PATCH 59/74] alpha/time: Migrate to new 'set-state' interface
Message-ID<pVSbQ-2Zz-111@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate alpha driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

rtc clockevent device wasn't doing anything in set-mode and so its
set-state callbacks aren't implemented.

Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: linux-alpha@vger.kernel.org
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 arch/alpha/kernel/time.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index 643a9dc..5b6202a 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -93,7 +93,7 @@ rtc_timer_interrupt(int irq, void *dev)
 	struct clock_event_device *ce = &per_cpu(cpu_ce, cpu);
 
 	/* Don't run the hook for UNUSED or SHUTDOWN.  */
-	if (likely(ce->mode == CLOCK_EVT_MODE_PERIODIC))
+	if (likely(clockevent_state_periodic(ce)))
 		ce->event_handler(ce);
 
 	if (test_irq_work_pending()) {
@@ -104,13 +104,6 @@ rtc_timer_interrupt(int irq, void *dev)
 	return IRQ_HANDLED;
 }
 
-static void
-rtc_ce_set_mode(enum clock_event_mode mode, struct clock_event_device *ce)
-{
-	/* The mode member of CE is updated in generic code.
-	   Since we only support periodic events, nothing to do.  */
-}
-
 static int
 rtc_ce_set_next_event(unsigned long evt, struct clock_event_device *ce)
 {
@@ -129,7 +122,6 @@ init_rtc_clockevent(void)
 		.features = CLOCK_EVT_FEAT_PERIODIC,
 		.rating = 100,
 		.cpumask = cpumask_of(cpu),
-		.set_mode = rtc_ce_set_mode,
 		.set_next_event = rtc_ce_set_next_event,
 	};
 
@@ -161,12 +153,12 @@ static struct clocksource qemu_cs = {
  * The QEMU alarm as a clock_event_device primitive.
  */
 
-static void
-qemu_ce_set_mode(enum clock_event_mode mode, struct clock_event_device *ce)
+static int qemu_ce_shutdown(struct clock_event_device *ce)
 {
 	/* The mode member of CE is updated for us in generic code.
 	   Just make sure that the event is disabled.  */
 	qemu_set_alarm_abs(0);
+	return 0;
 }
 
 static int
@@ -197,7 +189,9 @@ init_qemu_clockevent(void)
 		.features = CLOCK_EVT_FEAT_ONESHOT,
 		.rating = 400,
 		.cpumask = cpumask_of(cpu),
-		.set_mode = qemu_ce_set_mode,
+		.set_state_shutdown = qemu_ce_shutdown,
+		.set_state_oneshot = qemu_ce_shutdown,
+		.tick_resume = qemu_ce_shutdown,
 		.set_next_event = qemu_ce_set_next_event,
 	};
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204023 — [PATCH 19/74] clockevents/drivers/metag_generic: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:10 +0200
Subject[PATCH 19/74] clockevents/drivers/metag_generic: Migrate to new 'set-state' interface
Message-ID<pVSbQ-2Zz-113@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate metag_generic driver to the new 'set-state' interface provided
by clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

We weren't doing anything in the ->set_mode() callback. Even the WARN()
for periodic or unused modes isn't required anymore as the core is
taking care of that now. So, this patch doesn't provide any set-state
callbacks.

Cc: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/metag_generic.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/drivers/clocksource/metag_generic.c b/drivers/clocksource/metag_generic.c
index b7384b8..bcd5c0d 100644
--- a/drivers/clocksource/metag_generic.c
+++ b/drivers/clocksource/metag_generic.c
@@ -56,25 +56,6 @@ static int metag_timer_set_next_event(unsigned long delta,
 	return 0;
 }
 
-static void metag_timer_set_mode(enum clock_event_mode mode,
-				 struct clock_event_device *evt)
-{
-	switch (mode) {
-	case CLOCK_EVT_MODE_ONESHOT:
-	case CLOCK_EVT_MODE_RESUME:
-		break;
-
-	case CLOCK_EVT_MODE_SHUTDOWN:
-		/* We should disable the IRQ here */
-		break;
-
-	case CLOCK_EVT_MODE_PERIODIC:
-	case CLOCK_EVT_MODE_UNUSED:
-		WARN_ON(1);
-		break;
-	};
-}
-
 static cycle_t metag_clocksource_read(struct clocksource *cs)
 {
 	return __core_reg_get(TXTIMER);
@@ -129,7 +110,6 @@ static void arch_timer_setup(unsigned int cpu)
 	clk->rating = 200,
 	clk->shift = 12,
 	clk->irq = tbisig_map(TBID_SIGNUM_TRT),
-	clk->set_mode = metag_timer_set_mode,
 	clk->set_next_event = metag_timer_set_next_event,
 
 	clk->mult = div_sc(hwtimer_freq, NSEC_PER_SEC, clk->shift);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204025 — [PATCH 09/74] clockevents/drivers/sh_cmt: Remove obsolete sh-cmt-32-fast platform_device_id entry

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:20 +0200
Subject[PATCH 09/74] clockevents/drivers/sh_cmt: Remove obsolete sh-cmt-32-fast platform_device_id entry
Message-ID<pVSlr-3cZ-5@gated-at.bofh.it>
In reply to#1203963
From: Geert Uytterhoeven <geert+renesas@glider.be>

Since commit 59b89af1d5551c12 ("ARM: shmobile: sh7372: Remove Legacy C
SoC code"), there are no more users left of the "sh-cmt-32-fast"
platform device name. Hence remove the corresponding platform_device_id
entry from the driver.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
---
 drivers/clocksource/sh_cmt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index b8ff3c6..0aa6293 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -929,7 +929,6 @@ static int sh_cmt_map_memory(struct sh_cmt_device *cmt)
 static const struct platform_device_id sh_cmt_id_table[] = {
 	{ "sh-cmt-16", (kernel_ulong_t)&sh_cmt_info[SH_CMT_16BIT] },
 	{ "sh-cmt-32", (kernel_ulong_t)&sh_cmt_info[SH_CMT_32BIT] },
-	{ "sh-cmt-32-fast", (kernel_ulong_t)&sh_cmt_info[SH_CMT_32BIT_FAST] },
 	{ "sh-cmt-48", (kernel_ulong_t)&sh_cmt_info[SH_CMT_48BIT] },
 	{ "sh-cmt-48-gen2", (kernel_ulong_t)&sh_cmt_info[SH_CMT_48BIT_GEN2] },
 	{ }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204028 — [PATCH 13/74] clockevents/drivers/clps711x: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:20 +0200
Subject[PATCH 13/74] clockevents/drivers/clps711x: Migrate to new 'set-state' interface
Message-ID<pVSlr-3cZ-11@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate clps711x driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

We weren't doing anything in the ->set_mode() callback. So, this patch
doesn't provide any set-state callbacks.

Cc: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/clps711x-timer.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/clocksource/clps711x-timer.c b/drivers/clocksource/clps711x-timer.c
index d83ec1f..cdd86e3 100644
--- a/drivers/clocksource/clps711x-timer.c
+++ b/drivers/clocksource/clps711x-timer.c
@@ -61,11 +61,6 @@ static irqreturn_t clps711x_timer_interrupt(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static void clps711x_clockevent_set_mode(enum clock_event_mode mode,
-					 struct clock_event_device *evt)
-{
-}
-
 static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base,
 					unsigned int irq)
 {
@@ -91,7 +86,6 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base,
 	clkevt->name = "clps711x-clockevent";
 	clkevt->rating = 300;
 	clkevt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_C3STOP;
-	clkevt->set_mode = clps711x_clockevent_set_mode;
 	clkevt->cpumask = cpumask_of(0);
 	clockevents_config_and_register(clkevt, HZ, 0, 0);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204033 — [PATCH 14/74] clockevents/drivers/dummy_timer: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:20 +0200
Subject[PATCH 14/74] clockevents/drivers/dummy_timer: Migrate to new 'set-state' interface
Message-ID<pVSls-3cZ-23@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate dummy_timer driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

We weren't doing anything in the ->set_mode() callback. So, this patch
doesn't provide any set-state callbacks.

Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Viresh Kumae <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/dummy_timer.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/clocksource/dummy_timer.c b/drivers/clocksource/dummy_timer.c
index 3199060..776b6c8 100644
--- a/drivers/clocksource/dummy_timer.c
+++ b/drivers/clocksource/dummy_timer.c
@@ -16,15 +16,6 @@
 
 static DEFINE_PER_CPU(struct clock_event_device, dummy_timer_evt);
 
-static void dummy_timer_set_mode(enum clock_event_mode mode,
-			   struct clock_event_device *evt)
-{
-	/*
-	 * Core clockevents code will call this when exchanging timer devices.
-	 * We don't need to do anything here.
-	 */
-}
-
 static void dummy_timer_setup(void)
 {
 	int cpu = smp_processor_id();
@@ -35,7 +26,6 @@ static void dummy_timer_setup(void)
 			  CLOCK_EVT_FEAT_ONESHOT |
 			  CLOCK_EVT_FEAT_DUMMY;
 	evt->rating	= 100;
-	evt->set_mode	= dummy_timer_set_mode;
 	evt->cpumask	= cpumask_of(cpu);
 
 	clockevents_register_device(evt);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204036 — [PATCH 07/74] clockevents/drivers/Kconfig: Replace USE_OF with OF

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:20 +0200
Subject[PATCH 07/74] clockevents/drivers/Kconfig: Replace USE_OF with OF
Message-ID<pVSls-3cZ-31@gated-at.bofh.it>
In reply to#1203963
From: Antonio Borneo <borneo.antonio@gmail.com>

USE_OF is used as intermediate Kconfig option by few arch's (ARM, MIPS,
Xtensa); in all these cases it implies setting option OF too. Replace the
only instance of USE_OF in clocksource with OF.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 4e57730..c03f04d 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -277,7 +277,7 @@ config CLKSRC_MIPS_GIC
 
 config CLKSRC_PXA
 	def_bool y if ARCH_PXA || ARCH_SA1100
-	select CLKSRC_OF if USE_OF
+	select CLKSRC_OF if OF
 	help
 	  This enables OST0 support available on PXA and SA-11x0
 	  platforms.
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204045 — [PATCH 15/74] clockevents/drivers/dw_apb: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:20 +0200
Subject[PATCH 15/74] clockevents/drivers/dw_apb: Migrate to new 'set-state' interface
Message-ID<pVSlt-3cZ-47@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate dw_apb driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/dw_apb_timer.c | 143 +++++++++++++++++++++----------------
 1 file changed, 81 insertions(+), 62 deletions(-)

diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c
index 35a8809..97ba7cb 100644
--- a/drivers/clocksource/dw_apb_timer.c
+++ b/drivers/clocksource/dw_apb_timer.c
@@ -110,71 +110,87 @@ static void apbt_enable_int(struct dw_apb_timer *timer)
 	apbt_writel(timer, ctrl, APBTMR_N_CONTROL);
 }
 
-static void apbt_set_mode(enum clock_event_mode mode,
-			  struct clock_event_device *evt)
+static int apbt_shutdown(struct clock_event_device *evt)
 {
+	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
 	unsigned long ctrl;
-	unsigned long period;
+
+	pr_debug("%s CPU %d state=shutdown\n", __func__,
+		 cpumask_first(evt->cpumask));
+
+	ctrl = apbt_readl(&dw_ced->timer, APBTMR_N_CONTROL);
+	ctrl &= ~APBTMR_CONTROL_ENABLE;
+	apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
+	return 0;
+}
+
+static int apbt_set_oneshot(struct clock_event_device *evt)
+{
 	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
+	unsigned long ctrl;
 
-	pr_debug("%s CPU %d mode=%d\n", __func__,
-		 cpumask_first(evt->cpumask),
-		 mode);
-
-	switch (mode) {
-	case CLOCK_EVT_MODE_PERIODIC:
-		period = DIV_ROUND_UP(dw_ced->timer.freq, HZ);
-		ctrl = apbt_readl(&dw_ced->timer, APBTMR_N_CONTROL);
-		ctrl |= APBTMR_CONTROL_MODE_PERIODIC;
-		apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
-		/*
-		 * DW APB p. 46, have to disable timer before load counter,
-		 * may cause sync problem.
-		 */
-		ctrl &= ~APBTMR_CONTROL_ENABLE;
-		apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
-		udelay(1);
-		pr_debug("Setting clock period %lu for HZ %d\n", period, HZ);
-		apbt_writel(&dw_ced->timer, period, APBTMR_N_LOAD_COUNT);
-		ctrl |= APBTMR_CONTROL_ENABLE;
-		apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
-		break;
-
-	case CLOCK_EVT_MODE_ONESHOT:
-		ctrl = apbt_readl(&dw_ced->timer, APBTMR_N_CONTROL);
-		/*
-		 * set free running mode, this mode will let timer reload max
-		 * timeout which will give time (3min on 25MHz clock) to rearm
-		 * the next event, therefore emulate the one-shot mode.
-		 */
-		ctrl &= ~APBTMR_CONTROL_ENABLE;
-		ctrl &= ~APBTMR_CONTROL_MODE_PERIODIC;
-
-		apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
-		/* write again to set free running mode */
-		apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
-
-		/*
-		 * DW APB p. 46, load counter with all 1s before starting free
-		 * running mode.
-		 */
-		apbt_writel(&dw_ced->timer, ~0, APBTMR_N_LOAD_COUNT);
-		ctrl &= ~APBTMR_CONTROL_INT;
-		ctrl |= APBTMR_CONTROL_ENABLE;
-		apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
-		break;
-
-	case CLOCK_EVT_MODE_UNUSED:
-	case CLOCK_EVT_MODE_SHUTDOWN:
-		ctrl = apbt_readl(&dw_ced->timer, APBTMR_N_CONTROL);
-		ctrl &= ~APBTMR_CONTROL_ENABLE;
-		apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
-		break;
-
-	case CLOCK_EVT_MODE_RESUME:
-		apbt_enable_int(&dw_ced->timer);
-		break;
-	}
+	pr_debug("%s CPU %d state=oneshot\n", __func__,
+		 cpumask_first(evt->cpumask));
+
+	ctrl = apbt_readl(&dw_ced->timer, APBTMR_N_CONTROL);
+	/*
+	 * set free running mode, this mode will let timer reload max
+	 * timeout which will give time (3min on 25MHz clock) to rearm
+	 * the next event, therefore emulate the one-shot mode.
+	 */
+	ctrl &= ~APBTMR_CONTROL_ENABLE;
+	ctrl &= ~APBTMR_CONTROL_MODE_PERIODIC;
+
+	apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
+	/* write again to set free running mode */
+	apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
+
+	/*
+	 * DW APB p. 46, load counter with all 1s before starting free
+	 * running mode.
+	 */
+	apbt_writel(&dw_ced->timer, ~0, APBTMR_N_LOAD_COUNT);
+	ctrl &= ~APBTMR_CONTROL_INT;
+	ctrl |= APBTMR_CONTROL_ENABLE;
+	apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
+	return 0;
+}
+
+static int apbt_set_periodic(struct clock_event_device *evt)
+{
+	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
+	unsigned long period = DIV_ROUND_UP(dw_ced->timer.freq, HZ);
+	unsigned long ctrl;
+
+	pr_debug("%s CPU %d state=periodic\n", __func__,
+		 cpumask_first(evt->cpumask));
+
+	ctrl = apbt_readl(&dw_ced->timer, APBTMR_N_CONTROL);
+	ctrl |= APBTMR_CONTROL_MODE_PERIODIC;
+	apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
+	/*
+	 * DW APB p. 46, have to disable timer before load counter,
+	 * may cause sync problem.
+	 */
+	ctrl &= ~APBTMR_CONTROL_ENABLE;
+	apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
+	udelay(1);
+	pr_debug("Setting clock period %lu for HZ %d\n", period, HZ);
+	apbt_writel(&dw_ced->timer, period, APBTMR_N_LOAD_COUNT);
+	ctrl |= APBTMR_CONTROL_ENABLE;
+	apbt_writel(&dw_ced->timer, ctrl, APBTMR_N_CONTROL);
+	return 0;
+}
+
+static int apbt_resume(struct clock_event_device *evt)
+{
+	struct dw_apb_clock_event_device *dw_ced = ced_to_dw_apb_ced(evt);
+
+	pr_debug("%s CPU %d state=resume\n", __func__,
+		 cpumask_first(evt->cpumask));
+
+	apbt_enable_int(&dw_ced->timer);
+	return 0;
 }
 
 static int apbt_next_event(unsigned long delta,
@@ -233,7 +249,10 @@ dw_apb_clockevent_init(int cpu, const char *name, unsigned rating,
 	dw_ced->ced.min_delta_ns = clockevent_delta2ns(5000, &dw_ced->ced);
 	dw_ced->ced.cpumask = cpumask_of(cpu);
 	dw_ced->ced.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
-	dw_ced->ced.set_mode = apbt_set_mode;
+	dw_ced->ced.set_state_shutdown = apbt_shutdown;
+	dw_ced->ced.set_state_periodic = apbt_set_periodic;
+	dw_ced->ced.set_state_oneshot = apbt_set_oneshot;
+	dw_ced->ced.tick_resume = apbt_resume;
 	dw_ced->ced.set_next_event = apbt_next_event;
 	dw_ced->ced.irq = dw_ced->timer.irq;
 	dw_ced->ced.rating = rating;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204046 — [PATCH 18/74] clockevents/drivers/meson6: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:20 +0200
Subject[PATCH 18/74] clockevents/drivers/meson6: Migrate to new 'set-state' interface
Message-ID<pVSlt-3cZ-49@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate meson6 driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

Cc: Carlo Caione <carlo@caione.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Carlo Caione <carlo@caione.org>
---
 drivers/clocksource/meson6_timer.c | 50 ++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 23 deletions(-)

diff --git a/drivers/clocksource/meson6_timer.c b/drivers/clocksource/meson6_timer.c
index 5c15cba..1fa22c4 100644
--- a/drivers/clocksource/meson6_timer.c
+++ b/drivers/clocksource/meson6_timer.c
@@ -67,25 +67,25 @@ static void meson6_clkevt_time_start(unsigned char timer, bool periodic)
 	writel(val | TIMER_ENABLE_BIT(timer), timer_base + TIMER_ISA_MUX);
 }
 
-static void meson6_clkevt_mode(enum clock_event_mode mode,
-			       struct clock_event_device *clk)
+static int meson6_shutdown(struct clock_event_device *evt)
 {
-	switch (mode) {
-	case CLOCK_EVT_MODE_PERIODIC:
-		meson6_clkevt_time_stop(CED_ID);
-		meson6_clkevt_time_setup(CED_ID, USEC_PER_SEC/HZ - 1);
-		meson6_clkevt_time_start(CED_ID, true);
-		break;
-	case CLOCK_EVT_MODE_ONESHOT:
-		meson6_clkevt_time_stop(CED_ID);
-		meson6_clkevt_time_start(CED_ID, false);
-		break;
-	case CLOCK_EVT_MODE_UNUSED:
-	case CLOCK_EVT_MODE_SHUTDOWN:
-	default:
-		meson6_clkevt_time_stop(CED_ID);
-		break;
-	}
+	meson6_clkevt_time_stop(CED_ID);
+	return 0;
+}
+
+static int meson6_set_oneshot(struct clock_event_device *evt)
+{
+	meson6_clkevt_time_stop(CED_ID);
+	meson6_clkevt_time_start(CED_ID, false);
+	return 0;
+}
+
+static int meson6_set_periodic(struct clock_event_device *evt)
+{
+	meson6_clkevt_time_stop(CED_ID);
+	meson6_clkevt_time_setup(CED_ID, USEC_PER_SEC / HZ - 1);
+	meson6_clkevt_time_start(CED_ID, true);
+	return 0;
 }
 
 static int meson6_clkevt_next_event(unsigned long evt,
@@ -99,11 +99,15 @@ static int meson6_clkevt_next_event(unsigned long evt,
 }
 
 static struct clock_event_device meson6_clockevent = {
-	.name		= "meson6_tick",
-	.rating		= 400,
-	.features	= CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
-	.set_mode	= meson6_clkevt_mode,
-	.set_next_event	= meson6_clkevt_next_event,
+	.name			= "meson6_tick",
+	.rating			= 400,
+	.features		= CLOCK_EVT_FEAT_PERIODIC |
+				  CLOCK_EVT_FEAT_ONESHOT,
+	.set_state_shutdown	= meson6_shutdown,
+	.set_state_periodic	= meson6_set_periodic,
+	.set_state_oneshot	= meson6_set_oneshot,
+	.tick_resume		= meson6_shutdown,
+	.set_next_event		= meson6_clkevt_next_event,
 };
 
 static irqreturn_t meson6_timer_interrupt(int irq, void *dev_id)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204051 — [PATCH 06/74] clockevents/drivers/em_sti: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:20 +0200
Subject[PATCH 06/74] clockevents/drivers/em_sti: Migrate to new 'set-state' interface
Message-ID<pVSlt-3cZ-53@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate em_sti driver to the new 'set-state' interface provided by
the clockevents core, the earlier 'set-mode' interface is marked
obsolete now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

NOTE: This also drops a special check:

	if (old_mode == CLOCK_EVT_MODE_ONESHOT)
		em_sti_stop(p, USER_CLOCKEVENT);

as it doesn't look like that important. This driver only supports
ONESHOT and we can only move only to SHUTDOWN from ONESHOT and.
Also on second call (on shutdown), em_sti_stop() would return without
disabling the device again.

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/em_sti.c | 39 ++++++++++++++-------------------------
 1 file changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/clocksource/em_sti.c b/drivers/clocksource/em_sti.c
index dc3c6ee..7a97a34 100644
--- a/drivers/clocksource/em_sti.c
+++ b/drivers/clocksource/em_sti.c
@@ -251,33 +251,21 @@ static struct em_sti_priv *ced_to_em_sti(struct clock_event_device *ced)
 	return container_of(ced, struct em_sti_priv, ced);
 }
 
-static void em_sti_clock_event_mode(enum clock_event_mode mode,
-				    struct clock_event_device *ced)
+static int em_sti_clock_event_shutdown(struct clock_event_device *ced)
 {
 	struct em_sti_priv *p = ced_to_em_sti(ced);
+	em_sti_stop(p, USER_CLOCKEVENT);
+	return 0;
+}
 
-	/* deal with old setting first */
-	switch (ced->mode) {
-	case CLOCK_EVT_MODE_ONESHOT:
-		em_sti_stop(p, USER_CLOCKEVENT);
-		break;
-	default:
-		break;
-	}
+static int em_sti_clock_event_set_oneshot(struct clock_event_device *ced)
+{
+	struct em_sti_priv *p = ced_to_em_sti(ced);
 
-	switch (mode) {
-	case CLOCK_EVT_MODE_ONESHOT:
-		dev_info(&p->pdev->dev, "used for oneshot clock events\n");
-		em_sti_start(p, USER_CLOCKEVENT);
-		clockevents_config(&p->ced, p->rate);
-		break;
-	case CLOCK_EVT_MODE_SHUTDOWN:
-	case CLOCK_EVT_MODE_UNUSED:
-		em_sti_stop(p, USER_CLOCKEVENT);
-		break;
-	default:
-		break;
-	}
+	dev_info(&p->pdev->dev, "used for oneshot clock events\n");
+	em_sti_start(p, USER_CLOCKEVENT);
+	clockevents_config(&p->ced, p->rate);
+	return 0;
 }
 
 static int em_sti_clock_event_next(unsigned long delta,
@@ -303,11 +291,12 @@ static void em_sti_register_clockevent(struct em_sti_priv *p)
 	ced->rating = 200;
 	ced->cpumask = cpu_possible_mask;
 	ced->set_next_event = em_sti_clock_event_next;
-	ced->set_mode = em_sti_clock_event_mode;
+	ced->set_state_shutdown = em_sti_clock_event_shutdown;
+	ced->set_state_oneshot = em_sti_clock_event_set_oneshot;
 
 	dev_info(&p->pdev->dev, "used for clock events\n");
 
-	/* Register with dummy 1 Hz value, gets updated in ->set_mode() */
+	/* Register with dummy 1 Hz value, gets updated in ->set_state_oneshot() */
 	clockevents_config_and_register(ced, 1, 2, 0xffffffff);
 }
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204057 — [PATCH 16/74] clockevents/drivers/fsl_ftm: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:20 +0200
Subject[PATCH 16/74] clockevents/drivers/fsl_ftm: Migrate to new 'set-state' interface
Message-ID<pVSlu-3cZ-73@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate fsl_ftm driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

Cc: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/fsl_ftm_timer.c | 35 +++++++++++++++++------------------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/drivers/clocksource/fsl_ftm_timer.c b/drivers/clocksource/fsl_ftm_timer.c
index 454227d..ef43469 100644
--- a/drivers/clocksource/fsl_ftm_timer.c
+++ b/drivers/clocksource/fsl_ftm_timer.c
@@ -153,19 +153,16 @@ static int ftm_set_next_event(unsigned long delta,
 	return 0;
 }
 
-static void ftm_set_mode(enum clock_event_mode mode,
-				struct clock_event_device *evt)
+static int ftm_set_oneshot(struct clock_event_device *evt)
 {
-	switch (mode) {
-	case CLOCK_EVT_MODE_PERIODIC:
-		ftm_set_next_event(priv->periodic_cyc, evt);
-		break;
-	case CLOCK_EVT_MODE_ONESHOT:
-		ftm_counter_disable(priv->clkevt_base);
-		break;
-	default:
-		return;
-	}
+	ftm_counter_disable(priv->clkevt_base);
+	return 0;
+}
+
+static int ftm_set_periodic(struct clock_event_device *evt)
+{
+	ftm_set_next_event(priv->periodic_cyc, evt);
+	return 0;
 }
 
 static irqreturn_t ftm_evt_interrupt(int irq, void *dev_id)
@@ -174,7 +171,7 @@ static irqreturn_t ftm_evt_interrupt(int irq, void *dev_id)
 
 	ftm_irq_acknowledge(priv->clkevt_base);
 
-	if (likely(evt->mode == CLOCK_EVT_MODE_ONESHOT)) {
+	if (likely(clockevent_state_oneshot(evt))) {
 		ftm_irq_disable(priv->clkevt_base);
 		ftm_counter_disable(priv->clkevt_base);
 	}
@@ -185,11 +182,13 @@ static irqreturn_t ftm_evt_interrupt(int irq, void *dev_id)
 }
 
 static struct clock_event_device ftm_clockevent = {
-	.name		= "Freescale ftm timer",
-	.features	= CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
-	.set_mode	= ftm_set_mode,
-	.set_next_event	= ftm_set_next_event,
-	.rating		= 300,
+	.name			= "Freescale ftm timer",
+	.features		= CLOCK_EVT_FEAT_PERIODIC |
+				  CLOCK_EVT_FEAT_ONESHOT,
+	.set_state_periodic	= ftm_set_periodic,
+	.set_state_oneshot	= ftm_set_oneshot,
+	.set_next_event		= ftm_set_next_event,
+	.rating			= 300,
 };
 
 static struct irqaction ftm_timer_irq = {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204059 — [PATCH 04/74] clockevents/drivers/bcm_kona: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:20 +0200
Subject[PATCH 04/74] clockevents/drivers/bcm_kona: Migrate to new 'set-state' interface
Message-ID<pVSlu-3cZ-77@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate bcm_kona driver to the new 'set-state' interface provided by
the clockevents core, the earlier 'set-mode' interface is marked
obsolete now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

Oneshot callback isn't required as it was empty.

Acked-by: Ray Jui <rjui@broadcom.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Ray Jui <rjui@broadcom.com>
Cc: Scott Branden <sbranden@broadcom.com>
Cc: bcm-kernel-feedback-list@broadcom.com
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/bcm_kona_timer.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/clocksource/bcm_kona_timer.c b/drivers/clocksource/bcm_kona_timer.c
index f1e33d0..e717e87 100644
--- a/drivers/clocksource/bcm_kona_timer.c
+++ b/drivers/clocksource/bcm_kona_timer.c
@@ -127,25 +127,18 @@ static int kona_timer_set_next_event(unsigned long clc,
 	return 0;
 }
 
-static void kona_timer_set_mode(enum clock_event_mode mode,
-			     struct clock_event_device *unused)
+static int kona_timer_shutdown(struct clock_event_device *evt)
 {
-	switch (mode) {
-	case CLOCK_EVT_MODE_ONESHOT:
-		/* by default mode is one shot don't do any thing */
-		break;
-	case CLOCK_EVT_MODE_UNUSED:
-	case CLOCK_EVT_MODE_SHUTDOWN:
-	default:
-		kona_timer_disable_and_clear(timers.tmr_regs);
-	}
+	kona_timer_disable_and_clear(timers.tmr_regs);
+	return 0;
 }
 
 static struct clock_event_device kona_clockevent_timer = {
 	.name = "timer 1",
 	.features = CLOCK_EVT_FEAT_ONESHOT,
 	.set_next_event = kona_timer_set_next_event,
-	.set_mode = kona_timer_set_mode
+	.set_state_shutdown = kona_timer_shutdown,
+	.tick_resume = kona_timer_shutdown,
 };
 
 static void __init kona_timer_clockevents_init(void)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1206346 — Re: [PATCH 04/74] clockevents/drivers/bcm_kona: Migrate to new 'set-state' interface

FromScott Branden <sbranden@broadcom.com>
Date2015-08-12 21:40 +0200
SubjectRe: [PATCH 04/74] clockevents/drivers/bcm_kona: Migrate to new 'set-state' interface
Message-ID<pWK2v-5uP-35@gated-at.bofh.it>
In reply to#1204059
Looks good, thanks.

On 15-08-10 02:51 AM, Daniel Lezcano wrote:
> From: Viresh Kumar <viresh.kumar@linaro.org>
>
> Migrate bcm_kona driver to the new 'set-state' interface provided by
> the clockevents core, the earlier 'set-mode' interface is marked
> obsolete now.
>
> This also enables us to implement callbacks for new states of clockevent
> devices, for example: ONESHOT_STOPPED.
>
> Oneshot callback isn't required as it was empty.
>
> Acked-by: Ray Jui <rjui@broadcom.com>
Acked-by; Scott Branden <sbranden@broadcom.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Ray Jui <rjui@broadcom.com>
> Cc: Scott Branden <sbranden@broadcom.com>
> Cc: bcm-kernel-feedback-list@broadcom.com
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
>   drivers/clocksource/bcm_kona_timer.c | 17 +++++------------
>   1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/clocksource/bcm_kona_timer.c b/drivers/clocksource/bcm_kona_timer.c
> index f1e33d0..e717e87 100644
> --- a/drivers/clocksource/bcm_kona_timer.c
> +++ b/drivers/clocksource/bcm_kona_timer.c
> @@ -127,25 +127,18 @@ static int kona_timer_set_next_event(unsigned long clc,
>   	return 0;
>   }
>
> -static void kona_timer_set_mode(enum clock_event_mode mode,
> -			     struct clock_event_device *unused)
> +static int kona_timer_shutdown(struct clock_event_device *evt)
>   {
> -	switch (mode) {
> -	case CLOCK_EVT_MODE_ONESHOT:
> -		/* by default mode is one shot don't do any thing */
> -		break;
> -	case CLOCK_EVT_MODE_UNUSED:
> -	case CLOCK_EVT_MODE_SHUTDOWN:
> -	default:
> -		kona_timer_disable_and_clear(timers.tmr_regs);
> -	}
> +	kona_timer_disable_and_clear(timers.tmr_regs);
> +	return 0;
>   }
>
>   static struct clock_event_device kona_clockevent_timer = {
>   	.name = "timer 1",
>   	.features = CLOCK_EVT_FEAT_ONESHOT,
>   	.set_next_event = kona_timer_set_next_event,
> -	.set_mode = kona_timer_set_mode
> +	.set_state_shutdown = kona_timer_shutdown,
> +	.tick_resume = kona_timer_shutdown,
>   };
>
>   static void __init kona_timer_clockevents_init(void)
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1204060 — [PATCH 03/74] clockevents/drivers/bcm2835: Migrate to new 'set-state' interface

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-10 12:20 +0200
Subject[PATCH 03/74] clockevents/drivers/bcm2835: Migrate to new 'set-state' interface
Message-ID<pVSlu-3cZ-79@gated-at.bofh.it>
In reply to#1203963
From: Viresh Kumar <viresh.kumar@linaro.org>

Migrate bcm2835 driver to the new 'set-state' interface provided by
the clockevents core, the earlier 'set-mode' interface is marked
obsolete now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

We weren't doing anything in the ->set_mode() callback. So, this patch
doesn't provide any set-state callbacks.

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Lee Jones <lee@kernel.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/bcm2835_timer.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/clocksource/bcm2835_timer.c b/drivers/clocksource/bcm2835_timer.c
index 26ed331..6f28229 100644
--- a/drivers/clocksource/bcm2835_timer.c
+++ b/drivers/clocksource/bcm2835_timer.c
@@ -54,21 +54,6 @@ static u64 notrace bcm2835_sched_read(void)
 	return readl_relaxed(system_clock);
 }
 
-static void bcm2835_time_set_mode(enum clock_event_mode mode,
-	struct clock_event_device *evt_dev)
-{
-	switch (mode) {
-	case CLOCK_EVT_MODE_ONESHOT:
-	case CLOCK_EVT_MODE_UNUSED:
-	case CLOCK_EVT_MODE_SHUTDOWN:
-	case CLOCK_EVT_MODE_RESUME:
-		break;
-	default:
-		WARN(1, "%s: unhandled event mode %d\n", __func__, mode);
-		break;
-	}
-}
-
 static int bcm2835_time_set_next_event(unsigned long event,
 	struct clock_event_device *evt_dev)
 {
@@ -129,7 +114,6 @@ static void __init bcm2835_timer_init(struct device_node *node)
 	timer->evt.name = node->name;
 	timer->evt.rating = 300;
 	timer->evt.features = CLOCK_EVT_FEAT_ONESHOT;
-	timer->evt.set_mode = bcm2835_time_set_mode;
 	timer->evt.set_next_event = bcm2835_time_set_next_event;
 	timer->evt.cpumask = cpumask_of(0);
 	timer->act.name = node->name;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1205223 — Re: [PATCH 03/74] clockevents/drivers/bcm2835: Migrate to new 'set-state' interface

FromLee Jones <lee@kernel.org>
Date2015-08-11 17:40 +0200
SubjectRe: [PATCH 03/74] clockevents/drivers/bcm2835: Migrate to new 'set-state' interface
Message-ID<pWjOG-Ph-27@gated-at.bofh.it>
In reply to#1204060
On Mon, 10 Aug 2015, Daniel Lezcano wrote:

> From: Viresh Kumar <viresh.kumar@linaro.org>
> 
> Migrate bcm2835 driver to the new 'set-state' interface provided by
> the clockevents core, the earlier 'set-mode' interface is marked
> obsolete now.
> 
> This also enables us to implement callbacks for new states of clockevent
> devices, for example: ONESHOT_STOPPED.
> 
> We weren't doing anything in the ->set_mode() callback. So, this patch
> doesn't provide any set-state callbacks.
> 
> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> Tested-by: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Lee Jones <lee@kernel.org>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
>  drivers/clocksource/bcm2835_timer.c | 16 ----------------
>  1 file changed, 16 deletions(-)

Looks fine.

Acked-by: Lee Jones <lee@kernel.org>

> diff --git a/drivers/clocksource/bcm2835_timer.c b/drivers/clocksource/bcm2835_timer.c
> index 26ed331..6f28229 100644
> --- a/drivers/clocksource/bcm2835_timer.c
> +++ b/drivers/clocksource/bcm2835_timer.c
> @@ -54,21 +54,6 @@ static u64 notrace bcm2835_sched_read(void)
>  	return readl_relaxed(system_clock);
>  }
>  
> -static void bcm2835_time_set_mode(enum clock_event_mode mode,
> -	struct clock_event_device *evt_dev)
> -{
> -	switch (mode) {
> -	case CLOCK_EVT_MODE_ONESHOT:
> -	case CLOCK_EVT_MODE_UNUSED:
> -	case CLOCK_EVT_MODE_SHUTDOWN:
> -	case CLOCK_EVT_MODE_RESUME:
> -		break;
> -	default:
> -		WARN(1, "%s: unhandled event mode %d\n", __func__, mode);
> -		break;
> -	}
> -}
> -
>  static int bcm2835_time_set_next_event(unsigned long event,
>  	struct clock_event_device *evt_dev)
>  {
> @@ -129,7 +114,6 @@ static void __init bcm2835_timer_init(struct device_node *node)
>  	timer->evt.name = node->name;
>  	timer->evt.rating = 300;
>  	timer->evt.features = CLOCK_EVT_FEAT_ONESHOT;
> -	timer->evt.set_mode = bcm2835_time_set_mode;
>  	timer->evt.set_next_event = bcm2835_time_set_next_event;
>  	timer->evt.cpumask = cpumask_of(0);
>  	timer->act.name = node->name;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Page 4 of 4 — ← Prev page 1 2 3 [4]

Back to top | Article view | linux.kernel


csiph-web