Commit Graph

866747 Commits

Author SHA1 Message Date
Shawn Lin
8a6091f292 mmc: dw_mmc-rockchip: Restore slot's clock if it's updated
slot's clock is cached before calling ->set_ios for sub-driver.
If the clock is updated by sub-driver, it's better to restore
the cached slot's clock. Or we can see a unexpected clock as the
driver didn't know the slot's clock is updated and still use the
old clock to calculate divider. So we may see a lower clock. It
theory, it's won't be a problem because any rate lower than 400k
should be fine, and we even didn't start issuing any command during
the lower clock. But still it's right to update slot's clock to reflect
the correct clock and may fix some potential unknown problems.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I06581320547bb06c306da57e141d06f9206ea585
2021-11-10 16:06:55 +08:00
XiaoTan Luo
2ab6dde5c9 arm64: dts: rockchip: rk3568-evb: fixed hdmi sound probe error
Fixes: 520474071e ("arm64: dts: rockchip: rk3568-evb:
use "rockchip,hdmi" instead of "simple-audio-card"")

Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: Ia43b35ebf63f312a5b5de1ad17ed2e5ddd887b62
2021-11-10 14:34:45 +08:00
Daniel Vetter
15ca5d9432 UPSTREAM: drm/file: Uncompact the feature flags
This essentially undoes

commit 39868bd766
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Oct 29 08:55:58 2013 +0000

    drm: Compact booleans within struct drm_file

We do lockless access to these flags everywhere, and it's kinda not a
great idea to mix lockless and bitfields. Aside from that gcc isn't
generating great code for these.

If this ever becomes an issue size-wise, I think we need atomic_t here
and atomic bitflag ops.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181102132543.16486-2-daniel.vetter@ffwll.ch
(cherry picked from commit 078b7de412)

Change-Id: I3643619209bb9e292fb1a3c273f1a52cc4a4de74
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2021-11-09 09:38:05 +08:00
Caesar Wang
45298c2d6e arm64/config: update rk3326/px30_linux_defconfig
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: I50d05d0e7d6350f64fe1876e26af9e0f111a4673
2021-11-08 15:50:48 +08:00
Jianqun Xu
bcd39e1a04 drm: rockchip: gem: create sg with size according to swiotlb limit
The swiotlb limit the log of the size of each IO TLB slab by
IO_TLB_SHIFT, and limit the Maximum allowable number of contiguous slabs
to map by IO_TLB_SEGSIZE.

Since memory from rockchip gem maybe accessed by some processor only
with 32 bit address, so the gem should limit the sg size according to
the swiotlb limit.

The swiotlb limit single tlb size to IO_TLB_SEGSIZE * (1 << IO_TLB_SHIFT)

Change-Id: Ifa18068ea30e0f9277521d4efa8a55fdce5dd264
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2021-11-08 10:07:46 +08:00
William Wu
98a32a4b69 Revert "usb: dwc2: hcd: do not disable non-split periodic channels"
This reverts commit debf378724.
The patch a82c7abdf8 ("usb: dwc2: hcd: Fix host channel halt flow")
can fix the issue.

Change-Id: I9a014c42cf942cab22480b5faab13c802e7fd47e
Signed-off-by: William Wu <william.wu@rock-chips.com>
2021-11-06 17:52:45 +08:00
William Wu
4ee1573943 usb: dwc2: hcd: Fix channel halt for isoc and int transfer
The parameters g_dma and g_dma_desc is used for gadget,
so let's use host_dma and dma_desc_enable instead of them.
And it needs to update the chan->halt_status for non-split
periodic channels rather than return immediately, otherwise,
the software will not release the channel when the channel
halt interrupt is triggered next time.

In addition, it only needs to wait for the core generates
a channel halted if halt_status is DWC2_HC_XFER_URB_DEQUEUE.

Fixes: a82c7abdf8 ("usb: dwc2: hcd: Fix host channel halt flow")
Change-Id: I455444af020ff751406295f21133ff6a950c04dd
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
2021-11-06 17:52:18 +08:00
Steven Liu
effdc5032f arm64: dts: rockchip: rk3568: add rk3568-amp.dtsi
Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: I93e64854e053866b6faca68107f6a496f22aa864
2021-11-05 19:15:30 +08:00
Steven Liu
d5590a0c1e soc: rockchip: amp: support amp driver
1.Protect clock and iomux resources used by AMP.
2.Support RK3568 AMP.

Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: If53e893fac916217bfa5618350b1706b742b34e7
2021-11-05 18:58:25 +08:00
Jianqun Xu
28ce07e7f1 video: rockchip: rga2 use dma-buf-cache
Change-Id: Ic1b37308b9fe5d8558ed73eb576398e0f0f05290
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2021-11-05 09:52:25 +08:00
XiaoTan Luo
816e197f50 arm64: dts: rockchip: rk3568-linux: enable rk809 sound for headphones jack function
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: Ic9788c4c58a04828af3f50c06f7a96a1fd661cae
2021-11-04 17:27:34 +08:00
Yandong Lin
d47e486b19 video: rockchip: mpp: use dma-buf-cache func
Note:
The commit depends on the following commit:
commit 36514da674 ("dma-buf: support to cache dma-buf-attachment")

  The attachment and sg_table will be store in dma-buf-cache.
  So use dma-buf-cache api instead of dma-buf api to reduce
  the actual operation of attach/map.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I8b46c8f6a6f69ebe9854858e198d1c312a808a2f
2021-11-04 15:43:37 +08:00
Jianqun Xu
0ed46b824f drm: rockchip: do release callback if not define CONFIG_DMABUF_CACHE
When enable CONFIG_DMABUF_CACHE, the dmabuf attach will be cached by
dma-buf-cache driver.

Change-Id: Icc9c21542c2f0883e74a5b35f82e4d604509bcb3
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2021-11-04 09:52:06 +08:00
Elaine Zhang
3c29e3c43b clk: rockchip: rk3568: add CLK_SET_RATE_NO_REPARENT flag for clk_gmacx_rx_tx
Change-Id: If0f415b6b4f8694572e20ff3658d2f079a3190e8
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-11-04 09:52:06 +08:00
XiaoTan Luo
96166eb846 ASoC: es8311: fixed the dapm route error
SND_SOC_DAPM_AIF_OUT/SND_SOC_DAPM_AIF_IN must match the dai stream name

Fixes: 3b13f64c6d ("ASoC: es8311: add support es8311 codec driver")
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: I2ed044b2ea9e518bb4bd0fa1b578a64495e9723a
2021-11-04 09:52:06 +08:00
William Wu
1d5173fc2d phy: rockchip-naneng-usb2: do apb reset during probe
It's not enough to reset the internal circuit in phy
with the phy power reset signal when probe. It also
needs to reset the apb of phy, with this patch, we
can fix the usb enumeration error on some rv1126/rv1109
products.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Ib6bb0f0aeca7577ad65041a28ede57ba110b7bc0
2021-11-04 09:52:06 +08:00
XiaoTan Luo
0deaba2121 arm64: dts: rockchip: rk3568-linux: enable hdmi_sound with hdmi jack function
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: I56ed59069293cd04d867f7d0facf12569b322434
2021-11-04 09:52:06 +08:00
XiaoTan Luo
520474071e arm64: dts: rockchip: rk3568-evb: use "rockchip,hdmi" instead of "simple-audio-card"
Such as Debian SDK need the HDMI connection jack status to monitor the audio devices.
if want to enable jack detection must add this config: "rockchip,jack-det;"
else if want to disable jack detection and than remove "rockchip,jack-det;"

Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: I4a530987b032c1bc564804f6274cb30b495ea205
2021-11-04 09:52:06 +08:00
Shawn Lin
d8f7033aa0 mmc: dw_mmc-rockchip: Improve v2 tuning
v2 tuning has a defect that if invalid space is laid
between 90 and 180, and the PVT might make the invalid
space back and forth. To overcome this weakness, we don't
need to select phase from beginning, and should directly
chose the next one against the last phase selected.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I0cbeb1dba524c2e23a3719d28b868af3ed49e20b
2021-11-04 09:52:06 +08:00
Shawn Lin
8d0e882790 mmc: dw_mmc-rockchip: Skip all phases bigger than 270 degrees
Per design recommendation, it'd better not try to use any phase
which is bigger than 270. Let's officially follow this.

Change-Id: I8dee3eb648d321cc86e0926844cde528dbb5bd95
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2021-11-04 09:52:06 +08:00
Cai YiWei
abc59cba82 media: rockchip: ispp: replace iommu detach/attach
Change-Id: I1cf46cb9cba85be418f32d218dd70452c8062d42
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-11-04 09:52:06 +08:00
Cai YiWei
eac9782a73 media: rockchip: isp: replace iommu detach/attach
fix NULL Pointer when isp to reset
[ 4486.719609]  __iommu_dma_unmap+0x14/0x7c
[ 4486.719968]  iommu_dma_unmap_sg+0x64/0x90
[ 4486.720348]  __iommu_unmap_sg_attrs+0x48/0x5c
[ 4486.720745]  vb2_dma_sg_dmabuf_ops_detach+0x60/0x80
[ 4486.721192]  dma_buf_detach+0x88/0x9c

iommu_detach_device will set domain to null,
and __iommu_dma_unmap using domain but no check.

Change-Id: I3c679565c6a7e67783e1750fc4d028191a9c9fcf
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-11-04 09:52:05 +08:00
Ding Wei
ea09729690 video: rockchip: mpp: mpp_iommu_refresh via rockchip_iommu funcs
reason:
device_links_read_lock/unlock are not export symbols, thus use
rockchip_iommu_disable/enable instead.

Change-Id: I545eced499533383f6cfbdf81e696064f42b6c3e
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-11-04 09:52:05 +08:00
Wangqiang Guo
7964bdd1b1 input: sensor: accel: support 3-Axis accelerometer: da228e
Signed-off-by: Wangqiang Guo <kay.guo@rock-chips.com>
Change-Id: I272c179d151acefcd54fa01cf25fc3790a141ecd
2021-11-04 09:52:05 +08:00
Wangqiang Guo
ac2e46aaa7 input: sensor: accel: support 3-Axis accelerometer: da215s
Signed-off-by: Wangqiang Guo <kay.guo@rock-chips.com>
Change-Id: Ia1c00b45fb86043c730835f95543bbd01dd882ee
2021-11-04 09:52:05 +08:00
Jon Lin
4c99006d1c mtd: rawnand: rockchip: Support read_oob_raw
nanddump split read_page_raw into two operations, page read and oob read.
So read_oob_raw is necessary for getting the oob data.

Change-Id: I4e85bbdbf8cd3312fa3525f9e674c31ce20024e9
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-11-04 09:52:05 +08:00
Guochun Huang
694d0b4764 drm/rockchip: rk628: fix lvds default data format
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: Ib99e6e3d285b3693428523fdd11027d8862ee734
2021-11-04 09:52:05 +08:00
Zhen Chen
10317ccd43 MALI: bifrost: fix an error in Kbuild
Bifrost device driver should be built once CONFIG_MALI_BIFROST is enabled,
not CONFIG_MALI_MIDGARD.

Fixes: 100a5af029 ("MALI: rockchip: upgrade bifrost DDK to g7p1-01bet0, from g6p0-01eac0")
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: Idf49dd482576c293081f846891c39523520350a8
2021-11-04 09:52:05 +08:00
Zhen Chen
d0b95bb73b MALI: bifrost: fix compilation errors when CONFIG_DEBUG_FS is disabled
Such as involving non_debuggable.config.

Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: I4224a31169c2ce224d8cc2d6993f4ac3cd40d675
2021-10-29 10:36:46 +08:00
Simon Xue
26595250be iommu/rockchip: wrap enable/disable operation for user
There are issues about the field "links" of struct device
by calling pm_runtime_get_sync/pm_runtime_put_sync to
enable/disable iommu, wrap helpers to make things easy.

Change-Id: I03a85dc8c67b902e79b1e86a201b2074e2562d83
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2021-10-28 15:46:45 +08:00
Algea Cao
6341858d4b drm/bridge: rk630: Support new version rk630 tve
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I2b1eae031a7f78ec06cf28d9120038c8eb8ae419
2021-10-28 15:43:17 +08:00
Zhenke Fan
efa2999fc6 media: i2c: ov13b10: add ov13b10 sensor driver
Signed-off-by: Zhenke Fan <fanzy.fan@rock-chips.com>
Change-Id: Ie5c65660f4745aa7151cdbca172c45178bb8d6e4
2021-10-28 15:36:52 +08:00
Zhenke Fan
ce202a12c6 media: i2c: otp_eeprom: add sensor otp eeprom driver
Signed-off-by: Zhenke Fan <fanzy.fan@rock-chips.com>
Change-Id: If08548c4613289c15947428c8468e7fb3769c60e
2021-10-28 15:34:14 +08:00
Elaine Zhang
ab662f9660 rtc: rk630: add rtc for rk630
Change-Id: I36bfe7ba7c4876d9030b065f26b1e99fefc738b9
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-10-28 15:28:30 +08:00
Elaine Zhang
ffbb2a9f9f mfd: rk630: add rtc regmap and irq
Change-Id: Ia21198d9806e697c6383ed7211959a3a3c6e38d9
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-10-28 14:12:42 +08:00
Zhen Chen
7d79155429 MALI: bifrost: resolve error when 'make clean'
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: I492507877fc82c475c46d5c0c93d216ab052a48e
2021-10-27 18:40:32 +08:00
Zhen Chen
100a5af029 MALI: rockchip: upgrade bifrost DDK to g7p1-01bet0, from g6p0-01eac0
Including modifications under drivers/base/ from the new DDK.

Resolve lots of conflicts.

Change-Id: I69f9ac87d927441d0b92b8dac8b704922aeb6a0a
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-10-27 18:40:32 +08:00
Zhen Chen
c2d009d203 MALI: bifrost: fix a bug that makes vdd_gpu abnormally low
Change-Id: Ic0b785ead0da551e9e640c45b73f6686a1ec5cca
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-10-27 18:40:32 +08:00
Zhen Chen
84f151935f MALI: rockchip: upgrade bifrost DDK to g6p0-01eac0, from g2p0-01eac0
Include a new directory include/uapi/gpu/arm/bifrost/,
which includes some header files of bifrost device driver.
In the original part of g6, the path is include/uapi/gpu/arm/midgard/.
I changed the "midgard" to "bifrost", and modified the paths of the header files in .c files.

I resolved some conflicts between modifications form ARM and RK, manually.

In addition, introduce source files of protected_memory_allocator
that might be needed by bifrost_device_driver into build system.

Change-Id: I09d500a0fdbc5da352c81dc4fcfbffb5b7f907f5
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-10-27 18:40:32 +08:00
Jianqun Xu
50bd39f727 drm: rockchip: use dma-buf-cache
Change-Id: I6a34a5a4f33e54b7459461bcfa84f03a831d2f65
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2021-10-27 18:16:42 +08:00
Jianqun Xu
36514da674 dma-buf: support to cache dma-buf-attachment
This patch try to fix this issue by caching the dma-buf attachments and
stores the cache list to dtor_data of dma-buf structor. The dma-buf
attach with cache will try to find cached attachment first and return
the valid instance.

This patch also store the deattch operation to dtor of dma-buf structor
by dma_buf_set_destructor.

Change-Id: I4778c3328825f6c04f5d2608994e62fe3478bf1b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2021-10-27 18:16:42 +08:00
Sugar Zhang
b84613bfeb ASoC: rockchip: Kconfig: Remove unused PREALLOC_BUFFER_SIZE
This reverts part of commit 213457f1ef
("ASoC: rockchip: pcm: Adjust min/max value for pcm config").

Instead, pass module option 'prealloc_buffer_size_kbytes'
to specify it. any details please refer to:
Documentation/sound/alsa-configuration.rst

e.g. 32 kbytes prealloc buffer size:

"snd_soc_core.prealloc_buffer_size_kbytes=32"

Change-Id: I3788620807c4e94d3e9c15ef224b76266722dcc1
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-10-27 11:05:07 +08:00
Su Yuefu
e8ce286fac media: i2c: add sc223a sensor driver
Signed-off-by: Su Yuefu <yuefu.su@rock-chips.com>
Change-Id: Ib7b04474b80318889bc356c25506cc8e1497902a
2021-10-27 10:52:35 +08:00
Andy Yan
43f90e774d drm/rockchip: vop2: Reset plane->rotation to DRM_MODE_ROTATE_0
Some application(e.g Kwin) may use it as a default rotation.
We should set it a valid rotation here.

Change-Id: Idef8fa5097b54710e2ead32a197d5d1e6bf78d94
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-10-27 10:24:32 +08:00
Finley Xiao
790f77f1a1 arm64: dts: rockchip: rk3568: Add vop-frame-bw-dmc-freq
Fix vop POST_BUF_EMPTY irq err when rotate screen.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I3c0d5c52efa8612ce6bf24f6748ccab7c1c05a57
2021-10-26 18:07:07 +08:00
Finley Xiao
4163c2ca85 PM / devfreq: rockchip_dmc: Change frequency according to vop frame bandwidth
Sometimes the vop line bandwidth is not high, the vop also report
buf empty err, and the frame bandwidth is high at this time, so change
ddr frequency according to frame bandwidth can fix the error.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ia893a07def99aaaa4da421b6d619a8fd3eec9745
2021-10-26 18:07:07 +08:00
Sandy Huang
15201ca7b3 drm/rockchip: vop2: add calculate current frame data size
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ie9c92c651b8c379c77aac941d03bf3f772ed7eea
2021-10-26 18:07:04 +08:00
Yiqing Zeng
7bda16fadf media: i2c: sc5239 fix logic gain error
sc5239 have logic gain for analog, it can improve the image quality for
raw data.

Signed-off-by: Yiqing Zeng <zack.zeng@rock-chips.com>
Change-Id: I03a17f21d1457aa60a7438b4a4895493e879be28
2021-10-26 17:53:36 +08:00
Algea Cao
f4e8f555a4 drm/rockchip: dw_hdmi: Add rk356x hdmitx phy pll cfg
After testing, if use previous hdmitx pll cfg , rk356x some
chips will appear 297M tmds clock output abnormal. After
signal testing, it was decided to update the vendor
recommended pll cfg.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: If1ca2f9e5922c9b95b1d90055640daafcacc2301
2021-10-26 16:43:27 +08:00
Cai YiWei
05332f7eb9 media: rockchip: isp: sync multi vir dev stream on/off
Change-Id: I851b0390952a4f3921405a7cd24b8af7fbaff532
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-10-26 10:15:08 +08:00