Commit Graph

1059926 Commits

Author SHA1 Message Date
Tao Huang
31942565f6 arm64: rockchip_gki.config: Enable CONFIG_SND_SOC_ROCKCHIP_I2S_TDM
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I0d62076671987d047ad709b34707604a0714d2de
2021-08-27 16:10:50 +08:00
Sugar Zhang
6c7029ca49 ASoC: rockchip: Add support for i2s/tdm controller
This patch adds support for i2s/tdm controller which support
I2S, PCM, TDM.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I428e311402220ff14441c48e13fa51356ced46e8
2021-08-27 16:09:46 +08:00
Sugar Zhang
fa8be7127d ASoC: rockchip: i2s-tdm: Make soc_data symbol const
Change-Id: Id78f5f2d79f6345c97456e99ae107716e1a5f560
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-08-27 16:09:46 +08:00
Sugar Zhang
8b6420a3df ASoC: rockchip: i2s-tdm: Add support for 16ch tdm mode
TDM_I2S_ONE_FRAME:
support: [4, 8, 12, 16] channels

TDM_I2S_HALF_FRAME:
support: [2, 4, 6, 8] channels

TDM_PCM_XXX:
support: [2, 4, 6, 8] channels

Change-Id: If9d4205977ee09b993d32759353794c101dc281e
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-08-27 16:09:46 +08:00
Sugar Zhang
0a2f6adbb2 ASoC: rockchip: i2s-tdm: Silence warning by adding parentheses
This patch place parentheses around 'x' to silence potential warning.

Change-Id: I7c6cd70c03f71e85bd39faa092f2d0eb61409431
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-08-27 16:09:46 +08:00
Sugar Zhang
a6904ddc5f ASoC: rockchip: i2s-tdm: Remove sync reset for latest soc
Do sync reset only for PX30/RK1808/RK3308, because the BUG 'fsync
is out of sync' had been fixed on the latest version controller.

Change-Id: Ia4cd711a213cc03221726f7b6e89de3c317dc965
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-08-27 16:09:46 +08:00
Sugar Zhang
480eeafd45 ASoC: rockchip: i2s-tdm: Delay for reset successfully
This patch Adds delay after reset deassert to make sure
reset done before do enabling xfer.

Considering the follow situation:

- i2s_mclk for 8K capture [2.048M]
- i2s_hclk for i2s register access [150M]
- pclk_cru for cru register access [100M]

       SW                               HW

i2s reset assert   [pclk_cru]           |
        |                               |
   delay time                           |
        |                       i2s reset assert   [i2s_mclk]
i2s reset deassert [pclk_cru]           |
        |                               |
i2s xfer enable    [i2s_hclk]           |
        |                       i2s reset deassert [i2s_mclk]

Obviously, pclk_cru(10ns per cycle) is much faster than i2s_mclk
(500ns per cycle). so delay should be added after reset deassert
to make sure hw reset done. Otherwise, the race between reset and
enable xfer maybe break i2s data aligned.

Fixes: A 10us delay is enough

       SW                               HW

i2s reset assert   [pclk_cru]           |
        |                               |
   delay 10us                           |
        |                       i2s reset assert   [i2s_mclk]
i2s reset deassert [pclk_cru]           |
        |                               |
   delay 10us                           |
        |                       i2s reset deassert [i2s_mclk]
i2s xfer enable    [i2s_hclk]           |
        |                               |

Change-Id: Id370b0aa13f771053841ce04a554b408e9e3c831
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-08-27 16:09:46 +08:00
Sugar Zhang
1d3f337223 ASoC: rockchip: i2s-tdm: Fix potential deadlock
CPU0                    CPU1
     ----                    ----
lock(&(&i2s_tdm->lock)->rlock);
                             local_irq_disable();
                             lock(&(&substream->self_group.lock)->rlock);
                             lock(&(&i2s_tdm->lock)->rlock);
<Interrupt>
  lock(&(&substream->self_group.lock)->rlock);

Change-Id: I80cc2d0bc9df7e31ff23d0e5d04618ba57fd70df
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-08-27 16:09:46 +08:00
Sugar Zhang
7c22de8372 ASoC: rockchip: i2s-tdm: Replace dmaengine with rockchip pcm
rockchip pcm is a wrapper of snd dmaengine pcm with customize
config, to achieve flexible config.

Change-Id: I164e22dc3716075ccd520b74f03f554c075f25ec
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-08-27 16:09:46 +08:00
Sugar Zhang
2aec56ed7e ASoC: rockchip: Make rockchip_pcm depends on SND_SOC_ROCKCHIP
This patch make rockchip_pcm.c compiled depends on SND_SOC_ROCKCHIP,
because all the dai of rockchip will switch to use it, and we can
do much more customize, such as minimize the prealloc buffer size.

Change-Id: Ia7a3923db6760273d2291b41c194f28b43de83b2
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-08-27 16:09:46 +08:00
Algea Cao
8dab449f45 arm64: dts: rockchip: rk3568-nvr: Add hdmi property skip-check-420-mode
NVR product isn't need to check yuv420 mode valid in hdmi driver.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I56264bd3e4a9a3e9d5ddbec48e36fb816dd1de65
2021-08-27 15:50:26 +08:00
Algea Cao
60cf7d2f68 drm/rockchip: dw_hdmi: Support skip check yuv420 mode valid
Do this check in userspace.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I1a3b8510a58cdc0f1459c71ad6983a9ebf7240ce
2021-08-27 15:50:26 +08:00
Algea Cao
fb637c7480 drm/bridge: synopsys: dw-hdmi: Support force logo display
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ib885ab7064a874a898b1ae005f2a4d8e4e9a1b01
2021-08-27 15:50:26 +08:00
Algea Cao
14f2bf3e7f drm/bridge: dw-hdmi: Make sure to output full range RGB in DVI mode
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I0858fe28139ead5fba6fc797cb6f3bec00f333fa
2021-08-27 15:50:26 +08:00
Algea Cao
3972b45872 drm/rockchip: dw_hdmi: Add property to show whether sink is DVI
Add property output_type_capacity:
enums: DVI=0 HDMI=1

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Iad09b386b55c52e21b01f98e81fadfd5aa1a42d3
2021-08-27 15:50:26 +08:00
Algea Cao
9905ae2b79 drm/rockchip: dw_hdmi: Add property to switch HDMI/DVI mode
Add property output_hdmi_dvi:
enums: auto=0 force_hdmi=1 force_dvi=2

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ic048fb5c004f332b60bbbeca857de4abe9c0ca08
2021-08-27 15:50:26 +08:00
Algea Cao
2fbd84454a drm/rockchip: dw_hdmi: Support set quant range take effect immediately
When set property hdmi_quant_range, quant range was changed immediately.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ib8c14404cc3dde645012399b6155d047b4e9609a
2021-08-27 15:50:26 +08:00
David Wu
489e357c98 arm64: dts: rockchip: rk3588: Add i2c nodes at dtsi level
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ibe99be6e24bb926d65ff3ece0ad448dc82af2a6a
2021-08-27 14:43:19 +08:00
Yu Qiaowei
a6c8eee776 video/rockchip: rga2: Fix the misconfiguration of srcover's globalalpha
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I547ce7a8938a37ac96223f7435b94ec839b3ceba
2021-08-26 16:23:56 +08:00
Yu Qiaowei
cf30583ce1 video/rockchip: rga2: Change the way to alloc memory in rga slt mode.
1. Fix compile error when debugfs is disable.
2. Using get_page to alloc memory can save 1250KB(64-bit)/625KB(32-bit)
   of memory in the data segment.

./scripts/bloat-o-meter -c drivers/video/rockchip/rga2/rga2_drv.o.old
drivers/video/rockchip/rga2/rga2_drv.o
add/remove: 1/0 grow/shrink: 1/1 up/down: 396/-104 (292)
Function                                     old     new   delta
rga2_slt                                     864    1124    +260
rga2_service_session_clear.constprop           -     136    +136
rga2_release                                 292     188    -104
Total: Before=18736, After=19028, chg +1.56%
add/remove: 1/3 grow/shrink: 0/0 up/down: 8/-1280008 (-1280000)
Data                                         old     new   delta
__addressable_rga2_init2808                    -       8      +8
__addressable_rga2_init2895                    8       -      -8
src_buf                                   640000       - -640000
dst_buf                                   640000       - -640000
Total: Before=1282092, After=2092, chg -99.84%
add/remove: 0/0 grow/shrink: 1/0 up/down: 9/0 (9)
RO Data                                      old     new   delta
__func__                                      57      66      +9
Total: Before=1537, After=1546, chg +0.59%

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I21c36a268c86b75da7b9e8da5eaf4f1f698c9737
2021-08-26 16:22:36 +08:00
Wyon Bi
48fb554efc drm/rockchip: analogix_dp: Protect kernel logo with loader_protect callback
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I16a1653aac3f6475f898390e83b09c93b706429e
2021-08-26 15:03:04 +08:00
Tao Huang
bb1c2a5cc5 soc: rockchip: power-domain: Add missing dummy definition for pd on/off and pd status
Fixes a build break when CONFIG_ROCKCHIP_PM_DOMAINS is not selected.

drivers/video/rockchip/mpp/mpp_common.c:2286:13: error: implicit declaration of function 'rockchip_pmu_pd_is_on' [-Werror,-Wimplicit-function-declaration]
        pd_is_on = rockchip_pmu_pd_is_on(mpp->dev);
                   ^
drivers/video/rockchip/mpp/mpp_common.c:2288:3: error: implicit declaration of function 'rockchip_pmu_pd_on' [-Werror,-Wimplicit-function-declaration]
                rockchip_pmu_pd_on(mpp->dev);
                ^
drivers/video/rockchip/mpp/mpp_common.c:2304:3: error: implicit declaration of function 'rockchip_pmu_pd_off' [-Werror,-Wimplicit-function-declaration]
                rockchip_pmu_pd_off(mpp->dev);
                ^

Fixes: 93993a9497 ("soc: rockchip: power-domain: export pd on/off and pd status")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Idd4039639fb0884a6fccdec0e22f37888a301a98
2021-08-26 14:16:18 +08:00
Zhen Chen
ff6f00a18f MALI: midgard: use strncasecmp() to compare irq names
to adapt to current rk3399.dtsi.

Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: Ibe0906908ff50ed00c17d9dfd00a40f3898549c1
2021-08-26 14:15:35 +08:00
Steven Liu
44063c39fa arm64: dts: rockchip: rk3588s add pwm node
Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: I9b8a1ee5addc0e52f8a8e8f5b7fd10b7ff51050e
2021-08-26 11:17:15 +08:00
Elaine Zhang
4834c511d2 clk: rockchip: rk3399: fix up the spi softrst ID
fix up the spi3 and spi5 softrst ID.

Change-Id: Ib8870ef765284e04674ce80acf0b4702ed77cebc
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-08-25 17:58:42 +08:00
Algea Cao
79fa403744 drm/bridge: synopsys: dw-hdmi: check hdmi->cec_adap when hpd occur
hdmi->cec_adap may be null when system boot and hpd occur.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I208412b9b8b1e3fd846e62bf5e1f86e706d678e6
2021-08-25 17:23:20 +08:00
Algea Cao
e133944d0a drm/bridge: synopsys: dw-hdmi: set output mode hdmi when get edid failed
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I4bd5421603c0c82e4898e768996d0ffe447a3e63
2021-08-25 17:23:20 +08:00
Algea Cao
5f0786206e drm/bridge: synopsys: dw-hdmi: Remove dw_hdmi_setup when atomic_check
There is no need to call dw_hdmi_setup() when atomic_check.
dw_hdmi_color_changed() will check if color format changed and
call a mode_set.
If call dw_hdmi_setup() to enable hdmi when the first plug in
atomic_check, HPLL has not been configured in rk356x, there will
be display err in some monitor.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I83f3d1d3ff45e3e07910449d8d03f94b82fc0abe
2021-08-25 17:23:20 +08:00
Algea Cao
ced3577389 drm/bridge: synopsys: dw-hdmi: Don't set bus format as MEDIA_BUS_FMT_FIXED when dw-hdmi is only bridge
Using get_output_bus_format() and get_input_bus_format() to get
bus format when dw-hdmi is only bridge.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Iec341cbb782270baafb8fa50752296d989def58b
2021-08-25 17:23:20 +08:00
Algea Cao
809125adda drm: rockchip: dw-hdmi: Replace hdr_static_metadata with hdr_output_metadata
hdr_static_metadata is no longer used for HDR configuration,
used only as store the hdr info after edid parsing.

Change-Id: Ib2c5e3e739267433176181aa9a0611a50a847125
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2021-08-25 17:23:20 +08:00
Algea Cao
d5e6b96ce0 drm: rockchip: dw-hdmi: Change HDR_PANEL_METADATA to private property
For compatibility with GKI, HDR_PANEL_METADATA can't be a global
property. So change HDR_PANEL_METADATA to Rockchip private property.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I7926683a5dc6274e6cab2151e476344fa897b66c
2021-08-25 17:23:20 +08:00
Mark Yao
21dc499588 rockchip: clk: rk3399: default enable dual pll for vop
Change-Id: I88a2a549eaafa91e4159f262a5f5838c834a89e9
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-08-25 17:07:22 +08:00
Steven Liu
563597d0b9 arm64: dts: rockchip: rk3588s add uart node
Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: I43b0fa97baad9cfe362b4d5f7d48cc489ba2b4d7
2021-08-25 14:41:43 +08:00
Tao Huang
8a8168e343 Merge remote branch 'android12-5.10-2021-08' of https://android.googlesource.com/kernel/common
* android12-5.10-2021-08: (429 commits)
  ANDROID: Update symbol list for mtk
  ANDROID: scheduler: export task_sched_runtime
  FROMLIST: mm: slub: fix slub_debug disabling for list of slabs
  FROMLIST: mm/madvise: add MADV_WILLNEED to process_madvise()
  ANDROID: Update the exynos symbol list
  FROMGIT: firmware: arm_scmi: Free mailbox channels if probe fails
  ANDROID: GKI: gki_defconfig: Enable CONFIG_NFC
  ANDROID: sched: Make uclamp changes depend on CAP_SYS_NICE
  ANDROID: GKI: update xiaomi symbol list and ABI XML
  ANDROID: ABI: update generic symbol list
  ANDROID: scsi: ufs: Enable CONFIG_SCSI_UFS_HPB
  ANDROID: scsi: ufs: Make CONFIG_SCSI_UFS_HPB compatible with the GKI
  UPSTREAM: arm64: vdso: Avoid ISB after reading from cntvct_el0
  ANDROID: GKI: Disable X86_MCE drivers
  ANDROID: GKI: Update symbols to symbol list
  ANDROID: ABI: update allowed list for exynos
  FROMGIT: sched: Skip priority checks with SCHED_FLAG_KEEP_PARAMS
  FROMGIT: sched: Don't report SCHED_FLAG_SUGOV in sched_getattr()
  FROMGIT: sched/deadline: Fix reset_on_fork reporting of DL tasks
  BACKPORT: FROMGIT: sched: Fix UCLAMP_FLAG_IDLE setting
  ...

Change-Id: I5e0600bb4ccd0333366b016b42332e1e79e56b61

Conflicts:
	drivers/usb/gadget/configfs.c
	include/linux/usb/gadget.h
2021-08-24 20:07:38 +08:00
Simon Xue
2d828460dc arm64: dts: rockchip: rk3588s: add smmu nodes
Change-Id: Ibe5bdb7fd97cbaf2eb1d53144546b65238663a13
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2021-08-24 19:56:53 +08:00
Tao Huang
98fb0e705a arm64: rockchip_gki.config: Enable CONFIG_DRM_RK1000_TVE
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I78e90cf50712f518ad49ec611ebcb230a6bdbd54
2021-08-24 18:54:28 +08:00
shengfei Xu
611e60519e arm64: dts: rockchip: enable the suspend default config for rk3568-linux
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Change-Id: I6fefa1d37cf7e1d7bade038f2b909a62417ec254
2021-08-24 18:24:27 +08:00
shengfei Xu
f580b4b2ac arm64: dts: rockchip: enable the suspend default config for rk3568-android
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Change-Id: I9581ce931162012ecf508c6d14990b98e8466361
2021-08-24 18:24:27 +08:00
Tao Huang
74e91e56e1 arm64: rockchip_gki.config: Enable RK630
+CONFIG_DRM_RK630_TVE=m
+CONFIG_MFD_RK630_I2C=m

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I859dd45dab1db387ccf9fa6cdb92ba73c8a5a2bd
2021-08-24 18:02:49 +08:00
Algea Cao
c929c6a749 mfd: rk630: Avoid build fail when building as module
ERROR: modpost: "rk630_tve_regmap_config" [drivers/mfd/rk630-i2c.ko] undefined!
ERROR: modpost: "rk630_cru_regmap_config" [drivers/mfd/rk630-i2c.ko] undefined!

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ida6b17db91c97a2749f2e59629353a89e5303e10
2021-08-24 18:02:13 +08:00
Shawn Lin
75d88fe4bb arm64: dts: rockchip: rk3588s add sdmmc and sdio node
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: Iac1fe3671d241c0ca2581f01b3e3861dbcac3693
2021-08-24 16:37:17 +08:00
Simon Xue
eeccdd466a arm64: dts: rockchip: rk3588s: add partial iommu nodes in bulk
Signed-off-by: Simon Xue <xxm@rock-chips.com>
Change-Id: Ic89b94237b1232104681eee374e13163dd69f763
2021-08-24 16:34:38 +08:00
Tao Huang
c368f13e79 arm64: rockchip_gki.config: Enable CONFIG_CPU_RK3588
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I9519523120dcd703d7deba1d4d4a5bb912f31172
2021-08-24 16:31:39 +08:00
Finley Xiao
96b08211be arm64: dts: rockchip: rk3588: Add pmu device node
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: If620857222678d2dd90163887aa7197f1bdf1a5b
2021-08-24 16:23:22 +08:00
Elaine Zhang
6cc51b89d6 soc: rockchip: power-domain: Add a meaningful power domain name
Add the power domains names to the power domain info struct so we
have meaningful name for every power domain.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Link: https://lore.kernel.org/r/20210417112952.8516-10-jbx6244@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 0a69452e03)
Change-Id: I254ce440ee8560515300745911627006d521b3ac
2021-08-24 15:56:53 +08:00
Algea Cao
deeec05202 drm/bridge: support rk1000 tv encoder
RK1000 is a digital-analog mixed chip which has tve output function.
RK1000's registers can be written and read through I2C interaface.
Because RK1000's I2C need dclk and mclk, RK1000 TVE should be registered
after RK1000 CORE.

Change-Id: I65b40826bd1dbf07d4fa94ecdf8c75005008731f
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2021-08-24 14:54:15 +08:00
Algea Cao
4c61ce641f mfd: rk1000: Add rk1000 core driver to kbuild
RK1000's control register block need mclk for i2c communication.
So mclk should be enabled in advance.
RK1000's control register block should be registered before RK1000
TVE.

Change-Id: Iba9a2a410fe927666072f8d246995462a860ec3a
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2021-08-24 14:52:46 +08:00
Algea Cao
87cf222c18 drm/bridge: rk630: Add RK630 tve driver
Change-Id: I80180ca55d1eda0dd63dc8399d5196ae8d4e9f57
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2021-08-24 14:33:30 +08:00
Algea Cao
ba120ad91d mfd: Add RK630 mfd driver
Change-Id: I03c127df4ec2ad80cbaf4b0d4ad540cb5b32a245
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2021-08-24 14:33:27 +08:00
WeiYong Bi
4e28fd7626 arm64: dts: rockchip: rename mipi to dsi for rk3399
Change-Id: I6c6fb4e0399b805dfa012cc5562ad71103aa85e9
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
2021-08-24 11:21:50 +08:00