[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>
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>
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)
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
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
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
1. Support procfs, both debugfs and procfs.
2. Modify the debug node name:
/sys/kernel/debug/rga2_debug/rga2
-> /sys/kernel/debug/rkrga/debug
-> /proc/rkrga/debug (add)
3. Add a node to view the driver version number: driver_version.
4. Add CONFIG_ROCKCHIP_RGA2_PROC_FS/ROCKCHIP_RGA2_DEBUG_FS/
ROCKCHIP_RGA2_DEBUGGER, Where CONFIG_ROCKCHIP_RGA2_PROC_FS
defaults to n, CONFIG_ROCKCHIP_RGA2_DEBUGGER defaults to y.
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I89a971f18301ffa9cc7ac1962ebeee5e97d209aa
ROLE_CONTROL register would not have the actual CC terminations
unless the port does not set ROLE_CONTROL.DRP. For DRP ports,
CC_STATUS.cc1/cc2 indicates the final terminations applied
when TCPC enters potential_connect_as_source/_sink.
For DRP ports, infer port role from CC_STATUS and set corresponding
CC terminations before setting the orientation.
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20200901025927.3596190-4-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Change-Id: I108119eb0d9accf5697b9d69f1188766c2bdb0b9
(cherry picked from commit 57ce64668f)
"tReceiverResponse 15 ms Section 6.6.2
The receiver of a Message requiring a response Shall respond
within tReceiverResponse in order to ensure that the
sender’s SenderResponseTimer does not expire."
When the cpu complex is busy running other lower priority
work items, TCPM's work queue sometimes does not get scheduled
on time to meet the above requirement from the spec.
Moving to kthread_work apis to run with real time priority.
Further, as observed in 1ff688209e, moving to hrtimers to
overcome scheduling latency while scheduling the delayed work.
TCPM has three work streams:
1. tcpm_state_machine
2. vdm_state_machine
3. event_work
tcpm_state_machine and vdm_state_machine both schedule work in
future i.e. delayed. Hence each of them have a corresponding
hrtimer, tcpm_state_machine_timer & vdm_state_machine_timer.
When work is queued right away kthread_queue_work is used.
Else, the relevant timer is programmed and made to queue
the kthread_work upon timer expiry.
kthread_create_worker only creates one kthread worker thread,
hence single threadedness of workqueue is retained.
Change-Id: Iafd9ca68a00b61e39cc9de2609eaef2c277eabb0
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20200818192758.2562908-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 3ed8e1c2ac)
According to commit 9bde4e671f ("drm/rockchip: vop: fix iommu crash
with async atomic")
These two callback were added to avoid iommu crash on async
commit caused by drm_atomic_clean_old_fb after drm_atomic_async_commit.
drm_atomic_clean_old_fb was removed after commit
e00fb8564e ("drm: Stop updating plane->crtc/fb/old_fb on atomic drivers")
So we can remove them to make life simpler.
Change-Id: Iea1f2dbadd9bcfad5b8447831c0d31068d4fa97b
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
We assign window between vp by plane_mask now, no
need to check which vp is activated from register.
Change-Id: I89d22f253dcd26898dc79304d51b8a8d9e802bb2
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Rockchip platforms don't support HS200 or HS400 at low speed, so
we must limit it.
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I40eb9f117fd83789b6ab7a16d44049e16786698b
As we mask our SDHCI controller as SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
host->max_clk is derived from core clock in the first place. Then
f_max works together with it.
If we adjust loader's core clk setting, such as 50MHz, we will get
50MHz for host->max_clk, because .get_max_clock() reads core clk
when probing driver. That will lead f_max be set to 50MHz as well,
no matter if max-frequency is set higher than 50MHz.
We can simple solve this problem by assigning core clk as 200MHz
in the first place and then let max-frequency property takes over
it.
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: Idb2fdb8f68881d0286d977dc3718b74c30d3bc67
Enable lt6911uxc HDMI to MIPI CSI-2 bridge driver for hdmi-in
application. Which found on rk3568-evb2-lp4x-v10.
Signed-off-by: Dingxian Wen <shawn.wen@rock-chips.com>
Change-Id: I4ce22f3040dbe55c3236ac3d0ac62f7821011c8d
Do not print error information when pin is not mux to gpio,
since it will break debug print.
Also check the gpio direction before check gpio value.
Change-Id: Id3afb0af12cd1e33677f5a929a879f7d00f63318
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
rv1126 does not support display interface which need to
read and parse edid, such as hdmi and dp, so add config
option to reduce memory usage.
./ksize.sh drivers/gpu/drm/
before ksize: 482336 Bytes
after kszie: 396762 Bytes
save about: 85574 Bytes
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I0c3813711cfdb4a38ec66136569ca826c94c6c58
Add config option to modularize the DP interface support of DRM.
make ARCH=arm rv1126_defconfig
make ARCH=arm rv1126-evb-ddr3-v13.img -j32
./ksize.sh drivers/gpu/drm/
before ksize: 517946 Bytes
after kszie: 482336 Bytes
save about: 35610 Bytes
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: Ie2157fad13a71a3099b79085e0de40efe4b4ab34
rv1126 does not support PSR function, so add config option to
reduce memory usage.
make ARCH=arm rv1126_defconfig
./ksize.sh drivers/gpu/drm/
before ksize: 581268 Bytes
after kszie: 579486 Bytes
save about: 1782 Bytes
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I578bb6f4768ae807b6fc20987d421afefd421fcc
Kernel's SFC is used for a private flash drivers not like
the standard one, but u-boot SFC is register as standard
spi, and the alias UCLASS_SPI id is required for part of
spi initialization progress. So kernel's alias is also
required when u-boot enable using kernel dtb case.
Change-Id: Ic763eefb35ef5a93f6121055a5e04a2d72636430
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Some linux app(cusor) may set negative coordinates(crtc_x/y)
And some linux app(mpv) may set coordinates outside the screen.
These are both unsupported on rockchip vop.
so we use clipped coordinates here.
Change-Id: I63288cf9120cea75e784d49bc88b591f243e7d8d
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Look at the pinmux-functions debug node, there are several pcfg_xxx
nodes which actually are not pinctrl functions:
Under RV1126 EVB:
function: pcfg-pull-up, groups = [ ]
function: pcfg-pull-down, groups = [ ]
function: pcfg-pull-none, groups = [ ]
function: pcfg-pull-none-drv-level-1, groups = [ ]
function: pcfg-pull-none-drv-level-2, groups = [ ]
function: pcfg-pull-none-drv-level-3, groups = [ ]
function: pcfg-pull-up-drv-level-1, groups = [ ]
function: pcfg-pull-up-drv-level-2, groups = [ ]
function: pcfg-pull-none-smt, groups = [ ]
function: pcfg-output-low-pull-down, groups = [ ]
function: acodec, groups = [ acodec-pins ]
This patch fixs the function node valid check to ignore them.
Change-Id: I432783de72e137e2fb406ce400a69cd56cb1a8de
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
There are many kinds of nodes under pinctrl node, such as function
nodes, gpio nodes, and pcfg nodes.
The driver do a match check for the nodes, to ignore the gpio nodes.
This patch try to put the valid check as a function, it's better to
avoid error fix.
Change-Id: Ib9295fa77240f741a0a124d3235f5e2a6e51b499
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Select DRM_PANEL_SIMPLE_OF_ONLY as default on RV1126 SoC, so as to
reduce memory usage.
make ARCH=arm rv1126_defconfig
make ARCH=arm rv1126-evb-ddr3-v13.img -j32
./ksize.sh drivers/gpu/drm/
before ksize: 556038 Bytes
after kszie: 517946 Bytes
save about: 38092 Bytes
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I9584bd8de16ed0ef1c4a862e71a1eb725c0d2833
mpp build only one ko and all option config is bool.
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Id940f29a351d81c301a1ca100b8ebee828b8cc81
Using CONFIG_CPU_XX only compiles the code of matching CPU,
then it can reduce the object file.
Change-Id: Ic19345464c802939d08786ae29b34111c3c5a855
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
move the workaround functions for px30 to the mpp_hack_px30.c.
Change-Id: I9f9880c28fe1d797b0551d116a66294223a5e251
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
For kernel-tiny, remove debug relative code, and reduce the size of module.
Change-Id: Ic78a0839a75c9cebb56fa32e87235bd97be0370a
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>