diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2016-04-27 14:15:38 +0300 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2016-05-02 15:30:47 +0530 |
commit | 2e65060e803e046fc9b5ed0107494a452424845e (patch) | |
tree | 2e5adfe7ea7400586fff0623636912d2f1ded14a /drivers/dma/dw/platform.c | |
parent | 969f750fc63d3fd2f26eceedcdeca5878b785b2e (diff) |
dmaengine: dw: revisit data_width property
There several changes are done here:
- Convert the property to be in bytes
Besides that this is a common practice for such property, the use of a value
in bytes much more convenient than handling the encoded one.
- Rename data_width to data-width in the device tree bindings
The change leaves the support for the old format as well just in case someone
will use a newer kernel with an old device tree blob.
- While here, replace dwc_fast_ffs() by __ffs()
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/dw/platform.c')
-rw-r--r-- | drivers/dma/dw/platform.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c index e65ebe5ab88f..2420fb7267bc 100644 --- a/drivers/dma/dw/platform.c +++ b/drivers/dma/dw/platform.c @@ -138,9 +138,12 @@ dw_dma_parse_dt(struct platform_device *pdev) if (!of_property_read_u32(np, "block_size", &tmp)) pdata->block_size = tmp; - if (!of_property_read_u32_array(np, "data_width", arr, nr_masters)) { + if (!of_property_read_u32_array(np, "data-width", arr, nr_masters)) { for (tmp = 0; tmp < nr_masters; tmp++) pdata->data_width[tmp] = arr[tmp]; + } else if (!of_property_read_u32_array(np, "data_width", arr, nr_masters)) { + for (tmp = 0; tmp < nr_masters; tmp++) + pdata->data_width[tmp] = BIT(arr[tmp] & 0x07); } return pdata; |