diff options
author | Koul, Vinod <vinod.koul@intel.com> | 2010-10-04 06:42:40 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-10-07 18:03:42 -0400 |
commit | 53a61badf47e674fb43d73cd22f0f8065098ddf6 (patch) | |
tree | abf0b87c397d9129f22bd34bbfc8d9f9cb139cab /drivers/dma/intel_mid_dma_regs.h | |
parent | cc60f8878eab892c03d06b10f389232b9b66bd83 (diff) |
intel_mid_dma: Add runtime PM support
This patch adds runtime PM support in this dma driver
for 4 PCI Controllers
Whenever the driver is idle (no channels grabbed), it
can go to low power state
It also adds the PCI suspend and resume support
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/intel_mid_dma_regs.h')
-rw-r--r-- | drivers/dma/intel_mid_dma_regs.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/dma/intel_mid_dma_regs.h b/drivers/dma/intel_mid_dma_regs.h index d81aa658ab09..a12dd2572dc3 100644 --- a/drivers/dma/intel_mid_dma_regs.h +++ b/drivers/dma/intel_mid_dma_regs.h | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <linux/dmapool.h> | 29 | #include <linux/dmapool.h> |
30 | #include <linux/pci_ids.h> | 30 | #include <linux/pci_ids.h> |
31 | 31 | ||
32 | #define INTEL_MID_DMA_DRIVER_VERSION "1.0.5" | 32 | #define INTEL_MID_DMA_DRIVER_VERSION "1.0.6" |
33 | 33 | ||
34 | #define REG_BIT0 0x00000001 | 34 | #define REG_BIT0 0x00000001 |
35 | #define REG_BIT8 0x00000100 | 35 | #define REG_BIT8 0x00000100 |
@@ -152,6 +152,7 @@ union intel_mid_dma_cfg_hi { | |||
152 | u32 cfg_hi; | 152 | u32 cfg_hi; |
153 | }; | 153 | }; |
154 | 154 | ||
155 | |||
155 | /** | 156 | /** |
156 | * struct intel_mid_dma_chan - internal mid representation of a DMA channel | 157 | * struct intel_mid_dma_chan - internal mid representation of a DMA channel |
157 | * @chan: dma_chan strcture represetation for mid chan | 158 | * @chan: dma_chan strcture represetation for mid chan |
@@ -166,6 +167,7 @@ union intel_mid_dma_cfg_hi { | |||
166 | * @slave: dma slave struture | 167 | * @slave: dma slave struture |
167 | * @descs_allocated: total number of decsiptors allocated | 168 | * @descs_allocated: total number of decsiptors allocated |
168 | * @dma: dma device struture pointer | 169 | * @dma: dma device struture pointer |
170 | * @busy: bool representing if ch is busy (active txn) or not | ||
169 | * @in_use: bool representing if ch is in use or not | 171 | * @in_use: bool representing if ch is in use or not |
170 | */ | 172 | */ |
171 | struct intel_mid_dma_chan { | 173 | struct intel_mid_dma_chan { |
@@ -181,6 +183,7 @@ struct intel_mid_dma_chan { | |||
181 | struct intel_mid_dma_slave *slave; | 183 | struct intel_mid_dma_slave *slave; |
182 | unsigned int descs_allocated; | 184 | unsigned int descs_allocated; |
183 | struct middma_device *dma; | 185 | struct middma_device *dma; |
186 | bool busy; | ||
184 | bool in_use; | 187 | bool in_use; |
185 | }; | 188 | }; |
186 | 189 | ||
@@ -190,6 +193,10 @@ static inline struct intel_mid_dma_chan *to_intel_mid_dma_chan( | |||
190 | return container_of(chan, struct intel_mid_dma_chan, chan); | 193 | return container_of(chan, struct intel_mid_dma_chan, chan); |
191 | } | 194 | } |
192 | 195 | ||
196 | enum intel_mid_dma_state { | ||
197 | RUNNING = 0, | ||
198 | SUSPENDED, | ||
199 | }; | ||
193 | /** | 200 | /** |
194 | * struct middma_device - internal representation of a DMA device | 201 | * struct middma_device - internal representation of a DMA device |
195 | * @pdev: PCI device | 202 | * @pdev: PCI device |
@@ -205,6 +212,7 @@ static inline struct intel_mid_dma_chan *to_intel_mid_dma_chan( | |||
205 | * @max_chan: max number of chs supported (from drv_data) | 212 | * @max_chan: max number of chs supported (from drv_data) |
206 | * @block_size: Block size of DMA transfer supported (from drv_data) | 213 | * @block_size: Block size of DMA transfer supported (from drv_data) |
207 | * @pimr_mask: MMIO register addr for periphral interrupt (from drv_data) | 214 | * @pimr_mask: MMIO register addr for periphral interrupt (from drv_data) |
215 | * @state: dma PM device state | ||
208 | */ | 216 | */ |
209 | struct middma_device { | 217 | struct middma_device { |
210 | struct pci_dev *pdev; | 218 | struct pci_dev *pdev; |
@@ -220,6 +228,7 @@ struct middma_device { | |||
220 | int max_chan; | 228 | int max_chan; |
221 | int block_size; | 229 | int block_size; |
222 | unsigned int pimr_mask; | 230 | unsigned int pimr_mask; |
231 | enum intel_mid_dma_state state; | ||
223 | }; | 232 | }; |
224 | 233 | ||
225 | static inline struct middma_device *to_middma_device(struct dma_device *common) | 234 | static inline struct middma_device *to_middma_device(struct dma_device *common) |
@@ -257,4 +266,7 @@ static inline struct intel_mid_dma_desc *to_intel_mid_dma_desc | |||
257 | { | 266 | { |
258 | return container_of(txd, struct intel_mid_dma_desc, txd); | 267 | return container_of(txd, struct intel_mid_dma_desc, txd); |
259 | } | 268 | } |
269 | |||
270 | int dma_resume(struct pci_dev *pci); | ||
271 | |||
260 | #endif /*__INTEL_MID_DMAC_REGS_H__*/ | 272 | #endif /*__INTEL_MID_DMAC_REGS_H__*/ |