Commit Graph

847721 Commits

Author SHA1 Message Date
Ding Wei
3186ac2fbc video: rockchip: mpp: add control commands to process fd
1. command to reset all fd in session, used when user space info change
2. command to translate fd into iova
3. command for release fd

Change-Id: I8b9faf1d549901517563b14aaec5c178fdfc4037
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2019-12-23 15:07:39 +08:00
Sandy Huang
88f1e061ff drm/rockchip: vop: add dual channel swap config from dts
some pcb layout dual mipi/lvds channel maybe mistake. we can set
rockchip,dual-channel-swap = <1> to swap the dual channel at dts
file.

Change-Id: I940e1cd6ed006d07d9ba2e629c15472402a0d8e2
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-12-23 15:00:41 +08:00
Sandy Huang
f060f3b7db dt-bindings: display: rockchip: add add dual channel swap config from dts
Change-Id: I6327d90bfdfdf4c3352bdd2124aabfe962dcd268
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-12-23 15:00:32 +08:00
Wu Liangqing
5d65957e62 ARM: dts: rockchip: set gpu Frequency conversion threshold for rk312x
upthreshold = <40>
downdifferential = <10>

Change-Id: I02acc9ee840cbad4ed8b3f17f47719008eec8469
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2019-12-23 14:54:51 +08:00
Wu Liangqing
6bb00eb414 arm64: dts: rockchip: set gpu Frequency conversion threshold for px30
upthreshold = <40>
downdifferential = <10>

Change-Id: I855202385a8ee856793a2e3622e2099e6351c56f
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2019-12-23 14:54:11 +08:00
Liang Chen
4bd29509fe cpufreq: interactive: fix bug: release enable_sem when exit input event
Forget release enable_sem when porting patch.

Fixes: a4524d29de ("cpufreq: interactive: fix race between input event and governor exit")
Change-Id: Icb07b2a7a8ccc48dfd7bd2bc3cc5cbbf28d3c631
Signed-off-by: Liang Chen <cl@rock-chips.com>
2019-12-23 14:51:28 +08:00
Zhen Chen
ffd7b5d081 arm64: dts: rk3399: set gpu frequency conversion threshold
upthreshold = <40>
downdifferential = <10>

Change-Id: I492b973ef7401699dbeeecde8df6d66650155f14
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2019-12-23 11:02:57 +08:00
Kieran Bingham
056f232e72 UPSTREAM: media: uvcvideo: Move decode processing to process context
Newer high definition cameras, and cameras with multiple lenses such as
the range of stereo-vision cameras now available have ever increasing
data rates.

The inclusion of a variable length packet header in URB packets mean
that we must memcpy the frame data out to our destination 'manually'.
This can result in data rates of up to 2 gigabits per second being
processed.

To improve efficiency, and maximise throughput, handle the URB decode
processing through a work queue to move it from interrupt context, and
allow multiple processors to work on URBs in parallel.

Change-Id: I825a107e706a964525dcabba4faa9434f499fd96
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit b012186ace)
2019-12-23 10:16:25 +08:00
Kieran Bingham
e58f39f37d UPSTREAM: media: uvcvideo: Abstract streaming object lifetime
The streaming object is a key part of handling the UVC device. Although
not critical, we are currently missing a call to destroy the mutex on
clean up paths, and we are due to extend the objects complexity in the
near future.

Facilitate easy management of a stream object by creating a pair of
functions to handle creating and destroying the allocation. The new
uvc_stream_delete() function also performs the missing mutex_destroy()
operation.

Previously a failed streaming object allocation would cause
uvc_parse_streaming() to return -EINVAL, which is inappropriate. If the
constructor failes, we will instead return -ENOMEM.

While we're here, fix the trivial spelling error in the function banner
of uvc_delete().

Change-Id: I695d511a6e20b908f5f49da5cdd0833ee3641b92
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit ece41454c6)
2019-12-23 10:15:56 +08:00
Kieran Bingham
b17c9d8251 UPSTREAM: media: uvcvideo: queue: Support asynchronous buffer handling
The buffer queue interface currently operates sequentially, processing
buffers after they have fully completed.

In preparation for supporting parallel tasks operating on the buffers,
we will need to support buffers being processed on multiple CPUs.

Adapt the uvc_queue_next_buffer() such that a reference count tracks the
active use of the buffer, returning the buffer to the VB2 stack at
completion.

Change-Id: Ia42cca9bed7852175202017b042590d844e8c6b0
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 01e90464e4)
2019-12-23 10:15:56 +08:00
Kieran Bingham
1c76016449 UPSTREAM: media: uvcvideo: queue: Simplify spin-lock usage
Both uvc_start_streaming(), and uvc_stop_streaming() are called from
userspace context, with interrupts enabled. As such, they do not need to
save the IRQ state, and can use spin_lock_irq() and spin_unlock_irq()
respectively.

Change-Id: I1cde5a8d9a8890cc2b671d1e32d3b6b4b0eac635
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit c50c9c1e65)
2019-12-23 10:15:56 +08:00
Kieran Bingham
29a2dbd904 UPSTREAM: media: uvcvideo: Protect queue internals with helper
The URB completion operation obtains the current buffer by reading
directly into the queue internal interface.

Protect this queue abstraction by providing a helper
uvc_queue_get_current_buffer() which can be used by both the decode
task, and the uvc_queue_next_buffer() functions.

Change-Id: Ic5401fe9afec00b87bb075f99addae8591de6890
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit e829b262a6)
2019-12-23 10:15:56 +08:00
Kieran Bingham
86d65ab616 UPSTREAM: media: uvcvideo: Convert decode functions to use new context structure
The URB completion handlers currently reference the stream context.

Now that each URB has its own context structure, convert the decode (and
one encode) functions to utilise this context for URB management.

Change-Id: Ib56b25ca4ec049c5eb75ffceda9c2d8a0c1a96cf
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit c6d664fe8a)
2019-12-23 10:15:56 +08:00
Kieran Bingham
eb4572cb39 UPSTREAM: media: uvcvideo: Refactor URB descriptors
We currently store three separate arrays for each URB reference we hold.

Objectify the data needed to track URBs into a single uvc_urb structure,
allowing better object management and tracking of the URB.

All accesses to the data pointers through stream, are converted to use a
uvc_urb pointer for consistency.

Change-Id: I03320cff8ec5cb268b62610b9852b32505f136aa
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 811496c967)
2019-12-23 10:15:56 +08:00
Laurent Pinchart
79774882a3 UPSTREAM: media: uvcvideo: Store device information pointer in struct uvc_device
The device information structure is currently copied field by field in
the uvc_device structure. As we only have two fields at the moment this
isn't much of an issue, but it prevents easy addition of new info
fields.

Fix this by storing the uvc_device_info pointer in the uvc_device
structure. As a result the uvc_device meta_format field can be removed.
The quirks field, however, needs to stay as it can be modified through a
module parameter.

As not all device have an information structure, we declare a global
"NULL" info instance that is used as a fallback when the driver_info is
empty.

Change-Id: I648490fb775891687b6eededafd270dafe50641f
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 3a03284dd4)
2019-12-23 10:15:56 +08:00
Wu Liangqing
3bb31a0e11 ARM: dts: rockchip: rk3126-m88: enabled nandc for emmc and nand compatibility
Change-Id: Ifd5356aaffa00da2ba94897ee66cb0d7e8175994
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2019-12-20 08:40:48 +08:00
Liang Chen
a4524d29de cpufreq: interactive: fix race between input event and governor exit
The input event callback does not check the governor_enabled state on
affected CPUS, which will cause kernel panic because the governor_data
will be NULL when governor exit.

Change-Id: Ic2e5cdaefa519701b23203bb77804ce850a5d349
Signed-off-by: Liang Chen <cl@rock-chips.com>
2019-12-19 18:45:22 +08:00
Tao Huang
8497bd742e ARM: rockchip_defconfig: disable CONFIG_I2C_HID
No android board use hid-over-i2c.
before:
   text         data        bss     dec             hex filename
12536545	4902620	2158240	19597405	12b085d	vmlinux
after:
   text            data     bss     dec             hex filename
12530111	4902420	2158240	19590771	12aee73	vmlinux

Save about 6K.

Change-Id: Idc64bafe267d614041faf7ac0355fffabba8fc36
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-12-19 14:21:01 +08:00
Tao Huang
0afbe9828f ARM: rockchip_defconfig: disable Special HID support
before:
   text            data     bss     dec             hex filename
12756996	5025528	2158624	19941148	130471c	vmlinux
after:
   text            data     bss     dec             hex filename
12536545	4902620	2158240	19597405	12b085d	vmlinux

Save about 336K.

Change-Id: Ie50e85bd2673fa6ec355e79627ee0ccb166921b7
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-12-19 14:20:56 +08:00
Tao Huang
af8c182bbe ARM: rockchip_defconfig: disable some USB_STORAGE drivers
-CONFIG_USB_STORAGE_DATAFAB=y
-CONFIG_USB_STORAGE_FREECOM=y
-CONFIG_USB_STORAGE_ISD200=y
-CONFIG_USB_STORAGE_USBAT=y
-CONFIG_USB_STORAGE_SDDR09=y
-CONFIG_USB_STORAGE_SDDR55=y
-CONFIG_USB_STORAGE_JUMPSHOT=y
-CONFIG_USB_STORAGE_ALAUDA=y
-CONFIG_USB_STORAGE_ONETOUCH=y
-CONFIG_USB_STORAGE_KARMA=y
-CONFIG_USB_STORAGE_CYPRESS_ATACB=y

Save about 51K.

Change-Id: I97a7da23a8112b735bc38136c7853a5fcd13138c
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-12-19 14:19:47 +08:00
Tao Huang
392ef9216d ARM: rockchip_defconfig: disable USB_PRINTER
Save about 7K.

Change-Id: I05ceb64bbb8bc0b1e87b79f8067fd5e93cc2ea28
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-12-19 14:19:39 +08:00
Tao Huang
d55814ef80 ARM: rockchip_defconfig: disable CONFIG_USB_TRANCEVIBRATOR
Useless feature.

Change-Id: I5201b450172f2e9561c07cf9dc9697a805575275
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-12-19 14:19:34 +08:00
Tao Huang
9e7e45c20e ARM: rockchip_defconfig: disable CONFIG_KALLSYMS_ALL
before:
   text		   data	    bss	    dec		    hex	filename
12231986	4559104	2146976	18938066	120f8d2	vmlinux
after:
   text		   data	    bss	    dec		    hex	filename
12232306	3698944	2146976	18078226	113da12	vmlinux

Save about 840K.

Change-Id: I4472a77bdd2533516dd9bf5007d9507939647562
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-12-19 11:25:46 +08:00
Wu Liangqing
30e757b4c4 arm64: dts: rockchip: add adc_keys node for rk3399 board
Change-Id: I0fde323d5924df5389e51abc584cc6eccbcb6166
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2019-12-19 08:45:37 +08:00
Wu Liangqing
addd52e777 arm64: dts: rockchip: rk3399-tve1030g add rk_headset support
Change-Id: I4db0f8caa5011c5d2f4697fe6405316f1974c0f4
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2019-12-18 18:44:50 +08:00
Jianqun Xu
a25827902c arm64: dts: rockchip: remove adc-keys from rk3399-android.dtsi
Change-Id: I4a01cfcc4dfe69cab164836d4b2ecc893d463356
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-12-18 17:46:08 +08:00
Tao Huang
e8c812380f thermal: rk_virtual_thermal: select POWER_SUPPLY when RK_VIRTUAL_THERMAL enabled
Fix build error without POWER_SUPPLY.

Change-Id: I259f914e6e9a945ffdd8676639916a7e07f92d40
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-12-18 17:26:55 +08:00
Tao Huang
c93527b2a3 ARM: configs: remove unused rockchip_sec_defconfig
Rockchip Android/Linux all support TEE now.

Change-Id: I4816ab4e863ab8f859936432438259bd72080713
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-12-18 15:51:13 +08:00
William Wu
df6155fa81 ARM: dts: rockchip: remove unused nodes for rk3288 usb otg
The legacy node "dwc_control_usb" and related properties
is used for dwc_otg_310 driver which has been deprecated,
so remove these unused nodes and properties for rk3288 usb.

Change-Id: I38004b84fb03e879d8910bc125090c3f8197afd1
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-12-18 15:45:25 +08:00
William Wu
5f5ab4607a arm64: dts: rockchip: rk3368-px5-evb-android: remove unused property for rk3368 usb
Change-Id: I97f2f442d52d7d29add64815581b7bf7e41554fb
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-12-18 15:44:51 +08:00
William Wu
be61f93d65 dt-bindings: usb: dwc2: remove legacy document for rockchip usb
Change-Id: I5afc660fdc77cc882ce083ccbc763ef137d95f41
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-12-18 15:43:28 +08:00
William Wu
8b1f7a3b68 usb: dwc2: drop the legacy dwc_otg_310 drivers
This patch removes the legacy dwc_otg_310 drivers which are
used for RK3288/RK3368 SoCs, and use dwc2 drivers instead
of it.

Change-Id: I281a02f335fe64fd20d3cdb301d41eda74ea1b63
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-12-18 15:42:48 +08:00
Tao Huang
1846820d40 ARM: configs: remove unused rockchip_chromium_defconfig
Change-Id: Ida10ce43b89c88161d93030de22a154332e8f1ad
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-12-18 15:39:11 +08:00
William Wu
99809f9f9a phy: rockchip-typec: set usb3 to usb2 only for dp 4 lanes
If the Type-C PHY works as DP 4 lanes, the Tx/Rx lanes
of Type-C USB 3.0 PHY is used for DP lanes, so it needs
to force the USB 3.0 to USB 2.0 only, and make sure USB
3.0 xHCI controller doesn't support USB 3.0 port.

With this patch, an ASUS Type-C to HDMI dongle which
supports DP 4 lanes and USB 2.0 simultaneously can
suspend/resume successfully.

Change-Id: I77049702c768bd56d638d11c29aae07eeb608282
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-12-18 15:36:37 +08:00
Tao Huang
08235d93f9 soc: rockchip: sdmmc_vendor_storage: Add g_vendor free
Free g_vendor when init failed or module exit.
Alloc g_vendor once because g_vendor size is large.

Change-Id: Ia4909ba86f010c59fc2821dd0732b698b188bbcc
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-12-18 09:19:13 +08:00
Tao Huang
5f235a6cc2 soc: rockchip: flash_vendor_storage: free g_vendor when module exit
Avoid memory leak.

Change-Id: I391ed111ad49abeb7156441ab7cc0d2ba6cb6927
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-12-18 09:14:57 +08:00
Sandy Huang
f17edd2d3b drm/rockchip: gem: add dma buffer map to iommu
for some scene we need to alloc continue buffer from dma buffer,
but vop iommu is still enable, so we add iommu map for dma buffer.

Change-Id: I4749eac53609f865d0d4230364b1cbaf39ee095a
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-12-17 14:10:56 +08:00
Xinhuang Li
ec250395a3 drm: bridge: dw-hdmi: no need update i2s_select when hdmi audio shutdown
the previous practice will set the reg of i2s_select to select spdif when
audio shutdown and playing spdif at this point will cause the audio to
come out of hdmi as well

Change-Id: I8f9f53ea71ce83b33e32b575bacd2249da3b7d8f
Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
2019-12-16 18:07:16 +08:00
Sugar Zhang
3e0cf8c18e drm: bridge/dw-hdmi: add support for hdmi bitstream audio
Change-Id: Ib1f6c5dba6451f3fbb029b5472dbfbf5694cff68
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2019-12-16 18:06:57 +08:00
Jianqun Xu
8580b08fb9 arm64: dts: rockchip: rk3368: fix to ACLK_ISP for isp node
Change-Id: If7c67469c6b1c00b7976a073a44764bea7d0ec7c
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-12-16 17:52:53 +08:00
Jianqun Xu
bdd7c60ffc clk: rockchip: rk3368: remove the gate bit CRU_CLOCKGATE_CON16[0]
Change-Id: I17d0a9d13a1814e9d0d0676c6b7730bcf78925dc
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-12-16 17:52:36 +08:00
Wu Liangqing
e62af425ec arm64: configs: rockchip_defconfig: add CONFIG_VIDEO_GC2355
support camera gc2355 default for rk3399_tve1030g board

Change-Id: Ib90711a7ade38228ad5d3e6568777b39cfd932a2
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2019-12-16 16:27:50 +08:00
Wu Liangqing
b8eb221c97 arm64: dts: rockchip: rk3399-tve1030g: support Android10.0
Change-Id: Ibfb895b658d1053c774c21925da7367d3bb8b3cb
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2019-12-16 16:27:00 +08:00
Shunqing Chen
cf05417063 drm: rockchip: dw-hdmi: fix the issue of hdmi unbind error
Change-Id: Ida30cf7f38209ee730ca87589e22f9cdbaef4953
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2019-12-16 15:52:57 +08:00
Jianqun Xu
3e49cc2bff Revert "drm: bridge: synopsys: dw-hdmi: Set dw-hdmi driver data"
This reverts commit db79b1540c.

Change-Id: I75a5ada2b6e6f8cfc7959221af1c85483d7a1a1f
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-12-16 15:52:57 +08:00
Wu Liangqing
f428402880 arm64: dts: rockchip: rk3399-android: changed adc_keys add power_keys node name
Change-Id: I6d7560ba712190582bd2ecca57b85b807f8781cb
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2019-12-16 15:25:52 +08:00
Yifeng Zhao
1aea7d3866 drivers: rk_nand: use BLK_STS_x instead of -EIO to fix bug
bug:
[   91.053943] WARNING: CPU: 0 PID: 1606 at block/blk-core.c:247 blk_status_to_errno+0x20/0x30
[   91.167875] Call trace:
[   91.168109]  blk_status_to_errno+0x20/0x30
[   91.168485]  dec_pending+0x108/0x228
[   91.168814]  clone_endio+0xa4/0x160
[   91.169134]  bio_endio+0xe0/0x190
[   91.169441]  blk_update_request+0xa4/0x370
[   91.169816]  blk_update_bidi_request+0x24/0x90

Change-Id: I703c1707cae442c99482a2a39f3b09d6585d06c5
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-12-16 15:18:49 +08:00
Wu Liangqing
20d9407ed4 Revert "arm64: dts: rockchip: rk3399-evb-ind disabled dmc"
This reverts commit e7862a4a5d.

Change-Id: Ifb69fea34f757bea25ca407b5b47e63be20719ef
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2019-12-16 15:06:32 +08:00
Wang Panzhenzhuan
fd2e7e7070 arm64: dts: rockchip: rk3326-evb-lp3-v10-avb: add camera configs
Change-Id: Ic2d61cbd8a30608c61652a08cd194588bd2251c7
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
2019-12-16 14:13:56 +08:00
Jianqun Xu
911d2a2fe6 arm64: dts: rockchip: remove duplicated arm-pmu in rk3368 dtsi
The duplicated arm-pmu node is added by commit
d88bd40057

Fixes: d88bd40057 ("arm64: dts: rockchip: rk3368 add more ip nodes to core dts")
Change-Id: I6583345b5903ae4a3f7383b7f43399ed0cbafc0d
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-12-13 19:15:46 +08:00