diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mfd/mcp.h | 14 | ||||
-rw-r--r-- | include/linux/mfd/ucb1x00.h | 38 | ||||
-rw-r--r-- | include/linux/sa11x0-dma.h | 24 |
3 files changed, 46 insertions, 30 deletions
diff --git a/include/linux/mfd/mcp.h b/include/linux/mfd/mcp.h index f88c1cc0cb0f..a9e8bd157673 100644 --- a/include/linux/mfd/mcp.h +++ b/include/linux/mfd/mcp.h | |||
@@ -10,8 +10,6 @@ | |||
10 | #ifndef MCP_H | 10 | #ifndef MCP_H |
11 | #define MCP_H | 11 | #define MCP_H |
12 | 12 | ||
13 | #include <mach/dma.h> | ||
14 | |||
15 | struct mcp_ops; | 13 | struct mcp_ops; |
16 | 14 | ||
17 | struct mcp { | 15 | struct mcp { |
@@ -21,12 +19,7 @@ struct mcp { | |||
21 | int use_count; | 19 | int use_count; |
22 | unsigned int sclk_rate; | 20 | unsigned int sclk_rate; |
23 | unsigned int rw_timeout; | 21 | unsigned int rw_timeout; |
24 | dma_device_t dma_audio_rd; | ||
25 | dma_device_t dma_audio_wr; | ||
26 | dma_device_t dma_telco_rd; | ||
27 | dma_device_t dma_telco_wr; | ||
28 | struct device attached_device; | 22 | struct device attached_device; |
29 | int gpio_base; | ||
30 | }; | 23 | }; |
31 | 24 | ||
32 | struct mcp_ops { | 25 | struct mcp_ops { |
@@ -47,15 +40,14 @@ void mcp_disable(struct mcp *); | |||
47 | #define mcp_get_sclk_rate(mcp) ((mcp)->sclk_rate) | 40 | #define mcp_get_sclk_rate(mcp) ((mcp)->sclk_rate) |
48 | 41 | ||
49 | struct mcp *mcp_host_alloc(struct device *, size_t); | 42 | struct mcp *mcp_host_alloc(struct device *, size_t); |
50 | int mcp_host_register(struct mcp *); | 43 | int mcp_host_add(struct mcp *, void *); |
51 | void mcp_host_unregister(struct mcp *); | 44 | void mcp_host_del(struct mcp *); |
45 | void mcp_host_free(struct mcp *); | ||
52 | 46 | ||
53 | struct mcp_driver { | 47 | struct mcp_driver { |
54 | struct device_driver drv; | 48 | struct device_driver drv; |
55 | int (*probe)(struct mcp *); | 49 | int (*probe)(struct mcp *); |
56 | void (*remove)(struct mcp *); | 50 | void (*remove)(struct mcp *); |
57 | int (*suspend)(struct mcp *, pm_message_t); | ||
58 | int (*resume)(struct mcp *); | ||
59 | }; | 51 | }; |
60 | 52 | ||
61 | int mcp_driver_register(struct mcp_driver *); | 53 | int mcp_driver_register(struct mcp_driver *); |
diff --git a/include/linux/mfd/ucb1x00.h b/include/linux/mfd/ucb1x00.h index 4321f044d1e4..28af41756360 100644 --- a/include/linux/mfd/ucb1x00.h +++ b/include/linux/mfd/ucb1x00.h | |||
@@ -12,7 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/mfd/mcp.h> | 13 | #include <linux/mfd/mcp.h> |
14 | #include <linux/gpio.h> | 14 | #include <linux/gpio.h> |
15 | #include <linux/semaphore.h> | 15 | #include <linux/mutex.h> |
16 | 16 | ||
17 | #define UCB_IO_DATA 0x00 | 17 | #define UCB_IO_DATA 0x00 |
18 | #define UCB_IO_DIR 0x01 | 18 | #define UCB_IO_DIR 0x01 |
@@ -104,17 +104,27 @@ | |||
104 | #define UCB_MODE_DYN_VFLAG_ENA (1 << 12) | 104 | #define UCB_MODE_DYN_VFLAG_ENA (1 << 12) |
105 | #define UCB_MODE_AUD_OFF_CAN (1 << 13) | 105 | #define UCB_MODE_AUD_OFF_CAN (1 << 13) |
106 | 106 | ||
107 | enum ucb1x00_reset { | ||
108 | UCB_RST_PROBE, | ||
109 | UCB_RST_RESUME, | ||
110 | UCB_RST_SUSPEND, | ||
111 | UCB_RST_REMOVE, | ||
112 | UCB_RST_PROBE_FAIL, | ||
113 | }; | ||
107 | 114 | ||
108 | struct ucb1x00_irq { | 115 | struct ucb1x00_plat_data { |
109 | void *devid; | 116 | void (*reset)(enum ucb1x00_reset); |
110 | void (*fn)(int, void *); | 117 | unsigned irq_base; |
118 | int gpio_base; | ||
119 | unsigned can_wakeup; | ||
111 | }; | 120 | }; |
112 | 121 | ||
113 | struct ucb1x00 { | 122 | struct ucb1x00 { |
114 | spinlock_t lock; | 123 | raw_spinlock_t irq_lock; |
115 | struct mcp *mcp; | 124 | struct mcp *mcp; |
116 | unsigned int irq; | 125 | unsigned int irq; |
117 | struct semaphore adc_sem; | 126 | int irq_base; |
127 | struct mutex adc_mutex; | ||
118 | spinlock_t io_lock; | 128 | spinlock_t io_lock; |
119 | u16 id; | 129 | u16 id; |
120 | u16 io_dir; | 130 | u16 io_dir; |
@@ -122,7 +132,8 @@ struct ucb1x00 { | |||
122 | u16 adc_cr; | 132 | u16 adc_cr; |
123 | u16 irq_fal_enbl; | 133 | u16 irq_fal_enbl; |
124 | u16 irq_ris_enbl; | 134 | u16 irq_ris_enbl; |
125 | struct ucb1x00_irq irq_handler[16]; | 135 | u16 irq_mask; |
136 | u16 irq_wake; | ||
126 | struct device dev; | 137 | struct device dev; |
127 | struct list_head node; | 138 | struct list_head node; |
128 | struct list_head devs; | 139 | struct list_head devs; |
@@ -144,7 +155,7 @@ struct ucb1x00_driver { | |||
144 | struct list_head devs; | 155 | struct list_head devs; |
145 | int (*add)(struct ucb1x00_dev *dev); | 156 | int (*add)(struct ucb1x00_dev *dev); |
146 | void (*remove)(struct ucb1x00_dev *dev); | 157 | void (*remove)(struct ucb1x00_dev *dev); |
147 | int (*suspend)(struct ucb1x00_dev *dev, pm_message_t state); | 158 | int (*suspend)(struct ucb1x00_dev *dev); |
148 | int (*resume)(struct ucb1x00_dev *dev); | 159 | int (*resume)(struct ucb1x00_dev *dev); |
149 | }; | 160 | }; |
150 | 161 | ||
@@ -245,15 +256,4 @@ unsigned int ucb1x00_adc_read(struct ucb1x00 *ucb, int adc_channel, int sync); | |||
245 | void ucb1x00_adc_enable(struct ucb1x00 *ucb); | 256 | void ucb1x00_adc_enable(struct ucb1x00 *ucb); |
246 | void ucb1x00_adc_disable(struct ucb1x00 *ucb); | 257 | void ucb1x00_adc_disable(struct ucb1x00 *ucb); |
247 | 258 | ||
248 | /* | ||
249 | * Which edges of the IRQ do you want to control today? | ||
250 | */ | ||
251 | #define UCB_RISING (1 << 0) | ||
252 | #define UCB_FALLING (1 << 1) | ||
253 | |||
254 | int ucb1x00_hook_irq(struct ucb1x00 *ucb, unsigned int idx, void (*fn)(int, void *), void *devid); | ||
255 | void ucb1x00_enable_irq(struct ucb1x00 *ucb, unsigned int idx, int edges); | ||
256 | void ucb1x00_disable_irq(struct ucb1x00 *ucb, unsigned int idx, int edges); | ||
257 | int ucb1x00_free_irq(struct ucb1x00 *ucb, unsigned int idx, void *devid); | ||
258 | |||
259 | #endif | 259 | #endif |
diff --git a/include/linux/sa11x0-dma.h b/include/linux/sa11x0-dma.h new file mode 100644 index 000000000000..65839a58b8e5 --- /dev/null +++ b/include/linux/sa11x0-dma.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * SA11x0 DMA Engine support | ||
3 | * | ||
4 | * Copyright (C) 2012 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 | #ifndef __LINUX_SA11X0_DMA_H | ||
11 | #define __LINUX_SA11X0_DMA_H | ||
12 | |||
13 | struct dma_chan; | ||
14 | |||
15 | #if defined(CONFIG_DMA_SA11X0) || defined(CONFIG_DMA_SA11X0_MODULE) | ||
16 | bool sa11x0_dma_filter_fn(struct dma_chan *, void *); | ||
17 | #else | ||
18 | static inline bool sa11x0_dma_filter_fn(struct dma_chan *c, void *d) | ||
19 | { | ||
20 | return false; | ||
21 | } | ||
22 | #endif | ||
23 | |||
24 | #endif | ||