Commit Graph

1066696 Commits

Author SHA1 Message Date
Jianqun Xu
3212cfb965 dma-buf: heaps: system_heap: partial sync with sgtable from heap buffer
The dma-heap will allocate a scatterlist table at alloc time and store
into the heap buffer. Usually a device should attach to the dmabuf and
then map the dmabuf with the attachment, a new scatterlist table will be
created and set during dma map.

In the dma map, the sg_dma_address will be set for the first scatter of
the scatterlist table, if the device has a iommu domain, sg_dma_address
is set with the iova start address, else it will be set with a physical
address.

For a dmabuf hasn't been dma mapped, the sg_dma_address is a error value
(-1 = DMA_MAPPING_ERROR).

The partial sync hits the case that no device mapped to the dmabuf.

It's not easy to support both iommu/no iommu devices for partial sync,
this patch make the partial sync simple to implement for no iommu case.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Ib5d0715c4bde95bc444d6fbb873456c94755f550
2022-07-15 16:53:56 +08:00
Jianqun Xu
4925881228 dma-buf: heaps: system_heap: fix to for_each_sgtable_sg
Switch to use for_each_sgtable_sg to use orig_nents instead of nents for
the for the partial sync sgl.

struct sg_table is a common structure used for describing a memory
buffer. It consists of a scatterlist with memory pages and DMA addresses
(sgl entry), as well as the number of scatterlist entries: CPU pages
(orig_nents entry) and DMA mapped pages (nents entry).

It turned out that it was a common mistake to misuse nents and orig_nents
entries, calling the scatterlist iterating functions with a wrong number
of the entries.

To avoid such issues, lets introduce a common wrappers operating directly
on the struct sg_table objects, which take care of the proper use of
the nents and orig_nents entries.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I3f88b98f43b07f97c56b949f7625bebbc65dec26
2022-07-15 16:53:56 +08:00
Lin Jinhan
8050236b61 ARM: configs: rv1106-smart-door: enable ROCKCHIP_HW_DECOMPRESS_USER
Startup time  : essentially unchanged.
Firmware size : increase about 1KByte.

Change-Id: Ib079e04681a3249132bff2b298f8c4945af3d20a
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2022-07-15 15:42:43 +08:00
Lin Jinhan
2035a4673c soc: rockchip: add hardware decompression user interface
Export the hardware decompression interface to the user layer.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I033f0beabc2e44022418dcd06798ad94e971ff10
2022-07-15 15:42:35 +08:00
Yu Qiaowei
17b7ac8a5b video: rockchip: rga3: check mm_flag when mapping dma-buf
This part of the information is printed when the mapping fails
due to MMU limitations.

Update driver version to 1.2.17

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I2d6e4219ebc54d285bc9c25742f93503f7633b5e
2022-07-15 15:42:11 +08:00
Yu Qiaowei
fb617a18f5 video: rockchip: rga3: remove useless code about rga_job
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I004f35942c3300a173b0aae785bc750bb0497a55
2022-07-15 15:42:11 +08:00
Yu Qiaowei
a74de1825b video: rockchip: rga3: Get current_mm in request
Make sure to get the correct current_mm in asynchronous mode.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Iec2b989e072b68b88d920ce8591924168bac3a7e
2022-07-15 15:42:11 +08:00
Yu Qiaowei
5bd1341b7f video: rockchip: rga3: mpi-mode adapted to batch mode
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I51f38752edc49bb6d47b657a185f0dbfcecf133f
2022-07-15 15:42:11 +08:00
Yu Qiaowei
c93d87e863 video: rockchip: rga3: blit-command adapted to batch mode
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I1b5d25396cf26b10df8c4e62357ec0e203018b7b
2022-07-15 15:42:11 +08:00
Yu Qiaowei
0251aeb09b video: rockchip: rga3: fixed no put_request when request_config exits abnormally
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I82f359e6bec4c405642c8e0fb870596f5713ccb9
2022-07-15 15:42:11 +08:00
Jianqun Xu
aab138a4a6 drm/rockchip: rockchip_drm_vop2 avoid division by zero
WARN on when the frame time is '0'.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Id949b5b9178f67b54622439e8f95c23236f6f1c9
2022-07-15 15:22:53 +08:00
Tao Huang
252911111b media: rockchip: ispp: set vfs-only exports into their own namespace
According to gki commit d483eed85f ("ANDROID: GKI: set vfs-only exports into their own namespace").

ERROR: modpost: module video_rkispp uses symbol kernel_write from namespace VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver, but does not import it.
ERROR: modpost: module video_rkispp uses symbol filp_open from namespace VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver, but does not import it.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ia96b7434d14187e0f3fce5bdf59956d3644db50c
2022-07-15 14:57:58 +08:00
Tao Huang
42a2baccb2 input: touchscreen: gt1x: set vfs-only exports into their own namespace
According to gki commit d483eed85f ("ANDROID: GKI: set vfs-only exports into their own namespace").

ERROR: modpost: module gt1x-ts uses symbol filp_open from namespace VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver, but does not import it.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I2b25adf85977f90958292ef2af91c1ab6e5aa3e4
2022-07-15 14:57:47 +08:00
Tao Huang
8eb1d1f6c0 input: touchscreen: elan5515: set vfs-only exports into their own namespace
According to gki commit d483eed85f ("ANDROID: GKI: set vfs-only exports into their own namespace").

ERROR: modpost: module tp_elan_5515 uses symbol filp_open from namespace VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver, but does not import it.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I22f2fd565c01e804d1e252d6a33dcb62a7b73f62
2022-07-15 14:57:35 +08:00
Tao Huang
264acab70b input: sensors: mc3230: set vfs-only exports into their own namespace
According to gki commit d483eed85f ("ANDROID: GKI: set vfs-only exports into their own namespace").

ERROR: modpost: module mc3230 uses symbol filp_open from namespace VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver, but does not import it.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I29d6a1c79987dc30f4870c42e2995e7045e635ac
2022-07-15 14:57:21 +08:00
Tao Huang
31d7384ebb drm/rockchip: cdn-dp-core: Fix cdn_dp_connector_mode_valid return type
mode_valid should return enum drm_mode_status.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I5525403ad0d637dd41c3ac805d92d186332a8c5b
2022-07-15 14:50:34 +08:00
Tao Huang
5d64d87645 drm/rockchip: dsi2: Fix dw_mipi_dsi2_connector_mode_valid return type
Fix CFI violation:
Kernel panic - not syncing: CFI failure (target: dw_mipi_dsi2_connector_mode_valid+0x0/0x8)

mode_valid should return enum drm_mode_status.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ic59e7dda400c7eb18c8b29d6889f4a88d277a780
2022-07-15 14:39:00 +08:00
Zefa Chen
aa12781766 media: rockchip: vicap fixed toisp fs interrupt mask error
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I524c60e2c99f49a98b90d5e18aa50592c55863d2
2022-07-14 20:21:27 +08:00
Zefa Chen
0bd81e611e media: i2c: sensor adapter add ioctl RKMODULE_SET_SENSOR_INFOS
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: Id1a95c59168a59b4612b779ebb41e4ad711943f0
2022-07-14 20:19:47 +08:00
Zefa Chen
1e7c74a7aa include: uapi: linux: rk-camera-module: add commond RKMODULE_SET_SENSOR_INFO
Its for sensor adapter to sync all of sensor state, to avoid isp getting the wrong state
in the case of app execution order: sensor0 config param -> run isp0 ... sensorn config param -> run ispn

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I90cc6a1716d5198150b5a0897ada0412622b72d3
2022-07-14 20:09:36 +08:00
Tao Huang
8106e54bdf net: wireless: rockchip: rkwifi: bcmdhd: set vfs-only exports into their own namespace
According to gki commit d483eed85f ("ANDROID: GKI: set vfs-only exports into their own namespace").

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ie75429695e0f23ada39d8677a918e5b1c0b8fd97
2022-07-14 19:44:59 +08:00
Tao Huang
18f2a774bc rk: Makefile: Call gcc-wrapper.py use absolute path
Fixes: c2482146d1 ("rk: Makefile: add gcc-wrapper")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I6442c206c797573d57ef1976b4a30316235f4e03
2022-07-14 19:44:59 +08:00
Jianqun Xu
f2f7901e85 power: supply: rk817_battery avoid division by zero
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I811e0a0720a17879bfe36c03b44c2bbfd35355a6
2022-07-14 14:37:19 +08:00
Cai YiWei
7b7b2c475a media: rockchip: isp: add slab.h fix compile
Change-Id: Ie062a9ab953c1d8f9210f895af14e35d775917c3
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-07-14 14:26:37 +08:00
Algea Cao
37b7830dd3 drm/rockchip: dw_hdmi: Get uboot hdmi color format
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I06bbd4a8888716a4b209a81f219309304a18420f
2022-07-14 14:25:59 +08:00
Zefa Chen
3417af9ec0 phy: rockchip: csi2-dphy: fixed logic error about clk1_en
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I03dc62115346a5908d27ecf83b1705a96dc4bd53
2022-07-14 14:14:40 +08:00
Frank Wang
e96b693e05 usb: gadget: uvc: add uvc_num_request attribute
Adding uvc attribute "uvc_num_request" to set the number of uvc
requests by configfs, the maximum limit is 64, and the recommended
value is 2.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: I6031ba0b569a4ff53e16a59a5bcce021d80823db
2022-07-14 11:22:40 +08:00
Michael Grzeschik
8b66f0c181 UPSTREAM: usb: gadget: uvc: make uvc_num_requests depend on gadget speed
While sending bigger images is possible with USB_SPEED_SUPER it is
better to use more isochronous requests in flight. This patch makes the
number uvc_num_requests dynamic by changing it depending on the gadget
speed.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20210628155311.16762-3-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 229140375
Signed-off-by: Dan Vacura <w36195@motorola.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: I1385bf8f973f3e5ee6c76193bffe0046eca22439
(cherry picked from commit 5d084e9710)
2022-07-14 11:22:40 +08:00
Frank Wang
2df103be0d Revert "usb: gadget: uvc: add a new attribute uvc_num_request"
This reverts commit fbb23b9e8c.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: I62ef3bc763ab6d318d80ccef64fdb17d8c67998b
2022-07-14 11:22:40 +08:00
Zefa Chen
e2cb0f408f media: i2c: sensor adapter support set frame_interval
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I4273a898c35b52ee16cd7132b08c5eb49bde106b
2022-07-14 11:20:08 +08:00
Jianqun Xu
d741b100b4 clk: rockchip: avoid unintentional integer overflow in rockchip_rk3588_pll_recalc_rate()
Fixes: 58c1fa2ef2 ("clk: rockchip: add pll type for RK3588")
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I840458595475e9e1bb6df74453829ea22dd2d729
2022-07-14 11:18:13 +08:00
Zefa Chen
8704b56415 media: rockchip: vicap supports anomaly detection
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I205c9673f7f567597ec3c9e42d5cec1a58b87f5b
2022-07-14 10:57:58 +08:00
Zefa Chen
f1082a51d0 include: uapi: rkcif-config: add reset CMD
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I52ca7f84b6afcb8f286604fbef7e0940a9b20a4a
2022-07-14 10:57:04 +08:00
Sugar Zhang
bd0b0782e7 ARM: dts: rv1106-uvc: Add support pll frac mode for audio
This patch add pll frac freq around 1G for audio product,
which will do fine tune pll for async clk situation,
such as BT, UAC.

Because we have no much more PLLs, and much more devices
share the same PLL, so, we should setup around 1G to serve
all the devices.

PLLs in rv1106:

  APLL: CPU
  DPLL: DDR
  GPLL: DEVICES
  CPLL: DEVICES

  GPLL: 1188MHz
  CPLL: 1000MHz

* PLLs support frac mode:

  GPLL
  DPLL

So, the only way to use audio pll frac freq is to switch to
use GPLL. and switch the role of GPLL and CPLL.

  GPLL: audio frac freq (~1G)
  CPLL: 1188MHz

Tested by UAC product, so, we first address this. and, of course,
there still have chance apply this to other situation, such as IPC.
but, need more test. at this time, we just handle for UAC.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ief13456b6274802836266228d3288d91a148feff
2022-07-13 17:31:12 +08:00
Sugar Zhang
1fd942ea8b clk: rockchip: rv1106: Add pll frac freq for audio
This patch add pll frac freq around 1G for audio product,
which will do fine tune pll for async clk situation,
such as BT, UAC.

Because we have no much more PLLs, and much more devices
share the same PLL, so, we should setup around 1G to serve
all the devices.

PLLs in rv1106:

  APLL: CPU
  DPLL: DDR
  GPLL: DEVICES
  CPLL: DEVICES

  GPLL: 1188MHz
  CPLL: 1000MHz

* PLLs support frac mode:

  GPLL
  DPLL

So, the only way to use audio pll frac freq is to switch to
use GPLL. and switch the role of GPLL and CPLL.

  GPLL: audio frac freq (~1G)
  CPLL: 1188MHz

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: If26f464ac88cd21195db14084f8b4e9ffb457890
2022-07-13 17:31:12 +08:00
Jon Lin
01dd2b51d5 spi: rockchip-test: Support ACPI
Change-Id: I380953abb9ee33193bed7a40402d65cbfff8fd5d
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-07-13 16:41:21 +08:00
Jon Lin
dc77526fb0 spi: rockchip: Support ACPI
1.Remove the dependence on the linux clock framework
2.Change to use the compatible APIs to get device property
3.Add the necessary device property "clock-frequency" for ACPI

Change-Id: I6b996ad4fba8af8d871633947a9eb6a38b8c8707
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-07-13 16:41:21 +08:00
shengfei Xu
1294d14b48 arm64: configs: rockchip_defconfig: enable CONFIG_CHARGER_SGM41542
Enable CONFIG_CHARGER_SGM41542 used for sgm41542 which found on
rk3588s tablet

Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Change-Id: Ieeeebfe2dde83f40a7589a6fa0418e01ad3433cf
2022-07-13 16:30:43 +08:00
Jianqun Xu
9b7d213684 regulator: rk806: fix a copy-paster error
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I8b632e809c10da9d5eb5627d32a63d6418967f9f
2022-07-13 16:19:29 +08:00
Jianqun Xu
66a2112baa soc: rockchip: rockchip_system_monitor: fix a likely copy-paster error
The global structure system_monitor is same as argument from the
function for rockchip_system_monitor_parse_dt, fix to monitor to make
code easy to read.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I2e0412e9aac697e34e3cc35e1547e837ae7f69b8
2022-07-13 16:16:16 +08:00
Jianqun Xu
35a6ba5aa9 gpio/rockchip: avoid division by zero
If the clk_get_rate return '0', it will happen division by zero.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I1d2c6b12b961a78629f22496fe8f8b685b27dc09
2022-07-13 16:15:03 +08:00
Jianqun Xu
498aa5fd36 phy: rockchip: phy-rockchip-typec fix bad bit shift operation
Remove PHY_DP_POWER_STATE_DISABLED.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Reviewed-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I374341916916a0a3e0753b9fb7d071cea949bfa5
2022-07-13 15:58:34 +08:00
Chen Shunqing
ec31f2140f media: rockchip: hdmirx: add hdcp2 support
Signed-off-by: Chen Shunqing <csq@rock-chips.com>
Change-Id: I71146b743c1957a97333cbe1e35c1754cf6f1c90
2022-07-12 16:34:37 +08:00
Algea Cao
f023c52a1f drm/bridge: synopsys: dw-hdmi-qp: Support VSI packet
1.Support 3d mode.
2.Support hdmi1.4 4K resolution VIC number.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ifa424fc89f35ba8045de53929a925821d3e24c92
2022-07-12 16:29:33 +08:00
Lei Chen
62f29586ed drm/rockchip: logo: add resolution types without EDID
Fix the problem that the kernel cannot match the corresponding resolution
when 1080P is used to force output

Signed-off-by: Lei Chen <lei.chen@rock-chips.com>
Change-Id: I5ccc7ee026d4d68935e91f7d05fa3d21a5b26811
2022-07-12 16:29:17 +08:00
Tony Xie
85adeb4f55 serial: 8250_dw: don't set clk when clk is null for rockchip
Fixes: b205560ab1 ("serial: 8250_dw: set uart clk according to baudrate")
Change-Id: I89593824840b2d1c3f5671f46cd92ddea5929d46
Signed-off-by: Tony Xie <tony.xie@rock-chips.com>
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2022-07-12 16:09:24 +08:00
Wang Xiaobin
9622c8cd5a ARM: dts: rockchip: rv1106g-smart-door: reserved memory for meta
Since meta is enabled, remove unnecessary bootargs.

Signed-off-by: Wang Xiaobin <xb.wang@rock-chips.com>
Change-Id: Ief0a0f9788d2d3c6532d5385595a94f1decc8cf4
2022-07-12 15:25:26 +08:00
Lin Jinhan
16684192b2 ARM: dts: rockchip: rv1106-smd-cam: drop rkcif_mipi_lvds1_sditf
rkcif_mipi_lvds1_sditf is a virtual node that is used to link to ISP node.
An error occurs if you do not link to ISP node when stream off.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I441de230b7af955ff34af0e88ba8d0f318154cfc
2022-07-12 14:10:22 +08:00
Yandong Lin
986d8f9d5f arm64: dts: rockchip: Enable vepu node for rk3588 boards
Fixes: 94a5dd9f32 ("arm64: dts: rockchip: add vepu support and separate jpege for rk3588")
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Idc14891685c81f0103477d264d44a58585756cd5
2022-07-12 11:44:40 +08:00
Yu Qiaowei
759eaa8274 video: rockchip: rga3: Remove useless memory maps
Update driver version to 1.2.16

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I655c4cbc7dcf91769a978ad61700c43fb0e97d90
2022-07-11 20:23:22 +08:00