diff options
-rw-r--r-- | drivers/dma/ste_dma40.c | 15 | ||||
-rw-r--r-- | include/linux/platform_data/dma-ste-dma40.h | 4 |
2 files changed, 14 insertions, 5 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 5feab7db9449..ca18117def0a 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
@@ -3004,14 +3004,21 @@ static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev) | |||
3004 | * ? has revision 1 | 3004 | * ? has revision 1 |
3005 | * DB8500v1 has revision 2 | 3005 | * DB8500v1 has revision 2 |
3006 | * DB8500v2 has revision 3 | 3006 | * DB8500v2 has revision 3 |
3007 | * AP9540v1 has revision 4 | ||
3008 | * DB8540v1 has revision 4 | ||
3007 | */ | 3009 | */ |
3008 | rev = AMBA_REV_BITS(pid); | 3010 | rev = AMBA_REV_BITS(pid); |
3009 | 3011 | ||
3012 | plat_data = pdev->dev.platform_data; | ||
3013 | |||
3010 | /* The number of physical channels on this HW */ | 3014 | /* The number of physical channels on this HW */ |
3011 | num_phy_chans = 4 * (readl(virtbase + D40_DREG_ICFG) & 0x7) + 4; | 3015 | if (plat_data->num_of_phy_chans) |
3016 | num_phy_chans = plat_data->num_of_phy_chans; | ||
3017 | else | ||
3018 | num_phy_chans = 4 * (readl(virtbase + D40_DREG_ICFG) & 0x7) + 4; | ||
3012 | 3019 | ||
3013 | dev_info(&pdev->dev, "hardware revision: %d @ 0x%x\n", | 3020 | dev_info(&pdev->dev, "hardware revision: %d @ 0x%x with %d physical channels\n", |
3014 | rev, res->start); | 3021 | rev, res->start, num_phy_chans); |
3015 | 3022 | ||
3016 | if (rev < 2) { | 3023 | if (rev < 2) { |
3017 | d40_err(&pdev->dev, "hardware revision: %d is not supported", | 3024 | d40_err(&pdev->dev, "hardware revision: %d is not supported", |
@@ -3019,8 +3026,6 @@ static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev) | |||
3019 | goto failure; | 3026 | goto failure; |
3020 | } | 3027 | } |
3021 | 3028 | ||
3022 | plat_data = pdev->dev.platform_data; | ||
3023 | |||
3024 | /* Count the number of logical channels in use */ | 3029 | /* Count the number of logical channels in use */ |
3025 | for (i = 0; i < plat_data->dev_len; i++) | 3030 | for (i = 0; i < plat_data->dev_len; i++) |
3026 | if (plat_data->dev_rx[i] != 0) | 3031 | if (plat_data->dev_rx[i] != 0) |
diff --git a/include/linux/platform_data/dma-ste-dma40.h b/include/linux/platform_data/dma-ste-dma40.h index 9ff93b065686..833cb959f3df 100644 --- a/include/linux/platform_data/dma-ste-dma40.h +++ b/include/linux/platform_data/dma-ste-dma40.h | |||
@@ -147,6 +147,9 @@ struct stedma40_chan_cfg { | |||
147 | * @memcpy_conf_log: default configuration of logical channel memcpy | 147 | * @memcpy_conf_log: default configuration of logical channel memcpy |
148 | * @disabled_channels: A vector, ending with -1, that marks physical channels | 148 | * @disabled_channels: A vector, ending with -1, that marks physical channels |
149 | * that are for different reasons not available for the driver. | 149 | * that are for different reasons not available for the driver. |
150 | * @num_of_phy_chans: The number of physical channels implemented in HW. | ||
151 | * 0 means reading the number of channels from DMA HW but this is only valid | ||
152 | * for 'multiple of 4' channels, like 8. | ||
150 | */ | 153 | */ |
151 | struct stedma40_platform_data { | 154 | struct stedma40_platform_data { |
152 | u32 dev_len; | 155 | u32 dev_len; |
@@ -158,6 +161,7 @@ struct stedma40_platform_data { | |||
158 | struct stedma40_chan_cfg *memcpy_conf_log; | 161 | struct stedma40_chan_cfg *memcpy_conf_log; |
159 | int disabled_channels[STEDMA40_MAX_PHYS]; | 162 | int disabled_channels[STEDMA40_MAX_PHYS]; |
160 | bool use_esram_lcla; | 163 | bool use_esram_lcla; |
164 | int num_of_phy_chans; | ||
161 | }; | 165 | }; |
162 | 166 | ||
163 | #ifdef CONFIG_STE_DMA40 | 167 | #ifdef CONFIG_STE_DMA40 |