linux/drivers/gpu/drm/bridge
Jonas Karlman c4cba44eee drm/bridge: dw-hdmi: fix SCDC configuration for ddc-i2c-bus
When ddc-i2c-bus property is used, a NULL pointer dereference is reported:

[   31.041669] Unable to handle kernel NULL pointer dereference at virtual address 00000008
[   31.041671] pgd = 4d3c16f6
[   31.041673] [00000008] *pgd=00000000
[   31.041678] Internal error: Oops: 5 [#1] SMP ARM

[   31.041711] Hardware name: Rockchip (Device Tree)
[   31.041718] PC is at i2c_transfer+0x8/0xe4
[   31.041721] LR is at drm_scdc_read+0x54/0x84
[   31.041723] pc : [<c073273c>]    lr : [<c05926c4>]    psr: 280f0013
[   31.041725] sp : edffdad0  ip : 5ccb5511  fp : 00000058
[   31.041727] r10: 00000780  r9 : edf91608  r8 : c11b0f48
[   31.041728] r7 : 00000438  r6 : 00000000  r5 : 00000000  r4 : 00000000
[   31.041730] r3 : edffdae7  r2 : 00000002  r1 : edffdaec  r0 : 00000000

[   31.041908] [<c073273c>] (i2c_transfer) from [<c05926c4>] (drm_scdc_read+0x54/0x84)
[   31.041913] [<c05926c4>] (drm_scdc_read) from [<c0592858>] (drm_scdc_set_scrambling+0x30/0xbc)
[   31.041919] [<c0592858>] (drm_scdc_set_scrambling) from [<c05cc0f4>] (dw_hdmi_update_power+0x1440/0x1610)
[   31.041926] [<c05cc0f4>] (dw_hdmi_update_power) from [<c05cc574>] (dw_hdmi_bridge_enable+0x2c/0x70)
[   31.041932] [<c05cc574>] (dw_hdmi_bridge_enable) from [<c05aed48>] (drm_bridge_enable+0x24/0x34)
[   31.041938] [<c05aed48>] (drm_bridge_enable) from [<c0591060>] (drm_atomic_helper_commit_modeset_enables+0x114/0x220)
[   31.041943] [<c0591060>] (drm_atomic_helper_commit_modeset_enables) from [<c05c3fe0>] (rockchip_atomic_helper_commit_tail_rpm+0x28/0x64)

hdmi->i2c may not be set when ddc-i2c-bus property is used in device tree.
Fix this by using hdmi->ddc as the i2c adapter when calling drm_scdc_*().
Also report that SCDC is not supported when there is no DDC bus.

Fixes: 264fce6cc2 ("drm/bridge: dw-hdmi: Add SCDC and TMDS Scrambling support")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/VE1PR03MB59031814B5BCAB2152923BDAAC210@VE1PR03MB5903.eurprd03.prod.outlook.com
2019-04-25 10:38:21 +02:00
..
adv7511 drm: Split out drm_probe_helper.h 2019-01-24 13:20:42 +01:00
analogix drm: Split out drm_probe_helper.h 2019-01-24 13:20:42 +01:00
synopsys drm/bridge: dw-hdmi: fix SCDC configuration for ddc-i2c-bus 2019-04-25 10:38:21 +02:00
analogix-anx78xx.c drm: Split out drm_probe_helper.h 2019-01-24 13:20:42 +01:00
analogix-anx78xx.h drm/bridge: Add Analogix anx78xx support 2016-05-12 11:32:14 +02:00
cdns-dsi.c drm/bridge: cdns: Convert to phy framework 2019-02-07 09:48:40 +01:00
dumb-vga-dac.c drm: Split out drm_probe_helper.h 2019-01-24 13:20:42 +01:00
Kconfig drm/bridge: cdns: Convert to phy framework 2019-02-07 09:48:40 +01:00
lvds-encoder.c drm/bridge: lvds-encoder: add powerdown-gpios support 2019-01-18 09:27:54 +01:00
Makefile drm/bridge: tc358764: Add DSI to LVDS bridge driver 2018-07-27 09:09:57 +02:00
megachips-stdpxxxx-ge-b850v3-fw.c drm: Split out drm_probe_helper.h 2019-01-24 13:20:42 +01:00
nxp-ptn3460.c drm: Split out drm_probe_helper.h 2019-01-24 13:20:42 +01:00
panel.c drm: Split out drm_probe_helper.h 2019-01-24 13:20:42 +01:00
parade-ps8622.c drm: Split out drm_probe_helper.h 2019-01-24 13:20:42 +01:00
sii902x.c drm: Split out drm_probe_helper.h 2019-01-24 13:20:42 +01:00
sii9234.c drm/bridge: add Silicon Image SiI9234 driver 2017-10-06 14:28:22 +02:00
sil-sii8620.c drm/edid: Pass connector to AVI infoframe functions 2019-01-10 19:01:06 +02:00
sil-sii8620.h drm/bridge/sii8620: add HSIC initialization code 2017-02-02 15:15:30 +05:30
tc358764.c drm: Split out drm_probe_helper.h 2019-01-24 13:20:42 +01:00
tc358767.c Linux 5.0-rc7 2019-02-18 13:27:15 +10:00
thc63lvd1024.c drm: bridge: thc63: Restrict modes based on hardware operating frequency 2018-09-25 00:40:51 +03:00
ti-sn65dsi86.c drm: Split out drm_probe_helper.h 2019-01-24 13:20:42 +01:00
ti-tfp410.c drm: Split out drm_probe_helper.h 2019-01-24 13:20:42 +01:00