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: Check bridge connection failure

Read out and check the ID registers, so we can bail out if I2C
communication does not work or if the device is unknown. Tested on a
Renesas GrayHawk board (R-Car V4M) by using a wrong I2C address and by
not enabling RuntimePM for the device.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250318155549.19625-2-wsa+renesas@sang-engineering.com

authored by

Wolfram Sang and committed by
Douglas Anderson
d69362f5 1d1f7b15

+12
+12
drivers/gpu/drm/bridge/ti-sn65dsi86.c
··· 35 35 #include <drm/drm_print.h> 36 36 #include <drm/drm_probe_helper.h> 37 37 38 + #define SN_DEVICE_ID_REGS 0x00 /* up to 0x07 */ 38 39 #define SN_DEVICE_REV_REG 0x08 39 40 #define SN_DPPLL_SRC_REG 0x0A 40 41 #define DPPLL_CLK_SRC_DSICLK BIT(0) ··· 1899 1898 { 1900 1899 struct device *dev = &client->dev; 1901 1900 struct ti_sn65dsi86 *pdata; 1901 + u8 id_buf[8]; 1902 1902 int ret; 1903 1903 1904 1904 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { ··· 1942 1940 ret = devm_add_action_or_reset(dev, ti_sn65dsi86_runtime_disable, dev); 1943 1941 if (ret) 1944 1942 return ret; 1943 + 1944 + pm_runtime_get_sync(dev); 1945 + ret = regmap_bulk_read(pdata->regmap, SN_DEVICE_ID_REGS, id_buf, ARRAY_SIZE(id_buf)); 1946 + pm_runtime_put_autosuspend(dev); 1947 + if (ret) 1948 + return dev_err_probe(dev, ret, "failed to read device id\n"); 1949 + 1950 + /* The ID string is stored backwards */ 1951 + if (strncmp(id_buf, "68ISD ", ARRAY_SIZE(id_buf))) 1952 + return dev_err_probe(dev, -EOPNOTSUPP, "unsupported device id\n"); 1945 1953 1946 1954 /* 1947 1955 * Break ourselves up into a collection of aux devices. The only real