Commit Graph

302670 Commits

Author SHA1 Message Date
Chris Zhong
596bbbc157 DRM/rockchip: mipi: add a phy config clock control
Thers is a phy config clock in RK3399, it must be enable before phy
init, and be disable after phy init.

Change-Id: Idb2d4c85f5284065c3f1d540d9e2fddf5565040d
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
2016-04-01 10:09:52 +08:00
Mark Yao
f572d1c89a drm/rockchip: fix compile warning
fix warning:
    warning: format '%x' expects argument of type 'unsigned int',
    but argument 2 has type 'size_t'

Change-Id: Ifab0d16f0229aa3d5fc244678298fa2138bd4aa1
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-04-01 10:01:35 +08:00
Chris Zhong
aad6183376 DRM: mipi: support rk3399 mipi dsi
The vopb/vopl switch register of rk3399 mipi is different from rk3288,
the default setting for mipi dsi mode is different too, so add a
of_device_id structure to distinguish them, and make sure set the
correct mode before mipi phy init.

Change-Id: I54542752dddd1b28fc0500c0a763f14c29fe98f0
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-03-31 18:46:57 +08:00
Elaine Zhang
0a58123e6e ARM64: rockchip: rk3399: clk: fix i2c4 and i2c8 gate-register
Fix a typo making the sclk_i2c4 and sclk_i2c8 access a
wrong register bit offset to handle its gate.

Change-Id: I836244b8e14aa34ef44241c8ff24ebd6b63ed23a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2016-03-31 16:34:55 +08:00
Wei Ni
96608532b3 UPSTREAM: thermal: of-thermal: allow setting trip_temp on hardware
In current of-thermal, the .set_trip_temp only support to
set trip_temp for SW. But some sensors support to set
trip_temp on hardware, so that can trigger interrupt,
shutdown or any other events.
This patch adds .set_trip_temp() callback in
thermal_zone_of_device_ops{}, so that the sensor device can
use it to set trip_temp on hardware.

Change-Id: I879ea144a9ac21a5032dd885118887b4942c96cf
Signed-off-by: Wei Ni <wni@nvidia.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from git.kernel.org next/linux-next.git master
 commit 60f9ce3ada53498409d51da06502392884933f89)
2016-03-31 15:10:04 +08:00
Eduardo Valentin
36e7a60254 UPSTREAM: thermal: convert rockchip_thermal to use devm_thermal_zone_of_sensor_register
This changes the driver to use the devm_ version
of thermal_zone_of_sensor_register and cleans
up the  local points and unregister calls.

Change-Id: I9c13e9c91a626a0ef8df69edf3f383c494536bab
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Tested-by: Caesar Wang <wxt@rock-chips.com>
Reviewed-by: Caesar Wang <wxt@rock-chips.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from git.kernel.org next/linux-next.git master
 commit 93c2f85df90edfc515f99cacd7720e286861f744)
2016-03-31 15:07:21 +08:00
Laxman Dewangan
f919aa0a80 UPSTREAM: thermal: of-thermal: Add devm version of thermal_zone_of_sensor_register
Add resource managed version of thermal_zone_of_sensor_register() and
thermal_zone_of_sensor_unregister().

This helps in reducing the code size in error path, remove of
driver remove callbacks and making proper sequence for deallocations.

Change-Id: Ie2e47805f398ff7b4f1dcc71e0581221d79ba9d2
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from git.kernel.org next/linux-next.git master
 commit e498b4984d)
2016-03-31 15:06:57 +08:00
Mark Yao
b435f1a281 drm/rockchip: rewrite IOMMU support code
This patch is learn from Marek Szyprowski's patch:
  (drm/exynos: rewrite IOMMU support code)

The patch replaces usage of ARM-specific IOMMU/DMA-mapping related calls
with new generic code for managing DMA-IOMMU integration layer. It also
removes all the hacks, which were needed to configure common DMA/IO address
space on the virtual rockchip-drm device.

Change-Id: I5d2b90002bf135a72ce30cc8503a7d06769835f3
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-03-31 10:50:03 +08:00
Mark Yao
bd618f4637 drm/rockchip: vop: add rk3399 vop support
There are two VOP in rk3399 chip, respectively VOP_BIG and VOP_LIT.
most registers layout of this two vop is same, their framework arm both
VOP_FULL, the Major differences of this two is that:

VOP_BIG max output resolution is 4096x2160.
VOP_LIT max output resolution is 2560x1600

VOP_BIG support four windows.
VOP_LIT only support two windows.

RK3399 vop register layout is similar with rk3288, so some feature can reuse
with rk3288.

Change-Id: I76f94c93b0e63e4fbba51755e92c604211613e8b
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-03-31 10:48:24 +08:00
Mark Yao
f9310d0ab8 drm/rockchip: get rid of rockchip_drm_crtc_mode_config
We need to take care of the vop status when use rockchip_drm_crtc_mode_config,
if vop is disabled, the function would failed, that is terrible.

Save connector type and output mode on drm_display_mode->private_flags on
connector mode_fixup, then we can configure the type and mode safely
on crtc mode_set.

Change-Id: I129cf8a2f100fc19fe96f1d8985e905bea477e28
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-03-30 15:24:12 +08:00
Simon
d2c6ccd714 iommu/rockchip: enable upstream iommu build on ARM64 platform
Change-Id: Ied95b0a8d531210729a960b90dab81f1e25e9035
Signed-off-by: Simon <xxm@rock-chips.com>
2016-03-30 11:14:40 +08:00
Simon
acbe537f27 iommu/rockchip: add ARM64 cache flush operation for iommu
Change-Id: I5848ca01a38e902a436b5b4abccfe235e2746cc1
Signed-off-by: Simon <xxm@rock-chips.com>
2016-03-30 11:14:40 +08:00
Douglas Anderson
7dcfa54210 FROMLIST: drm/rockchip: dw_hdmi: Don't call platform_set_drvdata()
The Rockchip dw_hdmi driver just called platform_set_drvdata() to get
your hopes up that maybe, somehow, you'd be able to retrieve the 'struct
rockchip_hdmi' from a pointer to the 'struct device'.  You can't.  When
we call dw_hdmi_bind() the main driver calls dev_set_drvdata(), which
clobbers our setting.

Let's just remove the platform_set_drvdata() to avoid dashing people's
hopes.

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

Change-Id: I28c4dcff37f6800b841e0492eb2613dcff7d1c81
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-03-30 10:03:29 +08:00
Douglas Anderson
d8445394f6 FROMLIST: drm/rockchip: vop: Fix vop crtc cleanup
This fixes a few problems in the vop crtc cleanup (handling error
paths and cleanup upon exit):

* The vop_create_crtc() error path had an unsafe version of the
  iterator used for iterating over all planes (though it was
  destroying planes in the iterator so should have used the safe
  version)

* vop_destroy_crtc() - wasn't calling vop_plane_destroy(), which made
  slub_debug unhappy, at least if we ended up running this due to a
  deferred probe.

* In vop_create_crtc() if we were missing the "port" device tree node
  we would fail but not return an error (found by code inspection).

Fix these problems.

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

Change-Id: I3c00faca6e2fc10edc5b4576012ac28b6809a2f3
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-03-30 10:02:47 +08:00
Douglas Anderson
65bee33dab FROMLIST: drm/rockchip: dw_hdmi: Call drm_encoder_cleanup() in error path
The drm_encoder_cleanup() was missing both from the error path of
dw_hdmi_rockchip_bind().  This caused a crash when slub_debug was
enabled and we ended up deferring probe of HDMI at boot.

This call isn't needed from unbind() because if dw_hdmi_bind() returns
no error then it takes over the job of freeing the encoder (in
dw_hdmi_unbind).

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

Change-Id: Ibf5c39a5db304177a9f16d8dc691221512002348
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-03-30 10:02:16 +08:00
Tomeu Vizoso
cc01a559bd FROMLIST: drm/rockchip: vop: Disable planes when disabling CRTC
When a VOP is re-enabled, it will start scanning right away the
framebuffers that were configured from the last time, even if those have
been destroyed already.

To prevent the VOP from trying to access freed memory, disable all its
windows when the CRTC is being disabled, then each window will get a
valid framebuffer address before it's enabled again.

Link: http://lkml.kernel.org/g/CAAObsKAv+05ih5U+=4kic_NsjGMhfxYheHR8xXXmacZs+p5SHw@mail.gmail.com
(am from https://patchwork.kernel.org/patch/8643631/)

Change-Id: Iaacb1624b4351a94d663ec73d9174b0fd4bc4b54
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-03-30 10:01:47 +08:00
Tomeu Vizoso
232f21b837 FROMLIST: drm/rockchip: vop: Don't reject empty modesets
So that when DRM_IOCTL_MODE_SETCRTC is called without a FB nor mode, the
CRTC gets disabled.

Link: http://lkml.kernel.org/g/CAAObsKAv+05ih5U+=4kic_NsjGMhfxYheHR8xXXmacZs+p5SHw@mail.gmail.com

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

Change-Id: I3a36e20f727f2087d718acec886766b743de2d9b
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-03-30 10:01:17 +08:00
John Keeping
b130dc7dc1 FROMLIST: drm/rockchip: cancel pending vblanks on close
When closing the DRM device while a vblank is pending, we access
file_priv after it has been free'd, which gives:

  Unable to handle kernel NULL pointer dereference at virtual address 00000000
  ...
  PC is at __list_add+0x5c/0xe8
  LR is at send_vblank_event+0x54/0x1f0
  ...
  [<c02952e8>] (__list_add) from [<c031a7b4>] (send_vblank_event+0x54/0x1f0)
  [<c031a760>] (send_vblank_event) from [<c031a9c0>] (drm_send_vblank_event+0x70/0x78)
  [<c031a950>] (drm_send_vblank_event) from [<c031a9f8>] (drm_crtc_send_vblank_event+0x30/0x34)
  [<c031a9c8>] (drm_crtc_send_vblank_event) from [<c0339ad8>] (vop_isr+0x224/0x28c)
  [<c03398b4>] (vop_isr) from [<c0081780>] (handle_irq_event_percpu+0x12c/0x3e4)

This can be triggered somewhat reliably with:

	modetest -M rockchip -v -s ...

Add a preclose hook to the driver so that we can discard any pending
vblank events when the device is closed.

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

Change-Id: Icce075cf22f3a9d7b2157c29a47b370160b0c8d8
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-03-30 10:00:45 +08:00
Yakir Yang
f70d99fdb6 drm/rockchip: analogix_dp: add rk3399 eDP support
RK3399 and RK3288 shared the same eDP IP controller, so this time we
just need to append the RK3399 compatible name to analogix_dp documentation
and driver code.

Change-Id: I3fee6893c56698ee2948b9df2f3ffb7729fe75ef
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
2016-03-29 20:16:05 +08:00
Yakir Yang
455be1a2af drm: bridge: analogix_dp: correct the register bit define error in ANALOGIX_DP_PLL_REG_1
There're an register define error in ANALOGIX_DP_PLL_REG_1 which introduced
by commit 45970584ea (FROMLIST: drm: bridge:
analogix/dp: add some rk3288 special registers setting).

The PHY PLL input clock source is selected by ANALOGIX_DP_PLL_REG_1
BIT 0, not BIT 1.

Change-Id: I8cb806d23144697225f626aaa2af19e6379dfe51
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
2016-03-29 20:15:46 +08:00
Huang, Tao
7a8bd6a860 Merge branch 'android-4.4' of https://android.googlesource.com/kernel/common
* android-4.4: (34 commits)
  sdcardfs: remove unneeded __init and __exit
  sdcardfs: Remove unused code
  fs: Export d_absolute_path
  sdcardfs: remove effectless config option
  inotify: Fix erroneous update of bit count
  fs: sdcardfs: Declare LOOKUP_CASE_INSENSITIVE unconditionally
  trace: cpufreq: fix typo in min/max cpufreq
  sdcardfs: Add support for d_canonical_path
  vfs: add d_canonical_path for stacked filesystem support
  sdcardfs: Bring up to date with Android M permissions:
  Changed type-casting in packagelist management
  Port of sdcardfs to 4.4
  Included sdcardfs source code for kernel 3.0
  ANDROID: usb: gadget: Add support for MTP OS desc
  CHROMIUM: usb: gadget: f_accessory: add .raw_request callback
  CHROMIUM: usb: gadget: audio_source: add .free_func callback
  CHROMIUM: usb: gadget: f_mtp: fix usb_ss_ep_comp_descriptor
  CHROMIUM: usb: gadget: f_mtp: Add SuperSpeed support
  FROMLIST: mmc: block: fix ABI regression of mmc_blk_ioctl
  FROMLIST: mm: ASLR: use get_random_long()
  ...

Change-Id: I88fa8a7f6bfc80bee98503b9ede0fee08d62814c
2016-03-29 19:45:19 +08:00
Huang, Tao
a43f5002cd Revert "mmc: block: ioctl return EINVAL if cmd unknown"
This reverts commit 7c1abbfe2a.
Will fixes by aosp commit "mmc: block: fix ABI regression of mmc_blk_ioctl"

Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-03-29 19:40:03 +08:00
Xing Zheng
00fc9d59e2 clk: rockchip: rk3399: Add more pll rates for HDMI
Modify the 594MHz parameter for higher VCO freq to reduce the jitter.

Change-Id: I78784210b69d6895758192c84724b982fcc9e72d
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-29 19:30:55 +08:00
David Wu
eb4089b259 pinctrl: rockchip: fix pull setting error for rk3399
Change-Id: Ie52226e751510373abc75754ab756a36ae4f3aaa
Signed-off-by: David Wu <david.wu@rock-chips.com>
2016-03-27 05:29:11 +08:00
Zain Wang
c1d6d3486d regulator: mp8865: add regulator driver for MP8865
Change-Id: I5fa8423e5d1e301a008dcdfd60f93c442f6211a8
Signed-off-by: Zain Wang <wzz@rock-chips.com>
2016-03-29 14:56:15 +08:00
Elaine Zhang
0d85e81ec1 UPSTREAM: soc: rockchip: power-domain: Modify power domain driver for rk3399
This driver is modified to support RK3399 SoC.

Change-Id: Id4d040a78e7e18d78e9644b14e0611fc6ab44abe
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
[small indentation fixups]
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
 v4.7-armsoc/drivers commit fd8b62cc38)
2016-03-29 14:54:52 +08:00
Elaine Zhang
8a40546ac4 UPSTREAM: soc: rockchip: power-domain: add support for sub-power domains
This patch adds support for making one power domain a sub-domain of
other domain. This is useful for modeling power dependences,
which needs to have more than one power domain enabled to be operational.

Change-Id: Ie2a79aab6e1e073157c06d44252ef327caee5261
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
[restructured error handling in subdomain-addition]
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
 v4.7-armsoc/drivers commit 6be05b5ec1)
2016-03-29 14:53:55 +08:00
Elaine Zhang
23a0699a57 UPSTREAM: soc: rockchip: power-domain: allow domains only handling idle requests
On some Rockchip SoC there exist child-domains only handling their
idle state with the actual power-state handled by a (shared) parent-
domain.

So allow such types of domains. For them, we can determine their
state (on/off) by checking the inverse idle-state instead.

There exist one special case if both idle as well power handling
were set as not present, but as the domain-data is defined in the
code itself, we can expect the reasonable developer to define them
in a correct way, without adding more checks.

Change-Id: Ic82cb387565a39043d5d52e62a94910de10d4bbd
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
 v4.7-armsoc/drivers commit 1fe767a56c)
2016-03-29 14:53:10 +08:00
Elaine Zhang
3ea83abf50 UPSTREAM: soc: rockchip: power-domain: make idle handling optional
Not all new socs need to handle idle states on domain state changes,
so add the possibility to make them optional.

Change-Id: I46d869e1de9e03ec0664518effbcf2642053391e
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
 v4.7-armsoc/drivers commit 6aa841c809)
2016-03-29 14:52:18 +08:00
xubilv
172d27a35b video: rockchip: mipi: 3399: add support rk3399
Change-Id: I52fbecb5c6739b8ed1e35c3c3be7778a189874a6
Signed-off-by: xubilv <xbl@rock-chips.com>
2016-03-29 14:15:17 +08:00
Frank Wang
9ba702ce6e phy: rockchip-usb: Fixed the port cannot be resumed after suspended.
selecting utmi interface signals from utmi interface of usb20
host0 controller to usb2phy, when phy is resumed.

Change-Id: I487e836b89177cd8bc2dc56400f4dc277c8d2bf0
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2016-03-29 12:18:11 +08:00
Huang Jiachai
ac5406c5aa video: rockchip: vop: 3399: add support rk3399
Change-Id: Icbccfdd4fb841df67c0ade1cfd141fb574d837f0
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2016-03-29 10:36:10 +08:00
Xing Zheng
60c4848c4d clk: rockchip: rk3399: use the FRACMUX type for spdif and i2s0~2
Change-Id: I1f0f60185e70bb894010137db8a35dda218201f2
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-29 10:26:09 +08:00
xubilv
b7a7e2bfc9 video: rockchip: mipi: enable clk before write register
Change-Id: I717ed1143c53e7c2cd04697e8cc3984f89e29504
Signed-off-by: xubilv <xbl@rock-chips.com>
2016-03-28 17:06:30 +08:00
Xing Zheng
2f089ed109 clk: rockchip: rk3399: pclkin_isp1_wrapper should source from pclkin_cif
Change-Id: Id2ccc4003fcd286594fa2c2fc366f7c922417883
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-28 17:05:50 +08:00
Xing Zheng
6b8eed4760 clk: rockchip: rk3399: remove re-enable pmucru clk_gate/pclk_alive
These are not gating default when the SoC startup, so we don't need
to re-enable them.

Change-Id: I956a31345fe7f24b973db6c9e49d87a2988ac7d6
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-28 10:44:03 +08:00
Simon
d8e3c63e30 iommu/rockchip: add more judgement for virtual device who using iommu
A virtual device like "drm" call iommu_attach_device may fail.
Current only judge if a device has "group", this is not enough,
"group->iommu_data" is needed

Change-Id: I1a66d6016dfef867d83aa4cccaf223ced4e07161
Signed-off-by: Simon <xxm@rock-chips.com>
2016-03-28 10:42:59 +08:00
Xing Zheng
de4939f7fc clk: rockchip: rk3399: add some aclk/dclk IDs for vop0/vop1
Change-Id: If59b057892ad8bfe250ac763905150518cdc8631
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-28 09:21:49 +08:00
Caesar Wang
82d304f385 thermal: rockchip: handle the power sequence for rk3399 SoCs
This adds the grf property to handle the tsadc power sequence on
rk3399 SoCs.

The rk3399 tsadc can work with this patch on now.

while true; do grep "" /sys/class/thermal/thermal_zone[0-1]/temp;sleep .5; done
/sys/class/thermal/thermal_zone0/temp:40555
/sys/class/thermal/thermal_zone1/temp:41111
/sys/class/thermal/thermal_zone0/temp:40555
/sys/class/thermal/thermal_zone1/temp:41111
/sys/class/thermal/thermal_zone0/temp:40555
/sys/class/thermal/thermal_zone1/temp:41666
/sys/class/thermal/thermal_zone0/temp:40555
/sys/class/thermal/thermal_zone1/temp:41111
/sys/class/thermal/thermal_zone0/temp:40555
/sys/class/thermal/thermal_zone1/temp:41111
/sys/class/thermal/thermal_zone0/temp:40555

Change-Id: I0155826bddf0017ea4985920268b333a20278bbe
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-03-25 16:20:08 +08:00
Chaotian Jing
2f98f55d98 UPSTREAM: mmc: core: fix __mmc_switch timeout caused by preempt
there is a time window between __mmc_send_status() and time_afer(),
on some eMMC chip, the timeout_ms is only 10ms, if this thread was
scheduled out during this period, then, even card has already changes
to transfer state by the result of CMD13, this part of code also treat
it to timeout error.
So, need calculate timeout first, then call __mmc_send_status(), if
already timeout and card still in programing state, then treat it to
the real timeout error.

Change-Id: I7499d3d41711ea5abe6baec780d2988dc60dfc5b
Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 3bbb0deea6)
2016-03-25 14:58:22 +08:00
Adrian Hunter
354189f074 UPSTREAM: mmc: sdhci: Fix override of timeout clk wrt max_busy_timeout
Normally the timeout clock frequency is read from the capabilities
register.  It is also possible to set the value prior to calling
sdhci_add_host() in which case that value will override the
capabilities register value.  However that was being done after
calculating max_busy_timeout so that max_busy_timeout was being
calculated using the wrong value of timeout_clk.

Fix that by moving the override before max_busy_timeout is
calculated.

The result is that the max_busy_timeout and max_discard
increase for BSW devices so that, for example, the time for
mkfs.ext4 on a 64GB eMMC drops from about 1 minute 40 seconds
to about 20 seconds.

Note, in the future, the capabilities setting will be tidied up
and this override won't be used anymore.  However this fix is
needed for stable.

Change-Id: Ifd327b7c534a346f3537432d7bce7d8f1aebef3f
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org # v3.18+
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 9951362479)
2016-03-25 14:25:46 +08:00
Caesar Wang
a78536c528 thermal: rockchip: update the tsadc table for rk3399
This patch fixes the incorrect conversion table.
The Code to Temperature mapping is updated based on sillcon results.

Change-Id: If8ae3f5fb59786a8db8bf79276ecea44ab92ffc9
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-03-25 12:43:58 +08:00
Simon
5a3ebe609a iommu/rockchip: add map_sg callback for rk_iommu_ops
Change-Id: I7a677ba0c06c4031661681a26333b1e9a2aafd26
Signed-off-by: Simon <xxm@rock-chips.com>
2016-03-25 11:43:28 +08:00
Simon
737923cf7d iommu/rockchip: fix devm_request_irq and devm_free_irq parameter
When rk_iommu_attach_device or rk_iommu_detach_device be called, the second
parameter "dev" represent the device who own the iommu, so it is not resonable
using "dev" for devm_request_irq's first parameter. To avoid potential error,
we must use iommu device itself "iommu->dev" instead, the same as devm_free_irq.

Change-Id: Id9f4097d6f1b916308475854dcf75ce86d9494fc
Signed-off-by: Simon <xxm@rock-chips.com>
2016-03-25 11:42:58 +08:00
Frank Wang
dbcd409a06 phy: rockchip-usb: support usb2.0 phy for rk3399 SoC
1. Add a new compatible for rk3399;
2. Support gpio operation for vbus-drv.

Change-Id: I2eb1ac377db0bcb907d009c56fba22f1951c128e
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2016-03-25 11:32:44 +08:00
Heiko Stuebner
84c243bed6 drivers: firmware: psci: notify regulators on system-suspend
On some systems regulators need to do special actions on suspend/resume.
These get set from the generic regulator_suspend_prepare and
regulator_suspend_finish functions so these should be called from the
psci suspend ops as well.

Change-Id: I6fbf7b39ceae936ed5bd9df6719ccd3cd360840f
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Shengfei xu <xsf@rock-chips.com>
2016-03-25 10:14:39 +08:00
Wu Liang feng
ffee25e68d usb: dwc3: add dis_del_phy_power_chg_quirk
Add a quirk to clear the GUSB3PIPECTL.DELAYP1TRANS bit,
which specifies whether delay PHY power change from P0
to P1/P2/P3 when link state changing from U0 to U1/U2/U3
respectively.

Change-Id: I23e33f8b13001d6f86d6473ad43a261d9bda8f79
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2016-03-25 10:11:35 +08:00
Wu Liang feng
33a8a91509 usb: dwc3: add DWC3_GUCTL1 reg
Change-Id: I67dfabf539b85281904b9c4dfbc764bacecb7ac3
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2016-03-25 10:10:40 +08:00
Xing Zheng
d83ea61969 clk: rockchip: rk3399: add peri hp/lp0/lp1 noc clocks into critical
Change-Id: Id136016c27b17944fc33a848fb137c3452dd6289
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-25 10:08:53 +08:00
Xing Zheng
a67ffc5fee clk: rockchip: rk3399: Keep critical independently for the PMUCRU and CRU
Fix add critical clock for PMUCRU too late in the rk3399_clk_init. It
will be crash if there is one clock want to disable its parent which is
the PPLL.

Change-Id: I3fa236ab78571c8c8ec5d423228d00dbb02f24e6
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-25 09:59:24 +08:00