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

Commit 50667d63 authored by Linus Walleij's avatar Linus Walleij Committed by Mike Turquette
Browse files

ARM: u300: convert to common clock



This converts the U300 clock implementation over to use the common
struct clk and moves the implementation down into drivers/clk.
Since VCO isn't used in tree it was removed, it's not hard to
put it back in if need be.

Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
[mturquette@linaro.org: trivial Makefile conflict]
Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
parent 9ca1c5a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -888,7 +888,7 @@ config ARCH_U300
	select ARM_VIC
	select GENERIC_CLOCKEVENTS
	select CLKDEV_LOOKUP
	select HAVE_MACH_CLKDEV
	select COMMON_CLK
	select GENERIC_GPIO
	select ARCH_REQUIRE_GPIOLIB
	help
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
# Makefile for the linux kernel, U300 machine.
#

obj-y		:= core.o clock.o timer.o
obj-y		:= core.o timer.o
obj-m		:=
obj-n		:=
obj-		:=

arch/arm/mach-u300/clock.c

deleted100644 → 0
+0 −1504

File deleted.

Preview size limit exceeded, changes collapsed.

arch/arm/mach-u300/clock.h

deleted100644 → 0
+0 −50
Original line number Diff line number Diff line
/*
 * arch/arm/mach-u300/include/mach/clock.h
 *
 * Copyright (C) 2004 - 2005 Nokia corporation
 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
 * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
 * Copyright (C) 2007-2009 ST-Ericsson AB
 * Adopted to ST-Ericsson U300 platforms by
 * Jonas Aaberg <jonas.aberg@stericsson.com>
 *
 * 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.
 *
 */

#ifndef __MACH_CLOCK_H
#define __MACH_CLOCK_H

#include <linux/clk.h>

struct clk {
	struct list_head node;
	struct module *owner;
	struct device *dev;
	const char *name;
	struct clk *parent;

	spinlock_t lock;
	unsigned long rate;
	bool reset;
	__u16 clk_val;
	__s8 usecount;
	void __iomem * res_reg;
	__u16 res_mask;

	bool hw_ctrld;

	void (*recalc) (struct clk *);
	int (*set_rate) (struct clk *, unsigned long);
	unsigned long (*get_rate) (struct clk *);
	unsigned long (*round_rate) (struct clk *, unsigned long);
	void (*init) (struct clk *);
	void (*enable) (struct clk *);
	void (*disable) (struct clk *);
};

int u300_clock_init(void);

#endif
+11 −10
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include <linux/pinctrl/consumer.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/dma-mapping.h>
#include <linux/platform_data/clk-u300.h>

#include <asm/types.h>
#include <asm/setup.h>
@@ -44,7 +45,6 @@
#include <mach/dma_channels.h>
#include <mach/gpio-u300.h>

#include "clock.h"
#include "spi.h"
#include "i2c.h"
#include "u300-gpio.h"
@@ -1658,12 +1658,20 @@ void __init u300_init_irq(void)
	int i;

	/* initialize clocking early, we want to clock the INTCON */
	u300_clock_init();
	u300_clk_init(U300_SYSCON_VBASE);

	/* Bootstrap EMIF and SEMI clocks */
	clk = clk_get_sys("pl172", NULL);
	BUG_ON(IS_ERR(clk));
	clk_prepare_enable(clk);
	clk = clk_get_sys("semi", NULL);
	BUG_ON(IS_ERR(clk));
	clk_prepare_enable(clk);

	/* Clock the interrupt controller */
	clk = clk_get_sys("intcon", NULL);
	BUG_ON(IS_ERR(clk));
	clk_enable(clk);
	clk_prepare_enable(clk);

	for (i = 0; i < U300_VIC_IRQS_END; i++)
		set_bit(i, (unsigned long *) &mask[0]);
@@ -1811,13 +1819,6 @@ void __init u300_init_devices(void)
	/* Check what platform we run and print some status information */
	u300_init_check_chip();

	/* Set system to run at PLL208, max performance, a known state. */
	val = readw(U300_SYSCON_VBASE + U300_SYSCON_CCR);
	val &= ~U300_SYSCON_CCR_CLKING_PERFORMANCE_MASK;
	writew(val, U300_SYSCON_VBASE + U300_SYSCON_CCR);
	/* Wait for the PLL208 to lock if not locked in yet */
	while (!(readw(U300_SYSCON_VBASE + U300_SYSCON_CSR) &
		 U300_SYSCON_CSR_PLL208_LOCK_IND));
	/* Initialize SPI device with some board specifics */
	u300_spi_init(&pl022_device);

Loading