Commit Graph

862956 Commits

Author SHA1 Message Date
William Wu
241a5e5577 usb: gadget: f_uvc: add suspend and resume function
This patch adds uvc_function_suspend and uvc_function_resume
for uvc function. With this patch, if usb bus enter suspend
or resume state, the usb controller driver will call the
uvc_function_suspend or uvc_function_resume to send event
to uvc app.

Change-Id: I9c584aae25298747c5a287243cb3efd71c8adfe6
Signed-off-by: William Wu <william.wu@rock-chips.com>
2021-03-25 14:13:10 +08:00
Cai YiWei
f8b5452aae media: rockchip: isp: support multi dev for isp21
Change-Id: I5973f952d0b744448025496c29a1c6b4c5316db3
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-03-25 14:12:44 +08:00
Ville Syrjälä
b5529311af UPSTREAM: drm/edid: Add CTA-861-G modes with VIC >= 193
Add a second table to the cea modes with VIC >= 193.

v2: Improve the comment for cea_modes_*[] to indicate
    that one should always use cea_mode_for_vic() (Tom)

Cc: Hans Verkuil <hansverk@cisco.com>
Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>
Reviewed-by: Thomas Anderson <thomasanderson@google.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191213174348.27261-3-ville.syrjala@linux.intel.com
(cherry picked from commit f7655d42fc)
Change-Id: Ie8889d9062cdadfa3416ea35caf1b8ecca24cadc
2021-03-25 11:33:39 +08:00
Ville Syrjälä
c417ed8f46 UPSTREAM: drm/edid: Abstract away cea_edid_modes[]
We're going to need two cea mode tables (one for VICs < 128,
another one for VICs >= 193). To that end replace the direct
edid_cea_modes[] lookups with a function call. And we'll rename
the array to edid_cea_modes_0[] to indicate how it's to be
indexed.

v2: Fix typos (Tom)
    Drop the pointless NULL checks in the loops (Tom)
    Assign when declaring (Tom)
    Improve the comment for cea_modes_*[] to indicate
    that one should always use cea_mode_for_vic() (Tom)

Cc: Tom Anderson <thomasanderson@google.com>
Cc: Hans Verkuil <hansverk@cisco.com>
Cc: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191213174348.27261-2-ville.syrjala@linux.intel.com
Reviewed-by: Thomas Anderson <thomasanderson@google.com>
(cherry picked from commit 7befe621ff)
Change-Id: I97f9bfe67f0b4b7f2f4da53105d625add04b8f8b
2021-03-25 11:32:49 +08:00
Ville Syrjälä
01235a497c UPSTREAM: drm/edid: Add CTA-861-G modes with VIC < 128
Fill out our list of cea modes with the new stuff from CTA-861-G.
We only do the modes with VIC < 128 here. Adding the higher
numbered VICs will need some slight code refactoring first.

Cc: Hans Verkuil <hansverk@cisco.com>
Cc: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190711103234.6294-2-ville.syrjala@linux.intel.com
Reviewed-by: Shashank Sharma <shashank.sharma@intel.com>
(cherry picked from commit 978f6b0693)
Change-Id: I3fe74dc92e0f97e74445fc348962c2cd05155063
2021-03-25 11:31:17 +08:00
Jon Lin
483a2cd58a spi: rockchip: Stop spi slave dma receiver when cs inactive
The spi which's version is higher than ver 2 will automatically
enable this feature.

If the length of master transmission is uncertain, the RK spi slave
is better to automatically stop after cs inactive instead of waiting
for xfer_completion forever.

Change-Id: If99e51d35391b824f48e31a3e4508db036593c8a
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-03-25 10:24:37 +08:00
Vicent Chi
b33df72292 media: i2c: add techpoint driver
Change-Id: I6022492c26a9d792773de28f2ae05e817a9040e8
Signed-off-by: Vicent Chi <vicent.chi@rock-chips.com>
2021-03-25 09:26:04 +08:00
Yu Qiaowei
7918accd02 video/rockchip: rga2: Support 8G DDR.
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I2583cd7f96362803fd57a25f42aad21e23e837d4
2021-03-25 09:18:37 +08:00
Tao Huang
b8c64fbca6 media/i2c/soc_camera: remove unused rockchip drivers
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I898b1035c9d591143ec35e7b4c137603201ef89a
2021-03-24 18:52:38 +08:00
Vicent Chi
8f94f92285 media: platform: cif: not allow reset work after all streams off
Change-Id: Ifceccb3788dae7a95dae09a0c524a52b33808a26
Signed-off-by: Vicent Chi <vicent.chi@rock-chips.com>
2021-03-24 16:57:35 +08:00
Allon Huang
f8df77d207 media: platform: rockchip: cif: support bt656/bt1120 multi channels function
Signed-off-by: Allon Huang <allon.huang@rock-chips.com>
Change-Id: I0eb7c4d2a9d5d99eb69627741febedc09133ff21
2021-03-24 16:57:35 +08:00
Allon Huang
c1a4ffeb64 media: rockchip: cif: fix rk356x dvp pclk polarity
Signed-off-by: Allon Huang <allon.huang@rock-chips.com>
Change-Id: Ia5a41bf7b428c61d4b79911a88f9b93928de0ac6
2021-03-24 16:57:35 +08:00
Allon Huang
12a285bed1 media: platform: rockchip: cif: support YUYV for y swap in bt1120
Signed-off-by: Allon Huang <allon.huang@rock-chips.com>
Change-Id: I7a38f3a881be0689f3bf37736944cd7563c644ea
2021-03-24 16:57:35 +08:00
Allon Huang
cd0b093f5a media: platform: rockchip: cif: register sd itf when cif pipeline completed
Signed-off-by: Allon Huang <allon.huang@rock-chips.com>
Change-Id: I4025d325f0e5dee52a692a302a5cef699adfd6c9
2021-03-24 16:57:35 +08:00
Ding Wei
4d5fcff848 arm64: dts: rockchip: rk3568: rkvenc: remove advanced-rates for safety
Change-Id: Ie1c4a45c084a6bc98359868db54c6a333489cd45
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-03-24 10:57:49 +08:00
Zefa Chen
6e50af3b41 media: move rk_vcm_head.h from drivers/media/i2c/ to include/uapi/linux/
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I1774f05820df31468db8df196dccc7475730b1b5
2021-03-23 14:18:14 +08:00
Herman Chen
9ff59c732d video: rockchip: mpp: Add session index
Change-Id: I1b55227b0692e84ee28a1b229b38a1ad118b1e5b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-23 11:43:51 +08:00
Liu, Changcheng
37af141aeb UPSTREAM: dts: remove cris & metag dts hard link file
arch cris & metag have been removed from supported archs.
The dts hard link files should also be removed, or the ctags
tool will give warning.

execute"ctags -R" or "gtags", output:
ctags: Warning: cannot open source file
"scripts/dtc/include-prefixes/cris" : No such file or directory
ctags: Warning: cannot open source file
"scripts/dtc/include-prefixes/metag" : No such file or directory

This patch was override by commit 9820464afd ("UPSTREAM:
devicetree: Move include prefixes from arch to separate
directory"), so apply it again.

Change-Id: I002617cde3f879bc8364f55502839b3c3cd2dd92
Signed-off-by: Liu Changcheng <changcheng.liu@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
(cherry picked from commit 8d14f31ec9)
2021-03-23 11:09:24 +08:00
Wyon Bi
27bd6e4c11 drm/bridge: analogix_dp: Disable AUX CH in analogix_dp_bridge_disable()
Change-Id: I0eb7175619719c0b13a48cf4e82ed983b09c57ec
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2021-03-23 10:23:22 +08:00
Binyuan Lan
7f65256297 ASoC: rockchip: add rt5651_rk628 driver
add rockchip_rt5651_rk628 machine driver to support HDMIIn function

Signed-off-by: Binyuan Lan <lby@rock-chips.com>
Change-Id: I893afca69ba555a3a05751df32aa4461720d3ca4
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
2021-03-23 10:09:52 +08:00
Liang Chen
d85728da36 arm64: dts: rockchip: rk3568: adjust opp-talbe when low-temp
Change-Id: I21a6394f9c4473ca6d98f46c2d2a9527e2eaabd2
Signed-off-by: Liang Chen <cl@rock-chips.com>
2021-03-22 17:41:20 +08:00
Jon Lin
b0a6ec201f dt-bindings: spi: spi-rockchip: add description for rv1126 and rk3568
Change-Id: Ie54950ea83bfcd129cbb7295dc96158aa2badc7a
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-03-22 17:25:07 +08:00
Joseph Chen
f977519828 mfd: rk808: add reboot cmd list for PMIC to reset the 'RST' related register only
When system restart, there are two rst actions of PMIC sleep if
board hardware support:

- 0b'00: reset the PMIC itself completely.
- 0b'01: reset the 'RST' related register only.

In the case of 0b'00, PMIC reset itself which triggers SoC NPOR-reset
at the same time, so the command: reboot load/bootload/recovery, etc
is not effect any more.

We add a cmd list to check if this reboot cmd is what we expect for 0b'01.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib87d031a9dc2edc3d0ee2ba5bfb0d647696bf494
2021-03-22 16:51:35 +08:00
Herman Chen
25e8ceb642 video: rockchip: mpp: common: remove work_lock
Remove work_lock in mpp_taskqueue.

Change-Id: Ideda9e23acae5df9aa91136d9d4678d9ee4e2c7e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-22 14:34:21 +08:00
Cai YiWei
0a70e9461d media: rockchip: isp: make sure 3dlut no continuous read twice
if 3dlut enable and 3DLUT_UPDATE = 1,
will start read lut at following case:
1. isp force update
2. frame end
2->1 shouldn't for 3dlut.

Change-Id: I82d03836035bc06e25839fe4d90dba7cd36c2e1a
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-03-19 17:20:32 +08:00
Wyon Bi
2dc370f09b clk/rockchip/regmap: divider: Make round to closest divider valid
Change-Id: I6cff98ec7573f6774700bbbd2650b6e3a01b66f0
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2021-03-19 16:46:33 +08:00
Wyon Bi
696ecdc30f drm/bridge: analogix_dp: disable PSR feature by default
Panel Self Refresh (PSR), originally introduced in eDP v1.3, is an
optional feature for Source and Sink devices.

Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I39c357d7caefc087241407a7d6b452e47e16eb9a
2021-03-19 16:07:44 +08:00
Wang Panzhenzhuan
b58f0ed84f media: i2c: ov8858: update ov8858 sensor driver
1. fix g_mbus_config lane config issues
2. add debug info
3. add r1a version support

Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I7ef54d8216597963a90e60d5a57859818c07c929
2021-03-19 14:14:54 +08:00
Yu Qiaowei
99caf7cb77 video/rockchip: rga2: Support 8K resolution.
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Icf7a3aa835560abab1b7d6981952aa1534a4f694
2021-03-19 09:51:43 +08:00
Huang zhibao
02f02fc91e arm64: configs: rockchip_linux_defconfig: enable rk618 hdmi
This is needed for rk3568 nvr demo board

Signed-off-by: Huang zhibao <hzb@rock-chips.com>
Change-Id: I061c86af72d3ebad8e36c4218cb895dcfbfaabd7
2021-03-18 15:30:28 +08:00
Huang zhibao
e832e5d252 arm64: dts: rockchip: rk3568-nvr: add rk618 hdmi support
Signed-off-by: Huang zhibao <hzb@rock-chips.com>
Change-Id: If3f14ba1d3f9599fd3be967110aa9cf7684b2cd9
2021-03-18 15:30:11 +08:00
Yifeng Zhao
9fbd6619b0 phy: rockchip: naneng-combphy: modify SSC config for SATA
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: Icdb2079028df1edb8973608ad08a51113e1c9ce8
2021-03-18 15:29:06 +08:00
Lin Jinhan
f3a369407e crypto: rockchip: v2 fix bug calculations stuck when buffer not align
Data will divide into multi parts to calculating while buffer not
aligned, and crypto BC_CTL/HASH_CTL only be initialized at first
time. Crypto module will be stuck at second calculations if
BC_CTL/HASH_CTL is cleared after every calculations.

Change-Id: I753c4cefbcefcbf38f36f9a6798f406979b4d17d
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2021-03-18 14:29:32 +08:00
Cai YiWei
658587bd61 media: rockchip: ispp: check SHARP_CORE_CTRL after update
Change-Id: Iad0d7b2c1e9a0f1222d5055656b598ce542b6d54
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-03-18 14:27:39 +08:00
Joseph Chen
83c84e65c4 PM / sleep: update pm state after state message print
If update too early, the message is always "deep" even mem_sleep
is lite or ultra.

We expect the right message:
    "PM: suspend entry (ultra)" or "PM: suspend entry (lite)".

Fixes: 362667b0e3 ("PM / sleep: support mem_lite/mem_ultra mode")
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I15086d04cd05ec9f296c92e2f9adb8c0bfa32f33
2021-03-18 14:25:22 +08:00
Tao Huang
9a4bafebd2 rk: add "WITH Linux-syscall-note" to SPDX tag of uapi headers
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I4c5994349586905abf7ec44c9c01f22f8e3bfa37
2021-03-18 09:31:36 +08:00
Andy Yan
8e964a33a1 drm/rockchip: vop2: print module name when dump register
Change-Id: Ifaee56deff46ac0156831a37cbf7b77586beab84
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-03-17 17:34:21 +08:00
Ren Jianing
5bdeec86b6 arm64: dts: rockchip: rk3566-box: fix combphy1 ref-clk to 100MHz
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: I2808f908d087843aba7c4c0fd769b7c80518c022
2021-03-17 17:33:28 +08:00
Ren Jianing
365de1ccfa phy: rockchip: inno-usb2: add pre-emphasis at RK356x tuning
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: Ie6375b363d4ca641b971b331971ce7985d985075
2021-03-17 17:33:19 +08:00
Sandy Huang
f07e966dbd drm/rockchip: vop2: turn down scale fac cali log level
Change-Id: I13395bfb054c170dd58de4af4bccb35a52565dfa
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2021-03-17 15:18:49 +08:00
Zefa Chen
1cb6be0adb media: i2c: sensor driver add g_mbus_config for isp2
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I14dfc95c06ab93843a7c9956e7da5b04cdb820bb
2021-03-17 15:18:37 +08:00
William Wu
a140608dec usb: dwc3: gadget: fix request already in flight
Test on RV1126 board with UVC function. When do UVC streaming on/off
@H265 3840 * 2160 stress test, it fails to streaming on UVC with the
following log:

[ 1589.834573] WARNING: CPU: 3 PID: 3075 at drivers/usb/dwc3/gadget.c:1611 dwc3_gadget_ep_queue+0x148/0x178
[ 1589.834593] ep3in: request 638c13d3 already in flight
[ 1589.834603] Modules linked in: galcore(O)
[ 1589.834622] CPU: 3 PID: 3075 Comm: kworker/3:2 Tainted: G        W  O      4.19.111 #2
[ 1589.834631] Hardware name: Generic DT based system
[ 1589.834648] Workqueue: events uvcg_video_pump
[ 1589.834673] [<b010f408>] (unwind_backtrace) from [<b010b96c>] (show_stack+0x10/0x14)
[ 1589.834741] [<b010b96c>] (show_stack) from [<b0645104>] (dump_stack+0x90/0xa4)
[ 1589.834766] [<b0645104>] (dump_stack) from [<b0126204>] (__warn+0xfc/0x114)
[ 1589.834787] [<b0126204>] (__warn) from [<b0126260>] (warn_slowpath_fmt+0x44/0x68)
[ 1589.834806] [<b0126260>] (warn_slowpath_fmt) from [<b04571d8>] (dwc3_gadget_ep_queue+0x148/0x178)
[ 1589.834826] [<b04571d8>] (dwc3_gadget_ep_queue) from [<b0472074>] (uvcg_video_pump+0x94/0x164)
[ 1589.834849] [<b0472074>] (uvcg_video_pump) from [<b013cce0>] (process_one_work+0x1f0/0x408)
[ 1589.834869] [<b013cce0>] (process_one_work) from [<b013d9b8>] (worker_thread+0x30/0x564)
[ 1589.834891] [<b013d9b8>] (worker_thread) from [<b0142910>] (kthread+0x140/0x170)
[ 1589.834907] [<b0142910>] (kthread) from [<b01010d8>] (ret_from_fork+0x14/0x3c)
[ 1589.834922] Exception stack(0xbbdfffb0 to 0xbbdffff8)
[ 1589.834938] ffa0:                                     00000000 00000000 00000000 00000000
[ 1589.834953] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1589.834966] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 1589.834979] ---[ end trace b30d445a1f050523 ]---
[ 1589.834979] ---[ end trace b30d445a1f050523 ]---
[ 1589.834992] Failed to queue request (-22).

It's because that the __dwc3_gadget_start_isoc is called very late after
XferNotReady, so the frame number is outdated and start transfer fail
with the cmd_status "DEPEVT_TRANSFER_BUS_EXPIRY". In this case, the dwc3
driver return -EINVAL to the UVC function driver without delete and unmap
the failed request, this cause the request requeue fail next time.

Change-Id: I4cc919bcd4e1e0abbb6a929483e6fc2fe7dc9750
Signed-off-by: William Wu <william.wu@rock-chips.com>
2021-03-17 15:14:39 +08:00
Michael Olbrich
582ea1370a UPSTREAM: usb: dwc3: gadget: make starting isoc transfers more robust
Currently __dwc3_gadget_start_isoc must be called very shortly after
XferNotReady. Otherwise the frame number is outdated and start transfer
will fail, even with several retries.

DSTS provides the lower 14 bit of the frame number. Use it in combination
with the frame number provided by XferNotReady to guess the current frame
number. This will succeed unless more than one 14 rollover has happened
since XferNotReady.

Start transfer might still fail if the frame number is increased
immediately after DSTS is read. So retries are still needed.
Don't drop the current request if this happens. This way it is not lost and
can be used immediately to try again with the next frame number.

With this change, __dwc3_gadget_start_isoc is still not successfully in all
cases bit it increases the acceptable delay after XferNotReady
significantly.

Change-Id: I656b487b9a265921ae612a071ebcd496ffe5f510
Reviewed-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit c5a7092f40)
2021-03-17 15:14:39 +08:00
Xing Zheng
81b3c14f77 ASoC: rockchip: pdm: fix the missing register sound with 'rockchip,path-map' property
The return value equal 0 should be correct.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Change-Id: Id0ac8012f4e2eeb95a4dbf590f02843cbc3c863f
2021-03-17 14:01:36 +08:00
Shawn Lin
c84a4aa411 PCI: rockchip: dw: Move deassert #PERST after enabling LTSSM
It was recommended by ECN document, so following it will make
less risk in probing devices in case the refclk is coming from
SoC.

Change-Id: Ic4514f373b6014c406d5436738419c64df6d32b2
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2021-03-17 11:19:17 +08:00
Andy Yan
9a75da1582 drm/rockchip: vop2: Fix wait fs_by_vcnt in interlace mode
Change-Id: I940c690b8b4246b38ec94847fd2d2b0f8d481888
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-03-17 10:13:55 +08:00
Andy Yan
09d4b2c521 drm/rockchip: vop2: wait for fs by intr raw status
Change-Id: Idda6f973e70aa1ea0146e023173829555ccaa551
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-03-17 10:13:55 +08:00
Algea Cao
e616f98e1c drm: rockchip: dw-hdmi: Clean output_if when hdmi disable
To support multi-display output_if must be clean when
hdmi disable.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ic4205a59ce1adab7f4ac6f673c740a14556fdeae
2021-03-17 09:03:00 +08:00
Finley Xiao
c472f79a09 PM / devfreq: rockchip_dmc: Add SYS_STATUS_CIF0/1 system status support
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ie683ed0cc49b21ec95765396a73e2e7a3f7cbb04
2021-03-16 17:16:12 +08:00
Huang zhibao
241b780cac arm64: dts: rockchip: rk3568-nvr: set rockchip,default-max-load to 100
Signed-off-by: Huang zhibao <hzb@rock-chips.com>
Change-Id: I31859f56b753635999414342d934d18fa68298ad
2021-03-16 14:47:14 +08:00