@@ -34,7 +34,9 @@
#include <linux/regulator/consumer.h>
#include <linux/io.h>
#include <linux/of_gpio.h>
+#include <linux/of_platform.h>
#include <plat/gpio-cfg.h>
+#include <mach/sysmmu.h>
#include <drm/exynos_drm.h>
@@ -2275,6 +2277,34 @@ void hdmi_attach_hdmiphy_client(struct i2c_client *hdmiphy)
}
#ifdef CONFIG_OF
+
+static int drm_hdmi_dt_init_iommu(struct device *dev)
+{
+ struct platform_device *pds;
+ struct device_node *dn, *dns;
+ const __be32 *parp;
+
+ dn = dev->of_node;
+ parp = of_get_property(dn, "sysmmu", NULL);
+ if (parp == NULL) {
+ dev_err(dev, "failed to find sysmmu property\n");
+ return -EINVAL;
+ }
+ dns = of_find_node_by_phandle(be32_to_cpup(parp));
+ if (dns == NULL) {
+ dev_err(dev, "failed to find sysmmu node\n");
+ return -EINVAL;
+ }
+ pds = of_find_device_by_node(dns);
+ if (pds == NULL) {
+ dev_err(dev, "failed to find sysmmu platform device\n");
+ return -EINVAL;
+ }
+
+ platform_set_sysmmu(&pds->dev, dev);
+ return 0;
+}
+
static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
(struct device *dev)
{
@@ -2294,6 +2324,11 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
goto err_data;
}
+ if (drm_hdmi_dt_init_iommu(dev)) {
+ DRM_ERROR("no sysmmu property found\n");
+ goto err_data;
+ }
+
pd->hpd_gpio = of_get_named_gpio_flags(np, "hpd-gpio", 0, &flags);
return pd;