From: Thomas Abraham Date: Fri, 5 Apr 2013 06:25:15 +0000 (+0900) Subject: ARM: EXYNOS: Add a platform bus notifier to set dma masks for Exynos5440 X-Git-Tag: next-20130521~7^2~4^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9db04b1261817586062930ec69075d87fcc92544;p=karo-tx-linux.git ARM: EXYNOS: Add a platform bus notifier to set dma masks for Exynos5440 Use a platform bus notifier callback function to set the correct dma_mask and coherent_dma_mask for every device registered on Exynos5440 based machine. Signed-off-by: Thomas Abraham Signed-off-by: Kukjin Kim --- diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index 753b94f3fca7..e47c2a5d60f9 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -23,11 +24,30 @@ #include "common.h" +static u64 dma_mask64 = DMA_BIT_MASK(64); + static void __init exynos5_dt_map_io(void) { exynos_init_io(NULL, 0); } +static int exynos5440_platform_notifier(struct notifier_block *nb, + unsigned long event, void *__dev) +{ + struct device *dev = __dev; + + if (event != BUS_NOTIFY_ADD_DEVICE) + return NOTIFY_DONE; + + dev->dma_mask = &dma_mask64; + dev->coherent_dma_mask = DMA_BIT_MASK(64); + return NOTIFY_OK; +} + +static struct notifier_block exynos5440_platform_nb = { + .notifier_call = exynos5440_platform_notifier, +}; + static void __init exynos5_dt_machine_init(void) { struct device_node *i2c_np; @@ -52,6 +72,9 @@ static void __init exynos5_dt_machine_init(void) } } + if (of_machine_is_compatible("samsung,exynos5440")) + bus_register_notifier(&platform_bus_type, &exynos5440_platform_nb); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); }