Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a31bd28 authored by Linus Walleij's avatar Linus Walleij
Browse files

ARM: nomadik: convert to generic clock



Remove more custom stuff by simply converting the Nomadik machine
to use generic clocks and move the driver to drivers/clk.

Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: Mike Turquette <mturquette@ti.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent b5111d9e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -912,7 +912,7 @@ config ARCH_NOMADIK
	select ARM_AMBA
	select ARM_VIC
	select CPU_ARM926T
	select CLKDEV_LOOKUP
	select COMMON_CLK
	select GENERIC_CLOCKEVENTS
	select PINCTRL
	select MIGHT_HAVE_CACHE_L2X0
+0 −2
Original line number Diff line number Diff line
@@ -7,8 +7,6 @@

# Object file lists.

obj-y			+= clock.o

# Cpu revision
obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o

arch/arm/mach-nomadik/clock.c

deleted100644 → 0
+0 −75
Original line number Diff line number Diff line
/*
 *  linux/arch/arm/mach-nomadik/clock.c
 *
 *  Copyright (C) 2009 Alessandro Rubini
 */
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/clk.h>
#include <linux/clkdev.h>
#include "clock.h"

/*
 * The nomadik board uses generic clocks, but the serial pl011 file
 * calls clk_enable(), clk_disable(), clk_get_rate(), so we provide them
 */
unsigned long clk_get_rate(struct clk *clk)
{
	return clk->rate;
}
EXPORT_SYMBOL(clk_get_rate);

/* enable and disable do nothing */
int clk_enable(struct clk *clk)
{
	return 0;
}
EXPORT_SYMBOL(clk_enable);

void clk_disable(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_disable);

static struct clk clk_24 = {
	.rate = 2400000,
};

static struct clk clk_48 = {
	.rate = 48 * 1000 * 1000,
};

/*
 * Catch-all default clock to satisfy drivers using the clk API.  We don't
 * model the actual hardware clocks yet.
 */
static struct clk clk_default;

#define CLK(_clk, dev)				\
	{					\
		.clk		= _clk,		\
		.dev_id		= dev,		\
	}

static struct clk_lookup lookups[] = {
	{
		.con_id		= "apb_pclk",
		.clk		= &clk_default,
	},
	CLK(&clk_24, "mtu0"),
	CLK(&clk_24, "mtu1"),
	CLK(&clk_48, "uart0"),
	CLK(&clk_48, "uart1"),
	CLK(&clk_default, "gpio.0"),
	CLK(&clk_default, "gpio.1"),
	CLK(&clk_default, "gpio.2"),
	CLK(&clk_default, "gpio.3"),
	CLK(&clk_default, "rng"),
};

int __init clk_init(void)
{
	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
	return 0;
}

arch/arm/mach-nomadik/clock.h

deleted100644 → 0
+0 −15
Original line number Diff line number Diff line

/*
 *  linux/arch/arm/mach-nomadik/clock.h
 *
 *  Copyright (C) 2009 Alessandro Rubini
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
struct clk {
	unsigned long		rate;
};

int __init clk_init(void);
+2 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <linux/slab.h>
#include <linux/irq.h>
#include <linux/dma-mapping.h>
#include <linux/platform_data/clk-nomadik.h>

#include <plat/gpio-nomadik.h>
#include <mach/hardware.h>
@@ -35,7 +36,6 @@
#include <asm/cacheflush.h>
#include <asm/hardware/cache-l2x0.h>

#include "clock.h"
#include "cpu-8815.h"

/* The 8815 has 4 GPIO blocks, let's register them immediately */
@@ -123,7 +123,7 @@ void __init cpu8815_init_irq(void)
	 * Init clocks here so that they are available for system timer
	 * initialization.
	 */
	clk_init();
	nomadik_clk_init();
}

/*
Loading