Skip to content

Commit fc72462

Browse files
docularxuvinodkoul
authored andcommitted
dmaengine: mmp_pdma: Add reset controller support
Add support to acquire and deassert an optional hardware reset controller during mmp_pdma_probe(). It is optional because in Marvell devices such as "marvell,pdma-1.0" the resets property is not a required property. But in SpacemiT K1 PDMA, "spacemit,k1-pdma" as the dt binding schema file stated, resets is required. Signed-off-by: Guodong Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent e73a9a1 commit fc72462

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/dma/mmp_pdma.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/platform_data/mmp_dma.h>
1717
#include <linux/dmapool.h>
1818
#include <linux/clk.h>
19+
#include <linux/reset.h>
1920
#include <linux/of_dma.h>
2021
#include <linux/of.h>
2122

@@ -1021,6 +1022,7 @@ static int mmp_pdma_probe(struct platform_device *op)
10211022
struct mmp_pdma_device *pdev;
10221023
struct mmp_dma_platdata *pdata = dev_get_platdata(&op->dev);
10231024
struct clk *clk;
1025+
struct reset_control *rst;
10241026
int i, ret, irq = 0;
10251027
int dma_channels = 0, irq_num = 0;
10261028
const enum dma_slave_buswidth widths =
@@ -1043,6 +1045,11 @@ static int mmp_pdma_probe(struct platform_device *op)
10431045
if (IS_ERR(clk))
10441046
return PTR_ERR(clk);
10451047

1048+
rst = devm_reset_control_get_optional_exclusive_deasserted(pdev->dev,
1049+
NULL);
1050+
if (IS_ERR(rst))
1051+
return PTR_ERR(rst);
1052+
10461053
if (pdev->dev->of_node) {
10471054
/* Parse new and deprecated dma-channels properties */
10481055
if (of_property_read_u32(pdev->dev->of_node, "dma-channels",

0 commit comments

Comments
 (0)