diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-06 22:32:52 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-06 22:32:52 +0000 |
commit | 4073723acb9cdcdbe4df9c0e0c376c65d1697e43 (patch) | |
tree | f41c17eac157b1223ce104845cf9b1e5a9e6a83d /include/linux | |
parent | 58daf18cdcab550262a5f4681e1f1e073e21965a (diff) | |
parent | 4ec3eb13634529c0bc7466658d84d0bbe3244aea (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/linux')
-rw-r--r-- | include/linux/amba/bus.h | 8 | ||||
-rw-r--r-- | include/linux/clkdev.h | 36 |
2 files changed, 44 insertions, 0 deletions
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index c6454cca0447..9e7f259346e1 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -18,6 +18,7 @@ #include <linux/device.h> #include <linux/err.h> #include <linux/resource.h> +#include <linux/regulator/consumer.h> #define AMBA_NR_IRQS 2 #define AMBA_CID 0xb105f00d @@ -28,6 +29,7 @@ struct amba_device { struct device dev; struct resource res; struct clk *pclk; + struct regulator *vcore; u64 dma_mask; unsigned int periphid; unsigned int irq[AMBA_NR_IRQS]; @@ -71,6 +73,12 @@ void amba_release_regions(struct amba_device *); #define amba_pclk_disable(d) \ do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) +#define amba_vcore_enable(d) \ + (IS_ERR((d)->vcore) ? 0 : regulator_enable((d)->vcore)) + +#define amba_vcore_disable(d) \ + do { if (!IS_ERR((d)->vcore)) regulator_disable((d)->vcore); } while (0) + /* Some drivers don't use the struct amba_device */ #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) #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 000000000000..457bcb0a310a --- /dev/null +++ b/include/linux/clkdev.h @@ -0,0 +1,36 @@ +/* + * include/linux/clkdev.h + * + * 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. + */ +#ifndef __CLKDEV_H +#define __CLKDEV_H + +#include <asm/clkdev.h> + +struct clk; +struct device; + +struct clk_lookup { + struct list_head node; + const char *dev_id; + const char *con_id; + struct clk *clk; +}; + +struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, + const char *dev_fmt, ...); + +void clkdev_add(struct clk_lookup *cl); +void clkdev_drop(struct clk_lookup *cl); + +void clkdev_add_table(struct clk_lookup *, size_t); +int clk_add_alias(const char *, const char *, char *, struct device *); + +#endif |