Commit Graph

1272041 Commits

Author SHA1 Message Date
Sugar Zhang
15ec253f3c ASoC: rockchip: i2s-tdm: Init Valid Width for TDM from DT
e.g.
simple-audio-card,cpu {
	sound-dai = <&i2s0_8ch>;
	dai-tdm-slot-num = <8>;
	dai-tdm-slot-width = <32>;
};

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I55c3849d87e17145db6b4ce4af202303b5563080
2024-07-05 11:40:42 +08:00
Sugar Zhang
bcbbd20069 ASoC: rockchip: i2s-tdm: Fix config for stage set_fmt on ALWAYS-ON
Enable the xfer in the last card init stage to fix the config
failed on set_tdm_slot/set_fmt.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ie456b08d11eef5356036a431f5fd6117e0df3823
2024-07-05 11:40:42 +08:00
Sugar Zhang
75d401b731 ASoC: rockchip: i2s-tdm: Fix register sync failed on ALWAYS-ON
XFER must be placed after all registers sync done,
because a lots of registers depends on the XFER-Disabled.

Use regcache_sync_region to spilt the sync operation to address
the XFER in the final step.

And also fix for system suspend/resume by using the force one.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I4c5c48496940b2f20edf7a5fa65ad004a5ac9a55
2024-07-05 11:40:42 +08:00
Sugar Zhang
e77b6ebce2 ASoC: rockchip: i2s-tdm: Optimize pm_runtime_forbid
Should be placed after pm_runtime_enable to do
rpm_resume at the moment. otherwise, it will make sense
at the next pm_runtime_get.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I759e5c8c0602b380c7f50d80d8f564316beea632
2024-07-05 11:40:42 +08:00
David Wu
baf08b1852 i2c: rk3x: Fix unregister restart handler error
When i2c drivers probe failed, unregister_restart_handler() should be
done before leave probe().

Fixes: 497e7bd6e1 ("i2c: rk3x: Make sure the i2c transfer to be finished before system reboot")
Change-Id: I6587bd15b63315c173339c26dccf4388741d4286
Signed-off-by: David Wu <david.wu@rock-chips.com>
2024-07-05 09:53:17 +08:00
Sandy Huang
32062f68cc drm/rockchip: vop2: update dsc pd status when show logo with dsc
In normal case, dsc power domain will enable when crtc enable and
disabled when crtc disable. When enable dsc in uboot to show logo,
the dsc in kernel driver can't know the real power domain status,
which will trigger something wrong when disable/endale dsc power
domain.
To avoid this issue, we check the dsc power domain status when
vop_initial. the dsc power domain get in vop_initial function
is enabled only when dsc is enabled in uboot and  enter into kernel
driver. It need to update dsc power domain status in this case.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I9641373c2c8facc17ff90d4141909bcc3ac6b13d
2024-07-03 14:34:35 +08:00
Sandy Huang
fc4f9d2685 drm/rockchip: vop2: make sure dsc pd off take effect
after close dsc pd, the following function will set vop enter standby
immediately, this will lead to dsc pd close failed, so we use
vop2_power_domain_put_sync() instead of vop2_power_domain_put().

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I9120e46ec2047e8358b28a3f153b54b4825a5e60
2024-07-03 14:33:53 +08:00
Chaoyi Chen
59d943019c drm/rockchip: Enable ROCKCHIP_DRM_DEBUG feature by default
Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Change-Id: I78e1ffc660c0c735aff2e2a5cc272549ee8dd4a5
2024-07-03 14:24:33 +08:00
Chaoyi Chen
f483fa9405 drm/rockchip: debugfs: Remove unused vop_dump_list* structure
vop_dump_list* is no longer used and this patch removes this structure.

Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I9f32dfd707a1b7633479f2f2f8fee12ad69a96b1
2024-07-03 14:24:33 +08:00
Sandy Huang
c1c9524d3f drm/rockchip: debugfs: optimize dump buffer file name and size
1. for rfbc/afbc format we need to dump all buffer at fb even userspace
set src buffer offset;
2. optimize dump buffer name, so we can get buffer info correctly from
file name, the following is an example of a dump file:

old file name: video1920_1080_NV12.bin
new file name:
    Cluster0-win0_fb-1920x1088_stride-1920_offset-0x0_act-1920x1080_NV12_0.bin
    Cluster0-win0_fb-3840x2160_stride-5760_offset-0x0_act-3840x2160_YU08_AFBC_1.bin

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I96c3af65fdbe37629d408bb09a8ee9aed78a7f7f
2024-07-03 14:24:33 +08:00
Sandy Huang
8a5680ba81 drm/rockchip: drv: move modifier_to_string() to rockchip_drm_drv and rename
modifier_to_string() maybe used by vop/vop2/rockchip_drm_debugfs.c
and rename modifier_to_string() to rockchip_drm_modifier_to_string()

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I427d5f499d98315632bb91c56da37d9c014df75d
2024-07-03 14:24:33 +08:00
Chaoyi Chen
a607e5fabf drm/rockchip: vop: Use DRM plane info to implement the buffer dump
This patch deprecates the plane list record method used in the
previous plane buffer dump. There is no need to record these
information additionally now, as they are already accessible in DRM.

Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Change-Id: I965f42cc7372c4314aa8cd4de2a8a811b41badaf
2024-07-03 14:24:33 +08:00
Chaoyi Chen
9a9306f9ce drm/rockchip: vop2: Use DRM plane info to implement the buffer dump
This patch deprecates the plane list record method used in the
previous plane buffer dump. There is no need to record these
information additionally now, as they are already accessible in DRM.

Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Change-Id: Iaebf639bcc0759b0f1aa3c9a3888b964a8a6f35b
2024-07-03 14:24:33 +08:00
Chaoyi Chen
67c888e281 drm/rockchip: debugfs: Use DRM plane info to implement the buffer dump
This patch deprecates the plane list record method used in the
previous plane buffer dump. There is no need to record these
information additionally now, as they are already accessible in DRM.

Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Change-Id: Id638a7309ab2ae3f7820d1779e922d008cba7e6d
2024-07-03 14:24:33 +08:00
Cai Wenzhong
121d6e9be0 media: i2c: maxim: driver version v3.07.00
Signed-off-by: Cai Wenzhong <cwz@rock-chips.com>
Change-Id: Idfd53c2055d8496efd4624f1aaaa6fda0397cfcf
2024-07-02 18:57:05 +08:00
Cai Wenzhong
c7c244ff39 media: rockchip: vicap fixes set stream order error when suspend
1. suspend: sditf sensor off, then terminal sensor off
2. resume: terminal sensor on, then sditf sensor on

Signed-off-by: Cai Wenzhong <cwz@rock-chips.com>
Change-Id: I762a2b66e17f4d4016e9d4fd8f0289a3c287f519
2024-07-02 18:57:05 +08:00
Cai Wenzhong
f2d24b9d54 gpio: nca9539: suspend and resume using SET_LATE_SYSTEM_SLEEP_PM_OPS
Signed-off-by: Cai Wenzhong <cwz@rock-chips.com>
Change-Id: I5dc1d2ad9b80d5aa5245866759902328d805f531
2024-07-02 18:57:05 +08:00
Cody Xie
907e477376 gpio: nca9539: Add Runtime PM APIs
Change-Id: If4c20ead4a2273ec281f8ea69ed5306f18e72f5d
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
Signed-off-by: Cai Wenzhong <cwz@rock-chips.com>
2024-07-02 15:02:18 +08:00
Damon Ding
b054d2c768 arm64: dts: rockchip: rk3568: disable lvds1_in_vp1/lvds1_in_vp2 by default
Fixes: 5f0fc285ff32 ("arm64: dts: rockchip: add dual lvds support for rk3567/rk3568")
Change-Id: Ie2c7ea76bdfcc29c5a28ed373ead0a00dde911a1
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
2024-07-02 09:26:15 +08:00
Xueman Ruan
cdc9ee0588 video: rockchip: mpp: fix iep2 page-fault issue
The issue occurs when mode is I1O1T in 1080p.

Change-Id: I3ac5167d1bf0eb13dd4b48056f38bee3cf0dedf1
Signed-off-by: Xueman Ruan <xueman.ruan@rock-chips.com>
2024-07-01 09:53:24 +08:00
Elon Zhang
8449b4d2c2 crypto: rockchip: fix asn1 files dependence error
rk_crypto_v2_akcipher.c require asn1 files but not rk_crypto_ecc.c,
avoid compile errors like below:

drivers/crypto/rockchip/rk_crypto_v2_akcipher.c:21:10: fatal error: rk_sm2signature.asn1.h: No such file or directory
   21 | #include "rk_sm2signature.asn1.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[5]: *** [scripts/Makefile.build:250: drivers/crypto/rockchip/rk_crypto_v2_akcipher.o] Error 1
make[4]: *** [scripts/Makefile.build:500: drivers/crypto/rockchip] Error 2
make[3]: *** [scripts/Makefile.build:500: drivers/crypto] Error 2

Fixes: 743c5b92ab ("crypto: rockchip: add ECC/SM2 support")
Signed-off-by: Elon Zhang <zhangzj@rock-chips.com>
Change-Id: Id28fa9fdc21ea9cd56a73ece2baef512dc304925
2024-06-29 18:55:04 +08:00
Sandy Huang
db7fd2993d drm/rockchip: vop2: fbc vir height should aligned as block height
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I144728c4a98b64709aaf5ccb5fda9dd43062204b
2024-06-28 20:08:39 +08:00
Lin Jinhan
743c5b92ab crypto: rockchip: add ECC/SM2 support
Add support for the following algorithms:

    1. ecdsa-nist-p192
    2. ecdsa-nist-p224
    3. ecdsa-nist-p256
    4. sm2

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: Id58c7755a78293ccb6bfba2a781587922876d5bc
2024-06-28 17:04:49 +08:00
Mingwei Yan
0426bfc39b media: rockchip: vpss: fix switch scl params irq wrong
Signed-off-by: Mingwei Yan <mingwei.yan@rock-chips.com>
Change-Id: I68bdd03f6bff412a131099eaba8d160e89a0b6fa
2024-06-28 17:04:49 +08:00
Finley Xiao
b04747085f arm64: dts: rockchip: rk3576: Change opp table for cpu gpu and npu
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I433b5b8189fb542a5a73298f4db80ed40e5131a6
2024-06-28 17:04:49 +08:00
Finley Xiao
b7e25db5d0 MALI: bifrost: Add set soc info for rk3576
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I6d6d617a0be67c80e6119fcb291710161497b187
2024-06-28 17:04:48 +08:00
Finley Xiao
a911fef70d driver: rknpu: Add set soc info for rk3576
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ifc31a47c9c75e72ea2cc09fcd2c1a70ab664d1c8
2024-06-28 17:04:48 +08:00
Finley Xiao
0af1954a8d cpufreq: rockchip: Add set soc info for rk3576
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ifbaa8d8f2f40ef1828e3844e8e9897ab65eda92e
2024-06-28 17:04:48 +08:00
Finley Xiao
404d56f2e0 soc: rockchip: opp_select: Implement rockchip_opp_set_low_length()
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I17b57fe52bd764deec1400c88ac49a24b25ccaeb
2024-06-28 17:04:48 +08:00
Finley Xiao
a89ecfeca2 arm64: dts: rockchip: rk3576: Change ddr and logic voltage
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I20010a5874130865989f61bb58f1f581cc4af107
2024-06-28 17:04:48 +08:00
Yifeng Zhao
238ecdec05 scsi: ufs: rockchip: modify MPHY configuration based on signal testing
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: I6ec2bbf2e33279c3451ff91a55a8312da6d1c4c5
2024-06-28 17:04:48 +08:00
Algea Cao
85ebb3a26d drm/rockchip: dw-hdmi-qp: Fix crash caused by excessive memory usage when resume
Each time edid is parsed, all resolutions are added to
connector->probed_modes. drm_connector_list_update() must
be called, it will remove useless modes. Otherwise
connector->probed_modes will continue to expand.

Change-Id: Ie61db721fa34e1cabc20209d87273e1b578ed36f
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2024-06-27 17:27:28 +08:00
Algea Cao
70fc302a5b drm/rockchip: dw-hdmi-qp: Fix hpd irq mute after resume
Change-Id: I027005f7978b8a2e2f8e2eada97b7f6e6a0adb18
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2024-06-27 17:27:28 +08:00
Wang Panzhenzhuan
ad3c91351d arm64: dts: rockchip: rk3399-evb-ind-lpddr4-android: add gc8034 config
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I99e44cd0212e2a7d3a3e74ec528dae379f3930b5
2024-06-27 15:33:13 +08:00
Wang Panzhenzhuan
99ada5d52a media: i2c: vm149c: fix compile error
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I12cb08d62125eedafe6a37505e76d14e2a0cd6c7
2024-06-27 15:32:27 +08:00
Wang Panzhenzhuan
955676e81e arm64: dts: rockchip: rk3399-evb-ind-lpddr4-android: remove unused sgm3784
rk3399-evb-ind board's gpio is not connected to control sgm3784,
so remove it

Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I6e874c94fc5db82daa3b9f67adc5f5da51731390
2024-06-27 14:43:47 +08:00
Lin Jinhan
4ec4520de8 arm64: dts: rockchip: rk3576-evb: default enable crypto module
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I574407779de900962757332f80ab6b7c0dd06df6
2024-06-26 16:17:21 +08:00
Lin Jinhan
2fde6adc97 crypto: rockchip: Optimized the exception handling of clock enable failure
[    1.951687][    T1] rk-crypto 2a400000.crypto: invalid resource
[    1.951972][    T1] Failed to prepare clk 'aclk': -95
[    1.951989][    T1] rk-crypto 2a400000.crypto: failed to enable clks -95
[    1.952221][    T1] ------------[ cut here ]------------
[    1.952231][    T1] clk_pka_crypto_ns already disabled
[    1.952272][    T1] WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1040 clk_core_disable+0x88/0x220
[    1.952295][    T1] Modules linked in:
[    1.952308][    T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.1.75 #1956
[    1.952321][    T1] Hardware name: Rockchip RK3576 EVB1 V10 Board (DT)
[    1.952331][    T1] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    1.952344][    T1] pc : clk_core_disable+0x88/0x220
[    1.952358][    T1] lr : clk_core_disable+0x88/0x220
[    1.952371][    T1] sp : ffffffc00a48b740
[    1.952380][    T1] x29: ffffffc00a48b740 x28: 0000000000000001 x27: ffffffc009704780
[    1.952398][    T1] x26: 0000000000000001 x25: ffffffc00a25d838 x24: ffffffc009704dd0
[    1.952415][    T1] x23: ffffff80c0368000 x22: ffffffc00a3ef000 x21: ffffffc00a3ef000
[    1.952432][    T1] x20: ffffff80c0172e00 x19: ffffff80c0172e00 x18: ffffffc00a4650c0
[    1.952449][    T1] x17: 0000000000000013 x16: ffffffffffffffff x15: 0000000000000004
[    1.952466][    T1] x14: ffffffc009f8d6e0 x13: 0000000000003fff x12: 0000000000000003
[    1.952483][    T1] x11: 00000000ffffbfff x10: c0000000ffffbfff x9 : 0c33c05c11861400
[    1.952500][    T1] x8 : 0c33c05c11861400 x7 : 205b5d3133323235 x6 : 392e31202020205b
[    1.952517][    T1] x5 : ffffffc00a3c0617 x4 : ffffffc00a48b477 x3 : 0000000000000000
[    1.952533][    T1] x2 : 0000000000000000 x1 : ffffffc00a48b4e0 x0 : 0000000000000022
[    1.952551][    T1] Call trace:
[    1.952560][    T1]  clk_core_disable+0x88/0x220
[    1.952573][    T1]  clk_core_disable_lock+0x9c/0x130
[    1.952586][    T1]  clk_disable+0x20/0x2c
[    1.952597][    T1]  clk_bulk_disable+0x2c/0x48
[    1.952613][    T1]  rk_crypto_release+0x24/0x40
[    1.952626][    T1]  rk_crypto_register+0x1b0/0x2b8
[    1.952638][    T1]  rk_crypto_probe+0x398/0x3f4

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I34c41cea4844fdac28051401c472358c9e8042ea
2024-06-26 16:17:09 +08:00
Rimon Xu
3a151492f1 video: rockchip: vtunnel: return error when no unused buffer
When the number of queue buffer operations greatly exceeds the number
of deque buffer operations, the available buffers in the pool may be
exhausted, resulting in queue buffer or cancel buffer failures. However,
this error was not intercepted previously, leading to a crash.

Change-Id: Iad6f4146bf6d2685f7534185835ebc512117da4e
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2024-06-26 10:37:25 +08:00
Wang Panzhenzhuan
54233dfbc5 media: i2c: ov08d10: add delay to fix probability reg write failed
1. add delay in setting to fix probability reg write failed
2. remove duplicate global register setting.

Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I8381c9b03480de4119abe225e1ef561a51dec59b
2024-06-25 16:58:36 +08:00
Yifeng Zhao
75dfde714b mmc: sdhci-dwc: Fix SDHCI_RESET_ALL for CQHCI for rk35xx
For rockchip sdhci controllers, SDHCI_RESET_ALL resets also CQHCI registers.
Normally, SDHCI_RESET_ALL is not used while CQHCI is enabled, but that can
happen on the error path. e.g. if mmc_cqe_recovery() fails, mmc_blk_reset()
is called which, for a eMMC that does not support HW Reset, will cycle the
bus power and the driver will perform SDHCI_RESET_ALL.

So whenever performing SDHCI_RESET_ALL ensure CQHCI is deactivated.
That will force the driver to reinitialize CQHCI when it is next used.

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: Iee491501ff7e32e347303f5389f22eef9f8f658b
2024-06-25 10:04:56 +08:00
Shunhua Lan
95d65f02d0 arm64: dts: rockchip: rk3588-evb: add sleep property for pa control
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: I4652bf8e47ce7528a6545263634ddcd45793b1d2
2024-06-24 21:29:53 +08:00
Shunhua Lan
6e52c0b64a arm64: dts: rockchip: rk3576-evb: add sleep property for pa control
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: Ia77cb684ef69a642be62be3f291fe3a43e0ee4c2
2024-06-24 21:29:53 +08:00
Shunhua Lan
e6f3623149 ASoC: rockchip: multicodecs: add sleep time for pa gpio control to depop
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: I5f6fe5f5727734caf5b6c58935dc3bd131380ae7
2024-06-24 21:29:52 +08:00
Shunhua Lan
568481a10e ASoC: rockchip: multicodecs: move PA control operation from supply to speaker/headphone widget
The dapm power sequences is

static int dapm_up_seq[] = {
    [snd_soc_dapm_supply] = 3,
    [snd_soc_dapm_dac] = 8,
    [snd_soc_dapm_hp] = 12,
    [snd_soc_dapm_spk] = 12,
};

static int dapm_down_seq[] = {
    [snd_soc_dapm_hp] = 4,
    [snd_soc_dapm_spk] = 4,
    [snd_soc_dapm_dac] = 7,
    [snd_soc_dapm_supply] = 13,
};

We should enable PA power after dac on and disable before dac off

Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: Ie5b7d5736496061e8f7551bf7d40ffba83015144
2024-06-24 21:29:52 +08:00
Zhang Yubing
4ad8ea9a7a clk: rockchip: rk3588: support more pll frequency for display
Change-Id: I24a246f798a4e8bfe9f346e553cfeb2b168edcf3
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
2024-06-24 21:29:52 +08:00
Shunhua Lan
4389dbd8ec ASoC: es8323: Add a switch for dapm route to control "Speaker/Headphone Power" widgets
"Right Mixer" -> "Right Out 1" -> "OUT1" -> "ROUT1" -> "Speaker Power"
"Left Mixer" -> "Left Out 1" -> "OUT1" -> "LOUT1" -> "Speaker Power"

Change-Id: I31b8dc4e3ae0cfe7d28c5ad811851912914c2aca
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
2024-06-24 14:24:12 +08:00
Mingwei Yan
ce5b90cdcc media: rockchip: vpss: fix proc access register when clk off
Signed-off-by: Mingwei Yan <mingwei.yan@rock-chips.com>
Change-Id: Ic018bf13051b65a366a3b2ef8e5ca918169d0dd3
2024-06-24 10:27:15 +08:00
Zefa Chen
fa4e216c8c arm64: dts: rockchip: rk3576 test1: add flexbus cif
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I06ae1fe9c0e67b7c0eb1099e74e233e6f91cc4a5
2024-06-22 16:42:16 +08:00
Zefa Chen
39843a9d3a arm64: dts: rockchip: rk3576: Add flexbus cif
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: If5af8f3815a691abb1d17e8d50dbbe9dd8eaf38f
2024-06-22 16:40:59 +08:00