aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/usb.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-09-16 09:33:59 +0200
committerChristoph Hellwig <hch@lst.de>2020-09-25 06:15:32 +0200
commit38225f2ef2f4263fc65acae63fdd4e8489c9ffcf (patch)
tree049d9f69b361571b22f175a0cb5085c0a19fad72 /arch/arm/mach-omap1/usb.c
parentdma-mapping: better document dma_addr_t and DMA_MAPPING_ERROR (diff)
downloadlinux-dev-38225f2ef2f4263fc65acae63fdd4e8489c9ffcf.tar.xz
linux-dev-38225f2ef2f4263fc65acae63fdd4e8489c9ffcf.zip
ARM/omap1: switch to use dma_direct_set_offset for lbus DMA offsets
Switch the omap1510 platform ohci device to use dma_direct_set_offset to set the DMA offset instead of using direct hooks into the DMA mapping code and remove the now unused hooks. Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Acked-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1/usb.c')
-rw-r--r--arch/arm/mach-omap1/usb.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c
index d8e9bbda8f7b..ba8566204ea9 100644
--- a/arch/arm/mach-omap1/usb.c
+++ b/arch/arm/mach-omap1/usb.c
@@ -9,6 +9,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
#include <linux/io.h>
#include <asm/irq.h>
@@ -542,6 +543,25 @@ bad:
/* ULPD_APLL_CTRL */
#define APLL_NDPLL_SWITCH (1 << 0)
+static int omap_1510_usb_ohci_notifier(struct notifier_block *nb,
+ unsigned long event, void *data)
+{
+ struct device *dev = data;
+
+ if (event != BUS_NOTIFY_ADD_DEVICE)
+ return NOTIFY_DONE;
+
+ if (strncmp(dev_name(dev), "ohci", 4) == 0 &&
+ dma_direct_set_offset(dev, PHYS_OFFSET, OMAP1510_LB_OFFSET,
+ (u64)-1))
+ WARN_ONCE(1, "failed to set DMA offset\n");
+ return NOTIFY_OK;
+}
+
+static struct notifier_block omap_1510_usb_ohci_nb = {
+ .notifier_call = omap_1510_usb_ohci_notifier,
+};
+
static void __init omap_1510_usb_init(struct omap_usb_config *config)
{
unsigned int val;
@@ -600,6 +620,8 @@ static void __init omap_1510_usb_init(struct omap_usb_config *config)
if (config->register_host) {
int status;
+ bus_register_notifier(&platform_bus_type,
+ &omap_1510_usb_ohci_nb);
ohci_device.dev.platform_data = config;
status = platform_device_register(&ohci_device);
if (status)