Skip to content

Commit

Permalink
clocksource/drivers/clps711x: Remove board support
Browse files Browse the repository at this point in the history
Since board support for the CLPS711X platform was removed,
remove the board support from the clps711x-timer driver.

Signed-off-by: Alexander Shiyan <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Cc: Daniel Lezcano <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
shcgit authored and KAGA-KOKO committed Mar 24, 2019
1 parent 32d0be0 commit 2a6a8e2
Showing 1 changed file with 13 additions and 32 deletions.
45 changes: 13 additions & 32 deletions drivers/clocksource/clps711x-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,16 @@ static u64 notrace clps711x_sched_clock_read(void)
return ~readw(tcd);
}

static int __init _clps711x_clksrc_init(struct clk *clock, void __iomem *base)
static void __init clps711x_clksrc_init(struct clk *clock, void __iomem *base)
{
unsigned long rate;

if (!base)
return -ENOMEM;
if (IS_ERR(clock))
return PTR_ERR(clock);

rate = clk_get_rate(clock);
unsigned long rate = clk_get_rate(clock);

tcd = base;

clocksource_mmio_init(tcd, "clps711x-clocksource", rate, 300, 16,
clocksource_mmio_readw_down);

sched_clock_register(clps711x_sched_clock_read, 16, rate);

return 0;
}

static irqreturn_t clps711x_timer_interrupt(int irq, void *dev_id)
Expand All @@ -67,13 +58,6 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base,
struct clock_event_device *clkevt;
unsigned long rate;

if (!irq)
return -EINVAL;
if (!base)
return -ENOMEM;
if (IS_ERR(clock))
return PTR_ERR(clock);

clkevt = kzalloc(sizeof(*clkevt), GFP_KERNEL);
if (!clkevt)
return -ENOMEM;
Expand All @@ -93,32 +77,29 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base,
"clps711x-timer", clkevt);
}

static void __init clps711x_clksrc_init(void __iomem *tc1_base,
void __iomem *tc2_base,
unsigned int irq)
{
struct clk *tc1 = clk_get_sys("clps711x-timer.0", NULL);
struct clk *tc2 = clk_get_sys("clps711x-timer.1", NULL);

BUG_ON(_clps711x_clksrc_init(tc1, tc1_base));
BUG_ON(_clps711x_clkevt_init(tc2, tc2_base, irq));
}

#ifdef CONFIG_TIMER_OF
static int __init clps711x_timer_init(struct device_node *np)
{
unsigned int irq = irq_of_parse_and_map(np, 0);
struct clk *clock = of_clk_get(np, 0);
void __iomem *base = of_iomap(np, 0);

if (!base)
return -ENOMEM;
if (!irq)
return -EINVAL;
if (IS_ERR(clock))
return PTR_ERR(clock);

switch (of_alias_get_id(np, "timer")) {
case CLPS711X_CLKSRC_CLOCKSOURCE:
return _clps711x_clksrc_init(clock, base);
clps711x_clksrc_init(clock, base);
break;
case CLPS711X_CLKSRC_CLOCKEVENT:
return _clps711x_clkevt_init(clock, base, irq);
default:
return -EINVAL;
}

return 0;
}
TIMER_OF_DECLARE(clps711x, "cirrus,ep7209-timer", clps711x_timer_init);
#endif

0 comments on commit 2a6a8e2

Please sign in to comment.