Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/bridge: ti-sn65dsi86: make use of debugfs_init callback

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 <wsa+renesas@sang-engineering.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250315201651.7339-2-wsa+renesas@sang-engineering.com

authored by

Wolfram Sang and committed by
Douglas Anderson
1d1f7b15 909bda22

+10 -30
+10 -30
drivers/gpu/drm/bridge/ti-sn65dsi86.c
··· 440 440 441 441 return 0; 442 442 } 443 - 444 443 DEFINE_SHOW_ATTRIBUTE(status); 445 - 446 - static void ti_sn65dsi86_debugfs_remove(void *data) 447 - { 448 - debugfs_remove_recursive(data); 449 - } 450 - 451 - static void ti_sn65dsi86_debugfs_init(struct ti_sn65dsi86 *pdata) 452 - { 453 - struct device *dev = pdata->dev; 454 - struct dentry *debugfs; 455 - int ret; 456 - 457 - debugfs = debugfs_create_dir(dev_name(dev), NULL); 458 - 459 - /* 460 - * We might get an error back if debugfs wasn't enabled in the kernel 461 - * so let's just silently return upon failure. 462 - */ 463 - if (IS_ERR_OR_NULL(debugfs)) 464 - return; 465 - 466 - ret = devm_add_action_or_reset(dev, ti_sn65dsi86_debugfs_remove, debugfs); 467 - if (ret) 468 - return; 469 - 470 - debugfs_create_file("status", 0600, debugfs, pdata, &status_fops); 471 - } 472 444 473 445 /* ----------------------------------------------------------------------------- 474 446 * Auxiliary Devices (*not* AUX) ··· 1210 1238 return drm_edid_read_ddc(connector, &pdata->aux.ddc); 1211 1239 } 1212 1240 1241 + static void ti_sn65dsi86_debugfs_init(struct drm_bridge *bridge, struct dentry *root) 1242 + { 1243 + struct ti_sn65dsi86 *pdata = bridge_to_ti_sn65dsi86(bridge); 1244 + struct dentry *debugfs; 1245 + 1246 + debugfs = debugfs_create_dir(dev_name(pdata->dev), root); 1247 + debugfs_create_file("status", 0600, debugfs, pdata, &status_fops); 1248 + } 1249 + 1213 1250 static const struct drm_bridge_funcs ti_sn_bridge_funcs = { 1214 1251 .attach = ti_sn_bridge_attach, 1215 1252 .detach = ti_sn_bridge_detach, ··· 1232 1251 .atomic_reset = drm_atomic_helper_bridge_reset, 1233 1252 .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, 1234 1253 .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, 1254 + .debugfs_init = ti_sn65dsi86_debugfs_init, 1235 1255 }; 1236 1256 1237 1257 static void ti_sn_bridge_parse_lanes(struct ti_sn65dsi86 *pdata, ··· 1940 1958 ret = devm_add_action_or_reset(dev, ti_sn65dsi86_runtime_disable, dev); 1941 1959 if (ret) 1942 1960 return ret; 1943 - 1944 - ti_sn65dsi86_debugfs_init(pdata); 1945 1961 1946 1962 /* 1947 1963 * Break ourselves up into a collection of aux devices. The only real