From 07397df29e57cde5799af16e8f148ae10ed75285 Mon Sep 17 00:00:00 2001 From: Nipun Gupta Date: Sat, 28 Apr 2018 08:21:58 +0530 Subject: dma-mapping: move dma configuration to bus infrastructure ACPI/OF support for configuration of DMA is a bus specific aspect, and thus should be configured by the bus. Introduces a 'dma_configure' bus method so that busses can control their DMA capabilities. Also update the PCI, Platform, ACPI and host1x buses to use the new method. Suggested-by: Christoph Hellwig Signed-off-by: Nipun Gupta Acked-by: Bjorn Helgaas # PCI parts Acked-by: Thierry Reding Reviewed-by: Greg Kroah-Hartman [hch: simplified host1x_dma_configure based on a comment from Thierry, rewrote changelog] Signed-off-by: Christoph Hellwig --- include/linux/device.h | 4 ++++ include/linux/platform_device.h | 2 ++ 2 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/linux/device.h b/include/linux/device.h index 477956990f5e..63aa672bd394 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -88,6 +88,8 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *); * @resume: Called to bring a device on this bus out of sleep mode. * @num_vf: Called to find out how many virtual functions a device on this * bus supports. + * @dma_configure: Called to setup DMA configuration on a device on + this bus. * @pm: Power management operations of this bus, callback the specific * device driver's pm-ops. * @iommu_ops: IOMMU specific operations for this bus, used to attach IOMMU @@ -130,6 +132,8 @@ struct bus_type { int (*num_vf)(struct device *dev); + int (*dma_configure)(struct device *dev); + const struct dev_pm_ops *pm; const struct iommu_ops *iommu_ops; diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 49f634d96118..3097c943fab9 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -356,6 +356,8 @@ extern int platform_pm_restore(struct device *dev); #define platform_pm_restore NULL #endif +extern int platform_dma_configure(struct device *dev); + #ifdef CONFIG_PM_SLEEP #define USE_PLATFORM_PM_SLEEP_OPS \ .suspend = platform_pm_suspend, \ -- cgit v1.2.3-59-g8ed1b