Commit Graph

865470 Commits

Author SHA1 Message Date
Zhen Chen
fedf4bcc70 MALI: remove MALI_MIDGARD_FOR_ANDROID and MALI_MIDGARD_FOR_LINUX
Because they are no longer useful,
after rk3288/rk3399 Android and Linux device
use the same midgard_device_driver "drivers/gpu/arm/midgard".

Change-Id: I7ccc3c99fdfdde5a0ea12a7f3e1931fd5f1ce4cb
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-09-22 16:26:23 +08:00
Jianwei Fan
0d9ef4a325 arm64: dts: rockchip: rk3399-evb-ind-lpddr4-android-avb: add tc35874x
configuration

Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
Change-Id: Ib3e274017f3a971b5fb301c81e3ade43141af1d3
2021-09-22 16:23:00 +08:00
Jianwei Fan
1bc3ec16fd arm64: dts: rockchip: rk3399-evb-ind-lpddr4-v13-android-avb: add
tc35874x configuration

Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
Change-Id: Ia8e5c19ae4d37e0c7e16f8f149c17716e9f54d2d
2021-09-22 06:00:35 +00:00
Shunhua Lan
d0444258a7 pinctrl: rockchip: add i2sx_sclk_rx/i2sx_sclk_tx mux route for rk3568
Change-Id: I35525224a39ce45962bfb1559b5002eb841ddd00
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
2021-09-22 11:11:11 +08:00
David Wu
aab3af8ad0 net: ethernet: stmmac: dwmac-rk: Add config option for dwmac-rk-tool
Add this config option to reduce memory usage, if it was not necessary.

./ksize.sh drivers/net/ethernet/stmicro/

before size: 105216 Bytes
after  size: 94474  Bytes
save   size: 10742  Bytes

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I96c88d5eb5109fc956a85b8685e1746d76545a87
2021-09-18 20:06:20 +08:00
Sandy Huang
c66b7345f6 drm/rockchip: vop: fix alpha mode error for vop lite
1. vop lite can't support pixel-alpha + scale and can support global
alpha + scale;
2. global alpha must be non-premul alpha mode;
3. vop lite and vop full premul alpha config bit is reversed;
4. vop full add premul and non-premul config from userspace;

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ic42892eac39f07a41d46ed1a77398862f37894c0
2021-09-18 19:57:27 +08:00
Caesar Wang
9efdeb1c2a arm64: dts: rockchip: fixes ramoops for rk3399-linux.dtsi
This patch fixes the ramoops right register for kernel.

check the '/sys/fs/pstore/console-ramoops-0' after the reboot system.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: I345ca0b497031c5d18c2b10eb661efe39a4b3025
2021-09-18 16:01:32 +08:00
Algea Cao
54614e8ea6 drm/rockchip: dw_hdmi: set capacity properties immutable
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ia9774706b9647217c4065ade3f1a9f21e46edccc
2021-09-18 15:59:14 +08:00
Caesar Wang
6fa47f3ec2 arm64/configs: update rockchip_lnux_defconfig
1) Enable LT6911UXC and LT8619C

    Enable lt6911uxc HDMI to MIPI CSI-2 bridge driver for hdmi-in
application. Which found on rk3568-evb2-lp4x-v10.
Enable lt8619c HDMI to BT656/BT1120 bridge driver for hdmi-in
application. Which found on rk3568-evb6-ddr3-v10.

2) Enable CONFIG_DEVFREQ_EVENT_ROCKCHIP_NOCP

    This add the devfreq-event driver for Rockchip SoC. It provides NoC
(Network on Chip) Probe counters to monitor traffic statistics.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: I7d4e50329ff9576f5e16599b04c6b7af37d5d306
2021-09-18 09:08:52 +08:00
Fenrir Lin
709c17f341 ARM: dts: rockchip: add rv1126-bat-evb-v11.dts
Signed-off-by: Fenrir Lin <fenrir.lin@rock-chips.com>
Change-Id: I33365b97e74ff35d26a16861b6c81ab07f3e0f54
2021-09-17 15:48:52 +08:00
Liang Chen
e70299d6e8 soc: rockchip: add depends for config ROCKCHIP_SCHED_PERFORMANCE_BIAS
CONFIG_ROCKCHIP_SCHED_PERFORMANCE_BIAS depends on CONFIG_SMP and
CONFIG_CPU_FREQ_GOV_INTERACTIVE.

Change-Id: I6b564b1693e225ff6310f2dc8c8adabfb509cae9
Signed-off-by: Liang Chen <cl@rock-chips.com>
2021-09-17 15:36:44 +08:00
Yu Qiaowei
2e6dc356c9 video/rockchip: rga2: Added support for ARGB format
Add ARGB8888/XRGB8888/ARGB5551/ARGB4444/ABGR8888/XBGR8888/ABGR5551/ABGR4444.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I9eb8f5fbcc1a87a5750b7dc2eaf808f8395856a0
2021-09-17 15:35:53 +08:00
Yu Qiaowei
b4d1ec5cd2 video/rockchip: rga2: Optimize the process of mapping dma.
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ie8d140d8fc102c9a3677b266ac7848c4c3ade78e
2021-09-17 15:35:53 +08:00
Zorro Liu
9f1d22a8f0 regulator: xz3216: add resume function
enable sleep vol when resume, if not reboot will failed after sleep out
by vdd_cpu off

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: If56bc9894abb37b771ed1097e0deb73c679cc315
2021-09-17 15:17:36 +08:00
XiaoTan Luo
5f47c9f404 UPSTREAM: ASoC: hdmi-codec: Use set_jack ops to set jack
Use set_jack ops to set jack so machine drivers do not need to
includehdmi-codec.h explicitly.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
Link:https://lore.kernel.org/r/20200922062316.1172935-1-cychiang@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 55c5cc63ab)

Change-Id: I5717c3e47ac9a8feb05b830b159c9ac9224f4136
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
2021-09-17 14:35:07 +08:00
Cheng-Yi Chiang
0315c89b25 UPSTREAM: drm: bridge: dw-hdmi: Report connector status using callback
Allow codec driver register callback function for plug event.

The callback registration flow:
dw-hdmi <--- hw-hdmi-i2s-audio <--- hdmi-codec

dw-hdmi-i2s-audio implements hook_plugged_cb op
so codec driver can register the callback.

dw-hdmi exports a function dw_hdmi_set_plugged_cb so platform device
can register the callback.

When connector plug/unplug event happens, report this event using the
callback.

Make sure that audio and drm are using the single source of truth for
connector status.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Link: https://lore.kernel.org/r/20191028071930.145899-2-cychiang@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit a9c82d63ca)

Change-Id: Ieea468bf53165e2436996b453b048db049bcbf67
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
2021-09-17 14:34:51 +08:00
Cheng-Yi Chiang
3bfb85ec20 UPSTREAM: ASoC: hdmi-codec: Add an op to set callback function for plug event
Add an op in hdmi_codec_ops so codec driver can register callback
function to handle plug event.

Driver in DRM can use this callback function to report connector status.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Link: https://lore.kernel.org/r/20190717083327.47646-2-cychiang@chromium.org
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 6fa5963c37)

Change-Id: I5f4a931c3b91c2b230ce5a61b60f191628d93105
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
2021-09-17 14:33:31 +08:00
Tao Huang
77dd1a64ea media: rockchip: cif: build depends on CPU config
When build with rv1126_defconfig:

before:
   text    data     bss     dec     hex filename
   7820	    144	      0	   7964	   1f1c	drivers/media/platform/rockchip/cif/hw.o

after:
   text    data     bss     dec     hex filename
   4301	    144	      0	   4445	   115d	drivers/media/platform/rockchip/cif/hw.o

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I0dee5f7f43da3eb58a65342319ccb77b5501e0ce
2021-09-16 10:55:21 +08:00
Tao Huang
1a0176f009 net: stmmac: dwmac-rk: build depends on CPU config
When build with rv1126_defconfig:

before:
   text	   data	    bss	    dec	    hex	filename
  17063	    144	      0	  17207	   4337	drivers/net/ethernet/stmicro/stmmac/dwmac-rk.o

after:
   text	   data	    bss	    dec	    hex	filename
   7387	    144	      0	   7531	   1d6b	drivers/net/ethernet/stmicro/stmmac/dwmac-rk.o

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I941f79357f686f5d35e727abea2fe26c4ea0dafa
2021-09-16 10:55:21 +08:00
Tao Huang
5fa24759c0 soc: rockchip: pvtm: build depends on CPU config
When build with rv1126_defconfig:

before:
   text	   data	    bss	    dec	    hex	filename
   8796	    156	      4	   8956	   22fc	drivers/soc/rockchip/rockchip_pvtm.o

after:
   text	   data	    bss	    dec	    hex	filename
   4508	    156	      4	   4668	   123c	drivers/soc/rockchip/rockchip_pvtm.o

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I8c49713ebc48586aa4f08fb3ec965890c2beb1a2
2021-09-16 10:55:21 +08:00
Meiyou Chen
c6fc171e09 arm64: dts: rockchip: rk3399-ind: tc358749x use dummy codec
Signed-off-by: Meiyou Chen <cmy@rock-chips.com>
Change-Id: Id6213f44e64cd92b0369f8dfdb411bba9b108930
2021-09-16 10:49:06 +08:00
Douglas Anderson
6c37d44def BACKPORT: usb: dwc2: bus suspend/resume for hosts with DWC2_POWER_DOWN_PARAM_NONE
This is an attempt to rehash commit 0cf884e819 ("usb: dwc2: add bus
suspend/resume for dwc2") on ToT.  That commit was reverted in commit
b0bb9bb6ce ("Revert "usb: dwc2: add bus suspend/resume for dwc2"")
because apparently it broke the Altera SOCFPGA.

With all the changes that have happened to dwc2 in the meantime, it's
possible that the Altera SOCFPGA will just magically work with this
change now.  ...and it would be good to get bus suspend/resume
implemented.

This change is a forward port of one that's been living in the Chrome
OS 3.14 kernel tree.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Iba408750729ce6c8f1cb0c94a5e8891c7b240014
(cherry picked from commit 6f6d70597c)
2021-09-16 10:48:40 +08:00
Finley Xiao
0d97d2220b arm64: dts: rockchip: rk3308b-evb-v10: Remove invalid configuration for tsadc
Change-Id: I9eecd97f7a4df74f696fa6c8e337829800d3fcd0
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-09-16 09:28:52 +08:00
Wang Panzhenzhuan
955acd592f media: i2c: nvp6158: add workqueue & more resolution support
1. add workqueue to detect ahd state.
2. add following resolution support:
    AHD30_3M_18P //2048 x 1536@18
    AHD30_4M_15P //2560x1440@15
    AHD30_4M_30P //2560x1440@30
    AHD30_5M_12_5P //2592x 1944 @12.5
    AHD30_5M_20P //2592x 1944 @20
    AHD30_8M_7_5P //3840x2160 @7.5
    AHD30_8M_15P //3840x2160 @15

Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I6c7b762cacefe7de473a63cb275e1861c9ef096b
2021-09-15 16:31:59 +08:00
Wyon Bi
5b1eeee089 drm/bridge: analogix_dp: Fix display corruption in low temperature environment
Change-Id: I46b3dbc57c1f2b8482559d4ba44bd7f339657ccd
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2021-09-15 15:15:59 +08:00
Cai YiWei
b45203862c media: rockchip: isp: remove associated of cproc and ie
Change-Id: Ic4d6171398322e24993e4a0419fd43fae85672b8
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-09-15 11:52:31 +08:00
Cai YiWei
dedc22f3ee media: rockchip: ispp: add frame loss info to procfs
Change-Id: I413608060c2245809a4b1f9d908511531901608d
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-09-15 11:46:07 +08:00
Cai YiWei
066b913603 media: rockchip: isp: add frame loss info to procfs
Change-Id: Idecd94535da352fcde5f2a462d4596316f9ea049
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-09-15 11:43:03 +08:00
Cai YiWei
75d5fa521c media: rockchip: ispp: frame start to check stream output buffer
Change-Id: I8ca95767705ffd705c90e22ab5d067fe7d79ad9e
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-09-15 11:31:12 +08:00
Zorro Liu
70c1ef2a9e drm/rockchip: ebc_dev: release version v2.11
register /dev/waveform for hwc with eink regal lib

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I4a1db7199015f48423cd79905562b29dd28a8696
2021-09-14 11:46:17 +08:00
Zorro Liu
74414eb68e drm/rockchip: ebc_dev: release version v2.10
protect auto buf by rw lock

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I27b09e1c2e72f6d86e17b2b42365b37fccc4be56
2021-09-14 09:04:13 +08:00
Weixin Zhou
57c7a7ae08 regulator: xz3216: add mode setting support
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
Change-Id: I523b87bbf33a63d794cec7b99d443388f3a36f96
2021-09-13 11:43:56 +08:00
Tao Huang
cc34f814c9 clk: rockchip: rk3308: Call rockchip_soc_id_init() on init
clk init on time_init() which is before pure_initcall.
So call rockchip_soc_id_init() before call soc_is_rk3308b().

Change-Id: Iece3673bc7309ef9193df99f2a95e4b930613a3e
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-09-10 18:25:17 +08:00
Tao Huang
f5542b312a soc: rockchip: cpuinfo: Export rockchip_soc_id_init() function
Allow rockchip_soc_id_init() called before pure_initcall.

Change-Id: Ie0d3a18e96df02c2d6ab4aa3e17ea102685cd0c4
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-09-10 18:23:58 +08:00
Wang Panzhenzhuan
d3f9f64847 media: i2c: add camera driver hm5040
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: Icaaf459fe4ee87c88405be079b15d203ec7bb4f1
2021-09-09 11:47:44 +08:00
Kyle Tso
1e1aad4a82 UPSTREAM: usb: typec: tcpm: Do not finish VDM AMS for retrying Responses
If the VDM responses couldn't be sent successfully, it doesn't need to
finish the AMS until the retry count reaches the limit.

Fixes: 0908c5aca3 ("usb: typec: tcpm: AMS and Collision Avoidance")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable <stable@vger.kernel.org>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210606081452.764032-1-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Change-Id: Ida18c423bcc587bb217a61522ff5a4212f92ce2c
(cherry picked from commit 5ab14ab1f2)
2021-09-08 19:44:05 +08:00
Badhri Jagan Sridharan
f8b664eac2 UPSTREAM: usb: typec: tcpm: Skip sink_cap query only when VDM sm is busy
When port partner responds "Not supported" to the DiscIdentity command,
VDM state machine can remain in NVDM_STATE_ERR_TMOUT and this causes
querying sink cap to be skipped indefinitely. Hence check for
vdm_sm_running instead of checking for VDM_STATE_DONE.

Change-Id: Ie73eed677050a4ef15f2d36e159bf7e9c3879bfb
Fixes: 8dc4bd0736 ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)")
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210318064805.3747831-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
(cherry picked from commit 2b8c956ea6)
2021-09-08 19:42:40 +08:00
Kyle Tso
8c71e3ffce BACKPORT: usb: typec: tcpm: Respond Wait if VDM state machine is running
Port partner could send PR_SWAP/DR_SWAP/VCONN_SWAP/Request just after it
enters Ready states. This will cause conficts if the port is going to
send DISC_IDENT in the Ready states of TCPM. Set a flag indicating that
the state machine is processing VDM and respond Wait messages until the
VDM state machine stops.

Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210114145053.1952756-4-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Change-Id: I5d0c8106e5ed0c8cfeb65db6771a6a113972475f
(cherry picked from commit 8d3a0578ad)
2021-09-08 19:42:00 +08:00
Kyle Tso
b593b3e65c BACKPORT: usb: typec: tcpm: AMS and Collision Avoidance
This patch provides the implementation of Collision Avoidance introduced
in PD3.0. The start of each Atomic Message Sequence (AMS) initiated by
the port will be denied if the current AMS is not interruptible. The
Source port will set the CC to SinkTxNG if it is going to initiate an
AMS, and SinkTxOk otherwise. Meanwhile, any AMS initiated by a Sink port
will be denied in TCPM if the port partner (Source) sets SinkTxNG except
for HARD_RESET and SOFT_RESET.

Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210114145053.1952756-2-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Change-Id: Id0531c88ab8612745e042699a60f8a794415db36
(cherry picked from commit 0908c5aca3)
2021-09-08 19:39:02 +08:00
XiaoTan Luo
e877670daa ASoC: rockchip: rk817-codec: enable dac when play
In this case playback_path set to ON, and then play music.
when playback close, stream mute power off the dac,
but the playback_path do not be set to OFF, so we must
power on the dac again.

Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: I7baa8518ccbb567cb146c5739f9a125da320e674
2021-09-08 14:38:36 +08:00
Xing Zheng
20d8a7925f ASoC: rockchip: rk817-codec: add support recover playback/capture path after resume
[Fix and using new sound APIs (snd_soc_kcontrol_component()/snd_soc_component_get_drvdata())]

Change-Id: I52487370ce33b057d9cf774b7c0cef06f2c98bca
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2021-09-08 14:38:31 +08:00
Xing Zheng
ee10e96cd6 ASoC: rockchip: rk817-codec: clean up and wrap playback and capture path configurations
[Fix and using new sound APIs (snd_soc_kcontrol_component()/snd_soc_component_get_drvdata())]

Change-Id: I6bc36626a8952ef28789dfacf57c2b27580a3467
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2021-09-08 14:38:26 +08:00
Simon Xue
1d569a020b iommu: rockchip: optimise getting clocks
Use devm_clk_bulk_get_all instead of devm_clk_bulk_get. So we don't need
the complicated operation.

Change-Id: Idbe7668bd26b744f8d8b7d79d5eb99fa891bd0be
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2021-09-07 19:12:36 +08:00
Kyle Tso
f860d75d3b UPSTREAM: usb: typec: tcpm: Keep other events when receiving FRS and Sourcing_vbus events
When receiving FRS and Sourcing_Vbus events from low-level drivers, keep
other events which come a bit earlier so that they will not be ignored
in the event handler.

Change-Id: Ibb4a2ccd2bbb34e53d4fbe44803aad521bb7029f
Fixes: 8dc4bd0736 ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)")
Cc: stable <stable@vger.kernel.org>
Cc: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Badhri Jagan Sridharan <badhri@google.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210803091314.3051302-1-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
(cherry picked from commit 43ad944cd7)
2021-09-07 19:01:02 +08:00
Li Jun
60612bbd90 UPSTREAM: usb: typec: tcpm: cancel frs hrtimer when unregister tcpm port
Like the state_machine_timer, we should also cancel possible pending
frs hrtimer when unregister tcpm port.

Change-Id: I9a651304c9a3c0be8475773c119d000b5cddfa0f
Fixes: 8dc4bd0736 ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Li Jun <jun.li@nxp.com>
Link: https://lore.kernel.org/r/1622627829-11070-2-git-send-email-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
(cherry picked from commit 7ade4805e2)
2021-09-07 18:57:06 +08:00
Badhri Jagan Sridharan
8dd1e02217 UPSTREAM: usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)
PD 3.0 spec defines a new mechanism for power role swap called
Fast role swap. This change enables TCPM to support FRS when
acting as sink.

Once the explicit contract is negotiated, sink port is
expected to query the source port for sink caps to
determine whether the source is FRS capable.
Bits 23 & 24 of fixed pdo of the sink caps from the source, when
set, indicates the current needed by the source when fast role
swap is in progress(Implicit contract phasae). 0 indicates that
the source does not support Fast Role Swap.

Upon receiving the FRS signal from the source,
TCPC(TCPM_FRS_EVENT) informs TCPM to start the Fast role swap sequence.

1. TCPM sends FRS PD message: FR_SWAP_SEND
2. If response is not received within the expiry of
   SenderResponseTimer, Error recovery is triggered.:
   FR_SWAP_SEND_TIMEOUT
3. Upon receipt of the accept message, TCPM waits for
   PSSourceOffTimer for PS_READY message from the partner:
   FR_SWAP_SNK_SRC_NEW_SINK_READY.

TCPC is expected to autonomously turn on vbus once the FRS
signal is received and vbus voltage falls below vsafe5v within
tSrcFrSwap. This is different from traditional power role swap
where the vbus sourcing is turned on by TCPM.

4. By this time, TCPC most likely would have started to
   source vbus, TCPM waits for tSrcFrSwap to see  if the
   lower level TCPC driver signals TCPM_SOURCING_VBUS event:
   FR_SWAP_SNK_SRC_SOURCE_VBUS_APPLIED.
5. When TCPC signals sourcing vbus, TCPM sends PS_READY msg and
   changes the CC pin from Rd to Rp. This is the end of fast
   role swap sequence and TCPM initiates the sequnce to negotiate
   explicit contract by transitioning into SRC_STARTUP after
   SwapSrcStart.

The code is written based on the sequence described in "Figure 8-107:
Dual-role Port in Sink to Source Fast Role Swap State Diagram" of
USB Power Delivery Specification Revision 3.0, Version 1.2.

Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20201008061556.1402293-7-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Change-Id: I1316c4498187dc67a5d652341ddb48118a201acf
(cherry picked from commit 8dc4bd0736)
2021-09-07 18:34:14 +08:00
Caesar Wang
7dd3d86021 scripts/mkimg: fixes the realpath for io-domain.sh
This issue found on yocto builing the kernel.

yocto/build/tmp/work-shared/rockchip-rk3568-evb/kernel-source/scripts/mkimg:
line 227:./scripts/io-domain.sh: No such file or directory
arch/arm64/Makefile:203: recipe for target 'rk3568-evb1-ddr4-v10-linux.img' failed
make[2]: *** [rk3568-evb1-ddr4-v10-linux.img] Error 127
Makefile:146: recipe for target 'sub-make' failed

Fixes: b25c12a00a ("scripts: add io-domain.sh for rk356x io-domain check")

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: Id6d496fe886ce79c9efee30a5f4d2cd270d34efd
2021-09-07 17:47:59 +08:00
Wang Jie
0e9176d1fc usb: dwc3: core: fix pm runtime issue for rockchip platforms
The rockchip platforms, such as RK3399 and RK3568
otg port enable pm runtime to swith peripheral and
host mode. During dwc3 core probe, there are two
place which may call pm_runtime_put_sync_suspend(),
one is in dwc3_rockchip_async_probe(), the other one
is in the drd_work called from dwc3_core_init_mode().
The dwc3_rockchip_async_probe() and drd_work are
scheduled asynchronously, and the order of their
execution is randomly.

If the drd_work is handled prior to the async probe,
there's no problem, but if the async probe is handled
firstly, the pm_runtime_put_sync_suspend() will be
duplicated twice. If this issue happens, the value of
dwc3 power.usage_count is -1, in other words, the
runtime put/suspend operations is unbalanced, and
fail to do dwc3_runtime_suspend/resume.

This patch avoids do pm_runtime_put_sync_suspend()
in the drd_work if no usb connected.

Fixes: bb4c791a42 ("usb: dwc3: core: add pm runtime for drd mode")
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I088a7ddb60eb817093810fe874d5fdb242c73ca7
2021-09-07 16:17:10 +08:00
Andy Yan
e05d38ded5 drm/rockchip: vop2: Use macro for window phys_id
Change-Id: Icca89acb0397781c64538c68cc40530e1104455e
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-09-07 15:44:57 +08:00
Dingxian Wen
023dbce94d arm64: configs: rockchip_defconfig: enable LT8619C
Enable lt8619c HDMI to BT656/BT1120 bridge driver for hdmi-in
application. Which found on rk3568-evb6-ddr3-v10.

Signed-off-by: Dingxian Wen <shawn.wen@rock-chips.com>
Change-Id: Idd8bdfd2f2d2cc4af9e1d47e3002ebcee1252df5
2021-09-07 15:44:20 +08:00