Commit ae0add74 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Vinod Koul

dmaengine: edma: DT: Change reserved slot array from 16bit to 32bit type

This change makes the DT file to be easier to read since the reserved slots
array does not need the '/bits/ 16' to be specified, which might confuse
some people.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarRob Herring <robh@kernel.org>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent ecb7dece
...@@ -56,9 +56,8 @@ edma: edma@49000000 { ...@@ -56,9 +56,8 @@ edma: edma@49000000 {
/* Channel 20 and 21 is allocated for memcpy */ /* Channel 20 and 21 is allocated for memcpy */
ti,edma-memcpy-channels = <20 21>; ti,edma-memcpy-channels = <20 21>;
/* The following PaRAM slots are reserved: 35-45 and 100-110 */ /* The following PaRAM slots are reserved: 35-44 and 100-109 */
ti,edma-reserved-slot-ranges = /bits/ 16 <35 10>, ti,edma-reserved-slot-ranges = <35 10>, <100 10>;
/bits/ 16 <100 10>;
}; };
edma_tptc0: tptc@49800000 { edma_tptc0: tptc@49800000 {
......
...@@ -2015,31 +2015,50 @@ static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev, ...@@ -2015,31 +2015,50 @@ static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev,
&sz); &sz);
if (prop) { if (prop) {
const char pname[] = "ti,edma-reserved-slot-ranges"; const char pname[] = "ti,edma-reserved-slot-ranges";
u32 (*tmp)[2];
s16 (*rsv_slots)[2]; s16 (*rsv_slots)[2];
size_t nelm = sz / sizeof(*rsv_slots); size_t nelm = sz / sizeof(*tmp);
struct edma_rsv_info *rsv_info; struct edma_rsv_info *rsv_info;
int i;
if (!nelm) if (!nelm)
return info; return info;
tmp = kcalloc(nelm, sizeof(*tmp), GFP_KERNEL);
if (!tmp)
return ERR_PTR(-ENOMEM);
rsv_info = devm_kzalloc(dev, sizeof(*rsv_info), GFP_KERNEL); rsv_info = devm_kzalloc(dev, sizeof(*rsv_info), GFP_KERNEL);
if (!rsv_info) if (!rsv_info) {
kfree(tmp);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
}
rsv_slots = devm_kcalloc(dev, nelm + 1, sizeof(*rsv_slots), rsv_slots = devm_kcalloc(dev, nelm + 1, sizeof(*rsv_slots),
GFP_KERNEL); GFP_KERNEL);
if (!rsv_slots) if (!rsv_slots) {
kfree(tmp);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
}
ret = of_property_read_u16_array(dev->of_node, pname, ret = of_property_read_u32_array(dev->of_node, pname,
(u16 *)rsv_slots, nelm * 2); (u32 *)tmp, nelm * 2);
if (ret) if (ret) {
kfree(tmp);
return ERR_PTR(ret); return ERR_PTR(ret);
}
for (i = 0; i < nelm; i++) {
rsv_slots[i][0] = tmp[i][0];
rsv_slots[i][1] = tmp[i][1];
}
rsv_slots[nelm][0] = -1; rsv_slots[nelm][0] = -1;
rsv_slots[nelm][1] = -1; rsv_slots[nelm][1] = -1;
info->rsv = rsv_info; info->rsv = rsv_info;
info->rsv->rsv_slots = (const s16 (*)[2])rsv_slots; info->rsv->rsv_slots = (const s16 (*)[2])rsv_slots;
kfree(tmp);
} }
return info; return info;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment