Commit Graph

604813 Commits

Author SHA1 Message Date
Sandy Huang
deeb0dbf80 drm/rockchip: vop: add support rk3399 win lite csc function
Change-Id: I1819405efea275c3d50d29b139bb20f0c6722aea
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2017-11-30 14:06:08 +08:00
Zhang Zhijie
0aea51cd79 OP-TEE: keep compitable with new version driver
1.Rename some functions to fix multiple definition compile error.
2.Build optee_linuxdriver when TEE_SUPPORT is enabled.
3.Rename "optee" obj name to "optee_v1" to fix module name conflict error:

[    0.211629] sysfs: cannot create duplicate filename '/module/optee/version'
[    0.211670] ------------[ cut here ]------------
[    0.211684] WARNING: at fs/sysfs/dir.c:31
[    0.211697] Modules linked in:
[    0.211713]
[    0.211726] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 4.4.93 #42
[    0.211738] Hardware name: Rockchip RK3399 Excavator Board edp (Android) (DT)
[    0.211752] task: ffffffc0f2160000 task.stack: ffffffc0f2168000
[    0.211772] PC is at sysfs_warn_dup+0x60/0x7c
[    0.211785] LR is at sysfs_warn_dup+0x60/0x7c

Change-Id: I9cc98307a32d9b186f7aac86027da231b486c487
Signed-off-by: Zhang Zhijie <zhangzj@rock-chips.com>
2017-11-30 11:21:37 +08:00
Alex Zhao
60b3b75a43 net: wireless: rockchip_wlan: update rtl8188eu
update wifi driver to v5.2.2.3_24783.20171030

Change-Id: I6fb8d8791ecdd7a51349a7696b98942dfdcd29f7
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2017-11-29 17:30:35 +08:00
Chris Zhong
ac042485f4 net: wireless: rockchip_wlan: fix compile warning
fix this compile warning:
drivers/net/wireless/rockchip_wlan/rtl8189fs/core/rtw_p2p.c:3518:31:
warning: comparison of constant ‘3’ with boolean expression is alwa
false [-Wbool-compare] error, forbidden warning: rtw_p2p.c:3518

Change-Id: Ic900425434f3ae0069237bbe6d3cb8242e31ed0f
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
2017-11-29 11:47:45 +08:00
Caesar Wang
894c1f0e8c ARM: dts: rockchip: add the needed power domain node on rk3036
As the vpu needed handle the power domain for reset function, this patch
supported the vpu domain for rk3036 Socs.

Change-Id: I67ad6085e2eb9a213c364d58713f02cc78ce6849
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2017-11-29 11:45:56 +08:00
Caesar Wang
1f232f6bb2 soc/rockchip: support the power domains for rk3036 SoCs
The rk3036 SoCs have some domains with NOC idle function, but it can't
turn the power domain off. This patch supports it to handle some devices
for needing.

Change-Id: I515f2cea07f1af1777bb877a5f396fd21caba3ad
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2017-11-29 11:45:39 +08:00
Caesar Wang
9c51095c78 dt/bindings: rockchip: add the power domains for rk3036 SoCs
This patch add the binding documentation for power domains found on
Rockchip rk3036 SoCs.

Change-Id: I45ff200e4d891724633fe97bdc349faad82a2984
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2017-11-29 11:44:50 +08:00
Wyon Bi
f808d024c7 arm64: dts: rockchip: rk3368-xikp: Update display clock frequency for panel
Target pixel clock rate for refresh rate @60 Hz
	= 1341 * 1981 * 60 = 159391260 Hz ~ 159 MHz

Change-Id: Ia018ad3c1a34c48e676f9b63b06e7a2f1cb658f2
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2017-11-29 11:31:52 +08:00
Liang Chen
d0e827fc24 ARM: dts: rk312x: pinctrl pullup UART1 RX pin
UART RX pin need pullup to keep high voltage when bus is idle.

Change-Id: Iaeea6535bfc42d3ffec396798778cf8803cf3e90
Signed-off-by: Liang Chen <cl@rock-chips.com>
2017-11-29 11:12:40 +08:00
Hu Kejun
2f261ad2a4 media: soc_camera: add nt99230 and change parameter of soc_cfg->soc_cfg
Change-Id: Ie82c80483e918dafb3fe5237d20813a514374798
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2017-11-29 09:35:29 +08:00
zain wang
a42f179e65 ALSA: usb-audio: Add SNDRV_PCM_TRIGGER_SUSPEND/RESUME to trigger functions
Missing SNDRV_PCM_TRIGGER_SUSPEND/RESUME, usb-audio can not enter suspend
since pcm was always running.

Change-Id: I0f7be7345f2b5c1bd42dad4c6fc4647c8636eed8
Signed-off-by: zain wang <wzz@rock-chips.com>
2017-11-28 17:32:12 +08:00
Shawn Lin
34fec92792 UPSTREAM: soc: rockchip: disable jtag switching for RK3328 Soc
Disable IO function switching between sdmmc and jtag
for RK3328 Soc.

Change-Id: Ic8f4494b11e1091fa7a4d71674940d3c8fd5b1ad
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from 887758c325)
2017-11-28 17:31:40 +08:00
Heiko Stuebner
81ec76caaf UPSTREAM: soc: rockchip: add driver handling grf setup
The General Register Files are an area of registers containing a lot
of single-bit settings for numerous components as well full components
like usbphy control. Therefore all used components are accessed
via the syscon provided by the grf nodes or from the sub-devices
created through the simple-mfd created from the grf node.

Some settings are not used by anything but will need to be set up
according to expectations on the kernel side.

Best example is the force_jtag setting, which defaults to on and
results in the soc switching the pin-outputs between jtag and sdmmc
automatically depending on the card-detect status. This conflicts
heavily with how the dw_mmc driver expects to do its work and also
with the clock-controller, which has most likely deactivated the
jtag clock due to it being unused.

So far the handling of this setting was living in the mach-rockchip
code for the arm32-based rk3288 but that of course doesn't work
for arm64 socs and would also look ugly for further arm32 socs.

Also always disabling this setting is quite specific to linux and
its subsystems, other operating systems might prefer other settings,
so that the bootloader cannot really set a sane default for all.

So introduce a top-level driver for the grf that handles these
settings that need to be a certain way but nobody cares about.

Other needed settings might surface in the future and can then
be added here, but only as a last option. Ideally general GRF
settings should be handled in the driver needing them.

Conflicts:
	drivers/soc/rockchip/Kconfig
	drivers/soc/rockchip/Makefile

Change-Id: I6c7202f8e6c51898f25ffd0775c7c2d2f456d80e
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from 4c58063d42)
2017-11-28 17:31:35 +08:00
Liang Chen
a714d54f27 ARM: dts: rk312x-android: enable fiq mode
Change-Id: Idc400661beb11ba5198add30236f4365038859c9
Signed-off-by: Liang Chen <cl@rock-chips.com>
2017-11-28 17:31:06 +08:00
Wu Liangqing
f3a3899ec9 ARM: dts: rk312x: add gpu frequency 480Mhz
Change-Id: Ie2c7ff75524de5978676ac4f02ba359210e92eab
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2017-11-28 17:30:34 +08:00
Joseph Chen
1dfc515d7e ARM: dts: rk3066a-rayeager: add vdd_logic regulator
The vdd_logic is a pwm regulator. Since '#pwm-cells = <2>', there
is not polarity invert support by pwm driver, so we have to add
property 'pwm-dutycycle-range = <100 0>' to support polarity invert
by pwm regulator driver itself.

Change-Id: Ie5d2cda67ce19dc792f96263836bab658d385681
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-11-28 14:32:54 +08:00
Zhang Yunlong
0012af6f03 camera: rockchip: cif: use dmabuf in oneframe mode
Change-Id: Ic0acd28f569ce8f4b74ec2c60fe74fd998891464
Signed-off-by: Zhang Yunlong <dalon.zhang@rock-chips.com>
2017-11-28 14:32:20 +08:00
Jacob Chen
52e4502303 media: i2c: tc35874x: add link freq control
before we get it from dts, but now it must be get from driver

Change-Id: I911f02a1c4d6618c539aceb06d485b58eb4906cd
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-28 14:30:18 +08:00
Jacob Chen
c10f2c465a media: i2c: imx219: add some controls for 3A
Change-Id: I2157b98f9c00e303dd50470247ca794381db727e
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-28 14:30:07 +08:00
Meng Dongyang
76a28bb1b9 phy: rockchip-inno-usb2: turn off differential receiver in suspend mode
Turn off differential receiver in suspend mode to save power

Change-Id: Idd9b4c2d7d9d78915c94946ced99737683a2ce91
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2017-11-28 14:29:39 +08:00
Zheng Yang
c928aff3d8 drm: introduce HLG EOTF
CTA-861-G defined Hybrid Log-Gamma (HLG) based on ITU-R
BT.2100-0.

Change-Id: Ieb18284265529ee8d76b250d8bb5b3752425814a
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-28 14:23:54 +08:00
Finley Xiao
460c258da9 arm64: dts: rockchip: rk3368-xikp: Enable dmc and dfi
Change-Id: Ic839a159b225b06dbb300268a6cd0a66fd9d83a9
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-11-28 14:14:30 +08:00
Finley Xiao
550c44033a arm64: dts: rockchip: rk3368: Add 240MHz for dmc
Change-Id: I7f52bc136cd36177bba3a15febe8fbf03bb9c97c
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-11-28 14:13:04 +08:00
Dalon.zhang
0a894cc356 arm64: dts: rk3399-sapphire-excavator-linux: support ov4689&ov13850
Change-Id: Iadcfa66afb1de8c949dc453fdafc980975d1a4f3
Signed-off-by: Zhang Yunlong <dalon.zhang@rock-chips.com>
2017-11-28 14:09:15 +08:00
Mark Yao
44c576cb5d clk: rockchip: rk3066a: make hclk_vio_bus critical
Vop register access request hclk_vio_bus.

Change-Id: I94363252c595f248c1543c8484ccb071c51dcfda
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-11-28 12:00:29 +08:00
Yankun Zheng
391bf3832d ARM: dts: rockchip: rk3229-at-som.dtsi: add spi dev for user space
Change-Id: If552c8f07f43cc3e173c73687c0ff7d2ee6e946f
Signed-off-by: Yankun Zheng <zyk@rock-chips.com>
2017-11-27 20:52:32 +08:00
Binyuan Lan
a12aa9ef01 ARM: dts: rockchip: rk3126-bnd-d708: correct hp-ctl ACTIVE level
Change-Id: I9d1ecc2282261841f56d5d07a7c7e58fe39623d8
Signed-off-by: Binyuan Lan <lby@rock-chips.com>
2017-11-27 19:44:42 +08:00
Dalon.zhang
f2dc59cc0c ARM: dts: rockchip: add cif node for rk3288
Change-Id: Ia7e779b914991694fb1e4f20bf90477f38a5f997
Signed-off-by: Zhang Yunlong <dalon.zhang@rock-chips.com>
2017-11-27 19:37:38 +08:00
Finley Xiao
5207deac47 clk: rockchip: rk3288: Add ids for pclk_vip_in and pclk_vip
Change-Id: Id7c4b9a69ca22ae5eaee75929adb5ec0c1f0165c
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-11-27 19:36:28 +08:00
Dalon.zhang
38c93fe590 clk: rockchip: rk3288: add PCLK_VIP and PCLK_VIP_IN
Change-Id: I51357dc00c842c7ecb49b13580e59f33d87d21b8
Signed-off-by: Zhang Yunlong <dalon.zhang@rock-chips.com>
2017-11-27 19:36:16 +08:00
wennuan
66cb0ec2bc ARM: dts: rockchip: add a new dts file for RK_EVB_RK1608
Add this a dts-file for the RK_EVB_RK1608 board,the new dts modified
on the basis of the original rk3288-evb-act8846.dts file.The screen
light and touch are added,and the edp and hdmi interface are closed.

Change-Id:  I6895641ad6baa84b826587ca7bae275171bb6d08
Signed-off-by: Nuan Wen <leo.wen@rock-chips.com>
2017-11-27 19:35:02 +08:00
Jianqun Xu
7fb197a5cf ARM: dts: rockchip: rk312x fix to SCLK_CIF_OUT for cif out clk
Change-Id: Id78693129890ddff151753229681b00b911859c9
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2017-11-27 16:37:19 +08:00
Shunqing Chen
0250b83f98 power: rk818: add power_supply property for CTS.
Android8.0 CTS needs to get max charging current,
max charging voltage and battery charge counter.

Change-Id: Ia0e6589e92f24ece179299040336e050b21258b1
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2017-11-27 14:41:40 +08:00
Hu Kejun
a3c79584a4 media: rk-isp10: support isp0 and isp1 run at the same time
1. support isp0 and isp1 run at the same time;
2. support VIDIOC_G_INPUT command;
3. support VIDIOC_G_PARM command;
4. support VIDIOC_G_PARM command;
5. add pix.bytesperline and pix.sizeimage in VIDIOC_G_FMT command;

Change-Id: I6d0347350a0bef372ee2e01c508b2fb581ea7cfc
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2017-11-27 14:17:45 +08:00
Tomasz Figa
80072db056 FROMLIST: media: v4l2-fwnode: Check subdev count after checking port
Current implementation of __v4l2_async_notifier_parse_fwnode_endpoints()
checks first whether subdev_count >= subdev_max and only then whether
the port being parsed matches the given port index. This triggers an
error in otherwise valid cases of skipping ports that do not match.

Fix this by moving the check below the port index check.

Fixes: 9ca4653121 ("media: v4l: fwnode: Support generic parsing of graph endpoints in a device")
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
(am from https://patchwork.linuxtv.org/patch/45462/)

BUG=b:36227021
TEST=WiP Rockchip ISP driver probes without errors on Scarlet

Change-Id: Ie4d160af21d5dedde7e73e3f1a0819a0d5d4f340
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
255a3eb2b7 FROMLIST: v4l: async: Add a convenience function for registering sensors
Add a convenience function for parsing firmware for information on related
devices using v4l2_async_notifier_parse_fwnode_sensor_common() registering
the notifier and finally the async sub-device itself.

This should be useful for sensor drivers that do not have device specific
requirements related to firmware information parsing or the async
framework.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
(cherry picked from commit dd202f9d5346cacd785a482952f54b205eafcc64)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

Conflicts:
	include/media/v4l2-subdev.h
(convert to older documentation style)

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: Ia4af50d7204173d17d04faf9575f6605a1400e46
Reviewed-on: https://chromium-review.googlesource.com/693700
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
7c4d65f119 FROMLIST: v4l: fwnode: Add convenience function for parsing common external refs
Add v4l2_fwnode_parse_reference_sensor_common for parsing common
sensor properties that refer to adjacent devices such as flash or lens
driver chips.

As this is an association only, there's little a regular driver needs to
know about these devices as such.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
(cherry picked from commit 547be5f2082a4b5d148f8f4ddd8672c91ef52da9)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: I3440987cb1ed89819dc54c9d47f7bd4e27ef3203
Reviewed-on: https://chromium-review.googlesource.com/693699
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
4cea4776cc FROMLIST: v4l: fwnode: Add a helper function to obtain device / integer references
v4l2_fwnode_reference_parse_int_prop() will find an fwnode such that under
the device's own fwnode, it will follow child fwnodes with the given
property-value pair and return the resulting fwnode.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
(cherry picked from commit 804b867e30fe9855d9d7810a363a2b8388c2a9aa)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: I18727c371e64be7e0a3cfa5da4e23274187c0b5a
Reviewed-on: https://chromium-review.googlesource.com/693698
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
d2209ebe4e FROMLIST: v4l: fwnode: Add a helper function for parsing generic references
Add function v4l2_fwnode_reference_parse() for parsing them as async
sub-devices. This can be done on e.g. flash or lens async sub-devices that
are not part of but are associated with a sensor.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
(cherry picked from commit ba63cd710bba4c3d9f2379d4af62412b2e4bd4c7)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: I9f84287faf59c8215d010f83671985fb66e02181
Reviewed-on: https://chromium-review.googlesource.com/693697
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
ffa51fe4c7 FROMLIST: v4l: async: Ensure only unique fwnodes are registered to notifiers
While registering a notifier, check that each newly added fwnode is
unique, and return an error if it is not. Also check that a newly added
notifier does not have the same fwnodes twice.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
(cherry picked from commit cbd39508810ec530137a0c631d16e8a772d315b8)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: I02fe494594780d57a7bd536d4132ed633069351c
Reviewed-on: https://chromium-review.googlesource.com/693696
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
276604c3b9 FROMLIST: v4l: async: Allow binding notifiers to sub-devices
Registering a notifier has required the knowledge of struct v4l2_device
for the reason that sub-devices generally are registered to the
v4l2_device (as well as the media device, also available through
v4l2_device).

This information is not available for sub-device drivers at probe time.

What this patch does is that it allows registering notifiers without
having v4l2_device around. Instead the sub-device pointer is stored in the
notifier. Once the sub-device of the driver that registered the notifier
is registered, the notifier will gain the knowledge of the v4l2_device,
and the binding of async sub-devices from the sub-device driver's notifier
may proceed.

The root notifier's complete callback is only called when all sub-device
notifiers are completed.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
(cherry picked from commit 6527ddc572c6fe60808ed0ee690158498cb50439)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: I4e95e7f72f00a8f88786a26b73fc5ef22d4e4261
Reviewed-on: https://chromium-review.googlesource.com/693695
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
8857e46897 FROMLIST: v4l: async: Prepare for async sub-device notifiers
Refactor the V4L2 async framework a little in preparation for async
sub-device notifiers.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
(cherry picked from commit b0a3d090cf6c1f793758b5c900169f11e29669e1)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: Id6ea225545d16192ca8f6c10f99415b6bf4f22f0
Reviewed-on: https://chromium-review.googlesource.com/693694
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
50130584d5 FROMLIST: v4l: async: Allow async notifier register call succeed with no subdevs
The information on how many async sub-devices would be bindable to a
notifier is typically dependent on information from platform firmware and
it's not driver's business to be aware of that.

Many V4L2 main drivers are perfectly usable (and useful) without async
sub-devices and so if there aren't any around, just proceed call the
notifier's complete callback immediately without registering the notifier
itself.

If a driver needs to check whether there are async sub-devices available,
it can be done by inspecting the notifier's num_subdevs field which tells
the number of async sub-devices.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
(cherry picked from commit 0104ac5b7f345fc7e8c28fabaab2a272a94daa76)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: I07946a7022832968b60b5dc011b2df9201a723ce
Reviewed-on: https://chromium-review.googlesource.com/693693
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
60c05d9738 FROMLIST: v4l: async: Register sub-devices before calling bound callback
Register the sub-device before calling the notifier's bound callback.
Doing this the other way around is problematic as the struct v4l2_device
has not assigned for the sub-device yet and may be required by the bound
callback.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
(cherry picked from commit b1ba01634a3779612c760136710fc1de1f671b23)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: I5e8a7257461e4e773e8ec29720175fb1fc557f29
Reviewed-on: https://chromium-review.googlesource.com/693691
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
8c73730716 FROMLIST: v4l: async: Introduce helpers for calling async ops callbacks
Add three helper functions to call async operations callbacks. Besides
simplifying callbacks, this allows async notifiers to have no ops set,
i.e. it can be left NULL.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
(cherry picked from commit 6b4257572d7443669a1f83c6f90c2b43620fba6c)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: I2cb3051601dc068f60dc2072fb9b9a65b916d0a4
Reviewed-on: https://chromium-review.googlesource.com/693690
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Laurent Pinchart
5e744b23da FROMLIST: v4l: async: Move async subdev notifier operations to a separate structure
The async subdev notifier .bound(), .unbind() and .complete() operations
are function pointers stored directly in the v4l2_async_subdev
structure. As the structure isn't immutable, this creates a potential
security risk as the function pointers are mutable.

To fix this, move the function pointers to a new
v4l2_async_subdev_operations structure that can be made const in
drivers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
(cherry picked from commit ef44d7cb0c00968dc62987a6d0438ec30ca8c06c)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

    Conflicts:
            drivers/media/pci/intel/ipu3/ipu3-cio2.c
    (implement change in non-upstream driver)
            drivers/media/platform/davinci/vpif_capture.c
(Change vpif_probe() instead of newer vpif_capture_get_pdata() UNTESTED)
            drivers/media/platform/omap3isp/isp.c
(Add .bound = isp_subdev_notifier_bound which we still have UNTESTED)
            drivers/media/platform/atmel/atmel-isc.c
            drivers/media/platform/atmel/atmel-isi.c
            drivers/media/platform/pxa_camera.c
            drivers/media/platform/qcom/camss-8x16/camss.c
            drivers/media/platform/rcar-vin/rcar-core.c
            drivers/media/platform/rcar_drif.c
            drivers/media/platform/stm32/stm32-dcmi.c
            drivers/media/platform/ti-vpe/cal.c
            drivers/staging/media/imx/imx-media-dev.c
    (Ignore drivers we don't have)

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: Ic3c4a327763507c8b4fa242ae4642a633e3c7dbc
Reviewed-on: https://chromium-review.googlesource.com/693689
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
01e017d576 FROMLIST: v4l: fwnode: Support generic parsing of graph endpoints in a device
Add two functions for parsing devices graph endpoints:
v4l2_async_notifier_parse_fwnode_endpoints and
v4l2_async_notifier_parse_fwnode_endpoints_by_port. The former iterates
over all endpoints whereas the latter only iterates over the endpoints in
a given port.

The former is mostly useful for existing drivers that currently implement
the iteration over all the endpoints themselves whereas the latter is
especially intended for devices with both sinks and sources: async
sub-devices for external devices connected to the device's sources will
have already been set up, or they are part of the master device.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
(cherry picked from commit 339b5569a4c60144ae8b4aae497080ceea9190fa)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

Conflicts:
	include/media/v4l2-fwnode.h
(purely contextual conflict)

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: I97772ddab949a86f4a0eb2e3610d72cba22709ef
Reviewed-on: https://chromium-review.googlesource.com/693688
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
ae3bcb9263 FROMLIST: v4l: async: Use more intuitive names for internal functions
Rename internal functions to make the names of the functions better
describe what they do.

	Old name			New name
	v4l2_async_test_notify	v4l2_async_match_notify
	v4l2_async_belongs	v4l2_async_find_match

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
(cherry picked from commit 5a471379502e339fcf882a01e2f95c82f301bff1)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: I24fe0deb3152438e8b65d70addcdcddee90251ed
Reviewed-on: https://chromium-review.googlesource.com/693687
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
f22da32f4a FROMLIST: v4l: async: Remove re-probing support
Remove V4L2 async re-probing support. The re-probing support has been
there to support cases where the sub-devices require resources provided by
the main driver's hardware to function, such as clocks.

Reprobing has allowed unbinding and again binding the main driver without
explicilty unbinding the sub-device drivers. This is certainly not a
common need, and the responsibility will be the user's going forward.

An alternative could have been to introduce notifier specific locks.
Considering the complexity of the re-probing and that it isn't really a
solution to a problem but a workaround, remove re-probing instead.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
(cherry picked from commit 382da6accc6808123971e0f257eae2a2110d8486)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: Ic19af101230e335cb00c575d59a17040629aa72b
Reviewed-on: https://chromium-review.googlesource.com/693685
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00
Sakari Ailus
b5fb9529d3 FROMLIST: v4l: fwnode: Move KernelDoc documentation to the header
In V4L2 the practice is to have the KernelDoc documentation in the header
and not in .c source code files. This consequently makes the V4L2 fwnode
function documentation part of the Media documentation build.

Also correct the link related function and argument naming in
documentation.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Niklas Sderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
(cherry picked from commit 9115ae34c5fb99ea369972b03fa991ade67ff4f0)
https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd
http://www.spinics.net/lists/linux-media/msg122688.html
Signed-off-by: Marc Herbert <marc.herbert@intel.com>

Conflicts:
	drivers/media/v4l2-core/v4l2-fwnode.c
(pure context issue due to _parse_csi1_bus() not here)

BUG=b:64133998
TEST=media device topology shows subdevs registered successfully
TEST=no camera regression

Change-Id: Iccd13312e016a8dfb1f4ed028418f9a35516a9d4
Reviewed-on: https://chromium-review.googlesource.com/693684
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-27 14:12:20 +08:00