firefly-linux-kernel-4.4.55.git
8 years agoFROMLIST: extcon: Add the synchronization extcon APIs to support the notification
Chanwoo Choi [Fri, 22 Jul 2016 04:16:34 +0000 (13:16 +0900)]
FROMLIST: extcon: Add the synchronization extcon APIs to support the notification

This patch adds the synchronization extcon APIs to support the notifications
for both state and property. When extcon_*_sync() functions is called,
the extcon informs the information from extcon provider to extcon client.

The extcon driver may need to change the both state and multiple properties
at the same time. After setting the data of a external connector,
the extcon send the notification to client driver with the extcon_*_sync().

The list of new extcon APIs as following:
- extcon_sync() : Send the notification for each external connector to
synchronize the information between extcon provider driver
and extcon client driver.
- extcon_set_state_sync() : Set the state of external connector with noti.
- extcon_set_property_sync() : Set the property of external connector with noti.

For example,
case 1, change the state of external connector and synchronized the data.
extcon_set_state_sync(edev, EXTCON_USB, 1);

case 2, change both the state and property of external connector
and synchronized the data.
extcon_set_state(edev, EXTCON_USB, 1);
extcon_set_property(edev, EXTCON_USB, EXTCON_PROP_USB_ID, 1);
extcon_sync(edev, EXTCON_USB);

case 3, change the property of external connector and synchronized the data.
extcon_set_property(edev, EXTCON_USB, EXTCON_PROP_USB_VBUS, 0);
extcon_set_property(edev, EXTCON_USB, EXTCON_PROP_USB_ID, 1);
extcon_sync(edev, EXTCON_USB);

case 4, change the property of external connector and synchronized the data.
extcon_set_property_sync(edev, EXTCON_USB, EXTCON_PROP_USB_VBUS, 0);

Change-Id: Id8c04a88f28b8f3428afae122a761ff1d27a485f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chris Zhong <zyw@rock-chips.com>
Tested-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
(cherry picked from commit cc3e39670d41
 git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-test)
Signed-off-by: Guenter Roeck <groeck@chromium.org>
8 years agoFROMLIST: extcon: Rename the extcon_set/get_state() to maintain the function naming...
Chanwoo Choi [Fri, 22 Jul 2016 04:03:17 +0000 (13:03 +0900)]
FROMLIST: extcon: Rename the extcon_set/get_state() to maintain the function naming pattern

This patch just renames the existing extcon_get/set_cable_state_()
as following because of maintaining the function naming pattern
like as extcon APIs for property.
- extcon_set_cable_state_() -> extcon_set_state()
- extcon_get_cable_state_() -> extcon_get_state()

But, this patch remains the old extcon_set/get_cable_state_() functions
to prevent the build break. After altering new APIs, remove the old APIs.

Change-Id: I9dfdf0e254d2f598ca81836ec2a6a136da4fd8ba
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chris Zhong <zyw@rock-chips.com>
Tested-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
(cherry picked from commit 1bbc8c29be69
 git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-test)
Signed-off-by: Guenter Roeck <groeck@chromium.org>
8 years agoFROMLIST: extcon: Add the support for the capability of each property
Chanwoo Choi [Mon, 25 Jul 2016 12:15:19 +0000 (21:15 +0900)]
FROMLIST: extcon: Add the support for the capability of each property

This patch adds the support of the property capability setting. This function
decides the supported properties of each external connector on extcon provider
driver.

Ths list of new extcon APIs to get/set the capability of property as following:
- int extcon_get_property_capability(struct extcon_dev *edev,
unsigned int id, unsigned int prop);
- int extcon_set_property_capability(struct extcon_dev *edev,
unsigned int id, unsigned int prop);

Change-Id: I6b8b41de70f2bccc7b996592ec9a2a008730f45d
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chris Zhong <zyw@rock-chips.com>
Tested-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
(cherry picked from commit e4a095473938
 git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-test)
Signed-off-by: Guenter Roeck <groeck@chromium.org>
8 years agoFROMLIST: extcon: Add the support for extcon property according to extcon type
Chanwoo Choi [Mon, 11 Jul 2016 10:30:43 +0000 (19:30 +0900)]
FROMLIST: extcon: Add the support for extcon property according to extcon type

This patch support the extcon property for the external connector
because each external connector might have the property according to
the H/W design and the specific characteristics.

- EXTCON_PROP_USB_[property name]
- EXTCON_PROP_CHG_[property name]
- EXTCON_PROP_JACK_[property name]
- EXTCON_PROP_DISP_[property name]

Add the new extcon APIs to get/set the property value as following:
- int extcon_get_property(struct extcon_dev *edev, unsigned int id,
unsigned int prop,
union extcon_property_value *prop_val)
- int extcon_set_property(struct extcon_dev *edev, unsigned int id,
unsigned int prop,
union extcon_property_value prop_val)

Change-Id: I3e483c69b374dcd6b340c94671d237c21e862cd2
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chris Zhong <zyw@rock-chips.com>
Tested-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
(cherry picked from commit f8ffa9daf942
 git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-test)
Signed-off-by: Guenter Roeck <groeck@chromium.org>
8 years agoFROMLIST: extcon: Add the extcon_type to gather each connector into five category
Chanwoo Choi [Mon, 11 Jul 2016 07:34:52 +0000 (16:34 +0900)]
FROMLIST: extcon: Add the extcon_type to gather each connector into five category

This patch adds the new extcon type to group the each connecotr
into following five category. This type would be used to handle
the connectors as a group unit instead of a connector unit.
- EXTCON_TYPE_USB  : USB connector
- EXTCON_TYPE_CHG  : Charger connector
- EXTCON_TYPE_JACK : Jack connector
- EXTCON_TYPE_DISP : Display connector
- EXTCON_TYPE_MISC : Miscellaneous connector

Also, each external connector is possible to belong to one more extcon type.
In caes of EXTCON_CHG_USB_SDP, it have the EXTCON_TYPE_CHG and EXTCON_TYPE_USB.

Change-Id: I8299ecaa87a8277af4018f8cc28e9b63f25c026c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chris Zhong <zyw@rock-chips.com>
Tested-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
(cherry picked from commit 3665c70e95f7
 git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-test)
Signed-off-by: Guenter Roeck <groeck@chromium.org>
8 years agodrm/rockchip: Fix drm rga driver for arm64
Zikim,Wei [Thu, 4 Aug 2016 06:24:10 +0000 (14:24 +0800)]
drm/rockchip: Fix drm rga driver for arm64

compat_uptr_t is defined in asm/compat.h:
typedef u32  compat_uptr_t;
but cmd and cmd_buf store the user pointers.
Do not convert 64 bit pointer to 32 bit, it
will lead copy_from_user fail.

Change-Id: Ia0435f2a495bbe64d583e213349cb9f041c9d75a
Signed-off-by: Zikim,Wei <wzq@rock-chips.com>
8 years agoInput: gslx680 - enable macro define RK_GEAR_TOUCH
jerry.zhang [Tue, 2 Aug 2016 05:58:06 +0000 (13:58 +0800)]
Input: gslx680 - enable macro define RK_GEAR_TOUCH

Change-Id: Ie0cb0ccd645cbecf74b3d0d85d80d4537bae75cd
Signed-off-by: jerry.zhang <jerry.zhang@rock-chips.com>
8 years agoarm64: dts: rockchip: modify sd minimum frequency for rk3399-box
xiaoyao [Tue, 2 Aug 2016 10:13:02 +0000 (18:13 +0800)]
arm64: dts: rockchip: modify sd minimum frequency for rk3399-box

The host can issue continuous clock in the frequency range
of 100KHz-400KHz for card identification mode.

Change-Id: I4e6a96a5ec49ee102a3b24c3f7f9b74d6bc8fd5f
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
8 years agoARM64: dts: rk3399-vr: fix eas parameters for vr board with ES2
Jianqun Xu [Wed, 3 Aug 2016 04:11:07 +0000 (12:11 +0800)]
ARM64: dts: rk3399-vr: fix eas parameters for vr board with ES2

Change-Id: I8c1834e8515cc6387c68f1b3f8e370a5a1073aab
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
8 years agousb: dwc3: core: support DRD mode switch with extcon notifier
Wu Liang feng [Thu, 14 Jul 2016 02:32:19 +0000 (10:32 +0800)]
usb: dwc3: core: support DRD mode switch with extcon notifier

This patch register extcon notification for DRD mode.
If extcon cable state is EXTCON_USB, means that an USB
peripheral cable connected, and we need to set DWC3 work
in device mode. If extcon cable state is EXTCON_USB_HOST,
means that an USB host cable connected, and we need to
set DWC3 work in host mode.

And we need to register different notifier block for
EXTCON_USB notifier and EXTCON_USB_HOST notifier,because
if multiple notifiers registered with the same notifier
block, it will cause kernel crash on notification events.

Change-Id: Ia09e5088f738496b87d06b0f4062c144fa781e4e
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
8 years agodrm/rockchip: dsi: fix mipi display can't found at init time
Mark Yao [Mon, 1 Aug 2016 09:54:53 +0000 (17:54 +0800)]
drm/rockchip: dsi: fix mipi display can't found at init time

The problem is that:
  mipi panel probe request mipi_dsi_host_register.
  mipi host attach is call from panel device, so the defer function
always can't works.

So at the first bind time, always can't found mipi panel.

Change-Id: Ic95eeb4876896ea93860d8baaae074f50f078c62
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: support add fb from dev resource
Mark Yao [Mon, 1 Aug 2016 09:34:23 +0000 (17:34 +0800)]
drm/rockchip: support add fb from dev resource

Change-Id: I980af965d83de25c433ba5424bab2ad063534bcb
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: vop: enable iommu when we actually need it
Mark Yao [Tue, 2 Aug 2016 09:25:42 +0000 (17:25 +0800)]
drm/rockchip: vop: enable iommu when we actually need it

Change-Id: If22525a251b17a64c9e549b1aff93e4851de4080
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: find connector by device node
Mark Yao [Mon, 1 Aug 2016 09:03:17 +0000 (17:03 +0800)]
drm/rockchip: find connector by device node

Change-Id: I3851e296669c5c67ada47b472a3f7294ca25c796
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoarm64: dts: rk3399: use timing from dts
Mark Yao [Thu, 7 Jul 2016 08:28:42 +0000 (16:28 +0800)]
arm64: dts: rk3399: use timing from dts

Change-Id: I336af668ebc917388af47146400e6d5e3d94c2e0
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoARM64: dts: rk3399-box: adjust gpu opp table
Hans Yang [Tue, 2 Aug 2016 06:48:51 +0000 (14:48 +0800)]
ARM64: dts: rk3399-box: adjust gpu opp table

Adjust voltage of 500M to 0.9v

Change-Id: I21ac14f27cc7aaddfea6280e76decc28c8b1182a
Signed-off-by: Hans Yang <yhx@rock-chips.com>
8 years agosensor: add accel&gyro sensor driver for lsm330
Bin Yang [Tue, 2 Aug 2016 02:17:08 +0000 (10:17 +0800)]
sensor: add accel&gyro sensor driver for lsm330

Change-Id: Ibb0b6fe769774abc1a0f619eb9c626340e8b8bcc
Signed-off-by: Bin Yang <yangbin@rock-chips.com>
8 years agoUPSTREAM: extcon: Block the bit masking operation for cable state except for extcon...
Chanwoo Choi [Thu, 30 Jun 2016 17:41:18 +0000 (02:41 +0900)]
UPSTREAM: extcon: Block the bit masking operation for cable state except for extcon core

This patch restrict the usage of extcon_update_state() in the extcon
core because the extcon_update_state() use the bit masking to change
the state of external connector. When this function is used in device drivers,
it may occur the probelm with the handling mistake of bit masking.

Also, this patch removes the extcon_get/set_state() functions because these
functions use the bit masking which is reluctant way. Instead, extcon
provides the extcon_set/get_cable_state_() functions.

Change-Id: I436b8d4f9485bb318e7d77db8902f85e2bc15778
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit c2692f2dad4f3228579bb0b2cf2d6d9bf283f31a)

8 years agoUPSTREAM: extcon: adc-jack: Remove the usage of extcon_set_state()
Chanwoo Choi [Mon, 18 Jul 2016 07:16:29 +0000 (16:16 +0900)]
UPSTREAM: extcon: adc-jack: Remove the usage of extcon_set_state()

This patch removes the usage of extcon_set_state() because it uses the bit
masking to change the state of external connectors. The extcon framework
should handle the state by extcon_set/get_cable_state_() with extcon id.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
(cherry picked from commit 0ddde3db610d57d28c1fe9a61e32dff1dc55ea59
 git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-next)

Change-Id: I64d5ff0c054ca0bab9a59105bf5c395d998665ff
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
8 years agoUPSTREAM: extcon: gpio: Remove the usage of extcon_set_state()
Chanwoo Choi [Thu, 21 Jul 2016 11:00:29 +0000 (20:00 +0900)]
UPSTREAM: extcon: gpio: Remove the usage of extcon_set_state()

This patch removes the usage of extcon_set_state() because it uses
the bit masking to change the state of external connectors. The extcon framework
should handle the state by extcon_set_cable_state_() with extcon id.

Change-Id: I726f690d900375d36001fe4eda9b53bcdd2b4f86
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit 448991505c967d7b44ae9ea328224ec02858c8da)

8 years agoUPSTREAM: extcon: arizona: Remove the usage of extcon_update_state()
Chanwoo Choi [Thu, 30 Jun 2016 17:36:49 +0000 (02:36 +0900)]
UPSTREAM: extcon: arizona: Remove the usage of extcon_update_state()

This patch remvoes the usage of extcon_update_state() because
the extcon_update_state() use directly the bit masking calculation
to change the state of external connector without the unique id of
external connector. It makes the code diffcult to read it.
So, this patch uses the extcon_set_cable_state_() instead.

Change-Id: I807cce6c46e37b32d5fbdbf65c45d1ddf6587996
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit af67ea70da0e8e906a81ae00d742c82ecda63a27)

8 years agoUPSTREAM: extcon: arizona: Remove unneeded semi-colon
Charles Keepax [Tue, 19 Jul 2016 12:23:56 +0000 (13:23 +0100)]
UPSTREAM: extcon: arizona: Remove unneeded semi-colon

There is no need for a semi-colon at the end of a switch statement so
remove it.

Change-Id: I64a6f485bcb1b064d17cea5f56f22f8b3773bf75
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit fa1723bb3461f42b3c35eeb313f7021d089da5f1)

8 years agoUPSTREAM: extcon: Fix the wrong description about extcon_set/get_cable_state_()
Chanwoo Choi [Mon, 27 Jun 2016 12:09:04 +0000 (21:09 +0900)]
UPSTREAM: extcon: Fix the wrong description about extcon_set/get_cable_state_()

This patch fixes the wrong description about extcon_set/get_cable_state_()
because they use the unique id of external connector instead of legacy name.

Change-Id: I954d0905c966b5128e9de577db9633f6b4b398bb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit bc92126012c8c84988eebbbf9c8a246949b07462)

8 years agoUPSTREAM: extcon: Remove the state_store() to prevent the wrong access
Chanwoo Choi [Mon, 18 Jul 2016 06:39:28 +0000 (15:39 +0900)]
UPSTREAM: extcon: Remove the state_store() to prevent the wrong access

This patch removes the state_store() which change the state of external
connectors with bit masking on user-space. It is wrong access to modify
the change the state of external connectors.

Change-Id: I635e30e2a22ddc313ed90dc7ab0f7fdaa271ed1d
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit eeb820116207aa5dd71edbc0b8f0eaf3b20d77a1)

8 years agoUPSTREAM: extcon: Move extcon_get_edev_by_phandle() errors to dbg level
Stephen Boyd [Tue, 5 Jul 2016 18:57:05 +0000 (11:57 -0700)]
UPSTREAM: extcon: Move extcon_get_edev_by_phandle() errors to dbg level

Sometimes drivers may call this API and expect it to fail because
the extcon they're looking for is optional. Let's move these
prints to debug level so it doesn't look like there's a problem
when there isn't one.

Change-Id: Id3297af428cbaaef208e1990e1678b9ef04a7246
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit 27210e4efd5259c691c4c3ab53e74239efa0d581)

8 years agoUPSTREAM: extcon: add missing of_node_put after calling of_parse_phandle
Peter Chen [Fri, 1 Jul 2016 09:41:55 +0000 (18:41 +0900)]
UPSTREAM: extcon: add missing of_node_put after calling of_parse_phandle

of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

Change-Id: I96ad96b55e6f6c5e5335d12aeb5963c1b06451b3
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit 5d5c4c139dd766dff903ba35d72fb3ec90022e91)

8 years agoUPSTREAM: extcon: link devres into core module
Arnd Bergmann [Wed, 29 Jun 2016 14:38:30 +0000 (16:38 +0200)]
UPSTREAM: extcon: link devres into core module

Splitting the resource-managed functions into a separate module
means that the extcon core now fails to build because the internal
"extcon_dev_allocate" symbol is not exported:

ERROR: extcon_dev_allocate [drivers/extcon/devres.ko] undefined!

My guess is that the intention was not to have two separate
modules (which could be fixed by adding an export, plus the
normal MODULE_AUTHOR/MODULE_LICENSE/... fields), but have two
source files in the same module.

This fixes the Makefile accordingly, making the name of the
module extcon_core.ko, which is created from building both
extcon.c and devres.c.

Fixes: b225d00f3ad2 ("extcon: Split out the resource-managed functions from extcon core")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
(cherry picked from commit af61f96109b73fefbe0589c320d2219567f4f660
  git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-next)

Change-Id: I8a319f46437cd3d6ce98a4f6ac5d1c56930c9c76
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
8 years agoUPSTREAM: extcon: Add resource-managed functions to register extcon notifier
Chanwoo Choi [Mon, 27 Jun 2016 11:03:39 +0000 (20:03 +0900)]
UPSTREAM: extcon: Add resource-managed functions to register extcon notifier

This patch adds the resource-managed functions for register/unregister
the extcon notifier with the id of each external connector. This function
will make it easy to handle the extcon notifier.

- int devm_extcon_register_notifier(struct device *dev,
struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb);
- void devm_extcon_unregister_notifier(struct device *dev,
struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb);

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
(cherry picked from commit 58f386560a68dd98bd6744a28fc853eef11faebe
  git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-next)
Signed-off-by: Guenter Roeck <groeck@chromium.org>
Change-Id: I852184d12dc4a03b6d526112e998b087931726e5
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
8 years agoUPSTREAM: extcon: Split out the resource-managed functions from extcon core
Chanwoo Choi [Mon, 27 Jun 2016 10:28:04 +0000 (19:28 +0900)]
UPSTREAM: extcon: Split out the resource-managed functions from extcon core

This patch split out the resource-managed related functions
from extcon core driver.

Change-Id: I4dd6cff278849c754bd529f44c3489d8bc665b15
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit b225d00f3ad2d996f914790a0f6324a4efd18768)

8 years agoUPSTREAM: extcon: Move struct extcon_cable from header file to core
Chanwoo Choi [Mon, 27 Jun 2016 10:17:06 +0000 (19:17 +0900)]
UPSTREAM: extcon: Move struct extcon_cable from header file to core

This patch moves the struct extcon_cable because that should
be only handled by extcon core. There are no reason to publish
the internal structure.

Change-Id: I7b2e68487ad0ddfa8a2342e7754f16af8623aa58
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit 20f7b53dfc24e0caa984087691af82e442229680)

8 years agoUPSTREAM: extcon: Check for incorrect connection type in notifier register
Stephen Boyd [Thu, 23 Jun 2016 10:34:30 +0000 (19:34 +0900)]
UPSTREAM: extcon: Check for incorrect connection type in notifier register

If we call extcon_register_notifier() with the wrong cable type,
it blows up with an oops instead of returning an error code.
Let's be nice and fail gracefully given that the consumer might
not know if the cable is supported by the extcon provider.

Change-Id: I6e357a6af600dac82e9b1c30499b2d0a3d58d716
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit a05f44c89ee1151b0da3ddd43d9e57d8f15b2f20)

8 years agoUPSTREAM: extcon: Remove the deprecated extcon functions
Chanwoo Choi [Tue, 31 May 2016 08:32:30 +0000 (17:32 +0900)]
UPSTREAM: extcon: Remove the deprecated extcon functions

This patch removes the deprecated extcon functions using string type
to identify the type of external connector. The Commit 2a9de9c0f08d61
("extcon: Use the unique id for external connector instead of string)
uses the unique id to separate the type of external connector instead of
string name.
- extcon_register_interest()
- extcon_unregister_interest()
- extcon_set_cable_state()
- extcon_get_cable_state()

And, extcon_register_interest() finds the first extcon device to include the
requested external connector from extcon client device and then register the
notifier if extcon device argument is NULL. Instead, extcon_register_notifier()
supports this feature.

But, this patch remains the deprecatd function definition to prevent
the build break.

Change-Id: I8238aa91a6da91fe66cb6c182602bc3bcc8688ae
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(cherry picked from commit 830ae442202e314c2bdf7cb4c7cc64d76db0e197)

8 years agovideo: rockchip: edp: rk3399: add power domain control
Xubilv [Fri, 29 Jul 2016 10:15:51 +0000 (18:15 +0800)]
video: rockchip: edp: rk3399: add power domain control

Change-Id: I08a57e15bd182e3c4bcf87c383f55c21535a6acc
Signed-off-by: Xubilv <xbl@rock-chips.com>
8 years agoarm64: dts: rk3399-vr: ajust gpu opp table
wlq [Mon, 1 Aug 2016 01:38:12 +0000 (09:38 +0800)]
arm64: dts: rk3399-vr: ajust gpu opp table

ajust gpu voltage for stability

Change-Id: I1927bbe7990d6a9c9c712b53f1d5bf16b6102bb5
Signed-off-by: Liangqing Wu <wlq@rock-chips.com>
8 years agoARM: configs: remove DEBUG_LL relate configures from rockchip_linux_defconfig
Yakir Yang [Mon, 1 Aug 2016 10:10:28 +0000 (18:10 +0800)]
ARM: configs: remove DEBUG_LL relate configures from rockchip_linux_defconfig

If we enable the kernel low-level debugging port option, then we must
assign the right UART types and PHYS address for it. But different
CPUs must have different UART configures, we can't cover all of them
in this common configure file. For example:

* RK3036 would want to chose the UART types would be RK29_UART2, and
  UART_PHYS would be 0x20068000.

* RK3228 would want to chose the UART types would be RK29_UART2, and
  UART_PHYS would be 0x11030000.

* RK3288 would want to chose the UART types would be RK32_UART2, and
  UART_PHYS would be 0xff690000.

Change-Id: I70d0da1fbffbb720b5e464acd79405624d9e7d40
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agodrm/rockchip: dw-mipi: remove mode_valid
Chris Zhong [Tue, 2 Aug 2016 01:44:21 +0000 (09:44 +0800)]
drm/rockchip: dw-mipi: remove mode_valid

The MIPI DSI do not need check the validity of resolution, the max resolution
should depend VOP. So remove rk3288_mipi_dsi_mode_valid here.

Change-Id: I789d184f9a14010795fe595ef31e1bea5d1022e0
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
8 years agoARM64: dts: rk3399: add support edp screen for evb3
Jianqun Xu [Mon, 1 Aug 2016 08:13:12 +0000 (16:13 +0800)]
ARM64: dts: rk3399: add support edp screen for evb3

Support for some evb3 with edp screen, and with new touchscreen.

Change-Id: I8624ae38faef63aa5205861cfebb2a04f7bb8b30
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Tested-by: Frank Wang <frank.wang@rock-chips.com>
8 years agodt-bindings: display: support drm_mipi_dsi macro
Mark Yao [Tue, 26 Jul 2016 03:25:21 +0000 (11:25 +0800)]
dt-bindings: display: support drm_mipi_dsi macro

Change-Id: Ibbe73605fff42762d88f2bc138ce98914ab200cc
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: get rid of vop->is_enabled
Mark Yao [Mon, 1 Aug 2016 06:32:32 +0000 (14:32 +0800)]
drm/rockchip: get rid of vop->is_enabled

With atomic helpers there's no need to track the enabled state of a pipe
any more, because atomic helpers track this accurately already.

Change-Id: Ic2441b5acefe327cdef797aca88f6a2098643c69
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoUPSTREAM: drm/rockchip: Disarm vop->is_enabled
Mark Yao [Tue, 2 Aug 2016 09:24:37 +0000 (17:24 +0800)]
UPSTREAM: drm/rockchip: Disarm vop->is_enabled

With atomic helpers there's no need to track the enabled state of a pipe
any more, because atomic helpers track this accurately already.

Just disable the early returns, since the debug checks might be useful.

v2: Don't call drm_helper_disable_unused_functions, it blows up
without this check. At least explains why rockchip still needed this
old legacy-style state tracing - to work around issues from calling
other legacy style functions!

Change-Id: Ib63ad83b0212c5e2b0a44c1c5e2d188e7c876107
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Mark yao <mark.yao@rock-chips.com>
Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1465388359-8070-18-git-send-email-daniel.vetter@ffwll.ch
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoMALI: midgard: rockchip: add sysfs files to get GPU utilisation
chenzhen [Wed, 11 May 2016 10:18:04 +0000 (18:18 +0800)]
MALI: midgard: rockchip: add sysfs files to get GPU utilisation

Change-Id: I758369bdd9ef945a89fd87fd7a69bd9f391f0880
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
8 years agoARM: dts: rockchip: fix vdd_cpu to 1.25V on rk3036 kylin board
chenzhen [Tue, 14 Jun 2016 07:16:11 +0000 (15:16 +0800)]
ARM: dts: rockchip: fix vdd_cpu to 1.25V on rk3036 kylin board

In rk3036, the voltages of CPU and GPU are controlled by the same
regulator 'vdd_cpu'.
Here, we fix it to 1.25v to ensure that GPU could work well in
development period.
The actual voltage GPU needs might be much lower, and relative to
the frequence GPU runs at. this would be optimized when we implement
GPU DVFS with devfreq.

Change-Id: Ia25f0a67577fbfe248a25e4d913dc5f14fa40f0d
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
8 years agoarm64: dts: rockchip: manage the evb cros for rk3399
Caesar Wang [Fri, 29 Jul 2016 06:46:40 +0000 (14:46 +0800)]
arm64: dts: rockchip: manage the evb cros for rk3399

Add the rk3399-evb-cros.dtsi for cros private.
Also, we should add the rev3 dts to support it.

Change-Id: Ie68d4352474c7ea02c188e2c2176244709ac1b48
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
8 years agoARM64: dts: rk3399-box: ajust gpu opp table
Jianqun Xu [Fri, 29 Jul 2016 06:50:35 +0000 (14:50 +0800)]
ARM64: dts: rk3399-box: ajust gpu opp table

Ajust voltage of 800M to 1v, and remove 700M.

Change-Id: Iabcdcee4f84693c9db53fbaf885e946bc8ca4212
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
8 years agoARM64: dts: rk3399-vr: ajust gpu opp table
Jianqun Xu [Fri, 29 Jul 2016 06:49:12 +0000 (14:49 +0800)]
ARM64: dts: rk3399-vr: ajust gpu opp table

Ajust voltage of 800M to 1v, and remove 700M.

Change-Id: I429af91ff5660c0398f6c84f6e426be43c068c24
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
8 years agoARM: dts: rockchip: enable vpu for rk3288-miniarm
Nickey Yang [Fri, 29 Jul 2016 02:05:39 +0000 (10:05 +0800)]
ARM: dts: rockchip: enable vpu for rk3288-miniarm

Change-Id: Idc6b51984f92caf9ea8c8e608f3cef151d3c6b97
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
8 years agoARM64: configs: rockchip_cros_defconfig: enable EAS
Caesar Wang [Thu, 28 Jul 2016 08:47:49 +0000 (16:47 +0800)]
ARM64: configs: rockchip_cros_defconfig: enable EAS

This patch trys to sync the rockchip_defconfig for cros.

Change-Id: Ieeda1e41f05f33ffaa708c9825901553a759b17b
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
8 years agoarm64: dts: rockchip: enable both of otg usb2 phys for rk3399
Wu Liang feng [Thu, 28 Jul 2016 11:29:01 +0000 (19:29 +0800)]
arm64: dts: rockchip: enable both of otg usb2 phys for rk3399

Enable both OTG1 PHY and OTG2 USB2 PHY for rk3399 board.
With this patch, we can support usb battery charger detect
and hold wake lock in OTG peripheral mode.

Change-Id: Icae1924d8a2427c297f28032588f178532acc560
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
8 years agoARM: dts: rk3288: add asoc simple card for DW-HDMI audio for fennec board
Jacob Chen [Thu, 21 Jul 2016 09:12:17 +0000 (17:12 +0800)]
ARM: dts: rk3288: add asoc simple card for DW-HDMI audio for fennec board

Change-Id: I36e01d79fe48722369e896992b7086be7a762752
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
8 years agoarm64: dts: rockchip: enable dw_hdmi audio support on EVB boards
Yakir Yang [Thu, 28 Jul 2016 06:33:43 +0000 (14:33 +0800)]
arm64: dts: rockchip: enable dw_hdmi audio support on EVB boards

DRM dw_hdmi audio driver is based on common hdmi-codec driver, and bind
with i2s controller through simple-audio-card.

Change-Id: I2d9d5941b8e7c1f256e505338f43869584772e79
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoarm64: configs: enable dw-hdmi i2s audio on rockchip_cros_defconfig
Yakir Yang [Thu, 28 Jul 2016 06:32:18 +0000 (14:32 +0800)]
arm64: configs: enable dw-hdmi i2s audio on rockchip_cros_defconfig

Change-Id: I02762b544f5813036040bf526b0bd2561d79fa88
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
8 years agoHACK: phy: rockchip-inno-usb2: disable otg phy suspend for rk3399
Wu Liang feng [Thu, 28 Jul 2016 10:59:02 +0000 (18:59 +0800)]
HACK: phy: rockchip-inno-usb2: disable otg phy suspend for rk3399

This patch prevents OTG0 and OTG1 PHY from entering suspend mode.
Because if PHY enter suspend, it will cause DWC3 controller work
abnormally now. We can revert it if fusb302 driver is merged.

Change-Id: I74c3ee5d3e1b925e8dc758bdc6d67372df421b98
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
8 years agophy: rockchip-inno-usb2: add phy1 otg-port configurations for rk3399
Wu Liang feng [Wed, 27 Jul 2016 14:04:33 +0000 (22:04 +0800)]
phy: rockchip-inno-usb2: add phy1 otg-port configurations for rk3399

This patch add USB2 PHY1 OTG port configurations for rk3399,
it support PHY1 suspend and bvalid detect, but not support
usb battery charger detect.

Change-Id: I7a6aaf484d6ad2ad097a7d9679a56aa545f217c8
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
8 years agoarm64: dts: rockchip: add u2phy1_otg node for rk3399
Wu Liang feng [Wed, 27 Jul 2016 13:57:58 +0000 (21:57 +0800)]
arm64: dts: rockchip: add u2phy1_otg node for rk3399

RK3399 SoC USB2 PHY1 comprises with one host-port and
one otg-port, now we support PHY1 otg-port.

Change-Id: I8e7fd53ce6f1552172044ad2adc3f19e923d1bcd
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
8 years agoclk: rockchip: rk3399: delete the CLK_IGNORE_UNUSED for aclk_pcie
Elaine Zhang [Thu, 28 Jul 2016 08:28:00 +0000 (16:28 +0800)]
clk: rockchip: rk3399: delete the CLK_IGNORE_UNUSED for aclk_pcie

allow aclk_pcie and aclk_perf_pcie disabled when unused.

Change-Id: I55edb319d0abbabf841e7d479a40d736e657ad4b
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
8 years agodrm/rockchip: vop: make windows disable take effect
Mark Yao [Tue, 26 Jul 2016 02:53:26 +0000 (10:53 +0800)]
drm/rockchip: vop: make windows disable take effect

Should do vop_cfg_done to let windows disable take effect

Change-Id: Ib2966d8825a195696a963de7bc1d9665e78e5389
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: vop: get rid of vop_initial
Mark Yao [Fri, 22 Jul 2016 11:01:33 +0000 (19:01 +0800)]
drm/rockchip: vop: get rid of vop_initial

It's not need to do reset on vop init.

Change-Id: I25aec554b545471ce435648edc3b1e2ca51df570
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agodrm/rockchip: vop: add vop full series of vop support
Mark Yao [Fri, 22 Jul 2016 10:44:26 +0000 (18:44 +0800)]
drm/rockchip: vop: add vop full series of vop support

The series of vop is:
IP version    chipname
3.1           rk3288
3.2           rk3368
3.4           rk3366
3.5           rk3399 big
3.6           rk3399 lit
3.7           rk322x

The IP version is from VERSION_INFO register

major version: used for IP structure, Vop full framework is 3,
vop little framework is 2.
minor version: on same structure, newer design vop will bigger then
old one.

Change-Id: I032cb3d74cd01440274d3efeefa747e6028c1689
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
8 years agoARM64: rockchip_cros_defconfig: enable Rockchip Inno usb2phy driver
Chris Zhong [Thu, 28 Jul 2016 03:12:08 +0000 (11:12 +0800)]
ARM64: rockchip_cros_defconfig: enable Rockchip Inno usb2phy driver

Change-Id: I5d3a87aec065b5a3af2cc17888047a2506e8573b
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
8 years agoarm64: dts: rockchip: add more reboot mode on rk3399
Huang, Tao [Thu, 28 Jul 2016 03:04:52 +0000 (11:04 +0800)]
arm64: dts: rockchip: add more reboot mode on rk3399

Add charging and fastboot mode support.

Change-Id: Ib66c0d8c36ae33eeef2672b2bb31f075f833dd87
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
8 years agopower: reset: reboot-mode: fix normal mode setup
Huang, Tao [Thu, 28 Jul 2016 02:59:22 +0000 (10:59 +0800)]
power: reset: reboot-mode: fix normal mode setup

If cmd is empty in get_reboot_mode_magic, we should return normal magic.

Change-Id: I10931adc49e33f72ae73d9471159f82cc02ff0c0
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
8 years agodt-bindings: soc: rockchip_boot-mode: add charging mode support
Huang, Tao [Thu, 28 Jul 2016 02:56:35 +0000 (10:56 +0800)]
dt-bindings: soc: rockchip_boot-mode: add charging mode support

Change-Id: I66d5eb1813583aae37b2d19a2cf18dd9bbaf7125
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
8 years agoarm64: dts: rockchip: rk3399-box-rev1: increase drive strength for sd/sdio pin
xiaoyao [Thu, 28 Jul 2016 02:03:43 +0000 (10:03 +0800)]
arm64: dts: rockchip: rk3399-box-rev1: increase drive strength for sd/sdio pin

Change-Id: I6566a7ea6e6e91160f4f456f4f402f2b06c63b56
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
8 years agoarm64: dts: rockchip: Add some drive strength properties for rk3399
xiaoyao [Thu, 28 Jul 2016 02:01:21 +0000 (10:01 +0800)]
arm64: dts: rockchip: Add some drive strength properties for rk3399

Change-Id: I8e838901729142dabff3703c52103daf28945edb
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
8 years agoFROMLIST: arm64: dts: rockchip: support the pmu node for rk3399
Caesar Wang [Thu, 30 Jun 2016 10:47:02 +0000 (18:47 +0800)]
FROMLIST: arm64: dts: rockchip: support the pmu node for rk3399

This patch add to enable the ARM Performance Monitor Units for rk3399.
ARM cores often have a PMU for counting cpu and cache events like cache
misses and hits.

Also, as the Marc posted the patches [0] to support Partitioning per-cpu
interrupts. Let's add this patch to match it on rk3399 SoCs.

[0]:
https://lkml.org/lkml/2016/4/11/182
https://patchwork.kernel.org/patch/9209369/

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Marc Zyngier <marc.zyngier@arm.com>
CC: linux-arm-kernel@lists.infradead.org
Acked-by: Mark Rutland <mark.rutland@arm.com>
(Remove the original dts PMU)
Change-Id: I7e06c479bff7a431b0dc03309df08a640060bafd
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(am https://patchwork.kernel.org/patch/9215663/)

8 years agoFROMLIST: arm64: dts: rockchip: change all interrupts cells for 4 on rk3399 SoCs
Caesar Wang [Thu, 30 Jun 2016 11:11:08 +0000 (19:11 +0800)]
FROMLIST: arm64: dts: rockchip: change all interrupts cells for 4 on rk3399 SoCs

Add the interrupts cells value for 4, and the 4th cell is zero.

Due to the doc[0] said:" the system requires describing PPI affinity,
then the value must be at least 4"
The 4th cell is a phandle to a node describing a set of CPUs this
interrupt is affine to. The interrupt must be a PPI, and the node
pointed must be a subnode of the "ppi-partitions" subnode. For
interrupt types other than PPI or PPIs that are not partitionned,
this cell must be zero. See the "ppi-partitions" node description
below.

[0]:
Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt

Change-Id: I80d459b746aea40027a7eacfcc7aa764a57fdc9f
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(am https://patchwork.kernel.org/patch/9215659/)
(Note: fixes some no sync upstream node)

8 years agoFROMLIST: drivers/perf: arm-pmu: Handle per-interrupt affinity mask
Marc Zyngier [Wed, 6 Jul 2016 14:33:47 +0000 (15:33 +0100)]
FROMLIST: drivers/perf: arm-pmu: Handle per-interrupt affinity mask

On a big-little system, PMUs can be wired to CPUs using per CPU
interrups (PPI). In this case, it is important to make sure that
the enable/disable do happen on the right set of CPUs.

So instead of relying on the interrupt-affinity property, we can
use the actual percpu affinity that DT exposes as part of the
interrupt specifier. The DT binding is also updated to reflect
the fact that the interrupt-affinity property shouldn't be used
in that case.

Change-Id: I4a48e116cfa84d74985f44ed30d6e664ce3cfa5f
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9216445/)

8 years agoARM: rockchip_linux_defconfig: enable driver for mali400(utgard) GPU
chenzhen [Wed, 27 Jul 2016 07:02:03 +0000 (15:02 +0800)]
ARM: rockchip_linux_defconfig: enable driver for mali400(utgard) GPU

Change-Id: I2f89c53cd6eba49c7a6d8439cb94e1d3a2f95f0a
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
8 years agowifi: power save: turn off the reset pin when wifi is closed
xiaoyao [Wed, 27 Jul 2016 02:39:47 +0000 (10:39 +0800)]
wifi: power save: turn off the reset pin when wifi is closed

Change-Id: I06b188d9a67319d2508f016595e73b2f1d97fa99
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
8 years agoarm64: dts: rockchip: rk3399-evb: add utmi-avalid for evb1/evb2
Wu Liang feng [Tue, 26 Jul 2016 12:25:09 +0000 (20:25 +0800)]
arm64: dts: rockchip: rk3399-evb: add utmi-avalid for evb1/evb2

The usb2 phy utmi bvalid status is invalid for ES1 evb1/evb2
board, so check vbus status by utmi avalid status.

Change-Id: Iae369183cd15034eb35818c63988150f3aad6374
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
8 years agophy: rockchip-inno-usb2: make utmi vbus configurable in DT
Wu Liang feng [Tue, 26 Jul 2016 12:05:09 +0000 (20:05 +0800)]
phy: rockchip-inno-usb2: make utmi vbus configurable in DT

Rockchip USB2 phy provides utmi_avalid and utmi_bvalid for
user to check UTMI vbus status. Generally, both of them can
reflect the vbus status correctly, and the utmi_bvalid has
higher sensitivity, so we select the utmi_bvalid to get vbus
status by default.

But some special SoCs may not provide utmi_bvalid, so we
need to select utmi_avalid in this case.

Change-Id: I0d47c2237f852cb67ebd82fe2673b2bd2e6ccce6
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
8 years agoMALI: utgard: rockchip: walk around 'Understanding page domain faults'
chenzhen [Tue, 14 Jun 2016 06:21:00 +0000 (14:21 +0800)]
MALI: utgard: rockchip: walk around 'Understanding page domain faults'

Change-Id: I89c935f9b309393b16fcb848ded6e665f525bd1c
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
8 years agoMALI: utgard: rockchip: avoid crash when CONFIG_GPU_TRACEPOINTS enabled
chenzhen [Wed, 27 Jul 2016 03:22:30 +0000 (11:22 +0800)]
MALI: utgard: rockchip: avoid crash when CONFIG_GPU_TRACEPOINTS enabled

Change-Id: Icbb4f9e1b56a9a23cd7041c589e9814743fe562b
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
8 years agoMALI: utgard: rockchip: fix a compile error when GPU_TRACEPOINTS enabled
chenzhen [Wed, 27 Jul 2016 06:52:49 +0000 (14:52 +0800)]
MALI: utgard: rockchip: fix a compile error when GPU_TRACEPOINTS enabled

Change-Id: Ib8dafc9116b1b1a95dfe687faeb9889e0ab66d3c
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
8 years agoARM64: dts: rk3399: vr: add support compass ak8963
Zorro Liu [Wed, 27 Jul 2016 09:43:44 +0000 (17:43 +0800)]
ARM64: dts: rk3399: vr: add support compass ak8963

Change-Id: I095e9af7e2e007e042ff35a6a92425707465bc08
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
8 years agoARM: dts: rockchip: add rk3288-miniarm board
Nickey Yang [Fri, 8 Jul 2016 10:03:44 +0000 (18:03 +0800)]
ARM: dts: rockchip: add rk3288-miniarm board

This adds support for rk3288-miniarm board,
Rockchip RK3288 based development boards.

Change-Id: I3db8f16ae7fa5e18675eefb29684f6ef07434683
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
8 years agoarm64: dts: rk3399: ajust ipa parameters
Rocky Hao [Wed, 27 Jul 2016 08:46:31 +0000 (16:46 +0800)]
arm64: dts: rk3399: ajust ipa parameters

Big cores' power consumption and gpu's are greatly reduced, ipa parameters
are ajusted accordingly.

Change-Id: Ibfdae1856c2f1c2cf80a0a2f963ec878053c6ef0
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
8 years agoARM64: dts: rk3399-evb3: ajust gpu opp table
Jianqun Xu [Wed, 27 Jul 2016 09:23:08 +0000 (17:23 +0800)]
ARM64: dts: rk3399-evb3: ajust gpu opp table

Some evb3 need 1v for 800M.
We remove 700M currently since havn't a good opinion of it.

Change-Id: I7083857f5bb8a09efe0369a6bdd49e28c67da8b7
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
8 years agoarm64: dts: rockchip: add clk-480m for ehci and ohci of rk3399
Frank Wang [Wed, 27 Jul 2016 08:03:04 +0000 (16:03 +0800)]
arm64: dts: rockchip: add clk-480m for ehci and ohci of rk3399

We found that the suspend process was blocked when it run into
ehci/ohci module due to clk-480m of usb2-phy was disabled.

The root cause is that usb2-phy suspended earlier than ehci/ohci
(usb2-phy will be auto suspended if no devices plug-in). and the
clk-480m provided by it was diabled if no module used. However,
some suspend process related ehci/ohci are base on this clock,
so we should refer it into ehci/ohci driver to prevent this case.

Change-Id: Ic5e70a4234382e5cd1e1690e5174891e89360741
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
8 years agoclk: rockchip: rk3399: export 480M_SRC clock id for usbphy0/usbphy1
Xing Zheng [Wed, 27 Jul 2016 02:50:12 +0000 (10:50 +0800)]
clk: rockchip: rk3399: export 480M_SRC clock id for usbphy0/usbphy1

Change-Id: Icd566864d3651e7b64ee8209b66e8a326011422f
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
8 years agoARM64: configs: rockchip support CONFIG_F2FS_FS
Jianqun Xu [Tue, 26 Jul 2016 08:19:15 +0000 (16:19 +0800)]
ARM64: configs: rockchip support CONFIG_F2FS_FS

Select CONFIG_F2FS_FS and CONFIG_F2FS_FS_SECURITY.

Change-Id: I0380977d3593fccf6b417f8e72f118b7fc2c2b9b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
8 years agopower: rk818: support rk818 charger driver
Jianhong Chen [Tue, 5 Jul 2016 07:20:19 +0000 (15:20 +0800)]
power: rk818: support rk818 charger driver

Change-Id: Ica9a517723d10ea75baddd3f16e3ee0aa07dfb8b
Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
8 years agopower: rk818: support rk818 battery driver
Jianhong Chen [Fri, 17 Jun 2016 07:35:47 +0000 (15:35 +0800)]
power: rk818: support rk818 battery driver

Update version to v7.0, main features:
    1. new algorithm which is independent of time calculation in almost case,
    2. remove charger detect to driver: rk818-charger.c;
    3. save algorithm calculation rest value for next system power on calculation;
    4. recognize system halt and reset dsoc as rsoc;
    5. support hardware sample resistor selected as 10mR or 20mR;
    6. optimize zero algorithm to make discharge figure more smooth;
    7. fix some logic bugs.

Change-Id: I789d070693ac16102ecbe813d878a2a3c256c030
Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
8 years agoiommu/rockchip: active and inactive count should be in pairs if attach failed
Simon [Wed, 27 Jul 2016 06:27:43 +0000 (14:27 +0800)]
iommu/rockchip: active and inactive count should be in pairs if attach failed

Change-Id: Ic2362814695d135c68ce2db1aec7b71bfcb28dd0
Signed-off-by: Simon <xxm@rock-chips.com>
8 years agoARM64: dts: rk3399-box: rename files for box-rev1
Jianqun Xu [Wed, 27 Jul 2016 03:18:28 +0000 (11:18 +0800)]
ARM64: dts: rk3399-box: rename files for box-rev1

Make dts files in order as follows:
rk3399.dtsi
rk3399-box.dtsi
rk3399-box-rev1.dts
rk3399-box-rev2.dts
...

Change-Id: I93d1fb4380d0c84a14fc3476b7435b1abe4989d2
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
8 years agoMALI: utgard: rockchip: fix_mali_hang_on_windows
Jacob Chen [Wed, 27 Jul 2016 03:02:32 +0000 (11:02 +0800)]
MALI: utgard: rockchip: fix_mali_hang_on_windows

Change-Id: I9a03f2427cbe0653821a1671c1f3758bc8e891fe
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
8 years agodrm/rockchip: add rk3036_alpha_support
Jacob Chen [Mon, 18 Jul 2016 05:30:31 +0000 (13:30 +0800)]
drm/rockchip: add rk3036_alpha_support

Change-Id: Ife16fb36502e70dfffc80d31d7f33235d63366eb
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
8 years agoclk: rockchip: rk3399: fix up the make warning
Elaine Zhang [Wed, 27 Jul 2016 02:09:09 +0000 (10:09 +0800)]
clk: rockchip: rk3399: fix up the make warning

fix up the warning:
Line 246:  rate_table->nf = nf_out;
drivers/clk/rockchip/clk-pll.c:246:19: warning: 'nf_out' may be used uninitialized in this function [-Wmaybe-uninitialized]

Change-Id: I6c11bf91a280f324c21214cb7839e36f9ffa0da3
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
8 years agoARM64: dts: rk3399: vr: add support for new hardware
wlq [Tue, 26 Jul 2016 01:11:31 +0000 (09:11 +0800)]
ARM64: dts: rk3399: vr: add support for new hardware

Change-Id: I50d71c7e3b66013b7e8f65fdee662911c586a0bd
Signed-off-by: Liangqing Wu <wlq@rock-chips.com>
8 years agoclk: rockchip: rk3399: fix the incorrect bit
Xing Zheng [Tue, 26 Jul 2016 08:24:19 +0000 (16:24 +0800)]
clk: rockchip: rk3399: fix the incorrect bit

Due to refer to incorrect diagram, the bits of theXpll_aclk_perihp_src
and Xpll_aclk_emmc_src are incorrect, let's fix them.

Change-Id: I1054d172c8a1897da16287a01bfc5d83126d9666
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
8 years agoARM64: dts: rk3399: add support for box rev2
Zhangbin Tong [Tue, 19 Jul 2016 06:29:25 +0000 (14:29 +0800)]
ARM64: dts: rk3399: add support for box rev2

Change-Id: I77be7d3373696cb45aa4580fbb9a836dc2ff7ed0
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
8 years agoarm64: rockchip_defconfig: enable modules
Huang, Tao [Tue, 26 Jul 2016 09:32:35 +0000 (17:32 +0800)]
arm64: rockchip_defconfig: enable modules

Change-Id: I1dd9a7f8672144ad0994913a99560f4cee7045bd
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
8 years agoarm64/dma-mapping: __generic_dma_ops always call swiotlb_dma_ops
Jianqun Xu [Tue, 26 Jul 2016 09:21:25 +0000 (17:21 +0800)]
arm64/dma-mapping: __generic_dma_ops always call swiotlb_dma_ops

Arm64 dma-mapping will return dummy_dma_ops if none call arch_setup_dma_ops
at device creation time.

For ion APIS, ion_pages_sync_for_device and ion_pages_sync_for_cpu always
pass "NULL" as device, then dma-mapping return dummy_dma_ops, which cause
ion pages fail to sync.

This patch fixs __generic_dma_ops to return swiotlb_dma_ops instead of
dummy_dma_ops.

Change-Id: Ic00db5d4547bcd5f74e5fd155133fde408a05cdb
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
8 years agoMALI: utgard: rockchip: remove code depending on rk_dvfs_module
Jacob Chen [Fri, 22 Jul 2016 04:41:25 +0000 (12:41 +0800)]
MALI: utgard: rockchip: remove code depending on rk_dvfs_module

Set clk_gpu to 200M when initializing.
vdd_gpu isn't initialized explicitly.
DVFS isn't implemented.

Change-Id: I82c242d7929d55b7e40277a24b5c2b06a3121a3c
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
8 years agodriver, sensors, sensor-dev: add COMPAT ioctl for userspace
Zorro Liu [Tue, 26 Jul 2016 06:19:27 +0000 (14:19 +0800)]
driver, sensors, sensor-dev: add COMPAT ioctl for userspace

Change-Id: Id9340f8cca57f98c1b29e28e4d6aa566365b37e2
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
8 years agoinclude, linux, sensor-dev: add COMPAT ioctl define for sensors
Zorro Liu [Tue, 26 Jul 2016 06:18:03 +0000 (14:18 +0800)]
include, linux, sensor-dev: add COMPAT ioctl define for sensors

Change-Id: If59601bf08586f8a507ce3513b52e839327af59d
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
8 years agoARM64: dts: rk3399-evb-rev3: correct the es8316 codec i2c addr
Sugar Zhang [Tue, 26 Jul 2016 03:08:23 +0000 (11:08 +0800)]
ARM64: dts: rk3399-evb-rev3: correct the es8316 codec i2c addr

Change-Id: I5d329ae57d1059f464327f481d3db6525f5dbd64
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
8 years agoARM64: dts: rk3399: ajust gpu opp table for ES2 on evb3
Jianqun Xu [Tue, 26 Jul 2016 00:41:58 +0000 (08:41 +0800)]
ARM64: dts: rk3399: ajust gpu opp table for ES2 on evb3

Change-Id: Ia7283e2b4ddd2c008327024afbd89b2b176796e0
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
8 years agoclk: rockchip: rk3399: add pll up and down when change pll freq
Elaine Zhang [Mon, 25 Jul 2016 02:31:58 +0000 (10:31 +0800)]
clk: rockchip: rk3399: add pll up and down when change pll freq

set pll sequence:
->set pll to slow mode or other plls
->set pll down
->set pll params
->set pll up
->wait pll lock status
->set pll to normal mode

To slove the system error:
rockchip_rk3399_wait_pll_lock: timeout waiting for pll to lock
rockchip_rk3399_pll_set_params: pll update unsucessful,
trying to restore old params

Change-Id: I62aecd9f292de5a3c7bcd8a87231785bf115159d
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
8 years agoclk: rockchip: rk3399: support pll setting by auto
Elaine Zhang [Tue, 5 Jul 2016 09:20:33 +0000 (17:20 +0800)]
clk: rockchip: rk3399: support pll setting by auto

If setting freq is not support in rockchip_pll_rate_table rk3399_pll_rates[],
It can set pll params by auto.

Change-Id: I5016cece64dca4c2efec18d552ee6be426f6b95a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>