diff options
-rw-r--r-- | arch/arm/mach-ux500/devices-db8500.c | 1 | ||||
-rw-r--r-- | drivers/dma/ste_dma40.c | 16 | ||||
-rw-r--r-- | include/linux/platform_data/dma-ste-dma40.h | 2 |
3 files changed, 6 insertions, 13 deletions
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c index 7989c564e47a..130f3d9917e7 100644 --- a/arch/arm/mach-ux500/devices-db8500.c +++ b/arch/arm/mach-ux500/devices-db8500.c | |||
@@ -121,7 +121,6 @@ static const dma_addr_t dma40_rx_map[DB8500_DMA_NR_DEV] = { | |||
121 | }; | 121 | }; |
122 | 122 | ||
123 | static struct stedma40_platform_data dma40_plat_data = { | 123 | static struct stedma40_platform_data dma40_plat_data = { |
124 | .dev_len = DB8500_DMA_NR_DEV, | ||
125 | .dev_rx = dma40_rx_map, | 124 | .dev_rx = dma40_rx_map, |
126 | .dev_tx = dma40_tx_map, | 125 | .dev_tx = dma40_tx_map, |
127 | .disabled_channels = {-1}, | 126 | .disabled_channels = {-1}, |
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 367ef15a3cd8..f25c9ccf28e8 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
@@ -45,6 +45,9 @@ | |||
45 | #define D40_LCLA_LINK_PER_EVENT_GRP 128 | 45 | #define D40_LCLA_LINK_PER_EVENT_GRP 128 |
46 | #define D40_LCLA_END D40_LCLA_LINK_PER_EVENT_GRP | 46 | #define D40_LCLA_END D40_LCLA_LINK_PER_EVENT_GRP |
47 | 47 | ||
48 | /* Max number of logical channels per physical channel */ | ||
49 | #define D40_MAX_LOG_CHAN_PER_PHY 32 | ||
50 | |||
48 | /* Attempts before giving up to trying to get pages that are aligned */ | 51 | /* Attempts before giving up to trying to get pages that are aligned */ |
49 | #define MAX_LCLA_ALLOC_ATTEMPTS 256 | 52 | #define MAX_LCLA_ALLOC_ATTEMPTS 256 |
50 | 53 | ||
@@ -3210,6 +3213,8 @@ static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev) | |||
3210 | else | 3213 | else |
3211 | num_phy_chans = 4 * (readl(virtbase + D40_DREG_ICFG) & 0x7) + 4; | 3214 | num_phy_chans = 4 * (readl(virtbase + D40_DREG_ICFG) & 0x7) + 4; |
3212 | 3215 | ||
3216 | num_log_chans = num_phy_chans * D40_MAX_LOG_CHAN_PER_PHY; | ||
3217 | |||
3213 | dev_info(&pdev->dev, "hardware revision: %d @ 0x%x with %d physical channels\n", | 3218 | dev_info(&pdev->dev, "hardware revision: %d @ 0x%x with %d physical channels\n", |
3214 | rev, res->start, num_phy_chans); | 3219 | rev, res->start, num_phy_chans); |
3215 | 3220 | ||
@@ -3219,15 +3224,6 @@ static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev) | |||
3219 | goto failure; | 3224 | goto failure; |
3220 | } | 3225 | } |
3221 | 3226 | ||
3222 | /* Count the number of logical channels in use */ | ||
3223 | for (i = 0; i < plat_data->dev_len; i++) | ||
3224 | if (plat_data->dev_rx[i] != 0) | ||
3225 | num_log_chans++; | ||
3226 | |||
3227 | for (i = 0; i < plat_data->dev_len; i++) | ||
3228 | if (plat_data->dev_tx[i] != 0) | ||
3229 | num_log_chans++; | ||
3230 | |||
3231 | base = kzalloc(ALIGN(sizeof(struct d40_base), 4) + | 3227 | base = kzalloc(ALIGN(sizeof(struct d40_base), 4) + |
3232 | (num_phy_chans + num_log_chans + ARRAY_SIZE(dma40_memcpy_channels)) * | 3228 | (num_phy_chans + num_log_chans + ARRAY_SIZE(dma40_memcpy_channels)) * |
3233 | sizeof(struct d40_chan), GFP_KERNEL); | 3229 | sizeof(struct d40_chan), GFP_KERNEL); |
@@ -3295,7 +3291,7 @@ static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev) | |||
3295 | * The max number of logical channels are event lines for all | 3291 | * The max number of logical channels are event lines for all |
3296 | * src devices and dst devices | 3292 | * src devices and dst devices |
3297 | */ | 3293 | */ |
3298 | base->lookup_log_chans = kzalloc(plat_data->dev_len * 2 * | 3294 | base->lookup_log_chans = kzalloc(num_log_chans * |
3299 | sizeof(struct d40_chan *), | 3295 | sizeof(struct d40_chan *), |
3300 | GFP_KERNEL); | 3296 | GFP_KERNEL); |
3301 | if (!base->lookup_log_chans) | 3297 | if (!base->lookup_log_chans) |
diff --git a/include/linux/platform_data/dma-ste-dma40.h b/include/linux/platform_data/dma-ste-dma40.h index 9e42a67d0cd5..c54af61c9e48 100644 --- a/include/linux/platform_data/dma-ste-dma40.h +++ b/include/linux/platform_data/dma-ste-dma40.h | |||
@@ -136,7 +136,6 @@ struct stedma40_chan_cfg { | |||
136 | /** | 136 | /** |
137 | * struct stedma40_platform_data - Configuration struct for the dma device. | 137 | * struct stedma40_platform_data - Configuration struct for the dma device. |
138 | * | 138 | * |
139 | * @dev_len: length of dev_tx and dev_rx | ||
140 | * @dev_tx: mapping between destination event line and io address | 139 | * @dev_tx: mapping between destination event line and io address |
141 | * @dev_rx: mapping between source event line and io address | 140 | * @dev_rx: mapping between source event line and io address |
142 | * @disabled_channels: A vector, ending with -1, that marks physical channels | 141 | * @disabled_channels: A vector, ending with -1, that marks physical channels |
@@ -153,7 +152,6 @@ struct stedma40_chan_cfg { | |||
153 | * for 'multiple of 4' channels, like 8. | 152 | * for 'multiple of 4' channels, like 8. |
154 | */ | 153 | */ |
155 | struct stedma40_platform_data { | 154 | struct stedma40_platform_data { |
156 | u32 dev_len; | ||
157 | const dma_addr_t *dev_tx; | 155 | const dma_addr_t *dev_tx; |
158 | const dma_addr_t *dev_rx; | 156 | const dma_addr_t *dev_rx; |
159 | int disabled_channels[STEDMA40_MAX_PHYS]; | 157 | int disabled_channels[STEDMA40_MAX_PHYS]; |