| 235 | #endif /* RT_USING_OFW */ |
| 236 | |
| 237 | static const struct rt_dma_map_ops *device_dma_ops(struct rt_device *dev) |
| 238 | { |
| 239 | const struct rt_dma_map_ops *ops = dev->dma_ops; |
| 240 | |
| 241 | if (ops) |
| 242 | { |
| 243 | return ops; |
| 244 | } |
| 245 | |
| 246 | #ifdef RT_USING_OFW |
| 247 | if (dev->ofw_node && (ops = ofw_device_dma_ops(dev))) |
| 248 | { |
| 249 | return ops; |
| 250 | } |
| 251 | #endif |
| 252 | |
| 253 | if (rt_dma_device_is_coherent(dev)) |
| 254 | { |
| 255 | ops = &dma_map_coherent_ops; |
| 256 | } |
| 257 | else |
| 258 | { |
| 259 | ops = &dma_map_nocoherent_ops; |
| 260 | } |
| 261 | |
| 262 | dev->dma_ops = ops; |
| 263 | |
| 264 | return ops; |
| 265 | } |
| 266 | |
| 267 | static rt_ubase_t dma_pool_alloc(struct rt_dma_pool *pool, rt_size_t size) |
| 268 | { |
no test coverage detected