Commit Graph

604494 Commits

Author SHA1 Message Date
Laurent Pinchart
98781fa62b BACKPORT: [media] v4l: Add metadata buffer type and format
The metadata buffer type is used to transfer metadata between userspace
and kernelspace through a V4L2 buffers queue. It comes with a new
metadata capture capability and format description.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: removed left-over 'experimental' note]
[hans.verkuil@cisco.com: add newline after _v4l2-meta-format label]

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit fb9ffa6a7f)

 Conflicts:
	Documentation/media/uapi/v4l/buffer.rst
	Documentation/media/uapi/v4l/devices.rst
	Documentation/media/uapi/v4l/vidioc-querycap.rst
	Documentation/media/videodev2.h.rst.exceptions
	drivers/media/v4l2-core/v4l2-dev.c
	drivers/media/v4l2-core/videobuf2-v4l2.c
	include/media/v4l2-ioctl.h

Deleted the documentation, as 4.4 is before the conversion to rst.

BUG=b:66317170
TEST=compile

Change-Id: Id43757c0a0b1f34e10d17e5345f89ded25503d13
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/676767
Reviewed-by: Ricky Liang <jcliang@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-03 10:03:07 +08:00
Laurent Pinchart
0e764df617 UPSTREAM: [media] v4l: Add YUV 4:2:2 and YUV 4:4:4 tri-planar non-contiguous formats
The formats use three planes through the multiplanar API, allowing for
non-contiguous planes in memory.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
(cherry picked from commit d65fae92f9)
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>

BUG=chrome-os-partner:60805
TEST=build chromeos-4.4 for elm and boot
TEST=build chromeos-4.4 for kevin and boot

BUG=chrome-os-partner:43703
TEST=Compiled and tested on Elm.

Signed-off-by: Ricky Liang <jcliang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/420108
Reviewed-by: Wu-cheng Li <wuchengli@chromium.org>

Change-Id: I12fd0f0dc41325867777ae3723331926d5150d20
Reviewed-on: https://chromium-review.googlesource.com/424021
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-03 10:02:59 +08:00
Meng Dongyang
f8a05151b9 phy: rockchip-inno-usb2: add vbus control when set phy mode
The vbus may need control by u2phy when force. This patch
control vbus when set phy mode.

Change-Id: I237e9e3688b257689c79040f19642cea5365d409
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2017-11-03 09:49:10 +08:00
Huang jianzhi
a75fd68c1e ARM: rockchip_defconfig: add gslx680_firefly config
Change-Id: I132a595cda28f17e5e3cc3193150fd776f8277eb
Signed-off-by: Huang jianzhi <jesse.huang@rock-chips.com>
2017-11-03 09:38:53 +08:00
Huang jianzhi
7db7552596 Input: add gslx680 touch panel for firefly-rk3288 board
Change-Id: If273535f595217853009c3b0071010836f7c254e
Signed-off-by: Huang jianzhi <jesse.huang@rock-chips.com>
2017-11-03 09:38:37 +08:00
Tao Huang
6bedca442a Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
* linux-linaro-lsk-v4.4-android: (546 commits)
  Linux 4.4.93
  x86/alternatives: Fix alt_max_short macro to really be a max()
  USB: serial: console: fix use-after-free after failed setup
  USB: serial: qcserial: add Dell DW5818, DW5819
  USB: serial: option: add support for TP-Link LTE module
  USB: serial: cp210x: add support for ELV TFD500
  USB: serial: ftdi_sio: add id for Cypress WICED dev board
  fix unbalanced page refcounting in bio_map_user_iov
  direct-io: Prevent NULL pointer access in submit_page_section
  usb: gadget: composite: Fix use-after-free in usb_composite_overwrite_options
  ALSA: line6: Fix leftover URB at error-path during probe
  ALSA: caiaq: Fix stray URB at probe error path
  ALSA: seq: Fix copy_from_user() call inside lock
  ALSA: seq: Fix use-after-free at creating a port
  ALSA: usb-audio: Kill stray URB at exiting
  iommu/amd: Finish TLB flush in amd_iommu_unmap()
  usb: renesas_usbhs: Fix DMAC sequence for receiving zero-length packet
  KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit
  crypto: shash - Fix zero-length shash ahash digest crash
  HID: usbhid: fix out-of-bounds bug
  ...

Conflicts:
	drivers/cpufreq/cpufreq-dt.c
	drivers/usb/dwc3/gadget.c

Change-Id: I1a24ad0bba307b56b5ddf1fd7c4832ffb73ad12f
2017-11-02 17:00:07 +08:00
putinlee
7976ad8228 ARM: rockchip_defconfig: enable rga
Change-Id: I61ca98e16e05e846cf324b95ac503794526fdc51
Signed-off-by: Putin Lee <putin.li@rock-chips.com>
2017-11-02 16:31:41 +08:00
putinlee
8c8e830920 video/rockchip: rga2: fixup compile problem
Change-Id: I78cc0702febba4ee4b48d05ed8f49ed8b5451208
Signed-off-by: Putin Lee <putin.li@rock-chips.com>
2017-11-02 16:31:16 +08:00
putinlee
b6cf748ac0 video/rockchip: rga: Updata rga1 driver.
1.Change rga1 driver to use dma API.
  2.Fixup problem: version error.

Change-Id: Ibe8ac78927ec3b00e857c9c1e3c7321e418ede31
Signed-off-by: Putin Lee <putin.li@rock-chips.com>
2017-11-02 16:30:50 +08:00
Wu Liang feng
2a364db24a phy: rockchip-inno-usb2: support usb bypass uart function
Most of rockchip SoCs USB 2.0 DP/DM can be bypassed to UART,
it's useful for those platforms without UART interface to
print log via USB interface.

For the time being, we just support for rk312x and rk3399 in
this driver. And we will support for more SoCs in the feature.

With this patch, the user still can't use this bypass function.
It needs to add the property "rockchip,bypass-uart" in the DT
as following:

u2phy0_otg: otg-port {
	...
	rockchip,bypass-uart;
	...
};

And it also needs a special USB cable integrated with an USB
to UART chip.

Note: this function can only be used in debug stage.

Change-Id: Icdab516ff7b327f4a98c3b24bbaf953a605f5278
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-11-02 16:21:21 +08:00
ldq
7a6d6b270e arm64: rockchip_defconfig: enable fm1288
Change-Id: I5805daf8edb283c77095af110483e52af0381876
Signed-off-by: Li Dongqiang <david.li@rock-chips.com>
2017-11-02 16:19:38 +08:00
Jason Song
7cd8cce247 arm64: dts: rockchip: px5: modify es8396 and fm1288 configs.
Change-Id: I53ed6e90d4a4200a6ac1baa80ecdf86e6a2a8d14
Signed-off-by: Jason Song <sxj@rock-chips.com>
2017-11-02 16:19:26 +08:00
ldq
10587108cb ASoC: Add driver for Voice Processor Codec FM1288
Change-Id: I4d5fc9e4aff9a70f10ea27be1c21f4363608b5d3
Signed-off-by: Li Dongqiang <david.li@rock-chips.com>
2017-11-02 16:16:26 +08:00
Elaine Zhang
d1d6ca3c94 ARM: dts: rk312x: add power node to support power domain
add power and qos node to support power domain on/off.

Change-Id: I35088bfa7be407d7c627e32a84f2aafd1853e2df
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-11-02 15:51:17 +08:00
Elaine Zhang
c0ff4d90ed soc: rockchip: power-domain: add power domain support for rk3128
This driver is modified to support RK3128 SoC.

Change-Id: Ica063ae432fe5bdc1d4eb10d0749fcf039f43d35
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-11-02 15:50:44 +08:00
Elaine Zhang
5982a3f3d1 dt-bindings: add binding for rk3128 power domains
Add binding documentation for the power domains
found on Rockchip RK3128 SoCs.

Change-Id: I8ca00fdf19bfcf354355eafd814f049b46533fd6
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-11-02 15:50:15 +08:00
Elaine Zhang
03ec243a51 dt-bindings: power: add RK3128 SoCs header for power-domain
According to a description from TRM, add all the power domains.

Change-Id: Id21e1b51825f7cc94e194e164583ed2584743104
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-11-02 15:50:01 +08:00
Caesar Wang
da44343f25 ARM: dts: rk3036: fixes the cpu voltage and opp table for kylin
This patch supported the cpu voltage by changed with different
frequency, otherwise we will hit the following error on bootup.

..
[    5.031516] cpu cpu0: Failed to get cpu_reg
[    5.047725] cpu cpu0: clk or regulater is unavailable
..

Also, remove the 408M and 600M for rk3036 board, as the pclk_hdmi's parent
on apll, the low frequency will make the pclk be bad for hdmi display.

Change-Id: Ia4aac76a08cad3a59c33cd81065f943201a23a35
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2017-11-02 15:48:39 +08:00
Zheng Yang
aaa09dc626 drm: bridge: dw-hdmi: support send BT.2020 colorimetry in avi
Change-Id: I130e151c4576325103e7374e7402718b93ca5da3
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-02 15:46:41 +08:00
Uma Shankar
842366c5df FROMLIST: drm: Implement HDR source metadata set and get property handling
HDR source metadata set and get property implemented in this
patch. The blob data is received from userspace and saved in
connector state, the same is returned as blob in get property
call to userspace.

Change-Id: Iafde7d4d4a9567d54b283d8387d841e42d7b5b24
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
(am from list https://patchwork.kernel.org/patch/9756449/)
2017-11-02 15:41:45 +08:00
Zheng Yang
eda86cea45 drm: move panel HDR metadata to drm_hdmi_info
The hdr_panel_metadata indicate sink HDR capability,moving
it to drm_hdmi_info is more reasonable.

Change-Id: I0ccd404cfb0ec1e74130b0692de4261ae9a24c8f
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-02 15:41:19 +08:00
Uma Shankar
eabf439fe6 FROMLIST: drm: Parse HDR metadata info from EDID
HDR metadata block is introduced in CEA-861.3 spec.
Parsing the same to get the panel's HDR metadata.

Change-Id: I4cede936aa4d0ff844fa8abf24cb76211c785d53
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9756421/)
2017-11-02 15:33:56 +08:00
Uma Shankar
c51c06e952 FROMLIST: drm: Enable HDR infoframe support
Enable Dynamic Range and Mastering Infoframe for HDR
content, which is defined in CEA 861.3 spec.

 The metadata will be computed based on blending
policy in userspace compositors and passed as a connector
property blob to driver. The same will be sent as infoframe
to panel which support HDR.

Change-Id: I8025c3dba43dc5bb614115ede7841fe89d9f4d0b
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9756447/)
2017-11-02 15:33:34 +08:00
Uma Shankar
b1d0690d17 FROMLIST: drm: Add HDR source metadata property
This patch adds a blob property to get HDR metadata
information from userspace. This will be send as part
of AVI Infoframe to panel.

Change-Id: I0d009889ca567213a5e264d74b6816ba6d2ee0d4
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9756427/)
2017-11-02 15:33:02 +08:00
Uma Shankar
2ea096780c FROMLIST: drm: Parse Colorimetry data block from EDID
CEA 861.3 spec adds colorimetry data block for HDMI.
Parsing the block to get the colorimetry data from
panel.

Change-Id: I7067bdec0dde52bc0e83d3cd30e6a674020823ad
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9756433/)
2017-11-02 15:32:35 +08:00
Uma Shankar
462a18f718 FROMLIST: drm: Add CEA extended tag blocks and HDR bitfield macros
Add bit field and macro for extended tag in CEA block. Also,
declare macros for HDR metadata block.

Change-Id: I8169bc6605d7b2c718436f8cce1b8cb3932cd780
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9756419/)
2017-11-02 15:32:07 +08:00
Elaine Zhang
96d63cfdfd ARM: rockchip_defconfig: add CONFIG_PM_ADVANCED_DEBUG config
open debug node cat d/pm_genpd/pm_genpd_summary for pd summary

Change-Id: I6ad1c94ea8c5eb61a99235602825b19533c098f4
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-11-02 15:02:56 +08:00
Langlang Wang
b64b2ca56f arm64: rockchip_defconfig: add gsensor bma2xx and l/psensor stk3410
Change-Id: I055701e428676bb2971e884a5401aaa177648e78
Signed-off-by: Langlang Wang <langlang.wang@rock-chips.com>
2017-11-02 14:43:38 +08:00
Langlang Wang
e76ca91969 input: sensor: add proximity sensor stk3410 driver and config
Change-Id: I55b30d0a0d650376174dd681728a6c7dad211fc5
Signed-off-by: Langlang Wang <langlang.wang@rock-chips.com>
2017-11-02 14:43:03 +08:00
Langlang Wang
d0bd557aa5 input: sensor: add light sensor stk3410 driver and config
Change-Id: I53edc203f50412f6197d442abfbf0df4117af86d
Signed-off-by: Langlang Wang <langlang.wang@rock-chips.com>
2017-11-02 14:42:46 +08:00
Langlang Wang
056973ba46 input: sensor: add accel sensor bma2xx driver and config
Change-Id: I5d551441cd29f03a6d3ccb38e6cb31c4e5c04b74
Signed-off-by: Langlang Wang <langlang.wang@rock-chips.com>
2017-11-02 14:42:30 +08:00
Jacob Chen
172ce29242 media: i2c: tc35874x: enable clock lane LP11 state when stopping stream
Change-Id: Ie88b720bbda32f10483d84210456e75af2d9b6c4
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-02 12:58:54 +08:00
putinlee
154ca5fbc8 ARM: dts: rockchip: add rga node for rk312x
Change-Id: I0293998049d6d5c55ce6babfe070aa9adb619767
Signed-off-by: Putin Lee <putin.li@rock-chips.com>
2017-11-02 10:29:39 +08:00
Huang, Tao
86c52ed094 Revert "arm64: dts: rockchip: make rk3368 cru syscon"
This reverts commit bfd8339bc2.
cif driver don't access cru directly.

Change-Id: I907b700f1792be5ea7c4127638f55782f6223d00
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-11-01 18:25:49 +08:00
Caesar Wang
f947855a4b ARM: dts: rockchip: fixes the bt on rk3036 kylin board
This patch fixes the BT power reported the failure message.
As following:
root@linaro-alip:~# echo 1 > /sys/class/rfkill/rfkill0/state
[  892.558269] rockchip-pinctrl pinctrl: pin gpio0-19 already requested
by 20060000.serial; cannot claim for wireless-bluetooth
[  892.571052] rockchip-pinctrl pinctrl: pin-19 (wireless-bluetooth) status -22
...

And for now, the BT can work with this patch.
root@linaro-alip:~# echo 1 > /sys/class/rfkill/rfkill0/state
[   69.328768] [BT_RFKILL]: ENABLE UART_RTS
[   69.438540] [BT_RFKILL]: DISABLE UART_RTS
[   69.443117] [BT_RFKILL]: bt turn on power
...

root@linaro-alip:~# hcitool dev
Devices:
        hci0    94:A1:A2:E9:2D:18

And
root@linaro-alip:~# bluetoothctl
[NEW] Controller 94:A1:A2:E9:2D:18 linaro-alip [default]
[bluetooth]# scan on
Discovery started
[CHG] Controller 94:A1:A2:E9:2D:18 Discovering: yes
..

Change-Id: I2148f4203300ab4265fd3ba718f0d3ec0c57e7ca
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2017-11-01 18:00:02 +08:00
Peng Zhou
c86e82d833 ARM64: rockchip_defconfig: Enable cif controller
Enable:	ROCK_CHIP_SOC_CAMERA
	ROCKCHIP_CAMERA_SENSOR_INTERFACE
	RK30_CAMERA_ONEFRAME

Change-Id: I965f96fb4a5a40b03b74df05ec5eb00caa1f19c6
Signed-off-by: Peng Zhou <benjo.zhou@rock-chips.com>
2017-11-01 17:25:44 +08:00
Peng Zhou
5a709389a8 rockchip: vip: power manager with power-domains
Remove cru, update new api for clk control.

Change-Id: I3dd1294b723b2d146bb80ec6cd58dbc87c2e090a
Signed-off-by: Peng Zhou <benjo.zhou@rock-chips.com>
2017-11-01 17:23:42 +08:00
Alex Zhao
03f831b6c8 net: wireless: rockchip_wlan: wifi work as ko module
select CFG80211 and MAC80211 when CONFIG_WIFI_BUILD_MODULE is set

Change-Id: I42acf5d554223b13c0c689b8edae15b4a7a57a70
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
2017-11-01 16:08:13 +08:00
Peng Zhou
18a6e70182 arm64: dts: rockchip: rk3368-android: add node for cif controller
rk3368-android.dtsi: increase cma-heap size
add new file for rk3368_cif_sensor.

Change-Id: I6f3fa0cd8f5a640b7d5ad87410e406bd0bf6844b
Signed-off-by: Peng Zhou <benjo.zhou@rock-chips.com>
2017-11-01 16:05:50 +08:00
Peng Zhou
87ee4d5097 arm64: dts: rockchip: add cif nodes for rk3368
Change-Id: Ibe12b5eeac5a9fd929e22592a480352057560a6e
Signed-off-by: Peng Zhou <benjo.zhou@rock-chips.com>
2017-11-01 16:05:50 +08:00
Douglas Anderson
798ec1bde5 BACKPORT: UPSTREAM: mmc: dw_mmc: Cleanup the DTO timer like the CTO one
The recent CTO timer introduced in commit 03de19212e ("mmc: dw_mmc:
introduce timer for broken command transfer over scheme") was causing
observable problems due to race conditions.  Previous patches have
fixed those race conditions.

It can be observed that these same race conditions ought to be
theoretically possible with the DTO timer too though they are
massively less likely to happen because the data timeout is always set
to 0xffffff right now.  That means even at a 200 MHz card clock we
were arming the DTO timer for 94 ms:
  >>> (0xffffff * 1000. / 200000000) + 10
    93.886075

We always also were setting the DTO timer _after_ starting the
transfer, unlike how the old code was seting the CTO timer.

In any case, even though the DTO timer is much less likely to have
races, it still makes sense to add code to handle it _just in case_.

Change-Id: I87a1707399b64d43278239ddd830c3270402239a
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from https://patchwork.kernel.org/patch/10002771/)
2017-11-01 16:05:49 +08:00
Douglas Anderson
2f74d439c1 BACKPORT: UPSTREAM: mmc: dw_mmc: Fix the DTO timeout calculation
Just like the CTO timeout calculation introduced recently, the DTO
timeout calculation was incorrect.  It used "bus_hz" but, as far as I
can tell, it's supposed to use the card clock.  Let's account for the
div value, which is documented as 2x the value stored in the register,
or 1 if the register is 0.

NOTE: This was likely not terribly important until commit 16a34574c6
("mmc: dw_mmc: remove the quirks flags") landed because "DIV" is
documented on Rockchip SoCs (the ones that used to define the quirk)
to always be 0 or 1.  ...and, in fact, it's documented to only be 1
with EMMC in 8-bit DDR52 mode.  Thus before the quirk was applied to
everyone it was mostly OK to ignore the DIV value.

I haven't personally observed any problems that are fixed by this
patch but I also haven't tested this anywhere with a DIV other an 0.
AKA: this problem was found simply by code inspection and I have no
failing test cases that are fixed by it.  Presumably this could fix
real bugs for someone out there, though.

Change-Id: I0d81f991e10e60b8d03ee330b34d08af34a33fcb
Fixes: 16a34574c6 ("mmc: dw_mmc: remove the quirks flags")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from https://patchwork.kernel.org/patch/10002751/)
2017-11-01 16:05:49 +08:00
Douglas Anderson
48ea802727 BACKPORT: UPSTREAM: mmc: dw_mmc: Add locking to the CTO timer
This attempts to instill a bit of paranoia to the code dealing with
the CTO timer.  It's believed that this will make the CTO timer more
robust in the case that we're having very long interrupt latencies.

Note that I originally thought that perhaps this patch was being
overly paranoid and wasn't really needed, but then while I was running
mmc_test on an rk3399 board I saw one instance of the message:
  dwmmc_rockchip fe320000.dwmmc: Unexpected interrupt latency

I had debug prints in the CTO timer code and I found that it was
running CMD 13 at the time.

...so even though this patch seems like it might be overly paranoid,
maybe it really isn't?

Presumably the bad interrupt latency experienced was due to the fact
that I had serial console enabled as serial console is typically where
I place blame when I see absurdly large interrupt latencies.  In this
particular case there was an (unrelated) printout to the serial
console just before I saw the "Unexpected interrupt latency" printout.

...and actually, I managed to even reproduce the problems by running
"iw mlan0 scan > /dev/null" while mmc_test was running.  That not only
does a bunch of PCIe traffic but it also (on my system) outputs some
SELinux log spam.

Change-Id: I56373c6740d38b5c45a078e835f594261bad78d2
Fixes: 03de19212e ("mmc: dw_mmc: introduce timer for broken command transfer over scheme")
Tested-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from https://patchwork.kernel.org/patch/10002767/)
2017-11-01 15:22:09 +08:00
Douglas Anderson
56c6184515 BACKPORT: UPSTREAM: mmc: dw_mmc: Fix the CTO timeout calculation
In the commit 03de19212e ("mmc: dw_mmc: introduce timer for broken
command transfer over scheme") we tried to calculate the expected
hardware command timeout value.  Unfortunately that calculation isn't
quite correct in all cases.  It used "bus_hz" but, as far as I can
tell, it's supposed to use the card clock.  Let's account for the div
value, which is documented as 2x the value stored in the register, or
1 if the register is 0.

NOTE: It's not expected that this will actually fix anything important
since the 10 ms margin added by the function will pretty much dwarf
any calculations.  The card clock should be 100 kHz at minimum and:
  1000 ms/s * (255 * 2) / 100000 Hz.
  Gives us 5.1 ms.

...so really the point of this patch is just to make the code more
"correct" in case anyone ever tries to remove the 10 ms buffer.

Change-Id: Ie5d902edb3a5bdfb9dc9233eb46edbbee334994c
Fixes: 03de19212e ("mmc: dw_mmc: introduce timer for broken command transfer over scheme")
Tested-by: Emil Renner Berthing <kernel@esmil.dk>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from https://patchwork.kernel.org/patch/10002775/)
2017-11-01 15:21:37 +08:00
Douglas Anderson
150548af41 BACKPORT: UPSTREAM: mmc: dw_mmc: cancel the CTO timer after a voltage switch
When running with the commit 03de19212e ("mmc: dw_mmc: introduce
timer for broken command transfer over scheme") I found this message
in the log:
  Unexpected command timeout, state 7

It turns out that we weren't properly cancelling the new CTO timer in
the case that a voltage switch was done. Let's promote the cancel
into the dw_mci_cmd_interrupt() function to fix this.

Change-Id: I2ee3537eb7a756d64964cc49114011ad329409b8
Fixes: 03de19212e ("mmc: dw_mmc: introduce timer for broken command transfer over scheme")
Tested-by: Emil Renner Berthing <kernel@esmil.dk>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from https://patchwork.kernel.org/patch/10002779/)
2017-11-01 15:21:33 +08:00
Jacob Chen
6a77d26968 media: rockchip: rga: add quantization support
Also:
- correct the default quantization for RGB input, it should be full range.

Change-Id: I786799a3532b5c3a18e67c9195ec24ea811d1144
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-11-01 14:39:35 +08:00
Zheng Yang
3b85c52032 drm: bridge: dw-hdmi: support deep color mode
Introduce mtmdsclock to record tmds clock, which is different
to mpixelclock in deep color mode. Use this variable to select
synopsys phy curr_ctrl/phy_config, and audio N/CTS.

Change-Id: Ia78dee9c4901d2f1ca7f339dfb030d65bbf6861d
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-01 11:43:52 +08:00
Zheng Yang
da59743ca6 drm/rockchip: hdmi: support modify color format
This patch is based on https://patchwork.kernel.org/patch/9801533,
add the drm property "hdmi_output_format", the possible value
could be:
     - RGB
     - YCBCR 444
     - YCBCR 422

To handle various subsampling of YCBCR output types, this property
allows two special automatic cases:
     - DRM_HDMI_OUTPUT_YCBCR_HQ
       This indicates preferred output should be YCBCR output,
       with highest subsampling rate by the source/sink, which
       can be typically:
	- ycbcr444
	- ycbcr422
	- ycbcr420
     - DRM_HDMI_OUTPUT_YCBCR_LQ
       This indicates preferred output should be YCBCR output, with
       lowest subsampling rate supported by source/sink, which can be:
	- ycbcr420
	- ycbcr422
	- ycbcr444

Default value of the property is set to 0 = RGB, so no changes if you
don't set the property.

Change-Id: Ie4a98ba91c8285a2e8f1ec7832d73183ad57665e
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-01 11:21:25 +08:00
Zheng Yang
199377c761 drm/rockchip: hdmi: support modify color depth
This patch introduce a drm property hdmi_output_depth to
get/set HDMI color depth, the possible value could be
	- Automatic
	  This indicates prefer highest color depth, it is
	  30bit on rockcip platform.
	- 24bit
	- 30bit
The default value of property is 24bit.

The max_tmds_clock is 0 on some display device, we think it's
max_tmds_clock is 340MHz.

If tmdsclock > max_tmds_clock, real output color depth fallback
to 24bit.

Change-Id: I666ac85d1ce5e73af31251eae324d1a6ae00b31e
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-01 09:08:04 +08:00
Zheng Yang
a7a73c3770 drm: bridge: dw-hdmi: support attach property
Introduce struct dw_hdmi_property_ops in plat_data to attach
vendor connector property.

Change-Id: I3d23e40e9d342b22ca47f723b3f81057b58010e8
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-01 09:08:04 +08:00