Skip to content

Commit 29a7c0b

Browse files
Wolfram Sanggregkh
authored andcommitted
drm/bridge: ti-sn65dsi86: make use of debugfs_init callback
[ Upstream commit 1d1f7b1 ] Do not create a custom directory in debugfs-root, but use the debugfs_init callback to create a custom directory at the given place for the bridge. The new directory layout looks like this on a Renesas GrayHawk-Single with a R-Car V4M SoC: /sys/kernel/debug/dri/feb00000.display/DP-1/1-002c Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Douglas Anderson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Stable-dep-of: 55e8ff8 ("drm/bridge: ti-sn65dsi86: Add HPD for DisplayPort connector type") Signed-off-by: Sasha Levin <[email protected]>
1 parent 18ec560 commit 29a7c0b

File tree

1 file changed

+10
-30
lines changed

1 file changed

+10
-30
lines changed

drivers/gpu/drm/bridge/ti-sn65dsi86.c

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -424,36 +424,8 @@ static int status_show(struct seq_file *s, void *data)
424424

425425
return 0;
426426
}
427-
428427
DEFINE_SHOW_ATTRIBUTE(status);
429428

430-
static void ti_sn65dsi86_debugfs_remove(void *data)
431-
{
432-
debugfs_remove_recursive(data);
433-
}
434-
435-
static void ti_sn65dsi86_debugfs_init(struct ti_sn65dsi86 *pdata)
436-
{
437-
struct device *dev = pdata->dev;
438-
struct dentry *debugfs;
439-
int ret;
440-
441-
debugfs = debugfs_create_dir(dev_name(dev), NULL);
442-
443-
/*
444-
* We might get an error back if debugfs wasn't enabled in the kernel
445-
* so let's just silently return upon failure.
446-
*/
447-
if (IS_ERR_OR_NULL(debugfs))
448-
return;
449-
450-
ret = devm_add_action_or_reset(dev, ti_sn65dsi86_debugfs_remove, debugfs);
451-
if (ret)
452-
return;
453-
454-
debugfs_create_file("status", 0600, debugfs, pdata, &status_fops);
455-
}
456-
457429
/* -----------------------------------------------------------------------------
458430
* Auxiliary Devices (*not* AUX)
459431
*/
@@ -1217,6 +1189,15 @@ static const struct drm_edid *ti_sn_bridge_edid_read(struct drm_bridge *bridge,
12171189
return drm_edid_read_ddc(connector, &pdata->aux.ddc);
12181190
}
12191191

1192+
static void ti_sn65dsi86_debugfs_init(struct drm_bridge *bridge, struct dentry *root)
1193+
{
1194+
struct ti_sn65dsi86 *pdata = bridge_to_ti_sn65dsi86(bridge);
1195+
struct dentry *debugfs;
1196+
1197+
debugfs = debugfs_create_dir(dev_name(pdata->dev), root);
1198+
debugfs_create_file("status", 0600, debugfs, pdata, &status_fops);
1199+
}
1200+
12201201
static const struct drm_bridge_funcs ti_sn_bridge_funcs = {
12211202
.attach = ti_sn_bridge_attach,
12221203
.detach = ti_sn_bridge_detach,
@@ -1230,6 +1211,7 @@ static const struct drm_bridge_funcs ti_sn_bridge_funcs = {
12301211
.atomic_reset = drm_atomic_helper_bridge_reset,
12311212
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
12321213
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
1214+
.debugfs_init = ti_sn65dsi86_debugfs_init,
12331215
};
12341216

12351217
static void ti_sn_bridge_parse_lanes(struct ti_sn65dsi86 *pdata,
@@ -1938,8 +1920,6 @@ static int ti_sn65dsi86_probe(struct i2c_client *client)
19381920
if (ret)
19391921
return ret;
19401922

1941-
ti_sn65dsi86_debugfs_init(pdata);
1942-
19431923
/*
19441924
* Break ourselves up into a collection of aux devices. The only real
19451925
* motiviation here is to solve the chicken-and-egg problem of probe

0 commit comments

Comments
 (0)