aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-01-06 17:32:52 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-01-06 17:32:52 -0500
commit4073723acb9cdcdbe4df9c0e0c376c65d1697e43 (patch)
treef41c17eac157b1223ce104845cf9b1e5a9e6a83d /include
parent58daf18cdcab550262a5f4681e1f1e073e21965a (diff)
parent4ec3eb13634529c0bc7466658d84d0bbe3244aea (diff)
Merge branch 'misc' into devel
Conflicts: arch/arm/Kconfig arch/arm/common/Makefile arch/arm/kernel/Makefile arch/arm/kernel/smp.c
Diffstat (limited to 'include')
-rw-r--r--include/linux/amba/bus.h8
-rw-r--r--include/linux/clkdev.h36
2 files changed, 44 insertions, 0 deletions
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index c6454cca044..9e7f259346e 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -18,6 +18,7 @@
18#include <linux/device.h> 18#include <linux/device.h>
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/resource.h> 20#include <linux/resource.h>
21#include <linux/regulator/consumer.h>
21 22
22#define AMBA_NR_IRQS 2 23#define AMBA_NR_IRQS 2
23#define AMBA_CID 0xb105f00d 24#define AMBA_CID 0xb105f00d
@@ -28,6 +29,7 @@ struct amba_device {
28 struct device dev; 29 struct device dev;
29 struct resource res; 30 struct resource res;
30 struct clk *pclk; 31 struct clk *pclk;
32 struct regulator *vcore;
31 u64 dma_mask; 33 u64 dma_mask;
32 unsigned int periphid; 34 unsigned int periphid;
33 unsigned int irq[AMBA_NR_IRQS]; 35 unsigned int irq[AMBA_NR_IRQS];
@@ -71,6 +73,12 @@ void amba_release_regions(struct amba_device *);
71#define amba_pclk_disable(d) \ 73#define amba_pclk_disable(d) \
72 do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) 74 do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0)
73 75
76#define amba_vcore_enable(d) \
77 (IS_ERR((d)->vcore) ? 0 : regulator_enable((d)->vcore))
78
79#define amba_vcore_disable(d) \
80 do { if (!IS_ERR((d)->vcore)) regulator_disable((d)->vcore); } while (0)
81
74/* Some drivers don't use the struct amba_device */ 82/* Some drivers don't use the struct amba_device */
75#define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) 83#define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff)
76#define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f) 84#define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f)
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h
new file mode 100644
index 00000000000..457bcb0a310
--- /dev/null
+++ b/include/linux/clkdev.h
@@ -0,0 +1,36 @@
1/*
2 * include/linux/clkdev.h
3 *
4 * Copyright (C) 2008 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Helper for the clk API to assist looking up a struct clk.
11 */
12#ifndef __CLKDEV_H
13#define __CLKDEV_H
14
15#include <asm/clkdev.h>
16
17struct clk;
18struct device;
19
20struct clk_lookup {
21 struct list_head node;
22 const char *dev_id;
23 const char *con_id;
24 struct clk *clk;
25};
26
27struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
28 const char *dev_fmt, ...);
29
30void clkdev_add(struct clk_lookup *cl);
31void clkdev_drop(struct clk_lookup *cl);
32
33void clkdev_add_table(struct clk_lookup *, size_t);
34int clk_add_alias(const char *, const char *, char *, struct device *);
35
36#endif