Commit Graph

83864 Commits

Author SHA1 Message Date
Algea Cao
cef745a23a media: cec: Add an interface for hdmi report HPD
Add cec-notifier interface that hdmi can call it when
HPD is occurred.

Change-Id: I0087a879bf3ba65e300c3db3a67ddaa7e22f16ad
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2018-01-18 16:53:37 +08:00
Finley Xiao
8b31d4d2da clk: rockchip: px30: Modify clk tree according to latest document
Change-Id: Ib8d983509792b13c1cc84c78af0f572b89053cc7
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-01-18 16:52:22 +08:00
xuhuicong
87b681f969 drm/bridge: dw-hdmi: fix display shaking when uboot to kernel show
Change-Id: I899bb0dde7111fe97dd2c89d20afb09562d31300
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2018-01-15 14:11:16 +08:00
Zhou weixin
05ba6262c6 Rockchip: vip: add gc0312 driver
Change-Id: I2cc81469f48b35833832ff102b45221ea340f5a9
Signed-off-by: Zhou weixin <zwx@rock-chips.com>
2018-01-12 19:31:29 +08:00
Finley Xiao
32c581e78e soc: rockchip: power-domain: export qos save and restore
Change-Id: I89af4462f561fa06ace7761e20cf522b5954aaed
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-01-08 09:35:18 +08:00
Jeffy Chen
651e5e14ce FROMLIST: media: rkisp1: Add user space ABI definitions
Add the header for userspace

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>

BUG=b:36227021
TEST=Camera works on Scarlet with the whole series
(am from https://patchwork.linuxtv.org/patch/46245/)

Change-Id: I2ae3db2f719c4a5de2dc631a5692b333effe5ea3
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2018-01-05 17:57:22 +08:00
Jacob Chen
839b765c64 FROMLIST: media: videodev2.h, v4l2-ioctl: add rkisp1 meta buffer format
Add the Rockchip ISP1 specific processing parameter format
V4L2_META_FMT_RK_ISP1_PARAMS and metadata format
V4L2_META_FMT_RK_ISP1_STAT_3A for 3A.

Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>

BUG=b:36227021
TEST=Camera works on Scarlet with the whole series
(am from https://patchwork.linuxtv.org/patch/46247/)

Conflicts:
	drivers/media/v4l2-core/v4l2-ioctl.c

Change-Id: I9ede55b68c075e54cefb11edecf5ef68b5452ec4
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2018-01-05 17:57:22 +08:00
Joseph Chen
2d9a3c1125 rockchip: sip: sm_nsec_ctx adds fiq spsr, sp and lr
due to optee os bugfix patch for FIQ:
	cf6a4d8 arm: sm: [bugfix] save/restore fiq core registers

we have to update sm_nsec_ctx to keep same with optee os, otherwise
FIQ debugger "bt" command is abnormal.

Change-Id: I950cfacd1c34abd88fbee2862c593b5fa59387bd
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-05 10:59:37 +08:00
Javi Merino
5dcb4226bb BACKPORT: devfreq_cooling: pass a pointer to devfreq in the power model callbacks
When the devfreq cooling device was designed, it was an oversight not to
pass a pointer to the struct devfreq as the first parameters of the
callbacks.  The design patterns of the kernel suggest it for a good
reason.

By passing a pointer to struct devfreq, the driver can register one
function that works with multiple devices.  With the current
implementation, a driver that can work with multiple devices has to
create multiple copies of the same function with different parameters so
that each devfreq_cooling_device can use the appropriate one.  By
passing a pointer to struct devfreq, the driver can identify which
device it's referring to.

Change-Id: I384bf9aafd2391eccab2ca6a76e4e57f2740aa6b
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Reviewed-by: Punit Agrawal <punit.agrawal@arm.com>
Reviewed-by: Ørjan Eide <orjan.eide@arm.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 3aa5374376)
2018-01-04 09:22:34 +08:00
Liang Chen
17efab953d soc: rockchip: add functions to select opp level form device-tree
Some chips need adjust opp level by different chip-process, add
common functions to select opp level from device-tree, so modules
can select opp level easy.

Change-Id: Ifbd5f720e6a52a68f13697bbb37ac01ff4a87e3e
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-01-02 10:21:39 +08:00
Sandy Huang
6d852444b8 drm/rockchip: add afbdc feature for plane
For next Soc VOP only vopb win1 support AFBDC, so we need
add afbdc feature for every win.

Change-Id: Icbe5e26189d2147a6b81f2f75d0b855b2c35fd26
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2017-12-28 11:04:01 +08:00
Hecanyang
4807c45f72 PM / devfreq: rockchip_dmc: add support for rk3328
This adds the necessary data for handling dmcfreq on the rk3328

Change-Id: If4cff5cc372f80b6776a7272a1bff54abef2cf33
Signed-off-by: CanYang He <hcy@rock-chips.com>
2017-12-28 08:48:54 +08:00
Algea Cao
f2da070b51 UPSTREAM: [media] cec: Add cec_get_drvdata()
Add a helper function to get driver private data from CEC
adapter. This helps the readability a little bit and allows
to change the 'priv' field name to something else without
needing to touch all drivers.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 0b0b97dcc7)

Change-Id: I2691d8328350e968b74a90d1622b8e857cefc112
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:43:52 +08:00
Algea Cao
f7c2f7e904 UPSTREAM: media: cec-pin.h: move non-kAPI parts into cec-pin-priv.h
The kAPI cec-pin.h header also defined data structures that did
not belong here but were private to the CEC core code.

Split that part off into a cec-pin-priv.h header.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
(cherry picked from commit 5bf24e08b6)

Change-Id: I8a0100eb9731a5657ef51939ef56d0c22e046023
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
1dc19a6a92 UPSTREAM: media: cec: add CEC_EVENT_PIN_HPD_LOW/HIGH events
Add support for two new low-level events: PIN_HPD_LOW and PIN_HPD_HIGH.

This is specifically meant for use with the upcoming cec-gpio driver
and makes it possible to trace when the HPD pin changes. Some HDMI
sinks do strange things with the HPD and this makes it easy to debug
this.

Note that this also moves the initialization of a devnode mutex and
list to the allocate_adapter function: if the HPD is high, then as
soon as the HPD interrupt is created an interrupt occurs and
cec_queue_pin_hpd_event() is called which requires that the devnode
mutex and list are initialized.

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

Change-Id: I2fc5ca673ed67247d6f1a60906e515caa828a064
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
3630139097 UPSTREAM: media: cec: replace pin->cur_value by adap->cec_pin_is_high
The current CEC pin value (0 or 1) was part of the cec_pin struct,
but that assumes that CEC pin monitoring can only be used with
a driver that uses the low-level CEC pin framework.

But hardware that has both a high-level API and can monitor the
CEC pin at low-level at the same time does not need to depend on
the cec pin framework.

To support such devices remove the cur_value field from struct cec_pin
and add a cec_pin_is_high field to cec_adapter. This also makes it
possible to drop the '#ifdef CONFIG_CEC_PIN' in cec-api.c.

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

Change-Id: I7f144faf81e6eb3dfdaa7cca5978214f67eaa84d
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
e15d058971 UPSTREAM: media: cec-pin: fix irq handling
The free_irq() function could be called from interrupt context,
which is invalid. Move this to the thread.

In the interrupt handler we just request that the thread disables
the irq. This is done through an atomic so we don't need to add
any spinlocks.

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

Change-Id: Icb6eaa227e0799b33834758c6fa6d148859ec98f
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
8f65162afb UPSTREAM: media: cec: rename pin events/function
The CEC_EVENT_PIN_LOW/HIGH defines and the cec_queue_pin_event() function
did not specify that these were about CEC pin events.

Since in the future there will also be HPD pin events it is wise to rename
the event defines and function to CEC_EVENT_PIN_CEC_LOW/HIGH and
cec_queue_pin_cec_event() now before these become part of the ABI.

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

Change-Id: I292a2aca552575958e0705727ab7ea277839b479
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
ab040de4d7 UPSTREAM: media: linux/cec.h: add pin monitoring API support
Add support for low-level CEC pin monitoring. This adds a new monitor
mode, a new capability and two new events.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 6303d97873)

Change-Id: I39749134b7666c7454fa32ef12057cead7031c85
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
497d8fb293 UPSTREAM: media: cec-notifier: small improvements
Allow calling cec_notifier_set_phys_addr and
cec_notifier_set_phys_addr_from_edid with a NULL notifier, in which
case these functions do nothing.

Add a cec_notifier_phys_addr_invalidate helper function (the notifier
equivalent of cec_phys_addr_invalidate).

These changes simplify drm CEC driver support.

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

Change-Id: I301d15d4f7fd710ad8c532035492f7434a089fa7
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
da80af837b UPSTREAM: media: cec-pin: add low-level pin hardware support
Add support for CEC hardware that relies on low-level pin polling or
GPIO interrupts.

One example is the Allwinner SoC. But any GPIO-based CEC implementation can
use this as well.

A GPIO implementation is very suitable as well for debugging: it can use
interrupts to detect state changes and report it. Userspace can then verify
if the bus traffic is correct. This also makes error injection possible.

The disadvantage is that it is hard to get the timings right since linux
isn't a hard realtime system.

In general on an idle system it works quite well, but under load the timer
will miss its mark every so often.

The debugfs file /sys/kernel/debug/cec/cecX/status gives some statistics
with respect to the timer overruns.

When the adapter is unconfigured and the low-level driver supports
interrupts, then the interrupt will be used to detect changes. This should
be quite accurate. But when the adapter is configured a hrtimer has to be
used.

The hrtimer implements a state machine where for each state the code will
read the bus or drive the bus and go on to the next state. It will re-arm
the timer with a delay based on the next state.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit ea5c8ef296)

Change-Id: Iba76fc7d2a93bfe5fff1792afe82416ad4f02c8c
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
35425e92f7 UPSTREAM: media: cec: add core support for low-level CEC pin monitoring
Add support for the new MONITOR_PIN mode.

Add the cec_pin_event function that the CEC pin code will call to queue pin
change events.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit b8d62f50b1)

Change-Id: I52267565092f0f3539e2a0f98328a360839a1d2f
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
8a11dfd7bc UPSTREAM: media: cec: rework the cec event handling
Event handling was always fairly simplistic since there were only
two events. With the addition of pin events this needed to be redesigned.

The state_change and lost_msgs events are now core events with the
guarantee that the last state is always available. The new pin events
are a queue of events (up to 64 for each event) and the oldest event
will be dropped if the application cannot keep up. Lost events are
marked with a new event flag.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 6b2bbb0874)

Change-Id: I922f9ef9ae718ed93e02556cc007b2d943c5b11d
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
8ed255766c UPSTREAM: media: cec: add adap_free op
This is needed for CEC adapters that allocate resources that have
to be freed before the cec_adapter is deleted.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit e6259b5f7a)

Change-Id: I8a3b3270d158a34b79a2036953bcb06e0ebc297d
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
d6055c2fc3 UPSTREAM: media: cec: add *_ts variants for transmit_done/received_msg
Currently the transmit_(attempt_)done and received_msg functions set
the timestamp themselves. For the upcoming low-level pin API we need
to pass this as an argument instead. So make _ts variants that allow
the caller to specify the timestamp.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 0861ad14c6)

Change-Id: I98991dc09741fd6a5c3593e25d70f08897f663a6
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
9b0cf583ab UPSTREAM: media: cec: improve transmit timeout logging
Kernel logging messes up the upcoming low-level CEC monitoring support
which is very time-sensitive. So change the debug level of this message
but keep a counter that is shown in the debugfs status log.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit bb789e03f2)

Change-Id: I4d40fc677c4f5d35db2176aad8846ae780bce53d
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
90d6a371c2 UPSTREAM: [media] cec: add CEC_CAP_NEEDS_HPD
Add a new capability CEC_CAP_NEEDS_HPD. If this capability is set
then the hardware can only use CEC if the HDMI Hotplug Detect pin
is high. Such hardware cannot handle the corner case in the CEC specification
where it is possible to transmit messages even if no hotplug signal is
present (needed for some displays that turn off the HPD when in standby,
but still have CEC enabled).

Typically hardware that needs this capability have the HPD wired to the CEC
block, often to a 'power' or 'active' pin.

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

Change-Id: I6bdbb202fb53ae2e8f14e3be15ec7613914f2bbb
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
840e97b554 UPSTREAM: [media] cec: add cec_transmit_attempt_done helper function
A simpler variant of cec_transmit_done to be used where the HW does
just a single attempt at a transmit. So if the status indicates an
error, then the corresponding error count will always be 1 and this
function figures that out based on the status argument.

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

Change-Id: I707f73b15a3634c7a5883764caf6747422daa888
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
37ce5783c8 UPSTREAM: [media] cec: add cec_s_phys_addr_from_edid helper function
This function simplifies the integration of CEC in DRM drivers.

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

Change-Id: Ibad64be8af1b0548978bd91b467e82bc719afca3
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
c60acde65a UPSTREAM: [media] cec: rename MEDIA_CEC_NOTIFIER to CEC_NOTIFIER
This config option is strictly speaking independent of the
media subsystem since it can be used by drm as well.

Besides, it looks odd when drivers select CEC_CORE and
MEDIA_CEC_NOTIFIER, that's inconsistent naming.

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

Change-Id: I6f89afe3b6f0bca110451ece5ef3ecb12c2922bb
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
2fc08ce2e5 UPSTREAM: [media] cec.h: merge cec-edid.h into cec.h
Drop the separate cec-edid.h header and merge it into cec.h.

There was really no need to have a separate header for this.

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

Change-Id: Idf14df419f4663f24bcbb2de3603498651a469d4
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
d9b22827d2 UPSTREAM: [media] cec: Kconfig cleanup
The Kconfig options for the CEC subsystem were a bit messy. In
addition there were two cec sources (cec-edid.c and cec-notifier.c)
that were outside of the media/cec directory, which was weird.

Move those sources to media/cec as well.

The cec-edid and cec-notifier functionality is now part of the cec
module and these are no longer separate modules.

Also remove the MEDIA_CEC_EDID config option and include it with the
main CEC config option (which defined CEC_EDID anyway).

Added static inlines to cec-edid.h for dummy functions when CEC_CORE
isn't defined.

CEC drivers should now depend on CEC_CORE.

CEC drivers that need the cec-notifier functionality must explicitly
select CEC_NOTIFIER.

The s5p-cec and stih-cec drivers depended on VIDEO_DEV instead of
CEC_CORE, fix that as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 56a263aaa0)

Change-Id: I3c83c4d1aea534c2e8163422c73c8bc276f20f8f
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
f43408f55b UPSTREAM: [media] media: add CEC notifier support
Add support for CEC notifiers, which is used to convey CEC physical address
information from video drivers to their CEC counterpart driver(s).

Based on an earlier version from Russell King:

https://patchwork.kernel.org/patch/9277043/

The cec_notifier is a reference counted object containing the CEC physical address
state of a video device.

When a new notifier is registered the current state will be reported to
that notifier at registration time.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 6917a7b774)

Change-Id: I048f69ccbf5c1de2f856a6820653d8bfc8455e11
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Algea Cao
023a89d7eb UPSTREAM: [media] cec: integrate CEC notifier support
Support the CEC notifier framework, simplifying drivers that
depend on this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit e3a93adcc4)

Change-Id: I0e12ec8a9a0f98c6ff0b322dedaca7d37c557810
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:38:53 +08:00
Jung Zhao
709d83e7f2 video: rockchip: vpu: fix set power idle failed
when vpu reset, sometimes will failed when set power domain
idle

Change-Id: I38185cce616adb41e698b0c95793934abbd51f62
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-12-27 15:47:31 +08:00
Thomas Gleixner
255ba9587f UPSTREAM: genirq: Handle NOAUTOEN interrupt setup proper
If an interrupt is marked NOAUTOEN then request_irq() installs the action,
but does not enable the interrupt via startup_irq().  The interrupt is
enabled via enable_irq() later from the driver. enable_irq() calls
irq_enable().

That means that for interrupts which have a irq_startup() callback this
callback is never invoked. Neither is irq_domain_activate_irq() invoked for
such interrupts.

If an interrupt depends on irq_startup() or irq_domain_activate_irq() then
the enable via irq_enable() is not enough.

Add a status flag IRQD_IRQ_STARTED_UP and use this to select the proper
mechanism in enable_irq(). Use the flag also to avoid pointless calls into
the low level functions.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: dianders@chromium.org
Cc: jeffy <jeffy.chen@rock-chips.com>
Cc: Brian Norris <briannorris@chromium.org>
Cc: tfiga@chromium.org
Link: http://lkml.kernel.org/r/20170531100212.130986205@linutronix.de

(cherry picked from commit 201d7f47f3)

Conflicts:
	include/linux/irq.h
	[due to missing upstream patches:
	  08d85f3 irqdomain: Avoid activating interrupts more than once
	  1a3d28a UPSTREAM: genirq: Introduce IRQD_AFFINITY_MANAGED flag
	  6297714 UPSTREAM: irq: Privatize irq_common_data::state_use_accessors]

Change-Id: Ie8d492c694171fa81e3df61e8561bec160ad37bb
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2017-12-26 11:12:46 +08:00
XiaoDong Huang
e9fbb2f883 firmware: rockchip_sip: add sip_smc_vpu_reset
Change-Id: Ib3e1a8b957bc164b8c4cca821d8ea89ee2e1ac9d
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2017-12-22 16:58:14 +08:00
Eric Dumazet
702d673e9e BACKPORT: tcp/dccp: drop SYN packets if accept queue is full
Per listen(fd, backlog) rules, there is really no point accepting a SYN,
sending a SYNACK, and dropping the following ACK packet if accept queue
is full, because application is not draining accept queue fast enough.

This behavior is fooling TCP clients that believe they established a
flow, while there is nothing at server side. They might then send about
10 MSS (if using IW10) that will be dropped anyway while server is under
stress.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5ea8ea2cb7)

Backport for pass Android CTS CtsLibcoreTestCases:
libcore.javax.net.ServerSocketFactoryTest#testCreateServerSocketWithPortNoBacklog

Refer the comments on libcore/luni/src/test/java/libcore/javax/net/ServerSocketFactoryTest.java
// This test may fail on kernel versions between 4.4 and 4.9, due to a kernel implementation
// detail change. Backporting the following kernel change will fix the behavior.
// http://b/31960002
// https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=5ea8ea2cb7f1d0db15762c9b0bb9e7330425a071
public void testCreateServerSocketWithPortNoBacklog() throws IOException {
    ServerSocket serverSocket = ServerSocketFactory.getDefault().createServerSocket(0, 1);
    testSocket(serverSocket, 1);
}

Change-Id: I9bb3531480f4942447d8d4eded110aa31bc7c031
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-21 10:42:52 +08:00
Wyon Bi
d04dec1a54 clk/rockchip: add cru support for rk618
Change-Id: I223c85194f62fec2c22c2a013466b767a1128f9c
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2017-12-21 10:30:28 +08:00
Wyon Bi
2ef4ee93f4 mfd: Add support for rk618
RK618 is a partner chip for Rockchip mobile application processor.

RK618 includes two RGB display input interface with double data rate.
With the internal MUX function, it can output 1080P HDMI signal to
TV and output RGB/LVDS/MIPI signal to TFT panel. In this case, RK618
can support dual panel (TV and TFT) display.

RK618 includes a audio codec, which with two I2S/PCM interface, two
differential microphone input and audio processing function.

Change-Id: Id18c251cbe1613de98e84c2b022826f85b3dd82b
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2017-12-21 10:29:40 +08:00
Finley Xiao
e8a0df4762 drm/rockchip: Avoid multiple definition
Change-Id: I091eb45fd4ccc30e648d4b743e1f541a8718cc9d
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-20 14:51:39 +08:00
Philipp Zabel
14607484a2 UPSTREAM: regmap: add iopoll-like polling macro
This patch adds a macro regmap_read_poll_timeout that works similar
to the readx_poll_timeout defined in linux/iopoll.h, except that this
can also return the error value returned by a failed regmap_read.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 08188ba882)

Change-Id: I6f358e2b324591b311590e1b421cd7fb69f20cd7
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2017-12-19 09:37:31 +08:00
Finley Xiao
09f340ba86 clk: rockchip: px30: Fix aclk and hclk for vpu, sdcard and crypto
Change-Id: I6f3d77033b493bdaac9d05c2be5eea38290a089e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-13 18:32:21 +08:00
Finley Xiao
feb173722d soc: rockchip: power-domain: Modify power domain driver for px30
This driver is modified to support PX30 SoC.

Change-Id: I0226327d6d63302627a823bf73a5f8239b70adaf
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-13 18:03:22 +08:00
Tao Huang
1629f6ccbc rockchip_sip: add dummy sip_smc_remotectl_config
Change-Id: Ib015b6ed3a3f6c66e34c84e4964b9cfafc8c6501
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:37:03 +08:00
Tao Huang
43c9e54b19 soc: rockchip: rockchip_dmc: fix compilation error for !DRM_ROCKCHIP
Change-Id: I6f02fef9ecf9b74e16b8e35d5f9c23afa1d7ebc7
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:35:13 +08:00
Zheng Yang
f8fbbc4520 drm: bridge: dw-hdmi: introduce mpll_cfg_420
RK3368/RK3399 mpll input clock rate is twice of mpll output
in YCBCR420 mode. This patch introduce mpll_cfg_420 to get
the platform YCBCR420 phy setting. If mpll_cfg_420 is not
exist, use mpll_cfg.

Change-Id: I7910a75394cf371a8008f8a83e3ab9ec14e9a68a
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-11 15:27:58 +08:00
Zheng Yang
773d508df7 drm: introduce atomic_begin for connector
atomic_begin is used to prepare for update flush.

Change-Id: I1d3a2afaea4022c065bda2b4c0746464cc0c1303
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-11 15:17:24 +08:00
Finley Xiao
3cb6cc8a59 clk: rockchip: rk3066a: Rename i2s hclk id
Change-Id: I0a5ccf1846950353ea6fc6980c1c4a4fb3457fd1
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-07 18:57:44 +08:00
Wen Dingxian
90d186256b camera: rockchip: camsys_drv: v0.0x22.7 camsys_head: v0.e.0
read MRV_MIPI_FRAME register in camsys_mrv_irq, and pass the
value fs_id and fe_id into isp library.

Change-Id: I98c43f1cac25c74c5058b90dbf25937ceb924f84
Signed-off-by: Wen Dingxian <shawn.wen@rock-chips.com>
2017-12-07 15:39:42 +08:00