dmaengine Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v1 1/2] dmaengine: dw: Register ACPI DMA controller for PCI that has companion
@ 2020-05-26 18:24 Andy Shevchenko
  2020-05-26 18:24 ` [PATCH v1 2/2] dmaengine: dw: Replace 'objs' by 'y' Andy Shevchenko
  2020-06-16 16:25 ` [PATCH v1 1/2] dmaengine: dw: Register ACPI DMA controller for PCI that has companion Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2020-05-26 18:24 UTC (permalink / raw)
  To: Viresh Kumar, dmaengine, Vinod Koul; +Cc: Andy Shevchenko

If PCI enumerated controller has a companion device,
register it in the ACPI DMA controllers as well.

Fixes: f7c799e950f9 ("dmaengine: dw: we do support Merrifield SoC in PCI mode")
Depends-on: b685fe26e9af ("dmaengine: dw: platform: Split ACPI helpers to separate module")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/dma/dw/Makefile | 2 +-
 drivers/dma/dw/acpi.c   | 2 ++
 drivers/dma/dw/pci.c    | 4 ++++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/dw/Makefile b/drivers/dma/dw/Makefile
index b6f06699e91a..9e949f13e1b5 100644
--- a/drivers/dma/dw/Makefile
+++ b/drivers/dma/dw/Makefile
@@ -1,10 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DW_DMAC_CORE)	+= dw_dmac_core.o
 dw_dmac_core-objs	:= core.o dw.o idma32.o
+dw_dmac_core-$(CONFIG_ACPI)	+= acpi.o
 
 obj-$(CONFIG_DW_DMAC)		+= dw_dmac.o
 dw_dmac-y			:= platform.o
-dw_dmac-$(CONFIG_ACPI)		+= acpi.o
 dw_dmac-$(CONFIG_OF)		+= of.o
 
 obj-$(CONFIG_DW_DMAC_PCI)	+= dw_dmac_pci.o
diff --git a/drivers/dma/dw/acpi.c b/drivers/dma/dw/acpi.c
index f6e8d55b4f6e..c510c109d2c3 100644
--- a/drivers/dma/dw/acpi.c
+++ b/drivers/dma/dw/acpi.c
@@ -41,6 +41,7 @@ void dw_dma_acpi_controller_register(struct dw_dma *dw)
 	if (ret)
 		dev_err(dev, "could not register acpi_dma_controller\n");
 }
+EXPORT_SYMBOL_GPL(dw_dma_acpi_controller_register);
 
 void dw_dma_acpi_controller_free(struct dw_dma *dw)
 {
@@ -51,3 +52,4 @@ void dw_dma_acpi_controller_free(struct dw_dma *dw)
 
 	acpi_dma_controller_free(dev);
 }
+EXPORT_SYMBOL_GPL(dw_dma_acpi_controller_free);
diff --git a/drivers/dma/dw/pci.c b/drivers/dma/dw/pci.c
index cf6e8ec4c0ff..1142aa6f8c4a 100644
--- a/drivers/dma/dw/pci.c
+++ b/drivers/dma/dw/pci.c
@@ -60,6 +60,8 @@ static int dw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid)
 	if (ret)
 		return ret;
 
+	dw_dma_acpi_controller_register(chip->dw);
+
 	pci_set_drvdata(pdev, data);
 
 	return 0;
@@ -71,6 +73,8 @@ static void dw_pci_remove(struct pci_dev *pdev)
 	struct dw_dma_chip *chip = data->chip;
 	int ret;
 
+	dw_dma_acpi_controller_free(chip->dw);
+
 	ret = data->remove(chip);
 	if (ret)
 		dev_warn(&pdev->dev, "can't remove device properly: %d\n", ret);
-- 
2.26.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v1 2/2] dmaengine: dw: Replace 'objs' by 'y'
  2020-05-26 18:24 [PATCH v1 1/2] dmaengine: dw: Register ACPI DMA controller for PCI that has companion Andy Shevchenko
@ 2020-05-26 18:24 ` Andy Shevchenko
  2020-06-16 16:25 ` [PATCH v1 1/2] dmaengine: dw: Register ACPI DMA controller for PCI that has companion Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2020-05-26 18:24 UTC (permalink / raw)
  To: Viresh Kumar, dmaengine, Vinod Koul; +Cc: Andy Shevchenko

`-objs` is fitted for building host programs, change to `-y`,
more straightforward for device drivers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/dma/dw/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/dw/Makefile b/drivers/dma/dw/Makefile
index 9e949f13e1b5..a6f358ad8591 100644
--- a/drivers/dma/dw/Makefile
+++ b/drivers/dma/dw/Makefile
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DW_DMAC_CORE)	+= dw_dmac_core.o
-dw_dmac_core-objs	:= core.o dw.o idma32.o
+dw_dmac_core-y			:= core.o dw.o idma32.o
 dw_dmac_core-$(CONFIG_ACPI)	+= acpi.o
 
 obj-$(CONFIG_DW_DMAC)		+= dw_dmac.o
@@ -8,4 +8,4 @@ dw_dmac-y			:= platform.o
 dw_dmac-$(CONFIG_OF)		+= of.o
 
 obj-$(CONFIG_DW_DMAC_PCI)	+= dw_dmac_pci.o
-dw_dmac_pci-objs	:= pci.o
+dw_dmac_pci-y			:= pci.o
-- 
2.26.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/2] dmaengine: dw: Register ACPI DMA controller for PCI that has companion
  2020-05-26 18:24 [PATCH v1 1/2] dmaengine: dw: Register ACPI DMA controller for PCI that has companion Andy Shevchenko
  2020-05-26 18:24 ` [PATCH v1 2/2] dmaengine: dw: Replace 'objs' by 'y' Andy Shevchenko
@ 2020-06-16 16:25 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2020-06-16 16:25 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Viresh Kumar, dmaengine

On 26-05-20, 21:24, Andy Shevchenko wrote:
> If PCI enumerated controller has a companion device,
> register it in the ACPI DMA controllers as well.

Applied both, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 18:24 [PATCH v1 1/2] dmaengine: dw: Register ACPI DMA controller for PCI that has companion Andy Shevchenko
2020-05-26 18:24 ` [PATCH v1 2/2] dmaengine: dw: Replace 'objs' by 'y' Andy Shevchenko
2020-06-16 16:25 ` [PATCH v1 1/2] dmaengine: dw: Register ACPI DMA controller for PCI that has companion Vinod Koul

dmaengine Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dmaengine/0 dmaengine/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dmaengine dmaengine/ https://lore.kernel.org/dmaengine \
		dmaengine@vger.kernel.org
	public-inbox-index dmaengine

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dmaengine


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git