Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123539
b: refs/heads/master
c: 0318e69
h: refs/heads/master
i:
  123537: 7dddf18
  123535: c4198c4
v: v3
  • Loading branch information
Russell King authored and Russell King committed Nov 27, 2008
1 parent 4503b10 commit 4bc15a9
Show file tree
Hide file tree
Showing 31 changed files with 239 additions and 82 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c750815e2d436f4379c7af8a8770ef2ae71c5607
refs/heads/master: 0318e693d3a56836632bf1a2cfdafb7f34bcc703
28 changes: 0 additions & 28 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ choice

config ARCH_AAEC2000
bool "Agilent AAEC-2000 based"
select CPU_ARM920T
select ARM_AMBA
select HAVE_CLK
help
Expand Down Expand Up @@ -246,7 +245,6 @@ config ARCH_AT91

config ARCH_CLPS7500
bool "Cirrus CL-PS7500FE"
select CPU_ARM710
select TIMER_ACORN
select ISA
select NO_IOPORT
Expand All @@ -256,13 +254,11 @@ config ARCH_CLPS7500

config ARCH_CLPS711X
bool "Cirrus Logic CLPS711x/EP721x-based"
select CPU_ARM720T
help
Support for Cirrus Logic 711x/721x based boards.

config ARCH_EBSA110
bool "EBSA-110"
select CPU_SA110
select ISA
select NO_IOPORT
help
Expand All @@ -273,7 +269,6 @@ config ARCH_EBSA110

config ARCH_EP93XX
bool "EP93xx-based"
select CPU_ARM920T
select ARM_AMBA
select ARM_VIC
select GENERIC_GPIO
Expand All @@ -284,29 +279,25 @@ config ARCH_EP93XX

config ARCH_FOOTBRIDGE
bool "FootBridge"
select CPU_SA110
select FOOTBRIDGE
help
Support for systems based on the DC21285 companion chip
("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.

config ARCH_NETX
bool "Hilscher NetX based"
select CPU_ARM926T
select ARM_VIC
help
This enables support for systems based on the Hilscher NetX Soc

config ARCH_H720X
bool "Hynix HMS720x-based"
select CPU_ARM720T
select ISA_DMA_API
help
This enables support for systems based on the Hynix HMS720x

config ARCH_IMX
bool "IMX"
select CPU_ARM920T
select GENERIC_GPIO
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
Expand All @@ -316,7 +307,6 @@ config ARCH_IMX
config ARCH_IOP13XX
bool "IOP13xx-based"
depends on MMU
select CPU_XSC3
select PLAT_IOP
select PCI
select ARCH_SUPPORTS_MSI
Expand All @@ -327,7 +317,6 @@ config ARCH_IOP13XX
config ARCH_IOP32X
bool "IOP32x-based"
depends on MMU
select CPU_XSCALE
select PLAT_IOP
select PCI
select GENERIC_GPIO
Expand All @@ -339,7 +328,6 @@ config ARCH_IOP32X
config ARCH_IOP33X
bool "IOP33x-based"
depends on MMU
select CPU_XSCALE
select PLAT_IOP
select PCI
select GENERIC_GPIO
Expand All @@ -350,23 +338,20 @@ config ARCH_IOP33X
config ARCH_IXP23XX
bool "IXP23XX-based"
depends on MMU
select CPU_XSC3
select PCI
help
Support for Intel's IXP23xx (XScale) family of processors.

config ARCH_IXP2000
bool "IXP2400/2800-based"
depends on MMU
select CPU_XSCALE
select PCI
help
Support for Intel's IXP2400/2800 (XScale) family of processors.

config ARCH_IXP4XX
bool "IXP4xx-based"
depends on MMU
select CPU_XSCALE
select GENERIC_GPIO
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
Expand All @@ -376,7 +361,6 @@ config ARCH_IXP4XX

config ARCH_L7200
bool "LinkUp-L7200"
select CPU_ARM720T
select FIQ
help
Say Y here if you intend to run this kernel on a LinkUp Systems
Expand All @@ -390,7 +374,6 @@ config ARCH_L7200

config ARCH_KIRKWOOD
bool "Marvell Kirkwood"
select CPU_FEROCEON
select PCI
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
Expand All @@ -401,15 +384,13 @@ config ARCH_KIRKWOOD

config ARCH_KS8695
bool "Micrel/Kendin KS8695"
select CPU_ARM922T
select GENERIC_GPIO
help
Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
System-on-Chip devices.

config ARCH_NS9XXX
bool "NetSilicon NS9xxx"
select CPU_ARM926T
select GENERIC_GPIO
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
Expand All @@ -422,7 +403,6 @@ config ARCH_NS9XXX

config ARCH_LOKI
bool "Marvell Loki (88RC8480)"
select CPU_FEROCEON
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
select PLAT_ORION
Expand All @@ -431,7 +411,6 @@ config ARCH_LOKI

config ARCH_MV78XX0
bool "Marvell MV78xx0"
select CPU_FEROCEON
select PCI
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
Expand All @@ -453,7 +432,6 @@ config ARCH_MXC
config ARCH_ORION5X
bool "Marvell Orion"
depends on MMU
select CPU_FEROCEON
select PCI
select GENERIC_GPIO
select GENERIC_TIME
Expand All @@ -466,7 +444,6 @@ config ARCH_ORION5X

config ARCH_PNX4008
bool "Philips Nexperia PNX4008 Mobile"
select CPU_ARM926T
select HAVE_CLK
help
This enables support for Philips PNX4008 mobile platform.
Expand Down Expand Up @@ -500,7 +477,6 @@ config ARCH_RPC

config ARCH_SA1100
bool "SA1100-based"
select CPU_SA1100
select ISA
select ARCH_SPARSEMEM_ENABLE
select ARCH_MTD_XIP
Expand All @@ -524,7 +500,6 @@ config ARCH_S3C2410

config ARCH_SHARK
bool "Shark"
select CPU_SA110
select ISA
select ISA_DMA
select ZONE_DMA
Expand All @@ -535,7 +510,6 @@ config ARCH_SHARK

config ARCH_LH7A40X
bool "Sharp LH7A40X"
select CPU_ARM922T
select ARCH_DISCONTIGMEM_ENABLE if !LH7A40X_CONTIGMEM
select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM
help
Expand All @@ -546,7 +520,6 @@ config ARCH_LH7A40X

config ARCH_DAVINCI
bool "TI DaVinci"
select CPU_ARM926T
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
select GENERIC_GPIO
Expand All @@ -568,7 +541,6 @@ config ARCH_OMAP

config ARCH_MSM
bool "Qualcomm MSM"
select CPU_V6
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
help
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/arm/boot/compressed/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ static void putstr(const char *ptr)

#define __ptr_t void *

#define memzero(s,n) __memzero(s,n)

/*
* Optimised C version of memzero for the ARM.
*/
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/arm/common/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ config SHARPSL_PM

config SHARP_SCOOP
bool

config COMMON_CLKDEV
bool
1 change: 1 addition & 0 deletions trunk/arch/arm/common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ obj-$(CONFIG_SHARP_SCOOP) += scoop.o
obj-$(CONFIG_ARCH_IXP2000) += uengine.o
obj-$(CONFIG_ARCH_IXP23XX) += uengine.o
obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o
obj-$(CONFIG_COMMON_CLKDEV) += clkdev.o
128 changes: 128 additions & 0 deletions trunk/arch/arm/common/clkdev.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/*
* arch/arm/common/clkdev.c
*
* Copyright (C) 2008 Russell King.
*
* 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.
*
* Helper for the clk API to assist looking up a struct clk.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/list.h>
#include <linux/errno.h>
#include <linux/err.h>
#include <linux/string.h>
#include <linux/mutex.h>

#include <asm/clkdev.h>
#include <mach/clkdev.h>

static LIST_HEAD(clocks);
static DEFINE_MUTEX(clocks_mutex);

static struct clk *clk_find(const char *dev_id, const char *con_id)
{
struct clk_lookup *p;
struct clk *clk = NULL;
int match, best = 0;

list_for_each_entry(p, &clocks, node) {
if ((p->dev_id && !dev_id) || (p->con_id && !con_id))
continue;
match = 0;
if (p->dev_id)
match += 2 * (strcmp(p->dev_id, dev_id) == 0);
if (p->con_id)
match += 1 * (strcmp(p->con_id, con_id) == 0);
if (match == 0)
continue;

if (match > best) {
clk = p->clk;
best = match;
}
}
return clk;
}

struct clk *clk_get(struct device *dev, const char *con_id)
{
const char *dev_id = dev ? dev_name(dev) : NULL;
struct clk *clk;

mutex_lock(&clocks_mutex);
clk = clk_find(dev_id, con_id);
if (clk && !__clk_get(clk))
clk = NULL;
mutex_unlock(&clocks_mutex);

return clk ? clk : ERR_PTR(-ENOENT);
}
EXPORT_SYMBOL(clk_get);

void clk_put(struct clk *clk)
{
__clk_put(clk);
}
EXPORT_SYMBOL(clk_put);

void clkdev_add(struct clk_lookup *cl)
{
mutex_lock(&clocks_mutex);
list_add_tail(&cl->node, &clocks);
mutex_unlock(&clocks_mutex);
}
EXPORT_SYMBOL(clkdev_add);

#define MAX_DEV_ID 20
#define MAX_CON_ID 16

struct clk_lookup_alloc {
struct clk_lookup cl;
char dev_id[MAX_DEV_ID];
char con_id[MAX_CON_ID];
};

struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
const char *dev_fmt, ...)
{
struct clk_lookup_alloc *cla;

cla = kzalloc(sizeof(*cla), GFP_KERNEL);
if (!cla)
return NULL;

cla->cl.clk = clk;
if (con_id) {
strlcpy(cla->con_id, con_id, sizeof(cla->con_id));
cla->cl.con_id = cla->con_id;
}

if (dev_fmt) {
va_list ap;

va_start(ap, dev_fmt);
vscnprintf(cla->dev_id, sizeof(cla->dev_id), dev_fmt, ap);
cla->cl.dev_id = cla->dev_id;
va_end(ap);
}

return &cla->cl;
}
EXPORT_SYMBOL(clkdev_alloc);

/*
* clkdev_drop - remove a clock dynamically allocated
*/
void clkdev_drop(struct clk_lookup *cl)
{
mutex_lock(&clocks_mutex);
list_del(&cl->node);
mutex_unlock(&clocks_mutex);
kfree(cl);
}
EXPORT_SYMBOL(clkdev_drop);
Loading

0 comments on commit 4bc15a9

Please sign in to comment.