summaryrefslogtreecommitdiff
path: root/drivers/gpu/host1x
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2019-06-25 05:59:35 +0300
committerDave Airlie <airlied@redhat.com>2019-06-25 05:59:43 +0300
commitdfd03396d7b66f90071aa5e8fdc0f3c4a66471c5 (patch)
tree0988d127866346fdeb1f63f9cb87266edca3fe05 /drivers/gpu/host1x
parent9b75276e4fb190b47ed62693cc4d9549a45c76a2 (diff)
parenteb7cf945a8dac8603e6d0759023e9b6cfed7a008 (diff)
downloadlinux-dfd03396d7b66f90071aa5e8fdc0f3c4a66471c5.tar.xz
Merge tag 'drm/tegra/for-5.3-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next
drm/tegra: Changes for v5.3-rc1 This contains a couple of small improvements and cleanups for the Tegra DRM driver. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thierry Reding <thierry.reding@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190621150753.19550-1-thierry.reding@gmail.com
Diffstat (limited to 'drivers/gpu/host1x')
-rw-r--r--drivers/gpu/host1x/bus.c35
-rw-r--r--drivers/gpu/host1x/debug.c3
-rw-r--r--drivers/gpu/host1x/dev.c5
3 files changed, 38 insertions, 5 deletions
diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c
index 9797ccb0a073..742aa9ff21b8 100644
--- a/drivers/gpu/host1x/bus.c
+++ b/drivers/gpu/host1x/bus.c
@@ -305,6 +305,36 @@ static int host1x_device_match(struct device *dev, struct device_driver *drv)
return strcmp(dev_name(dev), drv->name) == 0;
}
+static int host1x_device_uevent(struct device *dev,
+ struct kobj_uevent_env *env)
+{
+ struct device_node *np = dev->parent->of_node;
+ unsigned int count = 0;
+ struct property *p;
+ const char *compat;
+
+ /*
+ * This duplicates most of of_device_uevent(), but the latter cannot
+ * be called from modules and operates on dev->of_node, which is not
+ * available in this case.
+ *
+ * Note that this is really only needed for backwards compatibility
+ * with libdrm, which parses this information from sysfs and will
+ * fail if it can't find the OF_FULLNAME, specifically.
+ */
+ add_uevent_var(env, "OF_NAME=%pOFn", np);
+ add_uevent_var(env, "OF_FULLNAME=%pOF", np);
+
+ of_property_for_each_string(np, "compatible", p, compat) {
+ add_uevent_var(env, "OF_COMPATIBLE_%u=%s", count, compat);
+ count++;
+ }
+
+ add_uevent_var(env, "OF_COMPATIBLE_N=%u", count);
+
+ return 0;
+}
+
static int host1x_dma_configure(struct device *dev)
{
return of_dma_configure(dev, dev->of_node, true);
@@ -322,6 +352,7 @@ static const struct dev_pm_ops host1x_device_pm_ops = {
struct bus_type host1x_bus_type = {
.name = "host1x",
.match = host1x_device_match,
+ .uevent = host1x_device_uevent,
.dma_configure = host1x_dma_configure,
.pm = &host1x_device_pm_ops,
};
@@ -408,12 +439,14 @@ static int host1x_device_add(struct host1x *host1x,
device->dev.dma_mask = &device->dev.coherent_dma_mask;
dev_set_name(&device->dev, "%s", driver->driver.name);
device->dev.release = host1x_device_release;
- device->dev.of_node = host1x->dev->of_node;
device->dev.bus = &host1x_bus_type;
device->dev.parent = host1x->dev;
of_dma_configure(&device->dev, host1x->dev->of_node, true);
+ device->dev.dma_parms = &device->dma_parms;
+ dma_set_max_seg_size(&device->dev, SZ_4M);
+
err = host1x_device_parse_dt(device, driver);
if (err < 0) {
kfree(device);
diff --git a/drivers/gpu/host1x/debug.c b/drivers/gpu/host1x/debug.c
index 070b30f72947..c0392672a842 100644
--- a/drivers/gpu/host1x/debug.c
+++ b/drivers/gpu/host1x/debug.c
@@ -162,9 +162,6 @@ static void host1x_debugfs_init(struct host1x *host1x)
{
struct dentry *de = debugfs_create_dir("tegra-host1x", NULL);
- if (!de)
- return;
-
/* Store the created entry */
host1x->debugfs = de;
diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
index c55e2d634887..5a3f797240d4 100644
--- a/drivers/gpu/host1x/dev.c
+++ b/drivers/gpu/host1x/dev.c
@@ -247,8 +247,11 @@ static int host1x_probe(struct platform_device *pdev)
host->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(host->clk)) {
- dev_err(&pdev->dev, "failed to get clock\n");
err = PTR_ERR(host->clk);
+
+ if (err != -EPROBE_DEFER)
+ dev_err(&pdev->dev, "failed to get clock: %d\n", err);
+
return err;
}