aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/amba
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/amba')
-rw-r--r--include/linux/amba/bus.h45
-rw-r--r--include/linux/amba/mmci.h22
-rw-r--r--include/linux/amba/pl022.h5
-rw-r--r--include/linux/amba/serial.h2
4 files changed, 69 insertions, 5 deletions
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index 724c69c40bb8..7847e197730a 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -60,6 +60,9 @@ extern struct bus_type amba_bustype;
60 60
61int amba_driver_register(struct amba_driver *); 61int amba_driver_register(struct amba_driver *);
62void amba_driver_unregister(struct amba_driver *); 62void amba_driver_unregister(struct amba_driver *);
63struct amba_device *amba_device_alloc(const char *, resource_size_t, size_t);
64void amba_device_put(struct amba_device *);
65int amba_device_add(struct amba_device *, struct resource *);
63int amba_device_register(struct amba_device *, struct resource *); 66int amba_device_register(struct amba_device *, struct resource *);
64void amba_device_unregister(struct amba_device *); 67void amba_device_unregister(struct amba_device *);
65struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int); 68struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int);
@@ -89,4 +92,46 @@ void amba_release_regions(struct amba_device *);
89#define amba_manf(d) AMBA_MANF_BITS((d)->periphid) 92#define amba_manf(d) AMBA_MANF_BITS((d)->periphid)
90#define amba_part(d) AMBA_PART_BITS((d)->periphid) 93#define amba_part(d) AMBA_PART_BITS((d)->periphid)
91 94
95#define __AMBA_DEV(busid, data, mask) \
96 { \
97 .coherent_dma_mask = mask, \
98 .init_name = busid, \
99 .platform_data = data, \
100 }
101
102/*
103 * APB devices do not themselves have the ability to address memory,
104 * so DMA masks should be zero (much like USB peripheral devices.)
105 * The DMA controller DMA masks should be used instead (much like
106 * USB host controllers in conventional PCs.)
107 */
108#define AMBA_APB_DEVICE(name, busid, id, base, irqs, data) \
109struct amba_device name##_device = { \
110 .dev = __AMBA_DEV(busid, data, 0), \
111 .res = DEFINE_RES_MEM(base, SZ_4K), \
112 .irq = irqs, \
113 .periphid = id, \
114}
115
116/*
117 * AHB devices are DMA capable, so set their DMA masks
118 */
119#define AMBA_AHB_DEVICE(name, busid, id, base, irqs, data) \
120struct amba_device name##_device = { \
121 .dev = __AMBA_DEV(busid, data, ~0ULL), \
122 .res = DEFINE_RES_MEM(base, SZ_4K), \
123 .dma_mask = ~0ULL, \
124 .irq = irqs, \
125 .periphid = id, \
126}
127
128/*
129 * module_amba_driver() - Helper macro for drivers that don't do anything
130 * special in module init/exit. This eliminates a lot of boilerplate. Each
131 * module may only use this macro once, and calling it replaces module_init()
132 * and module_exit()
133 */
134#define module_amba_driver(__amba_drv) \
135 module_driver(__amba_drv, amba_driver_register, amba_driver_unregister)
136
92#endif 137#endif
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h
index 0101e9c17fa1..32a89cf5ec45 100644
--- a/include/linux/amba/mmci.h
+++ b/include/linux/amba/mmci.h
@@ -6,6 +6,19 @@
6 6
7#include <linux/mmc/host.h> 7#include <linux/mmc/host.h>
8 8
9
10/*
11 * These defines is places here due to access is needed from machine
12 * configuration files. The ST Micro version does not have ROD and
13 * reuse the voltage registers for direction settings.
14 */
15#define MCI_ST_DATA2DIREN (1 << 2)
16#define MCI_ST_CMDDIREN (1 << 3)
17#define MCI_ST_DATA0DIREN (1 << 4)
18#define MCI_ST_DATA31DIREN (1 << 5)
19#define MCI_ST_FBCLKEN (1 << 7)
20#define MCI_ST_DATA74DIREN (1 << 8)
21
9/* Just some dummy forwarding */ 22/* Just some dummy forwarding */
10struct dma_chan; 23struct dma_chan;
11 24
@@ -18,7 +31,8 @@ struct dma_chan;
18 * @ocr_mask: available voltages on the 4 pins from the block, this 31 * @ocr_mask: available voltages on the 4 pins from the block, this
19 * is ignored if a regulator is used, see the MMC_VDD_* masks in 32 * is ignored if a regulator is used, see the MMC_VDD_* masks in
20 * mmc/host.h 33 * mmc/host.h
21 * @vdd_handler: a callback function to translate a MMC_VDD_* 34 * @ios_handler: a callback function to act on specfic ios changes,
35 * used for example to control a levelshifter
22 * mask into a value to be binary (or set some other custom bits 36 * mask into a value to be binary (or set some other custom bits
23 * in MMCIPWR) or:ed and written into the MMCIPWR register of the 37 * in MMCIPWR) or:ed and written into the MMCIPWR register of the
24 * block. May also control external power based on the power_mode. 38 * block. May also control external power based on the power_mode.
@@ -31,6 +45,8 @@ struct dma_chan;
31 * @capabilities: the capabilities of the block as implemented in 45 * @capabilities: the capabilities of the block as implemented in
32 * this platform, signify anything MMC_CAP_* from mmc/host.h 46 * this platform, signify anything MMC_CAP_* from mmc/host.h
33 * @capabilities2: more capabilities, MMC_CAP2_* from mmc/host.h 47 * @capabilities2: more capabilities, MMC_CAP2_* from mmc/host.h
48 * @sigdir: a bit field indicating for what bits in the MMC bus the host
49 * should enable signal direction indication.
34 * @dma_filter: function used to select an appropriate RX and TX 50 * @dma_filter: function used to select an appropriate RX and TX
35 * DMA channel to be used for DMA, if and only if you're deploying the 51 * DMA channel to be used for DMA, if and only if you're deploying the
36 * generic DMA engine 52 * generic DMA engine
@@ -46,14 +62,14 @@ struct dma_chan;
46struct mmci_platform_data { 62struct mmci_platform_data {
47 unsigned int f_max; 63 unsigned int f_max;
48 unsigned int ocr_mask; 64 unsigned int ocr_mask;
49 u32 (*vdd_handler)(struct device *, unsigned int vdd, 65 int (*ios_handler)(struct device *, struct mmc_ios *);
50 unsigned char power_mode);
51 unsigned int (*status)(struct device *); 66 unsigned int (*status)(struct device *);
52 int gpio_wp; 67 int gpio_wp;
53 int gpio_cd; 68 int gpio_cd;
54 bool cd_invert; 69 bool cd_invert;
55 unsigned long capabilities; 70 unsigned long capabilities;
56 unsigned long capabilities2; 71 unsigned long capabilities2;
72 u32 sigdir;
57 bool (*dma_filter)(struct dma_chan *chan, void *filter_param); 73 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
58 void *dma_rx_param; 74 void *dma_rx_param;
59 void *dma_tx_param; 75 void *dma_tx_param;
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h
index 572f637299c9..b8c51124ed19 100644
--- a/include/linux/amba/pl022.h
+++ b/include/linux/amba/pl022.h
@@ -25,8 +25,6 @@
25#ifndef _SSP_PL022_H 25#ifndef _SSP_PL022_H
26#define _SSP_PL022_H 26#define _SSP_PL022_H
27 27
28#include <linux/device.h>
29
30/** 28/**
31 * whether SSP is in loopback mode or not 29 * whether SSP is in loopback mode or not
32 */ 30 */
@@ -241,6 +239,8 @@ struct dma_chan;
241 * @autosuspend_delay: delay in ms following transfer completion before the 239 * @autosuspend_delay: delay in ms following transfer completion before the
242 * runtime power management system suspends the device. A setting of 0 240 * runtime power management system suspends the device. A setting of 0
243 * indicates no delay and the device will be suspended immediately. 241 * indicates no delay and the device will be suspended immediately.
242 * @rt: indicates the controller should run the message pump with realtime
243 * priority to minimise the transfer latency on the bus.
244 */ 244 */
245struct pl022_ssp_controller { 245struct pl022_ssp_controller {
246 u16 bus_id; 246 u16 bus_id;
@@ -250,6 +250,7 @@ struct pl022_ssp_controller {
250 void *dma_rx_param; 250 void *dma_rx_param;
251 void *dma_tx_param; 251 void *dma_tx_param;
252 int autosuspend_delay; 252 int autosuspend_delay;
253 bool rt;
253}; 254};
254 255
255/** 256/**
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h
index 514ed45c462e..d117b29d1062 100644
--- a/include/linux/amba/serial.h
+++ b/include/linux/amba/serial.h
@@ -23,6 +23,8 @@
23#ifndef ASM_ARM_HARDWARE_SERIAL_AMBA_H 23#ifndef ASM_ARM_HARDWARE_SERIAL_AMBA_H
24#define ASM_ARM_HARDWARE_SERIAL_AMBA_H 24#define ASM_ARM_HARDWARE_SERIAL_AMBA_H
25 25
26#include <linux/types.h>
27
26/* ------------------------------------------------------------------------------- 28/* -------------------------------------------------------------------------------
27 * From AMBA UART (PL010) Block Specification 29 * From AMBA UART (PL010) Block Specification
28 * ------------------------------------------------------------------------------- 30 * -------------------------------------------------------------------------------