Commit graph

604,568 commits

Author SHA1 Message Date
Mark Yao
58b03ce65e ARM: dts: rockchip: rk3066a: add mali gpu node
Change-Id: I193269edc32fc40d825f69820f77a96c5d06084c
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-11-09 11:09:17 +08:00
Huang jianzhi
66af9943e3 rtc: hym8563: add initialization data
Change-Id: Iad1c89d24235cb1867e7657d2218cbbbbc2a7c32
Signed-off-by: Huang jianzhi <jesse.huang@rock-chips.com>
2017-11-09 11:07:04 +08:00
Tao Huang
417c2c8f5d rk: rm include/linux/rockchip/dvfs.h
Change-Id: If02254735353c82fde3e0eba60abf64454fb4c6d
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-11-08 19:48:29 +08:00
Tao Huang
b5c71454f5 video: rockchip: hdmi: do not build hdmiv1 by default
Change-Id: I7cb01de22a031e88eb315c16a5e87edf272aff2c
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-11-08 19:39:25 +08:00
leo.ding
f1a6760b73 video: rockchip: vpu: set grf register
3126 need set grf to change hardware, and set
 register should via regmap_write

Change-Id: I49b9baf9cdd442689183d59cdc594f81bcc6bbba
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2017-11-08 18:55:27 +08:00
Huang jianzhi
078e414680 arm64: dts: rockchip: add dts for the rk3368-r88-dcdc board
Change-Id: I339502cf1c355e9d80892d06421e6b536aaf692b
Signed-off-by: Huang jianzhi <jesse.huang@rock-chips.com>
2017-11-08 17:42:22 +08:00
Peng Zhou
f7d23a9e9a ARM: dts: rockchip: add cif node for rk312x
Change-Id: I2d36932ce40c839825bb0b0e07eefaa1f3ffd834
Signed-off-by: Peng Zhou <benjo.zhou@rock-chips.com>
2017-11-08 17:30:28 +08:00
Zheng Yang
36a3883514 drm: Add HDR panel metadata property
HDR_PANEL_METADATA is used to indicate HDR capacity of sink device.

Change-Id: I598a7bb5634f14b57f94135fd3be6b0ad2075116
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-08 16:45:50 +08:00
Zheng Yang
afafb7ecd0 drm: rockchip: hdmi: attach HDR_SOURCE_METADATA property
HDR_SOURCE_METADATA property is used to set source hdr metadata,
which will be sent to sink though HDMI DRM infoframe.

Change-Id: If3500cb505c16c2f0caf66b8e64b4d80b93b228f
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-08 16:45:29 +08:00
Zheng Yang
21b0ea0285 drm: record hdr_source_metadata_property blob_id
The blob_id is used to get blob data of hdr_source_metadata_property.

Change-Id: I8383265e50261438cf8484bd731e42fc23c24c51
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-08 16:45:18 +08:00
Mark Yao
af9f68b189 drm/rockchip: vop: fix use-after-free bug on atomic_flush
old->tv_state pointer is not safe, its reference on connector state,
maybe free.

So save active_tv_state on vop is safe.

==================================================================
BUG: KASAN: use-after-free in vop_crtc_atomic_flush+0xd4/0x3c18 at addr ffffffc08cc6a3a0
Read of size 48 by task surfaceflinger/230
=============================================================================
BUG kmalloc-128 (Not tainted): kasan: bad access detected
-----------------------------------------------------------------------------

Disabling lock debugging due to kernel taint
INFO: Allocated in binder_alloc_new_buf_locked+0x388/0x5f0 age=34 cpu=5 pid=660
INFO: Freed in binder_delete_free_buffer+0x204/0x21c age=34 cpu=2 pid=986
CPU: 1 PID: 230 Comm: surfaceflinger Tainted: G    B           4.4.93 #13
Hardware name: Rockchip RK3399 Evaluation Board v3 (Android) (DT)
Call trace:
[<ffffff900808bfe4>] dump_backtrace+0x0/0x228
[<ffffff900808c220>] show_stack+0x14/0x1c
[<ffffff9008505e3c>] dump_stack+0xa4/0xcc
[<ffffff900823d608>] print_trailer+0x188/0x198
[<ffffff900823d77c>] object_err+0x3c/0x4c
[<ffffff9008243874>] kasan_report+0x320/0x4d4
[<ffffff9008242a64>] __asan_loadN+0x24/0x150
[<ffffff90086c7294>] vop_crtc_atomic_flush+0xd4/0x3c18
[<ffffff90086717e0>] drm_atomic_helper_commit_planes+0x2bc/0x308
[<ffffff90086beabc>] rockchip_atomic_commit_complete+0x6c/0xb4
[<ffffff90086bed48>] rockchip_drm_atomic_commit+0x244/0x264
[<ffffff90086a5974>] drm_atomic_commit+0x88/0x98
[<ffffff90086a7854>] drm_mode_atomic_ioctl+0x710/0x850
[<ffffff900867e398>] drm_ioctl+0x370/0x540
[<ffffff9008266574>] do_vfs_ioctl+0x86c/0x9d8
[<ffffff9008266740>] SyS_ioctl+0x60/0x88
[<ffffff9008083130>] el0_svc_naked+0x24/0x28

Change-Id: I619560f5c5d6beb0a7cfa3a6daf925ccfcfb7f8b
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-11-08 16:43:04 +08:00
Mark Yao
ef07366749 drm/rockchip: vop: fix null pointer on bandwidth check
[   56.320811] Unable to handle kernel NULL pointer dereference at virtual address 0000007f
[   56.330006] pgd = d675c000
[   56.333019] [0000007f] *pgd=00000000
[   56.337209] Internal error: Oops: 5 [#1] SMP ARM
[   56.342354] Modules linked in:
[   56.345774] CPU: 0 PID: 825 Comm: mppvideodec0:sr Not tainted 4.4.93 #194
[   56.353302] Hardware name: Generic DT based system
[   56.353309] task: d6778700 task.stack: c7806000
[   56.353337] PC is at vop_crtc_bandwidth+0x278/0x3fc
[   56.353347] LR is at irq_work_queue+0x4c/0x84
[   56.353354] pc : [<c04e5378>]    lr : [<c01da988>]    psr: 60010013
[   56.353354] sp : c7807c90  ip : 00000002  fp : c7807cec
[   56.353358] r10: d65d5340  r9 : 00000000  r8 : d65d5540
[   56.353364] r7 : 000001dd  r6 : 000010fb  r5 : 00002672  r4 : 00000001
[   56.353368] r3 : c0c57aa8  r2 : 00000000  r1 : dfbc63c8  r0 : 00000025
[   56.353375] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   56.353380] Control: 10c5387d  Table: 7675c06a  DAC: 00000051
[   56.354555] [<c04e5378>] (vop_crtc_bandwidth) from [<c04e1250>] (rockchip_drm_atomic_commit+0xc0/0x180)
[   56.354571] [<c04e1250>] (rockchip_drm_atomic_commit) from [<c04d60d8>] (drm_atomic_commit+0x64/0x7c)
[   56.354587] [<c04d60d8>] (drm_atomic_commit) from [<c04b161c>] (drm_atomic_helper_update_plane+0xc8/0x10c)
[   56.354604] [<c04b161c>] (drm_atomic_helper_update_plane) from [<c04c8798>] (__setplane_internal+0x1b4/0x218)
[   56.354615] [<c04c8798>] (__setplane_internal) from [<c04c8c9c>] (drm_mode_setplane+0x158/0x190)
[   56.354629] [<c04c8c9c>] (drm_mode_setplane) from [<c04baa1c>] (drm_ioctl+0x26c/0x404)
[   56.354644] [<c04baa1c>] (drm_ioctl) from [<c023fdcc>] (do_vfs_ioctl+0x564/0x68c)
[   56.354658] [<c023fdcc>] (do_vfs_ioctl) from [<c023ff50>] (SyS_ioctl+0x5c/0x84)
[   56.354672] [<c023ff50>] (SyS_ioctl) from [<c0107300>] (ret_fast_syscall+0x0/0x3c)

Change-Id: I7dc999e0f438b18af77dc9885ebc71745b6ac94b
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Reported-by: Caesar Wang <wxt@rock-chips.com>
2017-11-08 15:51:26 +08:00
Sandy Huang
7e2c9a1c37 FROMLIST: drm/rockchip: vop: Add more RGB output interface type
This patch add serial RGB output interface for rockchip vop, the
more info about serial RGB output interface described at the
following file:

Documentation/devicetree/bindings/display/panel/panel-rgb.txt

(am from https://patchwork.kernel.org/patch/10035987/)

Change-Id: I191d30879b42dab79ae40c5d85573057c86eeb53
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-11-08 14:21:13 +08:00
Sandy Huang
77998bc8a8 FROMLIST: drm/rockchip: Add support for Rockchip Soc RGB output interface
Some Rockchip CRTCs, like rv1108, can directly output parallel and
serial RGB data to panel or conversion chip, so we add this driver to
probe encoder and connector.

(am from https://patchwork.kernel.org/patch/10035995/)

Change-Id: Ieab9271205cace962b7e871becaf903b9abebd94
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-11-08 14:21:06 +08:00
Sandy Huang
e683aea575 FROMLIST: devicetree/bindings: display: Add document for rockchip RGB output
This path add support rv1108 rgb output interface driver.

(am from https://patchwork.kernel.org/patch/10035983/)

Change-Id: I571520b131688afd4591740c035c49e61ec03d52
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-11-08 14:20:30 +08:00
Wu Liangqing
4d45f826f9 ARM: dts: rockchip: rk312x: add iep iep_mmu
Change-Id: I1cb95155fd7b60f77a009839f48bfec4be9a4573
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
2017-11-08 10:41:39 +08:00
Sugar Zhang
fda59fa08b ARM: dts: rockchip: add i2s, spdif for rk312x
Change-Id: I8488a98caee1bc8384b5101217ae56f748fad5c7
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2017-11-08 10:40:25 +08:00
Sandy Huang
0c247b4c0c FROMLIST: devicetree/bindings: display: Add doucument for RGB panels
Describe the panel property rgb-mode for parallel and serial
RGB output interface, include the connection relations for each
mode.

(am from https://patchwork.kernel.org/patch/10035979/)

Change-Id: I05b25c397cba6b8de067492d7db61912a1c544ed
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-11-08 10:30:49 +08:00
Rob Herring
aeaec6aa88 UPSTREAM: drm: of: introduce drm_of_find_panel_or_bridge
Many drivers have a common pattern of searching the OF graph for either an
attached panel or bridge and then finding the DRM struct for the panel
or bridge. Also, most drivers need to handle deferred probing when the
DRM device is not yet instantiated. Create a common function,
drm_of_find_panel_or_bridge, to find the connected node and the
associated DRM panel or bridge device.

(cherry picked from commit 1f2db3034c)

Change-Id: Ibda889742bfb0ea53181ed2ef9b19a9d9df3303e
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
[seanpaul dropped extern from drm_of.h]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-11-08 10:29:53 +08:00
Rob Herring
b5a7bc3996 UPSTREAM: of: introduce of_graph_get_remote_node
The OF graph API leaves too much of the graph walking to clients when
in many cases the driver doesn't care about accessing the port or
endpoint nodes. The drivers typically just want the device connected via
a particular graph connection. of_graph_get_remote_node provides this
functionality.

(cherry picked from commit b85ad49409)

Change-Id: Iaee6a0f3c176d43d4bc6225f195aaaff1e7b419a
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-11-08 10:29:35 +08:00
Mark Yao
4eb94cdf60 ARM: dts: rockchip: rk3066a: add vop display nodes
Change-Id: I060e02d8dc053c93ff964525cf1643eed3ed0059
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-11-08 10:29:16 +08:00
Mark Yao
de862e8bbc drm/rockchip: vop: add rk3066 vop support
Change-Id: Icdb826c3f7b9e5dc36fd27dfa6bc401c026057ec
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-11-08 10:29:09 +08:00
Peng Zhou
32a54e3a26 ARM: rockchip_defconfig: enable cif controller
Enable: ROCK_CHIP_SOC_CAMERA
	ROCKCHIP_CAMERA_SENSOR_INTERFACE
	RK30_CAMERA_ONEFRAME

Change-Id: I9a58629b8080a9fa91c5f19a388693c8c5c5b136
Signed-off-by: Peng Zhou <benjo.zhou@rock-chips.com>
2017-11-08 10:13:37 +08:00
ZhuangXiaoLiang
e911ee2e34 RK3368 GPU: Update to Rogue 5.13.
Add gpu performance interface for cts.

Change-Id: I6d0259e97b4fe140eb1e63196e1008adf4a33c66
Signed-off-by: ZhuangXiaoLiang <zhuangxl@rock-chips.com>
2017-11-08 10:12:33 +08:00
Finley Xiao
957e542486 clk: rockchip: rk3128: Fix hclk_otg gate
Change-Id: Ia3d4b24f388b31635018a21ed3900590f821e0f6
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-11-07 16:18:30 +08:00
Hu Kejun
0fe98fce94 media: soc_camera: add ov7675 sensor driver
Change-Id: Ia98b71fcc72bb14fb5da8aec76dc9b44459c55b0
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2017-11-07 13:49:49 +08:00
Zheng Yang
6450fb3d5e drm/rockchip: hdmi: add color depth and output mode capacity property
Change-Id: I878780df5c1c81094498be2e7b4b3a22da0bfd4e
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-07 09:41:59 +08:00
Finley Xiao
a2163e3217 ARM: dts: rockchip: rk3066a: Add assigned-clocks for cru
Change-Id: I82713524f754b05b8f53921bc4730a10163963be
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-11-07 09:41:58 +08:00
Finley Xiao
32e6dae546 clk: rockchip: rk3066a: Add CLK_SET_RATE_PARENT for lcdc dclk
Change-Id: Ibd8aa28449f8c52df7395f31e7d12ae3753ad0b8
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-11-07 09:41:58 +08:00
Finley Xiao
390766191a clk: rockchip: rk3066a: Add some clock IDs
Change-Id: I57f948a425936e0f69b63e7ded86c8d2cdf84148
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-11-07 09:41:57 +08:00
Jerry Xu
111b6b69e0 ARM: dts: rk3288: add demo for dual-lcd (mipi + edp)
mipi->vopl, edp->vopb.

Change-Id: Ibbe55c569d5e78fca6e9d3160a66074fd5847462
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2017-11-07 09:41:57 +08:00
Jerry Xu
a220d62e5a ARM64: dts: rk3399: add demo for dual-lcd (mipi + edp)
mipi->vopb, edp->vopl.

backlight1 is invalid. because edp panel and mipi panel
on sdk share backlight. This is just an demo.

Change-Id: I75d21ee880dbcb771030fcbc129c940c9bd2422f
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2017-11-07 09:41:57 +08:00
Wenping Zhang
84485b26df ARM: dts: rockchip: arrange the dts structure for android things SOM.
Put unchangeable configs beyond the SOM in rk3229-at-common.dtsi
and put SOM configs in rk3229-at-som.dtsi.
Some pins which customer can change the iomux is put in product dts
files, such as rk3229-at-3nod.dts, you can see the comment in &pinctrl
node.

Change-Id: I5ba80e8aab72da24e498391835eb1a43646df5f8
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2017-11-07 09:41:56 +08:00
Mark Yao
9d967832c7 ARM: dts: rockchip: add emac phy-reset for rk3066a-rayeager
Change-Id: I0fb2dfa7c6772189b24fe651ca01511509ff1e87
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-11-07 09:41:56 +08:00
Alex Zhao
83605c3fa8 net: wireless: rockchip_wlan: fix country code setup failed
Change-Id: I8cc1b7c3bfd6dc941e0f6f771fcfd3f7eb15cc8e
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2017-11-07 09:41:55 +08:00
Hans Verkuil
a8e739af15 UPSTREAM: [media] cec: initiator should be the same as the destination for, poll
Poll messages that are used to allocate a logical address should
use the same initiator as the destination. Instead, it expected that
the initiator was 0xf which is not according to the standard.

This also had consequences for the message checks in cec_transmit_msg_fh
that incorrectly rejected poll messages with the same initiator and
destination.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 42980da2eb)

Change-Id: Ib00532f887be8758f5bbaf284f63656770e7f3f2
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-07 09:41:55 +08:00
Andi Shyti
d297ed2931 UPSTREAM: [media] rc-main: assign driver type during allocation
The driver type can be assigned immediately when an RC device
requests to the framework to allocate the device.

This is an 'enum rc_driver_type' data type and specifies whether
the device is a raw receiver or scancode receiver. The type will
be given as parameter to the rc_allocate_device device.

Change accordingly all the drivers calling rc_allocate_device()
so that the device type is specified during the rc device
allocation. Whenever the device type is not specified, it will be
set as RC_DRIVER_SCANCODE which was the default '0' value.

Suggested-by: Sean Young <sean@mess.org>
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 0f7499fddb)

Change-Id: Ic145f8c2ce310dacaa53d18f3f5dcb846ac1a967
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 18:15:36 +08:00
Hans Verkuil
8284ecab89 UPSTREAM: [media] cec: fix wrong last_la determination
Due to an incorrect condition the last_la used for the initial attempt at
claiming a logical address could be wrong.

The last_la wasn't converted to a mask when ANDing with type2mask, so that
test was broken.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit f9f96fc10c)

Change-Id: I7de00bb0346c8bf78ca4910bf1b22bf63d3674c2
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 18:15:24 +08:00
Hans Verkuil
dd75b2fd19 UPSTREAM: [media] cec: fix race between configuring and unconfiguring
This race was discovered by running cec-compliance -A with the cec module debug
parameter set to 2: suddenly the test would fail.

It turns out that this happens when the test configures the adapter in
non-blocking mode, then it waits for the CEC_EVENT_STATE_CHANGE event and once
the event is received it unconfigures the adapter.

What happened was that the unconfigure was executed while the configure was
still transmitting the Report Features and Report Physical Address messages.
This messed up the internal state of the cec_adapter.

The fix is to transmit those messages with the adap->lock mutex held (this will
just queue them up in the internal transmit queue, and not actually transmit
anything yet). Only unlock the mutex once everything is done. The main thread
will dequeue the messages from the internal transmit queue and transmit them
one by one, unless an unconfigure was done, and in that case any messages are
just dropped.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit f60f35609f)

Change-Id: I210f2d09f2ca7ce7733580bbefa6474b38a354cd
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 18:15:07 +08:00
Hans Verkuil
2129ba0989 UPSTREAM: [media] cec: move cec_report_phys_addr into cec_config_thread_func
It's only a small function and this makes it easier to switch to
transmitting the message with adap->lock held in the next patch.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit d3d64bc740)

Change-Id: I936ba05b9b70681d57d52e10645f8865a27f5689
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 18:14:52 +08:00
Hans Verkuil
05e8648b37 UPSTREAM: [media] cec: replace cec_report_features by cec_fill_msg_report_features
The fill function just fills in the cec_msg struct, it doesn't transmit
the message. This is now done explicitly.

This makes it possible to switch to transmitting this message with adap->lock
held.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 52bc30fda9)

Change-Id: Ie6c7a1f88b5691b8e4240af697646387db2e11a9
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 18:14:41 +08:00
Hans Verkuil
36fb482b62 UPSTREAM: [media] cec: update log_addr[] before finishing configuration
The loop that sets the unused logical addresses to INVALID should be
done before 'configured' is set to true. This ensures that cec_log_addrs
is consistent before it will be used.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 7af26f889e)

Change-Id: I431f4df06482c20c1a33d7b32afc742e61947425
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 18:14:30 +08:00
Hans Verkuil
3939b39580 UPSTREAM: [media] cec: CEC_MSG_GIVE_FEATURES should abort for CEC version < 2
This is a 2.0 only message, so it should return Feature Abort if the
adapter is configured for CEC version 1.4.

Right now it does nothing, which means that the sender will time out.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit a24f56d479)

Change-Id: Ibd812b99013bf83a080c0c89219b8fef4396cd88
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 18:14:13 +08:00
Hans Verkuil
b94321dc68 UPSTREAM: [media] cec: when canceling a message, don't overwrite old status info
When a pending message was canceled (e.g. due to a timeout), then the
old tx_status info was overwritten instead of ORed. The same happened
with the tx_error_cnt field. So just modify them instead of overwriting
them.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 1204761236)

Change-Id: Ibec7ccb5c1adaff39eb90f1ed4e0a962d9581746
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 17:57:02 +08:00
Hans Verkuil
36ada791c4 UPSTREAM: [media] cec: fix report_current_latency
In the (very) small print of the REPORT_CURRENT_LATENCY message there is a
line that says that the last byte of the message (audio out delay) is only
present if the 'audio out compensated' value is 3.

I missed this, and so if this message was sent with a total length of 6 (i.e.
without the audio out delay byte), then it was rejected by the framework
since a minimum length of 7 was expected.

Fix this minimum length check and update the wrappers in cec-funcs.h to do
the right thing based on the message length.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit f3854973f1)

Change-Id: Iec4d9db94bb66194ec68c014a06f8b2d33f1dbdb
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 17:54:41 +08:00
Hans Verkuil
ee609c9423 UPSTREAM: [media] cec: pass parent device in register(), not allocate()
The cec_allocate_adapter function doesn't need the parent device, only the
cec_register_adapter function needs it.

Drop the cec_devnode parent field, since devnode.dev.parent can be used
instead.

This change makes the framework consistent with other frameworks where the
parent device is not used until the device is registered.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit f51e80804f)

Change-Id: Ib9a26eedf0e07f5964482d8cbb2c4698031d7bd9
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 17:52:50 +08:00
Hans Verkuil
680c98ca39 UPSTREAM: [media] cec: ignore messages that we initiated
Some CEC adapters will receive messages that they initiated. Add a
check that will ignore such messages.

Most hardware behaves correctly in this respect, but I have seen
adapters that don't, so just filter this out in the framework.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 3f98da9636)

Change-Id: I3940308265d3e6f9370a3004fdd24945409f7a4b
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 17:52:14 +08:00
Hans Verkuil
e663244e3f UPSTREAM: [media] cec: zero counters in cec_received_msg()
Make sure the TX counters are zeroed in the cec_msg struct.
Non-zero TX counters make no sense when a message is received,
and applications should not see non-zero values here.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 8991a63d1a)

Change-Id: Ia592fe3992b4897ad5589c6bbb0976d48d630b78
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 17:51:44 +08:00
Hans Verkuil
76274441ba UPSTREAM: [media] cec: an inner loop clobbered the outer loop variable
An inner for-loop reused the outer loop variable. This was
only noticeable with CEC adapters supporting more than one
logical address.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit a161bef042)

Change-Id: I332d480bb6e73d55724634ade1bc038f9719cb09
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 17:51:25 +08:00
Hans Verkuil
ad3cd7685b UPSTREAM: [media] cec.h/cec-funcs.h: don't use bool in public headers
Replace bool by int or __u8 (when used in a struct).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 3145c754ac)

Change-Id: I690eccd438339cf490e746ba6ef780f705b1046a
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2017-11-06 17:51:08 +08:00