Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: ste_dma40: Remove platform data

The Ux500 is device tree-only since ages. Delete the
platform data header and push it into or next to the driver
instead.

Drop the non-DT probe path since this will not happen.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230417-ux500-dma40-cleanup-v3-4-60bfa6785968@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Linus Walleij and committed by
Vinod Koul
42ae6f16 fb85a8c5

+41 -119
+38 -18
drivers/dma/ste_dma40.c
··· 23 23 #include <linux/of_dma.h> 24 24 #include <linux/amba/bus.h> 25 25 #include <linux/regulator/consumer.h> 26 - #include <linux/platform_data/dma-ste-dma40.h> 27 26 28 27 #include "dmaengine.h" 28 + #include "ste_dma40.h" 29 29 #include "ste_dma40_ll.h" 30 + 31 + /** 32 + * struct stedma40_platform_data - Configuration struct for the dma device. 33 + * 34 + * @dev_tx: mapping between destination event line and io address 35 + * @dev_rx: mapping between source event line and io address 36 + * @disabled_channels: A vector, ending with -1, that marks physical channels 37 + * that are for different reasons not available for the driver. 38 + * @soft_lli_chans: A vector, that marks physical channels will use LLI by SW 39 + * which avoids HW bug that exists in some versions of the controller. 40 + * SoftLLI introduces relink overhead that could impact performace for 41 + * certain use cases. 42 + * @num_of_soft_lli_chans: The number of channels that needs to be configured 43 + * to use SoftLLI. 44 + * @use_esram_lcla: flag for mapping the lcla into esram region 45 + * @num_of_memcpy_chans: The number of channels reserved for memcpy. 46 + * @num_of_phy_chans: The number of physical channels implemented in HW. 47 + * 0 means reading the number of channels from DMA HW but this is only valid 48 + * for 'multiple of 4' channels, like 8. 49 + */ 50 + struct stedma40_platform_data { 51 + int disabled_channels[STEDMA40_MAX_PHYS]; 52 + int *soft_lli_chans; 53 + int num_of_soft_lli_chans; 54 + bool use_esram_lcla; 55 + int num_of_memcpy_chans; 56 + int num_of_phy_chans; 57 + }; 30 58 31 59 #define D40_NAME "dma40" 32 60 ··· 2297 2269 return NULL; 2298 2270 } 2299 2271 2300 - bool stedma40_filter(struct dma_chan *chan, void *data) 2272 + static bool stedma40_filter(struct dma_chan *chan, void *data) 2301 2273 { 2302 2274 struct stedma40_chan_cfg *info = data; 2303 2275 struct d40_chan *d40c = ··· 2316 2288 2317 2289 return err == 0; 2318 2290 } 2319 - EXPORT_SYMBOL(stedma40_filter); 2320 2291 2321 2292 static void __d40_set_prio_rt(struct d40_chan *d40c, int dev_type, bool src) 2322 2293 { ··· 3544 3517 int num_reserved_chans; 3545 3518 u32 val; 3546 3519 3547 - if (!plat_data) { 3548 - if (np) { 3549 - if (d40_of_probe(pdev, np)) { 3550 - ret = -ENOMEM; 3551 - goto report_failure; 3552 - } 3553 - } else { 3554 - d40_err(dev, "No pdata or Device Tree provided\n"); 3555 - goto report_failure; 3556 - } 3520 + if (d40_of_probe(pdev, np)) { 3521 + ret = -ENOMEM; 3522 + goto report_failure; 3557 3523 } 3558 3524 3559 3525 base = d40_hw_detect_init(pdev); ··· 3670 3650 3671 3651 d40_hw_init(base); 3672 3652 3673 - if (np) { 3674 - ret = of_dma_controller_register(np, d40_xlate, NULL); 3675 - if (ret) 3676 - dev_err(dev, 3677 - "could not register of_dma_controller\n"); 3653 + ret = of_dma_controller_register(np, d40_xlate, NULL); 3654 + if (ret) { 3655 + dev_err(dev, 3656 + "could not register of_dma_controller\n"); 3657 + goto destroy_cache; 3678 3658 } 3679 3659 3680 3660 dev_info(base->dev, "initialized\n");
+2 -1
drivers/dma/ste_dma40_ll.c
··· 6 6 */ 7 7 8 8 #include <linux/kernel.h> 9 - #include <linux/platform_data/dma-ste-dma40.h> 9 + #include <linux/dmaengine.h> 10 10 11 + #include "ste_dma40.h" 11 12 #include "ste_dma40_ll.h" 12 13 13 14 static u8 d40_width_to_bits(enum dma_slave_buswidth width)
+1 -100
include/linux/platform_data/dma-ste-dma40.h drivers/dma/ste_dma40.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Copyright (C) ST-Ericsson SA 2007-2010 4 - * Author: Per Forlin <per.forlin@stericsson.com> for ST-Ericsson 5 - * Author: Jonas Aaberg <jonas.aberg@stericsson.com> for ST-Ericsson 6 - */ 7 - 8 2 9 3 #ifndef STE_DMA40_H 10 4 #define STE_DMA40_H 11 - 12 - #include <linux/dmaengine.h> 13 - #include <linux/scatterlist.h> 14 - #include <linux/workqueue.h> 15 - #include <linux/interrupt.h> 16 5 17 6 /* 18 7 * Maxium size for a single dma descriptor ··· 107 118 int phy_channel; 108 119 }; 109 120 110 - /** 111 - * struct stedma40_platform_data - Configuration struct for the dma device. 112 - * 113 - * @dev_tx: mapping between destination event line and io address 114 - * @dev_rx: mapping between source event line and io address 115 - * @disabled_channels: A vector, ending with -1, that marks physical channels 116 - * that are for different reasons not available for the driver. 117 - * @soft_lli_chans: A vector, that marks physical channels will use LLI by SW 118 - * which avoids HW bug that exists in some versions of the controller. 119 - * SoftLLI introduces relink overhead that could impact performace for 120 - * certain use cases. 121 - * @num_of_soft_lli_chans: The number of channels that needs to be configured 122 - * to use SoftLLI. 123 - * @use_esram_lcla: flag for mapping the lcla into esram region 124 - * @num_of_memcpy_chans: The number of channels reserved for memcpy. 125 - * @num_of_phy_chans: The number of physical channels implemented in HW. 126 - * 0 means reading the number of channels from DMA HW but this is only valid 127 - * for 'multiple of 4' channels, like 8. 128 - */ 129 - struct stedma40_platform_data { 130 - int disabled_channels[STEDMA40_MAX_PHYS]; 131 - int *soft_lli_chans; 132 - int num_of_soft_lli_chans; 133 - bool use_esram_lcla; 134 - int num_of_memcpy_chans; 135 - int num_of_phy_chans; 136 - }; 137 - 138 - #ifdef CONFIG_STE_DMA40 139 - 140 - /** 141 - * stedma40_filter() - Provides stedma40_chan_cfg to the 142 - * ste_dma40 dma driver via the dmaengine framework. 143 - * does some checking of what's provided. 144 - * 145 - * Never directly called by client. It used by dmaengine. 146 - * @chan: dmaengine handle. 147 - * @data: Must be of type: struct stedma40_chan_cfg and is 148 - * the configuration of the framework. 149 - * 150 - * 151 - */ 152 - 153 - bool stedma40_filter(struct dma_chan *chan, void *data); 154 - 155 - /** 156 - * stedma40_slave_mem() - Transfers a raw data buffer to or from a slave 157 - * (=device) 158 - * 159 - * @chan: dmaengine handle 160 - * @addr: source or destination physicall address. 161 - * @size: bytes to transfer 162 - * @direction: direction of transfer 163 - * @flags: is actually enum dma_ctrl_flags. See dmaengine.h 164 - */ 165 - 166 - static inline struct 167 - dma_async_tx_descriptor *stedma40_slave_mem(struct dma_chan *chan, 168 - dma_addr_t addr, 169 - unsigned int size, 170 - enum dma_transfer_direction direction, 171 - unsigned long flags) 172 - { 173 - struct scatterlist sg; 174 - sg_init_table(&sg, 1); 175 - sg.dma_address = addr; 176 - sg.length = size; 177 - 178 - return dmaengine_prep_slave_sg(chan, &sg, 1, direction, flags); 179 - } 180 - 181 - #else 182 - static inline bool stedma40_filter(struct dma_chan *chan, void *data) 183 - { 184 - return false; 185 - } 186 - 187 - static inline struct 188 - dma_async_tx_descriptor *stedma40_slave_mem(struct dma_chan *chan, 189 - dma_addr_t addr, 190 - unsigned int size, 191 - enum dma_transfer_direction direction, 192 - unsigned long flags) 193 - { 194 - return NULL; 195 - } 196 - #endif 197 - 198 - #endif 121 + #endif /* STE_DMA40_H */