Commit Graph

592849 Commits

Author SHA1 Message Date
Mark Yao
853cbcbadb UPSTREAM: drm/rockchip: Use new vblank api drm_crtc_vblank_*
No functional update, drm_vblank_* is the legacy version of
drm_crtc_vblank_*. and use new api make driver more clean.

Change-Id: Ia93ec8124333d59446d1507f7567be2775bea144
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
(cherry picked from commit b5f7b75503)
2016-03-17 09:42:02 +08:00
Ville Syrjälä
52fb48a3d6 UPSTREAM: drm/rockchip: Constify function pointer structs
Moves a bunch of junk to .rodata from .data.

 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.ko:
-.rodata                      772
+.rodata                      828
-.data                        148
+.data                         92

 drivers/gpu/drm/rockchip/rockchipdrm.ko:
-.rodata                      748
+.rodata                      760
-.data                        448
+.data                        436

Change-Id: Ic93fc8d334a51618ea8075b4344983b795c7623e
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1450178476-26284-25-git-send-email-boris.brezillon@free-electrons.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 28c508ece6)
2016-03-17 09:42:01 +08:00
Ville Syrjälä
a91606afb1 UPSTREAM: drm: Pass 'name' to drm_encoder_init()
Done with coccinelle for the most part. However, it thinks '...' is
part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder
in its place and got rid of it with sed afterwards.

@@
identifier dev, encoder, funcs;
@@
 int drm_encoder_init(struct drm_device *dev,
                      struct drm_encoder *encoder,
                      const struct drm_encoder_funcs *funcs,
                      int encoder_type
+                     ,const char *name, int DOTDOTDOT
                      )
{ ... }

@@
identifier dev, encoder, funcs;
@@
 int drm_encoder_init(struct drm_device *dev,
                      struct drm_encoder *encoder,
                      const struct drm_encoder_funcs *funcs,
                      int encoder_type
+                     ,const char *name, int DOTDOTDOT
                      );

@@
expression E1, E2, E3, E4;
@@
 drm_encoder_init(E1, E2, E3, E4
+                 ,NULL
                  )

v2: Add ', or NULL...' to @name kernel doc (Jani)
    Annotate the function with __printf() attribute (Jani)

Change-Id: Id28ae2a6848fe1bd46905287b68f5d2c61d70039
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449670818-2966-1-git-send-email-ville.syrjala@linux.intel.com
(cherry picked from commit 13a3d91f17)
2016-03-17 09:42:01 +08:00
Ville Syrjälä
89df2e6a60 UPSTREAM: drm: Pass 'name' to drm_universal_plane_init()
Done with coccinelle for the most part. It choked on
msm/mdp/mdp5/mdp5_plane.c like so:
"BAD:!!!!!  enum drm_plane_type type;"
No idea how to deal with that, so I just fixed that up
by hand.

Also it thinks '...' is part of the semantic patch, so I put an
'int DOTDOTDOT' placeholder in its place and got rid of it with
sed afterwards.

I didn't convert drm_plane_init() since passing the varargs through
would mean either cpp macros or va_list, and I figured we don't
care about these legacy functions enough to warrant the extra pain.

@@
typedef uint32_t;
identifier dev, plane, possible_crtcs, funcs, formats, format_count, type;
@@
 int drm_universal_plane_init(struct drm_device *dev,
                              struct drm_plane *plane,
                              unsigned long possible_crtcs,
                              const struct drm_plane_funcs *funcs,
                              const uint32_t *formats,
                              unsigned int format_count,
                              enum drm_plane_type type
+                             ,const char *name, int DOTDOTDOT
                              )
{ ... }

@@
identifier dev, plane, possible_crtcs, funcs, formats, format_count, type;
@@
 int drm_universal_plane_init(struct drm_device *dev,
                              struct drm_plane *plane,
                              unsigned long possible_crtcs,
                              const struct drm_plane_funcs *funcs,
                              const uint32_t *formats,
                              unsigned int format_count,
                              enum drm_plane_type type
+                             ,const char *name, int DOTDOTDOT
                              );

@@
expression E1, E2, E3, E4, E5, E6, E7;
@@
 drm_universal_plane_init(E1, E2, E3, E4, E5, E6, E7
+                         ,NULL
                          )

v2: Split crtc and plane changes apart
    Pass NUL for no-name instead of ""
    Leave drm_plane_init() alone
v3: Add ', or NULL...' to @name kernel doc (Jani)
    Annotate the function with __printf() attribute (Jani)

Change-Id: I65fa347937ec17d21ac3fa28ec9c58c3ce97d496
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449670795-2853-1-git-send-email-ville.syrjala@linux.intel.com
(cherry picked from commit b0b3b79511)
2016-03-17 09:42:01 +08:00
Ville Syrjälä
d8bb13d947 UPSTREAM: drm: Pass 'name' to drm_crtc_init_with_planes()
Done with coccinelle for the most part. However, it thinks '...' is
part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder
in its place and got rid of it with sed afterwards.

I didn't convert drm_crtc_init() since passing the varargs through
would mean either cpp macros or va_list, and I figured we don't
care about these legacy functions enough to warrant the extra pain.

@@
identifier dev, crtc, primary, cursor, funcs;
@@
 int drm_crtc_init_with_planes(struct drm_device *dev,
                               struct drm_crtc *crtc,
                               struct drm_plane *primary, struct drm_plane *cursor,
                               const struct drm_crtc_funcs *funcs
+                              ,const char *name, int DOTDOTDOT
                               )
{ ... }

@@
identifier dev, crtc, primary, cursor, funcs;
@@
 int drm_crtc_init_with_planes(struct drm_device *dev,
                               struct drm_crtc *crtc,
                               struct drm_plane *primary, struct drm_plane *cursor,
                               const struct drm_crtc_funcs *funcs
+                              ,const char *name, int DOTDOTDOT
                               );

@@
expression E1, E2, E3, E4, E5;
@@
 drm_crtc_init_with_planes(E1, E2, E3, E4, E5
+                          ,NULL
                           )

v2: Split crtc and plane changes apart
    Pass NULL for no-name instead of ""
    Leave drm_crtc_init() alone
v3: Add ', or NULL...' to @name kernel doc (Jani)
    Annotate the function with __printf() attribute (Jani)

Link: http://patchwork.freedesktop.org/patch/msgid/1449670771-2751-1-git-send-email-ville.syrjala@linux.intel.com
(cherry picked from commit f98828769c)

Change-Id: I8eb2a67b3a01bd0cb49e552f05a5ee5c6ac99d40
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-03-17 09:42:01 +08:00
David Wu
ca441690cf ARM64: dts: rockchip: add io-domain support for rk3399-tb
Change-Id: Ib72983eb50c416649a35be4393a889bc72e2457a
Signed-off-by: David Wu <david.wu@rock-chips.com>
2016-03-16 20:29:56 +08:00
David Wu
bd7cad0698 ARM64: dts: rockchip: add backlight support for rk3399-tb
Change-Id: I99314db0fe7a31b4bb652749c35c738100bdf344
Signed-off-by: David Wu <david.wu@rock-chips.com>
2016-03-16 20:29:10 +08:00
David Wu
4d64919ca1 ARM64: dts: rockchip: add key support for rk3399-monkey
Change-Id: I1897555009fae4401d52eab443b59ff572b43879
Signed-off-by: David Wu <david.wu@rock-chips.com>
2016-03-16 20:28:45 +08:00
David Wu
2d42010d2d POWER: AVS: rockchip: add rk3399 io domain support
Change-Id: If4ccc31372f1cdbea84fc27009c1b8f9238ee1e9
Signed-off-by: David Wu <david.wu@rock-chips.com>
2016-03-16 20:28:09 +08:00
Huang, Tao
564ff29ab3 ARM64: dts: rk3366: add pmu node
Change-Id: I8ab43d9d6a1361ba1546363c4d16cfa3f87b3e3c
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-03-16 18:21:44 +08:00
Huang, Tao
33edbc6b60 ARM64: dts: rk3399: sort nodes and fix spi reg
Change-Id: Icb71adf3ebfcee57be46886672a0fe1afe77473f
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-03-16 17:56:39 +08:00
Elaine Zhang
e63146d4cf ARM64: dts: rockchip: add pmic node for RK3399
add pmic rk808 node for rk3399.
add pwm regulator node for rk3399.

Change-Id: I00b33363ba513064eb0a235c646df9a46062941c
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2016-03-16 17:25:44 +08:00
Huang, Tao
99b46d5254 ARM64: rockchip_defconfig: enable selinux
Change-Id: I0142795593483474ee157ed2d64cc0fb18f2ef44
Fixes: 361ddf2d69 ("arm64: rockchip: rockchip_defconfig updates for 4.4")
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-03-16 16:36:05 +08:00
Frank Wang
9dd79fc502 ARM64: dts: rockchip: add USB2.0 host nodes for rk3399
Change-Id: Id18a8b43210e439add8c5af8a18a3a62e0d06cc9
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2016-03-16 15:26:33 +08:00
Jianqun Xu
d7834b46fa ARM64: dts: rockchip: add dts files for rk3399
The dts files include three level:
- rk3399.dtsi
  includes nodes who closed to SoC, such as cpu\pmu\cru\i2c\pinctl\iommu...

- rk3399-tb.dtsi
  includes nodes who required by main board, they are common nodes for both
  chromeos and android; also to enable node from rk3399.dtsi if needs

- rk3399-monkey.dts
  used by evb board with android system

- rk3399-chrome.dts
  used by evb board with chromeos system

Change-Id: I02e21a8d184e74c96807f3b8b72075d466e1027f
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2016-03-16 15:04:37 +08:00
huweiguo
baa727d837 arm64: dts: rk3366-tb: add bt node and enable it
Change-Id: I2969aed08d0ca822d717c13680af71630bd57699
Signed-off-by: huweiguo <hwg@rock-chips.com>
2016-03-16 14:44:56 +08:00
Elaine Zhang
4f487054f7 ARM64: dts: rockchip: add power domain node for RK3399 Soc
add pd node for RK3399 Soc
create power domain tree

Change-Id: I5a455034f56b6d88860c3ed2decd8c6dc94896a3
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2016-03-16 14:25:35 +08:00
Shawn Lin
a268d44bf0 ARM64: dts: rockchip: add emmc, sdio and sdmmc node for rk3399
This patch add emmc, sdio and sdmmc node to support
mmc stuff on rk3399 platform.

Change-Id: I717855dded5f5161127ba29e34b9ff2106009c55
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-03-16 14:15:46 +08:00
Shawn Lin
a102978d92 phy: rockchip-emmc: fix compile issue on arm64 platform
This patch rename "reg" property to "reg_offset".
We rename it to fix the compile issue on ARM64 platform:
(reg_format): "reg" property in /phy has invalid length (4 bytes)
(#address-cells == 2, #size-cells == 2)

This's because "reg" is very special one which should keep the
*-cells with its parent node and can't be overwrited even if we
do that explicitly. On 32-bit plafform, the default *-cells
fit for what we assign to "reg". But that's not correct for 64-bit
platform. So we can see two possible solutions to fix this problem:
A) make phy-rockchip-emmc as a child phy node and overwrite its
parent's #address-cells and #size-cells.
B) avoid using this special property.

we use it just for passing on a offset for different Socs, and there's
no requirement to change the code to make phy-rockchip-emmc as a child
node. so choose option B) is sane.

Change-Id: Ib6a10cb8c3629ec3983854f1bfb7c2426edf79d2
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-03-16 14:13:06 +08:00
Shawn Lin
6ad7fb4206 ARM64: rockchip_defconfig: enable sdhci controller
Change-Id: Iec8f07c898ed651f662847d0605954f3c356c55e
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-03-16 14:12:13 +08:00
David Wu
d39e0ad771 pwm: rockchip: add pwm support for rk3399
Change-Id: I0658d1b69b5799c2ef6604563c41b5a0d87ddce2
Signed-off-by: David Wu <david.wu@rock-chips.com>
2016-03-16 14:11:31 +08:00
David Wu
8816005f35 ARM64: dts: rockchip: add saradc support for rk3399
Change-Id: I786e6efe31a45568d581baf09093f56409c0151f
Signed-off-by: David Wu <david.wu@rock-chips.com>
2016-03-16 14:09:36 +08:00
David Wu
211e773a63 ARM64: dts: rockchip: add pwm support for rk3399
Change-Id: I243cbf417cf78f39b97e12f66c916502fe72fe31
Signed-off-by: David Wu <david.wu@rock-chips.com>
2016-03-16 14:09:11 +08:00
David Wu
f7609e2590 ARM64: dts: rockchip: add i2c node for rk3399
Change-Id: I3a662d25927fc9c2c4f756963f1522c24fce70d6
Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2016-03-16 14:08:21 +08:00
David Wu
00a00a1ff0 iio: adc: rockchip_saradc: add saradc support for rk3399
Change-Id: I1d60583f02cc4b4cac8a8a1c1fb22bfeb5e52647
Signed-off-by: David Wu <david.wu@rock-chips.com>
2016-03-16 14:06:50 +08:00
xiaoyao
2f9c9cd46e net: rkwifi: Modify driver loading way to reduce boot time
Change-Id: Ie569aeedb5544cb0131ab48818db6a5b0dde05bb
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
2016-03-16 11:17:22 +08:00
Zhaoyifeng
85da5ca07a ARM64: dts: rk3366-tb: enable nandc
Change-Id: I2b563214e9ad276524f555a31a408c8995cb63a9
Signed-off-by: Zhaoyifeng <zyf@rock-chips.com>
2016-03-16 10:06:52 +08:00
Zhaoyifeng
8613805fc7 arm64: configs: rockchip_defconfig add nand driver
Change-Id: I3bccfe5710c860841714d6e54aa23ed075d5a584
Signed-off-by: Zhaoyifeng <zyf@rock-chips.com>
2016-03-16 10:06:19 +08:00
huweiguo
f99458ca37 net: rfkill-bt: auto compatible for uart rts control for all uart bt chip
Change-Id: I9b4d6614160285754ee86c427e8918296b92ddbd
Signed-off-by: huweiguo <hwg@rock-chips.com>
2016-03-15 19:38:01 +08:00
Zhaoyifeng
3cbba607a8 ARM64: nand: update nand drvier for 3366
Change-Id: I96ff59f331591807f8d5b009c933a6c71f62a93b
Signed-off-by: Zhaoyifeng <zyf@rock-chips.com>
2016-03-15 18:56:30 +08:00
Shengfei xu
050039bbaa ARM64: rockchip_defconfig: enable rk808 rtc
add CONFIG_RTC_DRV_RK808=y

Change-Id: I7aae9990c9bbf787a7e42e319116df6b4749c3cd
Signed-off-by: Shengfei xu <xsf@rock-chips.com>
2016-03-15 18:05:32 +08:00
Xing Zheng
85e725256d UPSTREAM: clk: rockchip: add new pll-type for rk3399 and similar socs
The rk3399's pll and clock are similar with rk3036's, it different
with base on the rk3066(rk3188, rk3288, rk3368 use it), there are
different adjust foctors and control registers, so these should be
independent and separate from the series of rk3066s.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git.kernel.org mmind/linux-rockchip.git
v4.7-clk/next commit 95e0c473a0ac1bdac25f55678dc602eb50dae684)

Change-Id: I77872b5fb33eb92402e9036b97b185ea56eb45c6
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-15 17:51:57 +08:00
Shawn Lin
6e7ff899c2 UPSTREAM: clk: rockchip: release io resource when failing to init clk
We should call iounmap to relase reg_base since it's not going
to be used any more if failing to init clk.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git.kernel.org mmind/linux-rockchip.git
v4.7-clk/next commit 86609a6613c64ee9272da1fd2f578d4beab2174e)

Conflicts:

	drivers/clk/rockchip/clk-rk3228.c
[zx: there is no rk3228 clock controller, and apply this patch for
clk-rk3366 manually.]

Change-Id: I2d73c90eb6f43150725c81417af37a6a562cd329
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-15 17:49:31 +08:00
Shawn Lin
d73b398d05 UPSTREAM: clk: rockchip: remove redundant checking of device_node
rockchip_clk_of_add_provider is used by sub-clk driver which
already call of_iomap before calling it. If device_node does
not exist, of_iomap returns NULL which will fail to init the
sub-clk driver. So really it's redundant.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git.kernel.org mmind/linux-rockchip.git
v4.7-clk/next commit a96edf5a5243e1bdf642492b783221aa498f1e49)

Change-Id: I9a51ed269fe26742da2ae84d99cf9689f49add1b
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-15 17:48:56 +08:00
Shawn Lin
fbb233e6fa UPSTREAM: clk: rockchip: fix warning reported by kernel-doc
./scripts/kernel-doc -man -v drivers/clk/rockchip/clk.h > /dev/null

drivers/clk/rockchip/clk.h:133: warning: missing initial short
description on line:
 * struct rockchip_clk_provider: information about clock provider
drivers/clk/rockchip/clk.h:133: info: Scanning doc for struct
drivers/clk/rockchip/clk.h:164: warning: missing initial short
description on line:
 * struct rockchip_pll_clock: information about pll clock
drivers/clk/rockchip/clk.h:164: info: Scanning doc for struct
drivers/clk/rockchip/clk.h:194: warning: No description found for
parameter 'parent_names'
drivers/clk/rockchip/clk.h:194: warning: No description found for
parameter 'num_parents'
drivers/clk/rockchip/clk.h:194: warning: Excess struct/union/enum/typedef
member 'parent_name' description in 'rockchip_pll_clock'
drivers/clk/rockchip/clk.h:235: warning: missing initial short
description on line:
 * struct rockchip_cpuclk_reg_data: describes register offsets and
masks of the cpuclock

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git.kernel.org mmind/linux-rockchip.git
v4.7-clk/next commit 1c908b320055e1ce706e91121dbb2ce7934c788f)

Change-Id: I18dbd45ebd528fe2a871c98a1561dd0c0bf41e13
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-15 17:48:21 +08:00
Shawn Lin
b270437e9d UPSTREAM: clk: rockchip: remove mux_core_reg from rockchip_cpuclk_reg_data
mux_core_reg isn't been used anywhere, let's remove it.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git.kernel.org mmind/linux-rockchip.git
v4.7-clk/next commit 72478f190fec9f2358b62f32ce5e27e6f323fa53)

Change-Id: Ib6d8ee5bca61d1ada6215660862d2d728927a948
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-15 17:47:44 +08:00
Xing Zheng
f7bb23aecf UPSTREAM: clk: rockchip: Add support for multiple clock providers
There are need to support Multi-CRUs probability in future, but
it is not supported on the current Rockchip Clock Framework.

Therefore, this patch add support a provider as the parameter
handler when we call the clock register functions for per CRU.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git.kernel.org mmind/linux-rockchip.git
v4.7-clk/next commit d509ddf2e57c99ae760d1a289b85f1e0d729f864)

Conflicts:

	drivers/clk/rockchip/clk-rk3036.c
	drivers/clk/rockchip/clk-rk3188.c
	drivers/clk/rockchip/clk-rk3228.c
	drivers/clk/rockchip/clk-rk3366.c
[zx: keep calling clk_register_fixed_factor previouslly, and there
is no rk3228 clock controller, add support for clk-rk3366 manually,
because it is not in the upstream codes.]

Change-Id: I94976f38fb6edd88f334479d6e44fef5bcdfc16a
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-15 17:46:48 +08:00
Xing Zheng
35bba3204b UPSTREAM: clk: rockchip: allow varying mux parameters for cpuclk pll-sources
Thers are only two parent PLLs that APLL and GPLL for core on the
previous SoCs (RK3066/RK3188/RK3288/RK3368). Hence, we set fixed
GPLL as alternate parent when core is switching freq.

Since RK3399 big.LITTLE architecture, we need to select and adapt
more PLLs (ALPLL/ABPLL/DPLL/GPLL) sources.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git.kernel.org mmind/linux-rockchip.git v4.7-clk/next
 commit 0fda2be634398f4b8d53c0436311f99557e56c4e)

Conflicts:

	drivers/clk/rockchip/clk-rk3228.c
[zx: there is no rk3228 clock controller, apply this patch for 
clk-rk3366.]

Change-Id: I48fde9facccd41585873c997b0b02a7a73972717
2016-03-15 17:24:38 +08:00
Heiko Stuebner
9f11b885e1 UPSTREAM: clk: rockchip: only enter pll slow-mode directly before reboots on rk3288
As commit 1d33929e2a ("clk: rockchip: switch PLLs to slow mode before
reboot for rk3288") states, switching the PLLs to slow-mode is only
necessary when rebooting using the soft-reset done through the CRU.

The dwc2 controllers used create really big number of interrupts in
special constellations involving usb-hubs and their number is so high,
it can even overwhelm the interrupt handler if the cpu-speed os to low.

Right now the PLLs are put into slow-mode in a shutdown syscore_ops
callback which means it happens on all reboots (not only the soft-reset
ones) and even on poweroff actions.

This can result in the system not powering off and getting stuck instead,
so we should move the slow-mode change nearer to the actual reboot action.

For this we introduce the possiblity to also set a callback that gets
called from the restart-handler directly prior to restarting the system
and move the shutdown-callback to this new option.

With this the slow-mode switch is done only on the necessary reboots
and also has a smaller possibility of causing artifacts.

Fixes: 1d33929e2a ("clk: rockchip: switch PLLs to slow mode before reboot for rk3288")
Signed-off-by: Heiko Stuebner <heiko.stuebner@collabora.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
(cherry picked from commit dfff24bde7)

Conflicts:

	drivers/clk/rockchip/clk-rk3228.c
[zx: there is no rk3228 clock controller, apply for clk-rk3366]

Change-Id: I2e91afd893c87eb3ab8a41db1fe81f5c43409951
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-15 17:21:33 +08:00
Chris Zhong
f0df56476f UPSTREAM: clk: rockchip: switch PLLs to slow mode before reboot for rk3288
We've been seeing some crashes at reboot test on rk3288-based systems,
which boards have not reset pin connected to NPOR, they reboot by
setting 0xfdb9 to RK3288_GLB_SRST_FST register. If the APLL works in
a high frequency mode, some IPs might hang during soft reset.
It appears that we can fix the problem by switching to slow mode before
reboot, just like what we did before suspend.

Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 1d33929e2a)

Change-Id: Ic01f80e6f33ae84cc87e954aae35f26b6f1a5434
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-03-15 17:20:14 +08:00
Frank Wang
eaef8b16af ARM64: dts: rockchip: rk3366: add usb2.0 phy node
Change-Id: Ib1bc0add32d99de9ed78e70c29526cef926c7cad
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2016-03-15 17:00:11 +08:00
Frank Wang
bf011cb752 phy: rockchip-usb: support InnoSilicon usb2.0 phy
For InnoSilicon usb2.0 phy, there is no siddq bit for operating,
what is more, when we control usb phy to suspend, its Plls will
not be affected. So we can operate resume/suspend bits directly
when it is going to power on/off.

Change-Id: I6bfe6b1a90b1bdcb0b0d5b670d579a625b22c0ba
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2016-03-15 16:59:43 +08:00
Frank Wang
a441e07982 Documentation: bindings: add compatible entry for Rockchip USB2.0 PHY
Compatible "rockchip,rk336x-usb-phy" support to RK3368 & RK3366.

Change-Id: I435ecd0a9f1c2a50836f7e3c44b6089ba49d728a
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2016-03-15 16:59:17 +08:00
Xing Zheng
331fd8c032 UPSTREAM: clk: rockchip: add a COMPOSITE_FRACMUX_NOGATE type
Because there are some frac clock mux nodes don't have a gate node on
the RK3399.

Change-Id: I4791b90a08faab286743a5cba30738cfb046594c
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git.kernel.org mmind/linux-rockchip.git v4.7-clk/next
 commit ffd9d4d39ef7ff90364d3abd6c39919e6582b605)
2016-03-14 15:45:56 +08:00
Feng Xiao
e69848b3a5 clk: rockchip: add clock ids for mpll_src and 32k on RK3366
Set the newly added id for mpll_src and 32k, so that they can be called
in other parts.

Change-Id: Ief82231215a147b62abcfbb5565054470fc9ea37
Signed-off-by: Feng Xiao <xf@rock-chips.com>
2016-03-14 15:40:06 +08:00
Caesar Wang
a04db15f5a ARM64: dts: rockchip: enable the tsadc for rk3399 chrome
This patch enables the tsadc for rk3399 evb board.

The rk3399 evb board uses the gpio to reset the chip since it connects the
PMIC to work, and TSHUT is low active on evb board.

Change-Id: Ibd4fc2c752fe1f34cc231385ee314e4b9a32e970
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-03-14 11:16:08 +08:00
Caesar Wang
ca96c1efd9 ARM64: dts: rockchip: add the thermal main info found on rk3399
This patch adds the thermal needed main information for rk3399 SoCS.

Basically has the following content:

1) TSADC controller:
    Add the needed attributes for rk3399 TSADC controller.
    Especially for the TSHUT, in some cases if we are unable to shut it down
    in orderly fashion (says: kernel is stuck holding a lock or similar), then
    hardware TSHUT will reset it.
    If the temperature is over 95C over a period of time the thermal shutdown
    of the tsadc is invoked with can either reset the entire chip via the CRU,
    or notify the PMIC via a GPIO. This should be set in the specific board.

2) Thermal zones:
    Add the needed device mode for thermal generic framework.
    Detail in Documentation/devicetree/bindings/thermal/thermal.txt.

Change-Id: I1361beeb85e6d4a134b4640c16440452aa950e16
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-03-14 11:16:00 +08:00
Huang Jiachai
d4a6147e3d video: rockchip: lcdc: 3366: add support power domain control
Change-Id: Ibb9d15e6e2a84a1847f4cfbbc8e75bca54e1782b
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2016-03-14 11:04:58 +08:00
Elaine Zhang
65fa879a39 dt/bindings: power: add RK3399 SoCs header for power-domain
According to a description from TRM, add all the power domains

Change-Id: Ibbf17fb1edc125358760db8acd99dd681913cd3c
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2016-03-14 10:08:07 +08:00
Sugar Zhang
03d5440241 ARM64: dts: rk3399: add pinctrl for i2s spdif
Change-Id: I12ae87196180efadb6a8b16787b4815c42223970
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2016-03-11 17:51:47 +08:00