Commit Graph

865429 Commits

Author SHA1 Message Date
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
Dingxian Wen
cd0c2a18da arm64: dts: rockchip: rk3568-evb6: add lt8619c configuration
Signed-off-by: Dingxian Wen <shawn.wen@rock-chips.com>
Change-Id: I9bff56d2cddd1d8d16bac0ffd09bd48167dd58ed
2021-09-07 15:44:20 +08:00
Dingxian Wen
32d6a552bb media: i2c: lt8619c: add lt8619c HDMI to BT656/BT1120 bridge driver
Signed-off-by: Dingxian Wen <shawn.wen@rock-chips.com>
Change-Id: I894dc4822d4a9efb6cf3b6d5b6c12b4f03c3ae92
2021-09-07 15:44:20 +08:00
Yu Qiaowei
c0b26710c9 video/rockchip: rga2: Add RGA debugger.
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
2021-09-07 15:42:36 +08:00
Badhri Jagan Sridharan
14fd077fca UPSTREAM: usb: typec: tcpci: update ROLE_CONTROL for DRP
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)
2021-09-07 11:19:03 +08:00
Li Jun
ef9dc469db UPSTREAM: usb: typec: tcpm: cancel vdm and state machine hrtimer when unregister tcpm port
A pending hrtimer may expire after the kthread_worker of tcpm port
is destroyed, see below kernel dump when do module unload, fix it
by cancel the 2 hrtimers.

[  111.517018] Unable to handle kernel paging request at virtual address ffff8000118cb880
[  111.518786] blk_update_request: I/O error, dev sda, sector 60061185 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[  111.526594] Mem abort info:
[  111.526597]   ESR = 0x96000047
[  111.526600]   EC = 0x25: DABT (current EL), IL = 32 bits
[  111.526604]   SET = 0, FnV = 0
[  111.526607]   EA = 0, S1PTW = 0
[  111.526610] Data abort info:
[  111.526612]   ISV = 0, ISS = 0x00000047
[  111.526615]   CM = 0, WnR = 1
[  111.526619] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000041d75000
[  111.526623] [ffff8000118cb880] pgd=10000001bffff003, p4d=10000001bffff003, pud=10000001bfffe003, pmd=10000001bfffa003, pte=0000000000000000
[  111.526642] Internal error: Oops: 96000047 [#1] PREEMPT SMP
[  111.526647] Modules linked in: dwc3_imx8mp dwc3 phy_fsl_imx8mq_usb [last unloaded: tcpci]
[  111.526663] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.13.0-rc4-00927-gebbe9dbd802c-dirty #36
[  111.526670] Hardware name: NXP i.MX8MPlus EVK board (DT)
[  111.526674] pstate: 800000c5 (Nzcv daIF -PAN -UAO -TCO BTYPE=--)
[  111.526681] pc : queued_spin_lock_slowpath+0x1a0/0x390
[  111.526695] lr : _raw_spin_lock_irqsave+0x88/0xb4
[  111.526703] sp : ffff800010003e20
[  111.526706] x29: ffff800010003e20 x28: ffff00017f380180
[  111.537156] buffer_io_error: 6 callbacks suppressed
[  111.537162] Buffer I/O error on dev sda1, logical block 60040704, async page read
[  111.539932]  x27: ffff00017f3801c0
[  111.539938] x26: ffff800010ba2490 x25: 0000000000000000 x24: 0000000000000001
[  111.543025] blk_update_request: I/O error, dev sda, sector 60061186 op 0x0:(READ) flags 0x0 phys_seg 7 prio class 0
[  111.548304]
[  111.548306] x23: 00000000000000c0 x22: ffff0000c2a9f184 x21: ffff00017f380180
[  111.551374] Buffer I/O error on dev sda1, logical block 60040705, async page read
[  111.554499]
[  111.554503] x20: ffff0000c5f14210 x19: 00000000000000c0 x18: 0000000000000000
[  111.557391] Buffer I/O error on dev sda1, logical block 60040706, async page read
[  111.561218]
[  111.561222] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[  111.564205] Buffer I/O error on dev sda1, logical block 60040707, async page read
[  111.570887] x14: 00000000000000f5 x13: 0000000000000001 x12: 0000000000000040
[  111.570902] x11: ffff0000c05ac6d8
[  111.583420] Buffer I/O error on dev sda1, logical block 60040708, async page read
[  111.588978]  x10: 0000000000000000 x9 : 0000000000040000
[  111.588988] x8 : 0000000000000000
[  111.597173] Buffer I/O error on dev sda1, logical block 60040709, async page read
[  111.605766]  x7 : ffff00017f384880 x6 : ffff8000118cb880
[  111.605777] x5 : ffff00017f384880
[  111.611094] Buffer I/O error on dev sda1, logical block 60040710, async page read
[  111.617086]  x4 : 0000000000000000 x3 : ffff0000c2a9f184
[  111.617096] x2 : ffff8000118cb880
[  111.622242] Buffer I/O error on dev sda1, logical block 60040711, async page read
[  111.626927]  x1 : ffff8000118cb880 x0 : ffff00017f384888
[  111.626938] Call trace:
[  111.626942]  queued_spin_lock_slowpath+0x1a0/0x390
[  111.795809]  kthread_queue_work+0x30/0xc0
[  111.799828]  state_machine_timer_handler+0x20/0x30
[  111.804624]  __hrtimer_run_queues+0x140/0x1e0
[  111.808990]  hrtimer_interrupt+0xec/0x2c0
[  111.813004]  arch_timer_handler_phys+0x38/0x50
[  111.817456]  handle_percpu_devid_irq+0x88/0x150
[  111.821991]  __handle_domain_irq+0x80/0xe0
[  111.826093]  gic_handle_irq+0xc0/0x140
[  111.829848]  el1_irq+0xbc/0x154
[  111.832991]  arch_cpu_idle+0x1c/0x2c
[  111.836572]  default_idle_call+0x24/0x6c
[  111.840497]  do_idle+0x238/0x2ac
[  111.843729]  cpu_startup_entry+0x2c/0x70
[  111.847657]  rest_init+0xdc/0xec
[  111.850890]  arch_call_rest_init+0x14/0x20
[  111.854988]  start_kernel+0x508/0x540
[  111.858659] Code: 910020e0 8b0200c2 f861d884 aa0203e1 (f8246827)
[  111.864760] ---[ end trace 308b9a4a3dcb73ac ]---
[  111.869381] Kernel panic - not syncing: Oops: Fatal exception in interrupt
[  111.876258] SMP: stopping secondary CPUs
[  111.880185] Kernel Offset: disabled
[  111.883673] CPU features: 0x00001001,20000846
[  111.888031] Memory Limit: none
[  111.891090] ---[ end Kernel panic - not syncing: Oops: Fatal exception in interrupt ]---

Change-Id: I4fae27939edca3a9c09020e6252c96ae373eaaf2
Fixes: 3ed8e1c2ac ("usb: typec: tcpm: Migrate workqueue to RT priority for processing events")
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-1-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 3a13ff7ef4)
2021-09-07 11:14:07 +08:00
Badhri Jagan Sridharan
14d6da04a6 UPSTREAM: usb: typec: tcpm: Migrate workqueue to RT priority for processing events
"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)
2021-09-07 11:10:25 +08:00
Badhri Jagan Sridharan
79ba1940b3 UPSTREAM: usb: typec: tcpm: Ignore CC and vbus changes in PORT_RESET change
After PORT_RESET, the port is set to the appropriate
default_state. Ignore processing CC changes here as this
could cause the port to be switched into sink states
by default.

echo source > /sys/class/typec/port0/port_type

Before:
[  154.528547] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms
[  154.528560] CC1: 0 -> 0, CC2: 3 -> 0 [state PORT_RESET, polarity 0, disconnected]
[  154.528564] state change PORT_RESET -> SNK_UNATTACHED

After:
[  151.068814] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS]
[  151.072440] CC1: 3 -> 0, CC2: 0 -> 0 [state PORT_RESET, polarity 0, disconnected]
[  151.172117] state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
[  151.172136] pending state change PORT_RESET_WAIT_OFF -> SRC_UNATTACHED @ 870 ms [rev3 NONE_AMS]
[  152.060106] state change PORT_RESET_WAIT_OFF -> SRC_UNATTACHED [delayed 870 ms]
[  152.060118] Start toggling

Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200402215947.176577-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Change-Id: Ic8a06dafdd4583cba12c7b66b1c9faf8ca830200
(cherry picked from commit 901789745a)
2021-09-07 11:03:13 +08:00
Cai YiWei
4a7a52e98c media: rockchip: isp: compiled with differe hardware version
Change-Id: Ic18a8ba5005e14f9676716fc9b089ed81bdd38b0
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-09-07 10:50:23 +08:00
Cai YiWei
acfebbb68f media: rockchip: isp: selfpath bytesperline 16 align
Change-Id: I39b36e7e3a8c483f5c77ddbea0f6bebb4e1a0b0a
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-09-06 19:17:40 +08:00
Andy Yan
39f12dae1f drm/rockchip: vop2: Remove prepare_fb/cleanup_fb callback
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>
2021-09-06 09:51:42 +08:00
Andy Yan
bcd4aed392 drm/rockchip: vop2: Use macro for window phys_id
Change-Id: I91ff9d169f5713e38c994f56980dfcf0cba0fe40
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-09-03 19:23:29 +08:00
Andy Yan
55462060b2 drm/rockchip: vop2: No need to check active vp in layer_map_initial
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>
2021-09-03 19:23:29 +08:00
Shawn Lin
9d60286b72 mmc: sdhci-of-dwcmshc: Remove HS200 and HS400 at low speed for rockchip
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
2021-09-03 17:45:07 +08:00
Zefa Chen
80fe73c741 media: rockchip: cif: add module exit to fix the failure of rmmod video_rkcif
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I97fc14eb411339796dfc58b28460ed00cd898814
2021-09-03 11:02:21 +08:00
Shawn Lin
c18fd2aea2 arm64: dts: rockchip: rk3568: Set SDHCI core clk to 200MHz
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
2021-09-03 10:05:27 +08:00
Jon Lin
2ecea59132 drivers: rkflash: Support new SPI Nand devices
GD5F1GQ4UExxH, W25N512GVEIG, SGM7000I-S24W1GH

Change-Id: Ib9e5422c3f57ef80e60fc6847d0ba9e1dd55dc3b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-02 16:36:04 +08:00
Jon Lin
abce936f23 drivers: rkflash: Add mutex for deinit ops.
Change-Id: I477c161cb22f58263963a4d8e0d08eaeda676f69
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-02 15:18:29 +08:00
Dingxian Wen
32210c5c1e arm64: configs: rockchip_defconfig: enable LT6911UXC
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
2021-09-02 15:16:17 +08:00
Dingxian Wen
5b721d45c8 arm64: dts: rockchip: rk3568-evb2: add lt6911uxc configuration
Signed-off-by: Dingxian Wen <shawn.wen@rock-chips.com>
Change-Id: I27e7cd02314fb288a4f553105de1027975b8e9d6
2021-09-02 15:15:13 +08:00
Dingxian Wen
f7e55b0143 media: i2c: lt6911uxc: add lt6911uxc HDMI to MIPI CSI-2 bridge driver
Signed-off-by: Dingxian Wen <shawn.wen@rock-chips.com>
Change-Id: I5dc11d3c8a2559303d96b3206fafadb46f95ed0f
2021-09-02 15:15:13 +08:00
Jianqun Xu
5efc9197d8 pinctrl: rockchip: fix pinconf_get for PIN_CONFIG_OUTPUT
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>
2021-09-01 15:13:04 +08:00
Algea Cao
031871bacc drm/edid: add config option of edid function
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
2021-09-01 15:08:03 +08:00
Damon Ding
4d13755e45 drm/rockchip: add config option of DRM DP support
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
2021-09-01 15:01:43 +08:00
Damon Ding
6e759276d2 drm/rockchip: add config option of PSR function
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
2021-09-01 14:35:57 +08:00
Jon Lin
97902663a9 arm64: dts: rockchip: rk3568: Add sfc a spi4 alias
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>
2021-09-01 11:32:22 +08:00
Andy Yan
1d9acc4e67 drm/rockchip: vop2: Use clipped src/dst coordinates
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>
2021-09-01 10:49:54 +08:00
Wyon Bi
e0354482bd arm64: dts: rockchip: Add rk3566-evb2-lp4x-v10-edp.dts
Change-Id: Id56ca263872b42643a66dd063d541968436c4ca6
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2021-09-01 10:34:37 +08:00
Zefa Chen
c30b539aa2 media: rockchip: cif: reinit buffer status when cif reset in mipi interlace mode
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I5f691cd65badda8cedf120a155de7096de8714b5
2021-08-31 18:31:59 +08:00
Jianqun Xu
9df5bfa9fc pinctrl: rockchip: treat pcfg_xxx nodes as invalid function nodes
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>
2021-08-31 14:28:56 +08:00
Jianqun Xu
295855202f pinctrl: rockchip: add function node valid check
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>
2021-08-31 14:28:56 +08:00
Sugar Zhang
cb8e6654bb ASoC: rk817: Move dbg message into CONFIG_SND_DEBUG
$ ./scripts/bloat-o-meter rk817_codec.o.old rk817_codec.o
add/remove: 0/3 grow/shrink: 0/15 up/down: 0/-1680 (-1680)
Function                                     old     new   delta
dbg_enable                                     4       -      -4
__param_dbg_level                             20       -     -20
__param_str_dbg_level                         24       -     -24
rk817_probe                                  328     284     -44
rk817_remove                                 156     108     -48
rk817_set_dai_sysclk                          76      24     -52
rk817_platform_shutdown                       84      32     -52
rk817_playback_path_get                       84      28     -56
rk817_capture_path_put                       504     444     -60
rk817_hw_params                              464     396     -68
rk817_digital_mute                           384     308     -76
rk817_playback_path_put                      880     788     -92
rk817_codec_ctl_gpio                         188      96     -92
rk817_set_dai_fmt                            196      92    -104
rk817_codec_power_up                         416     292    -124
rk817_codec_power_down                       460     336    -124
__func__                                     310      94    -216
rk817_platform_probe                        1304     880    -424
Total: Before=8618, After=6938, chg -19.49%

Change-Id: I98471c52ea342672e10deb02c4fb38d9fb82f906
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-08-31 14:28:12 +08:00
Cai YiWei
2a4f54dcf3 media: rockchip: ispp: fix monitor switch if don't power off
Change-Id: Iefe1f7df7417c84a09437d663cca3c342bf3888a
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-08-31 14:26:56 +08:00
Cai YiWei
81abdf229b media: rockchip: isp: check the output status of statistics v2x
Change-Id: If6076b93b37112ab28c58b6ffabe5770fc847cb8
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-08-31 14:26:56 +08:00
Damon Ding
834f43e2ba ARM: rv1126_defconfig: Enable CONFIG_DRM_PANEL_SIMPLE_OF_ONLY
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
2021-08-31 11:35:07 +08:00
Tao Huang
04a1a8eff9 ARM: rv1126-emmc-drivers-modules.config: Fix CONFIG_ROCKCHIP_MPP_XXX
mpp build only one ko and all option config is bool.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Id940f29a351d81c301a1ca100b8ebee828b8cc81
2021-08-31 11:21:09 +08:00
Ding Wei
cd5de37f97 video: rockchip: mpp: Use CONFIG_CPU_XX to match build target
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>
2021-08-31 11:09:17 +08:00
Ding Wei
cae7fb13d6 video: rockchip: mpp: px30: Use hack_xx.c instead workround funcs
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>
2021-08-31 11:08:08 +08:00
Ding Wei
e32bfc1ed7 video: rockchip: mpp: Use ROCKCHIP_MPP_PROC_FS instead of PROC_FS
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>
2021-08-31 10:48:39 +08:00
Jon Lin
201fbf5da3 drivers: rkflash: support new spiflash
Add F35SQA001G, W25Q128JWSQ, XT25F64F, P25Q32SL, GM25Q128A
Change XT25F256BSFIGU, MX25U51245G

Change-Id: Ib9f60efbd3aad72044b7f3b0ee5a1a93333f0005
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-08-31 09:39:09 +08:00
Zhihuan He
30fc471b5b arm64: dts: rockchip: rk3568: add dmcdbg node
Signed-off-by: Zhihuan He <huan.he@rock-chips.com>
Change-Id: Iab620f4d82f2b55c0a141138d59c80e102e2b829
2021-08-30 19:21:45 +08:00
Zhihuan He
6f922f7041 PM / devfreq: rockchip_dmcdbg: add rk3568 support
Signed-off-by: Zhihuan He <huan.he@rock-chips.com>
Change-Id: I9bf3a5dc18c8f0659bbd9053f6937bfe0f04ef51
2021-08-30 19:21:39 +08:00