Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1293961 > unrolled thread
| Started by | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| First post | 2015-12-17 16:00 +0100 |
| Last post | 2015-12-18 15:50 +0100 |
| Articles | 20 on this page of 72 — 2 participants |
Back to article view | Back to linux.kernel
[GIT PULL] clockevents for 4.5 Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-17 16:00 +0100
[PATCH 59/69] clocksource/drivers/dw_apb_timer: Use {readl|writel}_relaxed in critical path Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:20 +0100
[PATCH 11/69] clocksource/drivers/pxa_timer: Move the Kconfig rule Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:20 +0100
[PATCH 31/69] clocksource/drivers/prcmu: Fix Kconfig and add COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:20 +0100
[PATCH 03/69] clocksource/drivers/mtk_timer: Fix memleak in mtk_timer_init() Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:20 +0100
[PATCH 41/69] clocksource/drivers/h8300_timer8: Remove unused headers Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:20 +0100
[PATCH 05/69] clocksource/drivers/rockchip: Make the driver more readable Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:20 +0100
[PATCH 01/69] clocksource/drivers/mtk_timer: Add pr_fmt define Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:20 +0100
[PATCH 21/69] clocksource/drivers/dw_apb: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:20 +0100
[PATCH 07/69] clocksource/drivers/rockchip: Remove dsb() usage Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:20 +0100
[PATCH 34/69] clocksource/drivers/fsl-ftm: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:20 +0100
[PATCH 25/69] clocksource/drivers/vt8500: Remove unneeded header Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:20 +0100
[PATCH 53/69] clocksource/drivers/timer_sun5i: Replace code by clocksource_mmio_init Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:20 +0100
[PATCH 49/69] clocksource/drivers/h8300_timer16: Remove unused macros Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 54/69] clocksource/drivers/h8300_timer8: Separate the Kconfig option from the arch Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 51/69] clocksource/drivers/h8300_timer16: Fix irq return value check Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 66/69] clocksource/drivers/h8300: Fix timer not overflow case Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 47/69] clocksource/drivers/h8300_timer8: Retrieve the clock rate at init time Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 60/69] clocksource/drivers/dw_apb_timer: Inline apbt_readl and apbt_writel Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 65/69] clocksource/drivers/h8300: Change to overflow interrupt Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 55/69] h8300: Rename ctlr_out/in[bwl] to raw_read/write[bwl] Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 52/69] clocksource/drivers/h8300_timer16: Remove pointless lock Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 64/69] clocksource/drivers/lpc32: Correct pr_err() output format Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 48/69] clocksource/drivers/h8300_timer16: Remove pointless headers Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 63/69] clocksource/drivers/arm_global_timer: Fix suspend resume Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 68/69] clocksource/drivers/h8300: Initializer cleanup. Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 56/69] clocksource/drivers/h8300: Increase the compilation test coverage Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 67/69] clocksource/drivers/h8300: Simplify delta handling Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 50/69] clocksource/drivers/h8300_timer16: Remove unused fields in timer16_priv Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 44/69] clocksource/drivers/h8300_timer8: Fix irq return value check Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 58/69] clocksource/drivers/dw_apb_timer: Fix apbt_readl return types Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 45/69] clocksource/drivers/h8300_timer8: Remove pointless irq re-entrant safe code Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 62/69] clocksource/drivers/pistachio: Fix wrong calculated clocksource read value Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 46/69] clocksource/drivers/h8300_timer8: Remove irq and lock legacy code Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 69/69] clocksource/drivers/h8300: Use ioread / iowrite Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 61/69] clockevents/drivers/arm_global_timer: Use writel_relaxed in gt_compare_set Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 57/69] clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:30 +0100
[PATCH 43/69] clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 20/69] clocksource/drivers/digicolor: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 19/69] clocksource/drivers/orion: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 37/69] clocksource/drivers/h8300: Cleanup startup and remove module code. Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 30/69] clocksource/drivers/nomadik_mtu: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 40/69] clocksource/drivers/h8300_tpu: Remove pointless headers for TPU Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 39/69] clocksource/drivers/h8300_tpu: Remove unused macros Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 35/69] clocksource/drivers/Kconfig: Add missing GENERIC_CLOCKEVENTS dependency Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 27/69] clocksource/drivers/cadence_ttc: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 13/69] clocksource/drivers/tango: Add COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 17/69] clocksource/drivers/armada-370-xp: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 38/69] clocksource/drivers/h8300_timer8: Fix compilation error with dev_warn Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 42/69] clocksource/drivers/h8300_timer8: Remove unused macros Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 36/69] clocksource/drivers/dw_apb_timer_of: Implement ARM delay timer Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 26/69] clocksource/drivers/vt8500: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 22/69] clocksource/drivers/sun4i: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 12/69] clocksource/drivers/pxa_timer: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 23/69] clocksource/drivers/sun5i: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 28/69] clocksource/drivers/asm9260: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 18/69] clocksource/drivers/meson6: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 32/69] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 24/69] clocksource/drivers/tegra2: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 29/69] clocksource/drivers/lpc32xx: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 33/69] clocksource/drivers/samsung-pwm: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:40 +0100
[PATCH 14/69] clocksource/drivers/pistachio: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:50 +0100
[PATCH 08/69] clocksource/drivers/qcom: Make COMPILE_TEST enabled for ARM architecture Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:50 +0100
[PATCH 09/69] clocksource/drivers/st_lpc: Fix Kconfig dependency Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:50 +0100
[PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:50 +0100
Re: [PATCH 02/69] clocksource/drivers/mtk_timer: Fix pr_warn() messages in mtk_timer_init Matthias Brugger <matthias.bgg@gmail.com> - 2015-12-30 19:20 +0100
[PATCH 15/69] clocksource/drivers/mediatek: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:50 +0100
Re: [PATCH 15/69] clocksource/drivers/mediatek: Add the COMPILE_TEST option Matthias Brugger <matthias.bgg@gmail.com> - 2015-12-30 19:20 +0100
[PATCH 10/69] clocksource/drivers/st_lpc: Add the COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:50 +0100
[PATCH 06/69] time: Define dummy functions for the generic sched clock Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:50 +0100
[PATCH 16/69] clocksource/drivers/rockchip: Add COMPILE_TEST option Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:50 +0100
[PATCH 04/69] clocksource/drivers/tegra: Allow timer irq affinity change Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-12-18 15:50 +0100
Page 3 of 4 — ← Prev page 1 2 [3] 4 Next page →
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 37/69] clocksource/drivers/h8300: Cleanup startup and remove module code. |
| Message-ID | <qH4ml-6QB-7@gated-at.bofh.it> |
| In reply to | #1294848 |
From: Yoshinori Sato <ysato@users.sourceforge.jp>
Remove some legacy code and replace it by the clksrc-of code.
Do some cleanup and code consolidation.
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/clocksource/h8300_timer16.c | 141 +++++++++++++--------------------
drivers/clocksource/h8300_timer8.c | 150 ++++++++++++------------------------
drivers/clocksource/h8300_tpu.c | 117 ++++++++++------------------
3 files changed, 144 insertions(+), 264 deletions(-)
diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index 0e076c6..cdf0d83 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -17,6 +17,8 @@
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
#include <asm/segment.h>
#include <asm/irq.h>
@@ -47,9 +49,7 @@
#define ABSOLUTE 1
struct timer16_priv {
- struct platform_device *pdev;
struct clocksource cs;
- struct irqaction irqaction;
unsigned long total_cycles;
unsigned long mapbase;
unsigned long mapcommon;
@@ -144,110 +144,77 @@ static void timer16_disable(struct clocksource *cs)
p->cs_enabled = false;
}
+static struct timer16_priv timer16_priv = {
+ .cs = {
+ .name = "h8300_16timer",
+ .rating = 200,
+ .read = timer16_clocksource_read,
+ .enable = timer16_enable,
+ .disable = timer16_disable,
+ .mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8),
+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+ },
+};
+
#define REG_CH 0
#define REG_COMM 1
-static int timer16_setup(struct timer16_priv *p, struct platform_device *pdev)
+static void __init h8300_16timer_init(struct device_node *node)
{
- struct resource *res[2];
+ void __iomem *base[2];
int ret, irq;
unsigned int ch;
+ struct clk *clk;
- p->pdev = pdev;
-
- res[REG_CH] = platform_get_resource(p->pdev,
- IORESOURCE_MEM, REG_CH);
- res[REG_COMM] = platform_get_resource(p->pdev,
- IORESOURCE_MEM, REG_COMM);
- if (!res[REG_CH] || !res[REG_COMM]) {
- dev_err(&p->pdev->dev, "failed to get I/O memory\n");
- return -ENXIO;
- }
- irq = platform_get_irq(p->pdev, 0);
- if (irq < 0) {
- dev_err(&p->pdev->dev, "failed to get irq\n");
- return irq;
+ clk = of_clk_get(node, 0);
+ if (IS_ERR(clk)) {
+ pr_err("failed to get clock for clocksource\n");
+ return;
}
- p->clk = clk_get(&p->pdev->dev, "fck");
- if (IS_ERR(p->clk)) {
- dev_err(&p->pdev->dev, "can't get clk\n");
- return PTR_ERR(p->clk);
+ base[REG_CH] = of_iomap(node, 0);
+ if (!base[REG_CH]) {
+ pr_err("failed to map registers for clocksource\n");
+ goto free_clk;
}
- of_property_read_u32(p->pdev->dev.of_node, "renesas,channel", &ch);
-
- p->pdev = pdev;
- p->mapbase = res[REG_CH]->start;
- p->mapcommon = res[REG_COMM]->start;
- p->enb = 1 << ch;
- p->imfa = 1 << ch;
- p->imiea = 1 << (4 + ch);
- p->cs.name = pdev->name;
- p->cs.rating = 200;
- p->cs.read = timer16_clocksource_read;
- p->cs.enable = timer16_enable;
- p->cs.disable = timer16_disable;
- p->cs.mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8);
- p->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS;
- ret = request_irq(irq, timer16_interrupt,
- IRQF_TIMER, pdev->name, p);
- if (ret < 0) {
- dev_err(&p->pdev->dev, "failed to request irq %d\n", irq);
- return ret;
+ base[REG_COMM] = of_iomap(node, 1);
+ if (!base[REG_COMM]) {
+ pr_err("failed to map registers for clocksource\n");
+ goto unmap_ch;
}
- clocksource_register_hz(&p->cs, clk_get_rate(p->clk) / 8);
-
- return 0;
-}
-
-static int timer16_probe(struct platform_device *pdev)
-{
- struct timer16_priv *p = platform_get_drvdata(pdev);
-
- if (p) {
- dev_info(&pdev->dev, "kept as earlytimer\n");
- return 0;
+ irq = irq_of_parse_and_map(node, 0);
+ if (irq < 0) {
+ pr_err("failed to get irq for clockevent\n");
+ goto unmap_comm;
}
- p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
- if (!p)
- return -ENOMEM;
+ of_property_read_u32(node, "renesas,channel", &ch);
- return timer16_setup(p, pdev);
-}
+ timer16_priv.mapbase = (unsigned long)base[REG_CH];
+ timer16_priv.mapcommon = (unsigned long)base[REG_COMM];
+ timer16_priv.enb = 1 << ch;
+ timer16_priv.imfa = 1 << ch;
+ timer16_priv.imiea = 1 << (4 + ch);
-static int timer16_remove(struct platform_device *pdev)
-{
- return -EBUSY;
-}
-
-static const struct of_device_id timer16_of_table[] = {
- { .compatible = "renesas,16bit-timer" },
- { }
-};
-static struct platform_driver timer16_driver = {
- .probe = timer16_probe,
- .remove = timer16_remove,
- .driver = {
- .name = "h8300h-16timer",
- .of_match_table = of_match_ptr(timer16_of_table),
+ ret = request_irq(irq, timer16_interrupt,
+ IRQF_TIMER, timer16_priv.cs.name, &timer16_priv);
+ if (ret < 0) {
+ pr_err("failed to request irq %d of clocksource\n", irq);
+ goto unmap_comm;
}
-};
-static int __init timer16_init(void)
-{
- return platform_driver_register(&timer16_driver);
-}
+ clocksource_register_hz(&timer16_priv.cs,
+ clk_get_rate(timer16_priv.clk) / 8);
+ return;
-static void __exit timer16_exit(void)
-{
- platform_driver_unregister(&timer16_driver);
+unmap_comm:
+ iounmap(base[REG_COMM]);
+unmap_ch:
+ iounmap(base[REG_CH]);
+free_clk:
+ clk_put(clk);
}
-subsys_initcall(timer16_init);
-module_exit(timer16_exit);
-MODULE_AUTHOR("Yoshinori Sato");
-MODULE_DESCRIPTION("H8/300H 16bit Timer Driver");
-MODULE_LICENSE("GPL v2");
+CLOCKSOURCE_OF_DECLARE(h8300_16bit, "renesas,16bit-timer", h8300_16timer_init);
diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 44375d8..f0680eb 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -12,13 +12,14 @@
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/init.h>
-#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/clockchips.h>
#include <linux/module.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
#include <asm/irq.h>
@@ -39,10 +40,10 @@
#define RELATIVE 0
#define ABSOLUTE 1
+#define SCALE 64
+
struct timer8_priv {
- struct platform_device *pdev;
struct clock_event_device ced;
- struct irqaction irqaction;
unsigned long mapbase;
raw_spinlock_t lock;
unsigned long flags;
@@ -111,7 +112,7 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
static int timer8_enable(struct timer8_priv *p)
{
- p->rate = clk_get_rate(p->pclk) / 64;
+ p->rate = clk_get_rate(p->pclk) / SCALE;
ctrl_outw(0xffff, p->mapbase + TCORA);
ctrl_outw(0x0000, p->mapbase + _8TCNT);
ctrl_outw(0x0c02, p->mapbase + _8TCR);
@@ -179,7 +180,7 @@ static int timer8_clock_event_periodic(struct clock_event_device *ced)
{
struct timer8_priv *p = ced_to_priv(ced);
- dev_info(&p->pdev->dev, "used for periodic clock events\n");
+ pr_info("%s: used for periodic clock events\n", ced->name);
timer8_stop(p);
timer8_clock_event_start(p, PERIODIC);
@@ -190,7 +191,7 @@ static int timer8_clock_event_oneshot(struct clock_event_device *ced)
{
struct timer8_priv *p = ced_to_priv(ced);
- dev_info(&p->pdev->dev, "used for oneshot clock events\n");
+ pr_info("%s: used for oneshot clock events\n", ced->name);
timer8_stop(p);
timer8_clock_event_start(p, ONESHOT);
@@ -208,110 +209,61 @@ static int timer8_clock_event_next(unsigned long delta,
return 0;
}
-static int timer8_setup(struct timer8_priv *p,
- struct platform_device *pdev)
+static struct timer8_priv timer8_priv = {
+ .ced = {
+ .name = "h8300_8timer",
+ .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
+ .rating = 200,
+ .set_next_event = timer8_clock_event_next,
+ .set_state_shutdown = timer8_clock_event_shutdown,
+ .set_state_periodic = timer8_clock_event_periodic,
+ .set_state_oneshot = timer8_clock_event_oneshot,
+ },
+};
+
+static void __init h8300_8timer_init(struct device_node *node)
{
- struct resource *res;
+ void __iomem *base;
int irq;
- int ret;
+ int ret = 0;
+ int rate;
+ struct clk *clk;
- p->pdev = pdev;
+ clk = of_clk_get(node, 0);
+ if (IS_ERR(clk)) {
+ pr_err("failed to get clock for clockevent\n");
+ return;
+ }
- res = platform_get_resource(p->pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(&p->pdev->dev, "failed to get I/O memory\n");
- return -ENXIO;
+ base = of_iomap(node, 0);
+ if (!base) {
+ pr_err("failed to map registers for clockevent\n");
+ goto free_clk;
}
- irq = platform_get_irq(p->pdev, 0);
+ irq = irq_of_parse_and_map(node, 0);
if (irq < 0) {
- dev_err(&p->pdev->dev, "failed to get irq\n");
- return -ENXIO;
+ pr_err("failed to get irq for clockevent\n");
+ goto unmap_reg;
}
- p->mapbase = res->start;
-
- p->irqaction.name = dev_name(&p->pdev->dev);
- p->irqaction.handler = timer8_interrupt;
- p->irqaction.dev_id = p;
- p->irqaction.flags = IRQF_TIMER;
-
- p->pclk = clk_get(&p->pdev->dev, "fck");
- if (IS_ERR(p->pclk)) {
- dev_err(&p->pdev->dev, "can't get clk\n");
- return PTR_ERR(p->pclk);
- }
+ timer8_priv.mapbase = (unsigned long)base;
+ timer8_priv.pclk = clk;
- p->ced.name = pdev->name;
- p->ced.features = CLOCK_EVT_FEAT_PERIODIC |
- CLOCK_EVT_FEAT_ONESHOT;
- p->ced.rating = 200;
- p->ced.cpumask = cpumask_of(0);
- p->ced.set_next_event = timer8_clock_event_next;
- p->ced.set_state_shutdown = timer8_clock_event_shutdown;
- p->ced.set_state_periodic = timer8_clock_event_periodic;
- p->ced.set_state_oneshot = timer8_clock_event_oneshot;
-
- ret = setup_irq(irq, &p->irqaction);
+ ret = request_irq(irq, timer8_interrupt,
+ IRQF_TIMER, timer8_priv.ced.name, &timer8_priv);
if (ret < 0) {
- dev_err(&p->pdev->dev,
- "failed to request irq %d\n", irq);
- return ret;
+ pr_err("failed to request irq %d for clockevent\n", irq);
+ goto unmap_reg;
}
- clockevents_register_device(&p->ced);
- platform_set_drvdata(pdev, p);
-
- return 0;
-}
-
-static int timer8_probe(struct platform_device *pdev)
-{
- struct timer8_priv *p = platform_get_drvdata(pdev);
-
- if (p) {
- dev_info(&pdev->dev, "kept as earlytimer\n");
- return 0;
- }
-
- p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
- if (!p)
- return -ENOMEM;
-
- return timer8_setup(p, pdev);
-}
-
-static int timer8_remove(struct platform_device *pdev)
-{
- return -EBUSY;
-}
-
-static const struct of_device_id timer8_of_table[] __maybe_unused = {
- { .compatible = "renesas,8bit-timer" },
- { }
-};
-
-MODULE_DEVICE_TABLE(of, timer8_of_table);
-static struct platform_driver timer8_driver = {
- .probe = timer8_probe,
- .remove = timer8_remove,
- .driver = {
- .name = "h8300-8timer",
- .of_match_table = of_match_ptr(timer8_of_table),
- }
-};
-
-static int __init timer8_init(void)
-{
- return platform_driver_register(&timer8_driver);
-}
-
-static void __exit timer8_exit(void)
-{
- platform_driver_unregister(&timer8_driver);
+ rate = clk_get_rate(clk) / SCALE;
+ clockevents_config_and_register(&timer8_priv.ced, rate, 1, 0x0000ffff);
+ return;
+
+unmap_reg:
+ iounmap(base);
+free_clk:
+ clk_put(clk);
}
-subsys_initcall(timer8_init);
-module_exit(timer8_exit);
-MODULE_AUTHOR("Yoshinori Sato");
-MODULE_DESCRIPTION("H8/300 8bit Timer Driver");
-MODULE_LICENSE("GPL v2");
+CLOCKSOURCE_OF_DECLARE(h8300_8bit, "renesas,8bit-timer", h8300_8timer_init);
diff --git a/drivers/clocksource/h8300_tpu.c b/drivers/clocksource/h8300_tpu.c
index 5487410..ed0b493 100644
--- a/drivers/clocksource/h8300_tpu.c
+++ b/drivers/clocksource/h8300_tpu.c
@@ -1,5 +1,5 @@
/*
- * H8/300 TPU Driver
+ * H8S TPU Driver
*
* Copyright 2015 Yoshinori Sato <ysato@users.sourcefoge.jp>
*
@@ -17,8 +17,8 @@
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/of.h>
-
-#include <asm/irq.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
#define TCR 0
#define TMDR 1
@@ -32,9 +32,7 @@
#define TGRD 14
struct tpu_priv {
- struct platform_device *pdev;
struct clocksource cs;
- struct clk *clk;
unsigned long mapbase1;
unsigned long mapbase2;
raw_spinlock_t lock;
@@ -116,91 +114,54 @@ static void tpu_clocksource_disable(struct clocksource *cs)
p->cs_enabled = false;
}
+static struct tpu_priv tpu_priv = {
+ .cs = {
+ .name = "H8S_TPU",
+ .rating = 200,
+ .read = tpu_clocksource_read,
+ .enable = tpu_clocksource_enable,
+ .disable = tpu_clocksource_disable,
+ .mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8),
+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+ },
+};
+
#define CH_L 0
#define CH_H 1
-static int __init tpu_setup(struct tpu_priv *p, struct platform_device *pdev)
+static void __init h8300_tpu_init(struct device_node *node)
{
- struct resource *res[2];
-
- p->pdev = pdev;
+ void __iomem *base[2];
+ struct clk *clk;
- res[CH_L] = platform_get_resource(p->pdev, IORESOURCE_MEM, CH_L);
- res[CH_H] = platform_get_resource(p->pdev, IORESOURCE_MEM, CH_H);
- if (!res[CH_L] || !res[CH_H]) {
- dev_err(&p->pdev->dev, "failed to get I/O memory\n");
- return -ENXIO;
+ clk = of_clk_get(node, 0);
+ if (IS_ERR(clk)) {
+ pr_err("failed to get clock for clocksource\n");
+ return;
}
- p->clk = clk_get(&p->pdev->dev, "fck");
- if (IS_ERR(p->clk)) {
- dev_err(&p->pdev->dev, "can't get clk\n");
- return PTR_ERR(p->clk);
+ base[CH_L] = of_iomap(node, CH_L);
+ if (!base[CH_L]) {
+ pr_err("failed to map registers for clocksource\n");
+ goto free_clk;
}
-
- p->mapbase1 = res[CH_L]->start;
- p->mapbase2 = res[CH_H]->start;
-
- p->cs.name = pdev->name;
- p->cs.rating = 200;
- p->cs.read = tpu_clocksource_read;
- p->cs.enable = tpu_clocksource_enable;
- p->cs.disable = tpu_clocksource_disable;
- p->cs.mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8);
- p->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS;
- clocksource_register_hz(&p->cs, clk_get_rate(p->clk) / 64);
- platform_set_drvdata(pdev, p);
-
- return 0;
-}
-
-static int tpu_probe(struct platform_device *pdev)
-{
- struct tpu_priv *p = platform_get_drvdata(pdev);
-
- if (p) {
- dev_info(&pdev->dev, "kept as earlytimer\n");
- return 0;
+ base[CH_H] = of_iomap(node, CH_H);
+ if (!base[CH_H]) {
+ pr_err("failed to map registers for clocksource\n");
+ goto unmap_L;
}
- p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
- if (!p)
- return -ENOMEM;
+ tpu_priv.mapbase1 = (unsigned long)base[CH_L];
+ tpu_priv.mapbase2 = (unsigned long)base[CH_H];
- return tpu_setup(p, pdev);
-}
+ clocksource_register_hz(&tpu_priv.cs, clk_get_rate(clk) / 64);
-static int tpu_remove(struct platform_device *pdev)
-{
- return -EBUSY;
-}
+ return;
-static const struct of_device_id tpu_of_table[] = {
- { .compatible = "renesas,tpu" },
- { }
-};
-
-static struct platform_driver tpu_driver = {
- .probe = tpu_probe,
- .remove = tpu_remove,
- .driver = {
- .name = "h8s-tpu",
- .of_match_table = of_match_ptr(tpu_of_table),
- }
-};
-
-static int __init tpu_init(void)
-{
- return platform_driver_register(&tpu_driver);
-}
-
-static void __exit tpu_exit(void)
-{
- platform_driver_unregister(&tpu_driver);
+unmap_L:
+ iounmap(base[CH_H]);
+free_clk:
+ clk_put(clk);
}
-subsys_initcall(tpu_init);
-module_exit(tpu_exit);
-MODULE_AUTHOR("Yoshinori Sato");
-MODULE_DESCRIPTION("H8S Timer Pulse Unit Driver");
-MODULE_LICENSE("GPL v2");
+CLOCKSOURCE_OF_DECLARE(h8300_tpu, "renesas,tpu", h8300_tpu_init);
--
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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 30/69] clocksource/drivers/nomadik_mtu: Add the COMPILE_TEST option |
| Message-ID | <qH4ml-6QB-9@gated-at.bofh.it> |
| In reply to | #1294848 |
Increase the compilation test coverage by adding the COMPILE_TEST option. Due to the non portable code for the delay timer, this option is only available for the ARM architecture. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index ed7a824..847b3b1 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -108,8 +108,8 @@ config ASM9260_TIMER Enables support for the ASM9260 timer. config CLKSRC_NOMADIK_MTU - bool - depends on (ARCH_NOMADIK || ARCH_U8500) + bool "Nomakdik clocksource driver" if COMPILE_TEST + depends on ARM select CLKSRC_MMIO help Support for Multi Timer Unit. MTU provides access -- 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 40/69] clocksource/drivers/h8300_tpu: Remove pointless headers for TPU |
| Message-ID | <qH4ml-6QB-11@gated-at.bofh.it> |
| In reply to | #1294848 |
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/h8300_tpu.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/clocksource/h8300_tpu.c b/drivers/clocksource/h8300_tpu.c index 576dae6..c1eef42 100644 --- a/drivers/clocksource/h8300_tpu.c +++ b/drivers/clocksource/h8300_tpu.c @@ -6,14 +6,9 @@ */ #include <linux/errno.h> -#include <linux/sched.h> #include <linux/kernel.h> -#include <linux/interrupt.h> #include <linux/init.h> -#include <linux/platform_device.h> -#include <linux/slab.h> #include <linux/clocksource.h> -#include <linux/module.h> #include <linux/clk.h> #include <linux/io.h> #include <linux/of.h> -- 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 39/69] clocksource/drivers/h8300_tpu: Remove unused macros |
| Message-ID | <qH4ml-6QB-15@gated-at.bofh.it> |
| In reply to | #1294848 |
Some macros are unused, delete them.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/clocksource/h8300_tpu.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/clocksource/h8300_tpu.c b/drivers/clocksource/h8300_tpu.c
index ed0b493..576dae6 100644
--- a/drivers/clocksource/h8300_tpu.c
+++ b/drivers/clocksource/h8300_tpu.c
@@ -20,16 +20,9 @@
#include <linux/of_address.h>
#include <linux/of_irq.h>
-#define TCR 0
-#define TMDR 1
-#define TIOR 2
-#define TER 4
-#define TSR 5
-#define TCNT 6
-#define TGRA 8
-#define TGRB 10
-#define TGRC 12
-#define TGRD 14
+#define TCR 0x0
+#define TSR 0x5
+#define TCNT 0x6
struct tpu_priv {
struct clocksource cs;
--
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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 35/69] clocksource/drivers/Kconfig: Add missing GENERIC_CLOCKEVENTS dependency |
| Message-ID | <qH4ml-6QB-13@gated-at.bofh.it> |
| In reply to | #1294848 |
In order to compile on all arch without error with 'allyesconfig' make sure the platform selected the GENERIC_CLOCKEVENTS. Without this patch the new added drivers will prevent the kernel to compile on PARISC. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 7085eb7..de331b8 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -29,11 +29,13 @@ config CLKSRC_MMIO config DIGICOLOR_TIMER bool "Digicolor timer driver" if COMPILE_TEST + depends on GENERIC_CLOCKEVENTS help Enables the support for the digicolor timer driver. config DW_APB_TIMER bool "DW APB timer driver" if COMPILE_TEST + depends on GENERIC_CLOCKEVENTS help Enables the support for the dw_apb timer. @@ -58,6 +60,7 @@ config ARMADA_370_XP_TIMER config MESON6_TIMER bool "Meson6 timer driver" if COMPILE_TEST + depends on GENERIC_CLOCKEVENTS select CLKSRC_MMIO help Enables the support for the Meson6 timer driver. @@ -72,6 +75,7 @@ config ORION_TIMER config SUN4I_TIMER bool "Sun4i timer driver" if COMPILE_TEST + depends on GENERIC_CLOCKEVENTS select CLKSRC_MMIO help Enables support for the Sun4i timer. @@ -91,6 +95,7 @@ config TEGRA_TIMER config VT8500_TIMER bool "VT8500 timer driver" if COMPILE_TEST + depends on GENERIC_CLOCKEVENTS help Enables support for the VT8500 driver. @@ -102,6 +107,7 @@ config CADENCE_TTC_TIMER config ASM9260_TIMER bool "ASM9260 timer driver" if COMPILE_TEST + depends on GENERIC_CLOCKEVENTS select CLKSRC_MMIO select CLKSRC_OF help @@ -124,6 +130,7 @@ config CLKSRC_NOMADIK_MTU_SCHED_CLOCK config CLKSRC_DBX500_PRCMU bool "Clocksource PRCMU Timer" if COMPILE_TEST + depends on GENERIC_CLOCKEVENTS help Use the always on PRCMU Timer as clocksource @@ -145,6 +152,7 @@ config CLKSRC_EFM32 config CLKSRC_LPC32XX bool "Clocksource for LPC32XX" if COMPILE_TEST + depends on GENERIC_CLOCKEVENTS select CLKSRC_MMIO select CLKSRC_OF help @@ -238,6 +246,7 @@ config CLKSRC_EXYNOS_MCT config CLKSRC_SAMSUNG_PWM bool "PWM timer drvier for Samsung S3C, S5P" if COMPILE_TEST + depends on GENERIC_CLOCKEVENTS help This is a new clocksource driver for the PWM timer found in Samsung S3C, S5P and Exynos SoCs, replacing an earlier driver @@ -246,6 +255,7 @@ config CLKSRC_SAMSUNG_PWM config FSL_FTM_TIMER bool "Freescale FlexTimer Module driver" if COMPILE_TEST + depends on GENERIC_CLOCKEVENTS help Support for Freescale FlexTimer Module (FTM) timer. @@ -259,6 +269,7 @@ config SYS_SUPPORTS_SH_CMT config MTK_TIMER bool "Mediatek timer driver" if COMPILE_TEST + depends on GENERIC_CLOCKEVENTS select CLKSRC_OF select CLKSRC_MMIO help -- 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 27/69] clocksource/drivers/cadence_ttc: Add the COMPILE_TEST option |
| Message-ID | <qH4mm-6QB-17@gated-at.bofh.it> |
| In reply to | #1294848 |
Increase the compilation test coverage by adding the COMPILE_TEST option. The driver depends on the common clock framework, thus the dependency added on COMMON_CLK. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index c2b87b4..badef72 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -95,7 +95,10 @@ config VT8500_TIMER Enables support for the VT8500 driver. config CADENCE_TTC_TIMER - bool + bool "Cadence TTC timer driver" if COMPILE_TEST + depends on COMMON_CLK + help + Enables support for the cadence ttc driver. config ASM9260_TIMER bool -- 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 13/69] clocksource/drivers/tango: Add COMPILE_TEST option |
| Message-ID | <qH4mm-6QB-23@gated-at.bofh.it> |
| In reply to | #1294848 |
Increase the compilation test coverage by adding the COMPILE_TEST option. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index e07ada9..8ea7140 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -303,8 +303,11 @@ config CLKSRC_MIPS_GIC select CLKSRC_OF config CLKSRC_TANGO_XTAL - bool + bool "Clocksource for Tango SoC" if COMPILE_TEST + depends on ARM select CLKSRC_OF + help + This enables the clocksource for Tango SoC config CLKSRC_PXA bool "Clocksource for PXA or SA-11x0 platform" if COMPILE_TEST -- 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 17/69] clocksource/drivers/armada-370-xp: Add the COMPILE_TEST option |
| Message-ID | <qH4mm-6QB-35@gated-at.bofh.it> |
| In reply to | #1294848 |
Increase the compilation test coverage by adding the COMPILE_TEST option. Due to the non portable 'delay' code, the compilation is restricted to the ARM architecture only. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 0c06103..b6bb0a6 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -46,8 +46,11 @@ config ROCKCHIP_TIMER Enables the support for the rockchip timer driver. config ARMADA_370_XP_TIMER - bool + bool "Armada 370 and XP timer driver" if COMPILE_TEST + depends on ARM select CLKSRC_OF + help + Enables the support for the Armada 370 and XP timer driver. config MESON6_TIMER bool -- 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 38/69] clocksource/drivers/h8300_timer8: Fix compilation error with dev_warn |
| Message-ID | <qH4mm-6QB-37@gated-at.bofh.it> |
| In reply to | #1294848 |
The dev_warn is using the platform driver which was removed in the previous
patch.
Let's replace dev_warn by pr_warn.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/clocksource/h8300_timer8.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index f0680eb..35b0e8f 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -98,7 +98,7 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
raw_spin_lock_irqsave(&p->lock, flags);
if (delta >= 0x10000)
- dev_warn(&p->pdev->dev, "delta out of range\n");
+ pr_warn("delta out of range\n");
now = timer8_get_counter(p);
p->tcora = delta;
ctrl_outb(ctrl_inb(p->mapbase + _8TCR) | 0x40, p->mapbase + _8TCR);
--
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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 42/69] clocksource/drivers/h8300_timer8: Remove unused macros |
| Message-ID | <qH4mm-6QB-43@gated-at.bofh.it> |
| In reply to | #1294848 |
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/clocksource/h8300_timer8.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 62a7f8c..88b9b06 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -24,7 +24,6 @@
#define TCORB 6
#define _8TCNT 8
-#define FLAG_REPROGRAM (1 << 0)
#define FLAG_SKIPEVENT (1 << 1)
#define FLAG_IRQCONTEXT (1 << 2)
#define FLAG_STARTED (1 << 3)
@@ -32,9 +31,6 @@
#define ONESHOT 0
#define PERIODIC 1
-#define RELATIVE 0
-#define ABSOLUTE 1
-
#define SCALE 64
struct timer8_priv {
--
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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 36/69] clocksource/drivers/dw_apb_timer_of: Implement ARM delay timer |
| Message-ID | <qH4mn-6QB-51@gated-at.bofh.it> |
| In reply to | #1294848 |
From: Jisheng Zhang <jszhang@marvell.com>
Implement an ARM delay timer to be used for udelay(). This allows us to
skip the delay loop calibration at boot on Marvell BG2, BG2Q, BG2CD
platforms. And after this patch, udelay() will be unaffected by CPU
frequency changes.
Note: Although in case there are several possible delay timers, we may
not select the "best" delay timer. Take one Marvell Berlin platform for
example: we have arch timer and dw-apb timer. The arch timer freq is
25MHZ while the dw-apb timer freq is 100MHZ, current selection would
choose the dw-apb timer. But the dw apb timer is on the APB bus while
arch timer sits in CPU, the cost of accessing the apb timer is higher
than the arch timer. We could introduce "rating" concept to delay
timer, but this approach "brings a lot of complexity and workarounds
in the code for a small benefit" as pointed out by Daniel.
Later, Arnd pointed out "However, we could argue that this actually
doesn't matter at all, because the entire point of the ndelay()/
udelay()/mdelay() functions is to waste CPU cycles doing not much at
all, so we can just as well waste them reading the timer register
than spinning on the CPU reading the arch timer more often.", so we
just simply register the dw apb base delay timer.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/clocksource/dw_apb_timer_of.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c
index a19a3f6..860843c 100644
--- a/drivers/clocksource/dw_apb_timer_of.c
+++ b/drivers/clocksource/dw_apb_timer_of.c
@@ -16,6 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <linux/delay.h>
#include <linux/dw_apb_timer.h>
#include <linux/of.h>
#include <linux/of_address.h>
@@ -130,6 +131,17 @@ static void __init init_sched_clock(void)
sched_clock_register(read_sched_clock, 32, sched_rate);
}
+#ifdef CONFIG_ARM
+static unsigned long dw_apb_delay_timer_read(void)
+{
+ return ~readl_relaxed(sched_io_base);
+}
+
+static struct delay_timer dw_apb_delay_timer = {
+ .read_current_timer = dw_apb_delay_timer_read,
+};
+#endif
+
static int num_called;
static void __init dw_apb_timer_init(struct device_node *timer)
{
@@ -142,6 +154,10 @@ static void __init dw_apb_timer_init(struct device_node *timer)
pr_debug("%s: found clocksource timer\n", __func__);
add_clocksource(timer);
init_sched_clock();
+#ifdef CONFIG_ARM
+ dw_apb_delay_timer.freq = sched_rate;
+ register_current_timer_delay(&dw_apb_delay_timer);
+#endif
break;
default:
break;
--
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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 26/69] clocksource/drivers/vt8500: Add the COMPILE_TEST option |
| Message-ID | <qH4mn-6QB-59@gated-at.bofh.it> |
| In reply to | #1294848 |
Increase the compilation test coverage by adding the COMPILE_TEST option. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index e33ed76..c2b87b4 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -90,7 +90,9 @@ config TEGRA_TIMER Enables support for the Tegra driver. config VT8500_TIMER - bool + bool "VT8500 timer driver" if COMPILE_TEST + help + Enables support for the VT8500 driver. config CADENCE_TTC_TIMER bool -- 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 22/69] clocksource/drivers/sun4i: Add the COMPILE_TEST option |
| Message-ID | <qH4mn-6QB-57@gated-at.bofh.it> |
| In reply to | #1294848 |
Increase the compilation test coverage by adding the COMPILE_TEST option. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 24a8d8d..67be8f4 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -71,8 +71,10 @@ config ORION_TIMER Enables the support for the Orion timer driver config SUN4I_TIMER + bool "Sun4i timer driver" if COMPILE_TEST select CLKSRC_MMIO - bool + help + Enables support for the Sun4i timer. config SUN5I_HSTIMER select CLKSRC_MMIO -- 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 12/69] clocksource/drivers/pxa_timer: Add the COMPILE_TEST option |
| Message-ID | <qH4mn-6QB-67@gated-at.bofh.it> |
| In reply to | #1294848 |
Increase the compilation test coverage by adding the COMPILE_TEST option. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index d4221e0..e07ada9 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -307,7 +307,9 @@ config CLKSRC_TANGO_XTAL select CLKSRC_OF config CLKSRC_PXA - bool + bool "Clocksource for PXA or SA-11x0 platform" if COMPILE_TEST + depends on GENERIC_CLOCKEVENTS + select CLKSRC_MMIO 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 23/69] clocksource/drivers/sun5i: Add the COMPILE_TEST option |
| Message-ID | <qH4mn-6QB-63@gated-at.bofh.it> |
| In reply to | #1294848 |
Increase the compilation test coverage by adding the COMPILE_TEST option. The driver depends on the common clock framework, thus the dependency added on COMMON_CLK. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 67be8f4..625d459 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -77,8 +77,11 @@ config SUN4I_TIMER Enables support for the Sun4i timer. config SUN5I_HSTIMER + bool "Sun5i timer driver" if COMPILE_TEST select CLKSRC_MMIO - bool + depends on COMMON_CLK + help + Enables support the Sun5i timer. config TEGRA_TIMER bool -- 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 28/69] clocksource/drivers/asm9260: Add the COMPILE_TEST option |
| Message-ID | <qH4mn-6QB-65@gated-at.bofh.it> |
| In reply to | #1294848 |
Increase the compilation test coverage by adding the COMPILE_TEST option. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index badef72..a658190 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -101,9 +101,11 @@ config CADENCE_TTC_TIMER Enables support for the cadence ttc driver. config ASM9260_TIMER - bool + bool "ASM9260 timer driver" if COMPILE_TEST select CLKSRC_MMIO select CLKSRC_OF + help + Enables support for the ASM9260 timer. config CLKSRC_NOMADIK_MTU bool -- 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 18/69] clocksource/drivers/meson6: Add the COMPILE_TEST option |
| Message-ID | <qH4mo-6QB-73@gated-at.bofh.it> |
| In reply to | #1294848 |
Increase the compilation test coverage by adding the COMPILE_TEST option. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index b6bb0a6..f6e71b7 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -53,8 +53,10 @@ config ARMADA_370_XP_TIMER Enables the support for the Armada 370 and XP timer driver. config MESON6_TIMER - bool + bool "Meson6 timer driver" if COMPILE_TEST select CLKSRC_MMIO + help + Enables the support for the Meson6 timer driver. config ORION_TIMER select CLKSRC_OF -- 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 32/69] clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST option |
| Message-ID | <qH4mo-6QB-71@gated-at.bofh.it> |
| In reply to | #1294848 |
Let the platform's Kconfig to select the clock instead of having a reverse dependency from the driver to the platform options. Add the COMPILE_TEST option for the compilation test coverage. Due to the non portable 'delay' code, this driver is only compilable on ARM. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> --- arch/arm/mach-exynos/Kconfig | 1 + drivers/clocksource/Kconfig | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 3a10f1a..ff10539 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -27,6 +27,7 @@ menuconfig ARCH_EXYNOS select SRAM select THERMAL select MFD_SYSCON + select CLKSRC_EXYNOS_MCT help Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index e3ba5b4..2062783 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -231,8 +231,8 @@ config CLKSRC_METAG_GENERIC This option enables support for the Meta per-thread timers. config CLKSRC_EXYNOS_MCT - def_bool y if ARCH_EXYNOS - depends on !ARM64 + bool "Exynos multi core timer driver" if COMPILE_TEST + depends on ARM help Support for Multi Core Timer controller on Exynos SoCs. -- 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 24/69] clocksource/drivers/tegra2: Add the COMPILE_TEST option |
| Message-ID | <qH4mo-6QB-89@gated-at.bofh.it> |
| In reply to | #1294848 |
Increase the compilation test coverage by adding the COMPILE_TEST option. Due to the non portable code for the delay timer, this option is only available for the ARM architecture. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 625d459..e33ed76 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -84,7 +84,10 @@ config SUN5I_HSTIMER Enables support the Sun5i timer. config TEGRA_TIMER - bool + bool "Tegra timer driver" if COMPILE_TEST + depends on ARM + help + Enables support for the Tegra driver. config VT8500_TIMER bool -- 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]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2015-12-18 15:40 +0100 |
| Subject | [PATCH 29/69] clocksource/drivers/lpc32xx: Add the COMPILE_TEST option |
| Message-ID | <qH4mo-6QB-83@gated-at.bofh.it> |
| In reply to | #1294848 |
Increase the compilation test coverage by adding the COMPILE_TEST option. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index a658190..ed7a824 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -146,9 +146,11 @@ config CLKSRC_EFM32 event device. config CLKSRC_LPC32XX - bool + bool "Clocksource for LPC32XX" if COMPILE_TEST select CLKSRC_MMIO select CLKSRC_OF + help + Support for the LPC32XX clocksource. config CLKSRC_PISTACHIO bool "Clocksource for Pistachio SoC" if COMPILE_TEST -- 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]
Page 3 of 4 — ← Prev page 1 2 [3] 4 Next page →
Back to top | Article view | linux.kernel
csiph-web