Commit Graph

83551 Commits

Author SHA1 Message Date
Jacob Chen
2e3c43155b media: i2c: rename tc358643 driver to tc35864x
tc358649 is similar with tc358643, when VIP in tc358649 is
set to bypassed.
So this driver can also be used for tc358649, we
should rename it to tc35864x.

Below is the function table show differences between tc358643/9:

tc358643 :
- HDMI 1.4a
- MIPI CSI2-TX
- Audio Support
- HDCP Support
- 3D Support

tc358649 :
- HDMI 1.4a
- MIPI CSI2-TX
- Audio Support
- HDCP Support
- 3D Support
- Scalar
- De-interface

Change-Id: I4851f62b58687dfffdc5de686a9d12ece08e6c28
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 18:10:58 +08:00
Jacob Chen
83ff5e5bd9 media: i2c: tc358743: sync to upstream version
Change-Id: I77cb05e16ca36c14a5fa7041c29f98dc4821c2be
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 18:10:47 +08:00
Sakari Ailus
cd40430ed3 BACKPORT: [media] v4l: Switch from V4L2 OF not V4L2 fwnode API
Switch users of the v4l2_of_ APIs to the more generic v4l2_fwnode_ APIs.
Async OF matching is replaced by fwnode matching and OF matching support
is removed.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Benoit Parrot <bparrot@ti.com> # i2c/ov2569.c, am437x/am437x-vpfe.c and ti-vpe/cal.c
Tested-by: Hans Verkuil <hans.verkuil@cisco.com> # Atmel sama5d3 board + ov2640 sensor
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 859969b38e)
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>

Conflicts:
Nathan: context, comment and include deltas, as well as deleting files
that don't apply to ChromeOS-4.4 yet
	drivers/media/i2c/Kconfig
	drivers/media/i2c/mt9v032.c
	drivers/media/i2c/ov5645.c
	drivers/media/i2c/ov5647.c
	drivers/media/i2c/s5c73m3/s5c73m3-core.c
	drivers/media/i2c/smiapp/smiapp-core.c
	drivers/media/i2c/tc358743.c
	drivers/media/i2c/tvp514x.c
	drivers/media/i2c/tvp5150.c
	drivers/media/i2c/tvp7002.c
	drivers/media/platform/Kconfig
	drivers/media/platform/atmel/Kconfig
	drivers/media/platform/atmel/atmel-isc.c
	drivers/media/platform/atmel/atmel-isi.c
	drivers/media/platform/exynos4-is/mipi-csis.c
	drivers/media/platform/omap3isp/isp.c
	drivers/media/platform/pxa_camera.c
	drivers/media/platform/rcar-vin/Kconfig
	drivers/media/platform/rcar-vin/rcar-core.c
	drivers/media/platform/soc_camera/soc_camera.c
	drivers/media/platform/stm32/stm32-dcmi.c
	drivers/media/platform/ti-vpe/cal.c
	include/media/v4l2-subdev.h

BUG=b:62359918
TEST=No regression in camera functionality
TEST=Kernel builds and boots

Change-Id: If338e2ab0c68c72f242988f34202e0449642734c
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/528621
Commit-Ready: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 17:31:38 +08:00
Sakari Ailus
aed4e07a75 UPSTREAM: [media] v4l: flash led class: Use fwnode_handle instead of device_node in init
Pass the more generic fwnode_handle to the init function than the
device_node.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 048ea05b4f)

BUG=b:62359918
TEST=No regression in camera functionality
TEST=Kernel builds and boots

Change-Id: Ied9439f2b96be3afe047b54877703d35074bf455
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/528620
Commit-Ready: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 17:24:05 +08:00
Sakari Ailus
d99d484173 BACKPORT: [media] v4l: async: Add fwnode match support
Add fwnode matching to complement OF node matching. And fwnode may also be
an OF node.

Do not enable fwnode matching yet. It will replace OF matching soon.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit ecdf0cfe71)
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>

Conflicts:
Nathan - small comment delta
	include/media/v4l2-async.h
	include/media/v4l2-subdev.h

BUG=b:62359918
TEST=No regression in camera functionality
TEST=Kernel builds and boots

Change-Id: I71720cd1ae4879dbcf2dd5d17cb82777b066584d
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/528619
Commit-Ready: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 17:23:05 +08:00
Sakari Ailus
263be2ee48 UPSTREAM: [media] v4l: fwnode: Support generic fwnode for parsing standardised properties
The fwnode_handle is a more generic way than OF device_node to describe
firmware nodes. Instead of the OF API, use more generic fwnode API to
obtain the same information.

As the V4L2 fwnode support will be required by a small minority of e.g.
ACPI based systems (the same might actually go for OF), make this a module
instead of embedding it in the videodev module.

The origins of the V4L2 fwnode framework is in the V4L2 OF framework.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit ca50c197bd)

BUG=b:62359918
TEST=No regression in camera functionality
TEST=Kernel builds and boots

Change-Id: Ie213acbb02b13281e7869816c326497d39ee470a
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/528618
Commit-Ready: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 15:25:33 +08:00
Sakari Ailus
fd424e34f1 UPSTREAM: device property: Add fwnode_get_next_parent()
In order to differentiate the functionality between dropping a reference
to the node (or not) for the benefit of OF, introduce
fwnode_get_next_parent().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 233872585d)
from v4.12-rc1

BUG=b:62359918
TEST=No regression in camera functionality
TEST=Kernel builds and boots

Change-Id: I3d80dff164c45b75a32f5e8e3152fb1f9757c716
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/528616
Commit-Ready: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 15:05:39 +08:00
Sakari Ailus
5741287331 UPSTREAM: device property: Add support for fwnode endpoints
Similar to OF endpoints, endpoint type nodes can be also supported on
ACPI. In order to make it possible for drivers to ignore the matter,
add a type for fwnode_endpoint and a function to parse them.

On ACPI, find the child node index instead of relying on the "endpoint"
property.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 2bd5452d46)
from v4.12-rc1

BUG=b:62359918
TEST=No regression in camera functionality
TEST=Kernel builds and boots

Change-Id: I4e052e5d3d0f3bc0950fb3a059eaa89ab12bd902
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/528615
Commit-Ready: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 15:05:39 +08:00
Sakari Ailus
1d5f07751a UPSTREAM: device property: Make dev_fwnode() public
The function to obtain a fwnode related to a struct device is useful for
drivers that use the fwnode property API: it allows not being aware of the
underlying firmware implementation.
(cherry-pick from e44bb0cbdc)

Change-Id: I269d15f3ba302fed386b474190be8e9b13043952
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 15:05:39 +08:00
Sakari Ailus
1d546fb017 UPSTREAM: of: Add of_fwnode_handle() to convert device nodes to fwnode_handle
of_fwnode_handle() returns a struct fwnode_handle of the struct
device_node. This may be used on the fwnode property API.

Use a macro instead of a function in order to support const and non-const
arguments.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 67831837e0)
from v4.12-rc1

BUG=b:62359918
TEST=No regression in camera functionality
TEST=Kernel builds and boots

Change-Id: Ifb36a667299f157e9f0b472bc2ea43c1a9779e34
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/528613
Commit-Ready: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 15:05:39 +08:00
Sakari Ailus
796636e73c UPSTREAM: device property: Add fwnode_handle_get()
fwnode_handle_get() is used to obtain a reference to a fwnode_handle
container. In this case this is OF specific struct device_node.

This complements fwnode_handle_put() which is already implemented.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit e7887c2849)
from v4.12-rc1

BUG=b:62359918
TEST=No regression in camera functionality
TEST=Kernel builds and boots

Change-Id: I571aa153e92e309f89a122627e468abda5ea7dfb
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/528612
Commit-Ready: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 15:05:39 +08:00
Mika Westerberg
23702a85c5 UPSTREAM: device property: Add support for remote endpoints
This follows DT implementation of of_graph_* APIs but we call them
fwnode_graph_* instead. For DT nodes the existing of_graph_* implementation
will be used. For ACPI we use the new ACPI graph implementation instead.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 07bb80d40b)
from v4.12-rc1

BUG=b:62359918
TEST=No regression in camera functionality
TEST=Kernel builds and boots

Change-Id: Id3c4c7c346841da525a8fa118af82d7ef9a6f8f6
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/528611
Commit-Ready: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 15:05:39 +08:00
Jacob Chen
3e6f039fb5 ACPI / property: Add dummy function for remote endpoints
complete version:
79389a83bc

Change-Id: Ib6147e7ba2b426bc16253c27cdf8170a546f4ac5
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 15:05:39 +08:00
Mika Westerberg
f22086c9d9 UPSTREAM: device property: Add fwnode_get_named_child_node()
Since now we have means to enumerate all children of any fwnode even in
ACPI we can implement fwnode_get_named_child_node(). This is similar than
device_get_named_child_node() with the exception that it can be called to
any fwnode handle. Make device_get_named_child_node() call directly this
new function.

This is useful in cases where we need to be able to find child nodes which
are not direct descendants of the parent device.
(cherry-pick from 21ea73f54c)

Change-Id: I9a62aff7a9106fcf03b7ccfa67d2814fc3981350
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 15:05:39 +08:00
Mika Westerberg
fe98dc2c23 UPSTREAM: ACPI / property: Add fwnode_get_next_child_node()
The ACPI _DSD hierarchical data extension makes it possible to have
hierarchies deeper than one level in similar way than DT allows. These
"subsubnodes" have not been accessible because device property
implementation only provides device_get_next_child_node() that is limited
to direct descendants of a device.

We need this ability in order support things like remote endpoints
currently supported in DT with of_graph_* APIs.

Modify acpi_get_next_subnode() to accept fwnode handle instead and update
callers accordingly. Also add a new function fwnode_get_next_child_node()
that works directly with fwnodes and modify device_get_next_child_node() to
call it directly. While there add a macro fwnode_for_each_child_node()
analogous to the current device_for_each_child_node() but it works with
fwnodes instead of devices.

Link: http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.pdf
(cherry-pick from 34055190b1)

Change-Id: I25a0f7dbb49da7055f8ea0d4e658b4e0b3998882
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 15:05:39 +08:00
Mika Westerberg
107ca0960e UPSTREAM: device property: Add fwnode_get_parent()
Now that ACPI has support for returning parent firmware node for both types
of nodes we can expose this to others as well. This adds a new function
fwnode_get_parent() that can be used for DT and ACPI nodes to retrieve the
parent firmware node.
(cherry-pick from afaf26fd84)

Change-Id: I69470610108ac0f524eb30e856e8601a6201d9d8
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 15:05:39 +08:00
Jacob Chen
26d482a324 ACPI: add dummy acpi_node_get_parent to pass compile
Complete version in dfa672fbc0

Change-Id: I93f7a3fe299866295eb7a986e5e39cd8819772e0
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 15:05:39 +08:00
Heikki Krogerus
6619f538b3 UPSTREAM: device property: Avoid potential dereferences of invalid pointers
Since fwnode may hold ERR_PTR(-ENODEV) or it may be NULL,
the fwnode type checks is_of_node(), is_acpi_node() and is
is_pset_node() need to consider it. Using IS_ERR_OR_NULL()
to check it.

Fixes: 0d67e0fa16 (device property: fix for a case of use-after-free)
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
[ rjw: Subject & changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

(cherry picked from commit 0224a4a30b)
from v4.7-rc1

BUG=b:62359918
TEST=No regression in camera functionality
TEST=Kernel builds and boots

Change-Id: I7784c41117c3fe0b4661bb08f0ef7b734a6c6780
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/528596
Commit-Ready: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 14:50:28 +08:00
Mika Westerberg
490feb8e9b UPSTREAM: device property: Take a copy of the property set
It is convenient if the property set associated with the device secondary
firmware node is a copy of the original. This allows passing property set
from a stack for example for devices created dynamically. This also ties
the property set lifetime to the associated device.

Because of that we provide new function device_remove_property_set() that
is used to disassociate and release memory allocated for the property set.
(cherry-pick from 13141e1cb8)

Change-Id: Ia7e05b72726226628cc2a6bd910149d22c3f42f0
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 14:50:28 +08:00
Andy Shevchenko
fb0f1244f5 UPSTREAM: device property: improve readability of macros
There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 1d656fb757)
from v4.5-rc1

BUG=b:62359918
TEST=No regression in camera functionality
TEST=Kernel builds and boots

Change-Id: I72d7ad3b4f279e5b377d41f049e3d5743a7823e5
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/528502
Commit-Ready: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 14:50:28 +08:00
Andy Shevchenko
4e96a0d355 UPSTREAM: device property: keep single value inplace
We may save a lot of lines of code and space by keeping single values inside
the struct property_entry. Refactor the implementation to do so.
(cherry-pick from 66586baba5)

Change-Id: Ife4010518d3a89ac719cc2ba0ce9e497a30384fc
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 14:50:28 +08:00
Andy Shevchenko
09a28924b4 UPSTREAM: device property: refactor built-in properties support
Instead of using the type and nval fields we will use length (in bytes) of the
value. The sanity check is done in the accessors.

The built-in property accessors are split in the same way such as device tree.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 318a197182)
from v4.5-rc1

BUG=b:62359918
TEST=No regression in camera functionality
TEST=Kernel builds and boots

Change-Id: Id671146dd6cc89641c4db6c0827ed4ea36ebe835
Signed-off-by: Nathan Ciobanu <nathan.d.ciobanu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/528500
Commit-Ready: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Tested-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-30 14:50:28 +08:00
Adam Thomson
a17856c5e7 UPSTREAM: device property: Add function to search for named child of device
For device nodes in both DT and ACPI, it possible to have named
child nodes which contain properties (an existing example being
gpio-leds). This adds a function to find a named child node for
a device which can be used by drivers for property retrieval.

For DT data node name matching, of_node_cmp() and similar functions
are made available outside of CONFIG_OF block so the new function
can reference these for DT and non-DT builds.

For ACPI data node name matching, a helper function is also added
which returns false if CONFIG_ACPI is not set, otherwise it
performs a string comparison on the data node name. This avoids
using the acpi_data_node struct for non CONFIG_ACPI builds,
which would otherwise cause a build failure.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Acked-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
commit 613e97218c)

BUG=chrome-os-partner:54440
TEST=Boot on kevin

Change-Id: Ide996e72bd1a290da4bd31233046da4cd2fc71f7
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/365263
Commit-Ready: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-24 18:40:10 +08:00
Andy Shevchenko
02eac3ee40 UPSTREAM: lib/string: introduce match_string() helper
Occasionally we have to search for an occurrence of a string in an array
of strings.  Make a simple helper for that purpose.

BUG=chromium:622499
TEST=Build image with match_string() enabled

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: David Airlie <airlied@linux.ie>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 56b060814e)
Signed-off-by: Guenter Roeck <groeck@chromium.org>

Change-Id: I6075bb868e3578caa33561c85f4be57f4ea94cc2
Reviewed-on: https://chromium-review.googlesource.com/355210
Commit-Ready: Guenter Roeck <groeck@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-24 18:39:04 +08:00
Sandy Huang
1e23e1f0b2 clk: rockchip: rk3128: add clk gate for PCLK_MIPIPHY
Change-Id: Icf55c315edc9514a23d00433ffe56c864ad7f3d8
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2017-08-24 11:31:50 +08:00
shengfei Xu
8516153ecb regulator: rk808: fix regulator operations table to the bucks for rk816
the patch fixes the following BUG:
[    2.249731] PC is at regulator_map_voltage_linear+0x78/0x16c
[    2.255413] LR is at regulator_map_voltage_linear+0x68/0x16c
[    2.261092] pc : [<c042c1a8>]    lr : [<c042c198>]    psr: 60000013
[    2.261092] sp : ef0a5a08  ip : 00000000  fp : c0c34368
[    2.272578] r10: 000b71b0  r9 : c120394c  r8 : 000b71b0
[    2.277817] r7 : 000b71b0  r6 : ee85b800  r5 : 000b71b0  r4 : ee85b800
[    2.284357] r3 : 00000000  r2 : dc8ba64d  r1 : 60000013  r0 : 00000021
[    2.290899] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[    2.298047] Control: 10c5387d  Table: 6000406a  DAC: 00000051

Change-Id: I4a0d773f7847e7af14d1850e2250671a216b0c86
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-08-23 20:37:15 +08:00
Joseph Chen
208ce417cb mfd: rk808: add suspend and resume register setting for rk805
Because Buck3 don't have sleep state register, so we need a manual
switch: set BUCK3 suspend as Auto PWM mode and resume as FPWM mode.

This is for power saving in system suspend.

Change-Id: I67db458e650b6e85ed4267f0b0dcdb01dff4c635
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-08-17 12:04:07 +08:00
Zhangbin Tong
210e0ef438 firmware: rockchip: add rc config interface
Change-Id: I3d769761f58c51fb366e99b62cf27a5974e511a1
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
2017-08-16 18:32:11 +08:00
Boris Brezillon
2272eb5d62 UPSTREAM: drm: Add TV connector states to drm_connector_state
Some generic TV connector properties are exposed in drm_mode_config, but
they are currently handled independently in each DRM encoder driver.

Extend the drm_connector_state to store TV related states, and modify the
drm_atomic_connector_{set,get}_property() helpers to fill the connector
state accordingly.

Each driver is then responsible for checking and applying the new config
in its ->atomic_mode_{check,set}() operations.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 299a16b163)

Change-Id: I50d7c79013235d75972b8cdd46cf89bbd9cf596d
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-15 18:38:28 +08:00
Boris Brezillon
777d56231f UPSTREAM: drm: Turn DRM_MODE_SUBCONNECTOR_xx definitions into an enum
List of values like the DRM_MODE_SUBCONNECTOR_xx ones are better
represented with enums.

Turn the DRM_MODE_SUBCONNECTOR_xx macros into an enum.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit dee7a4fee7)

Change-Id: I02d7856d2d933caeb39c0bb64ad4dee946493843
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-15 18:38:06 +08:00
algea.cao
bce841cc7f mfd: rk1000: update mfd rk1000 core driver
RK1000's control register block need mclk for i2c communication.
So mclk should be enabled in advance.
RK1000's control register block should be registered before RK1000
TVE.

Change-Id: Iba9a2a410fe927666072f8d246995462a860ec3a
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-08-14 16:42:57 +08:00
Laurent Pinchart
fcb60baab3 UPSTREAM: drm/bridge: Make (pre/post) enable/disable callbacks optional
Instead of forcing bridges to implement empty callbacks make them all
optional.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
(cherry picked from commit c8a3b2ae07)

Change-Id: Id37cbb6114e69957dfd6b72c8bd7b66dcc6f0590
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-14 14:57:20 +08:00
Elaine Zhang
18138af79b clk: fractional-divider: allow overriding of approximation
Fractional dividers may have special requirements concerning numerator
and denominator selection that differ from just getting the best
approximation.

For example on Rockchip socs the denominator must be at least 20 times
larger than the numerator to generate precise clock frequencies.

Therefore add the ability to provide custom approximation functions.

Change-Id: I656a5851a3e2581b7f1b44bd67681ac00172873d
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-08-10 12:13:28 +08:00
Geliang Tang
cf30714766 UPSTREAM: clk: move the common clock's to_clk_*(_hw) macros to clk-provider.h
to_clk_*(_hw) macros have been repeatedly defined in many places.
This patch moves all the to_clk_*(_hw) definitions in the common
clock framework to public header clk-provider.h, and drop the local
definitions.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit 5fd9c05c84)

Change-Id: Ib0f9de8b9aeb30302b9d21e6668a35d18764517e
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-08-10 12:13:17 +08:00
Mark Yao
0fc8ce4b39 drm/rockchip: gem: support secure memory
Change-Id: I91dfbbfbf5d13983edfb79585e9beb980566f784
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-09 16:36:50 +08:00
Mark Yao
258970afc5 drm/rockchip: gem: add get phys ioctl
Change-Id: Ic9b8c6acfaeb47ec720dbad3d8f5141ef7b13e5d
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-09 16:35:04 +08:00
Mark Yao
2965ada189 drm/rockchip: gem: support force alloc cma buffer with flags
Change-Id: I4749eac53609f865d0d4230364b1cbaf39ee0955
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-09 16:34:59 +08:00
Jacob Chen
10a0fcf693 FROMLIST: v4l: add porter duff blend controls
At peresent, we don't have a control for Compositing and Blend.
All drivers are just doing copies while actually many hardwares
supports more functions.

So Adding V4L2 controls for Compositing and Blend, used for for
composting streams.
(am from https://patchwork.linuxtv.org/patch/42848/)
The values are based on porter duff operations.
Defined in below links.
https://developer.xamarin.com/api/type/Android.Graphics.PorterDuff+Mode/

Change-Id: I16245fc8389a433ebdcb228081a80daa48e8c539
Suggested-by: Nicolas Dufresne <nicolas@ndufresne.ca>
Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-04 15:38:54 +08:00
Huang Jiachai
c4e97a6379 drm/rockchip: get connector in bridge mode
Change-Id: I08535f5c2d83783dc86ae641daeb530dedec36e6
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2017-08-03 20:25:32 +08:00
Huang Jiachai
b05ec6d240 drm/rockchip: add loader protect for encoder
Change-Id: I9fa1e949a55d8778b44ff809630337d5d35ffa11
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2017-08-03 20:23:17 +08:00
zzc
9b18f3c7d7 net: rfkill-wlan: fix read wifi mac address failed
Change-Id: I4eea5e32a063bca45671c8a70d48b26bb2e7bd44
Signed-off-by: zzc <zzc@rock-chips.com>
2017-08-03 14:45:58 +08:00
zzc
602539cfc9 net: wireless: rockchip_wlan: add rtl8723ds support
update rtl8723ds wifi driver to version v5.1.1.5_20523.20161209_BTCOEX20161208-1212

Change-Id: Ifd44ce917d1fcb47696b893f2293ed932952bdef
Signed-off-by: zzc <zzc@rock-chips.com>
2017-08-01 17:13:14 +08:00
Finley Xiao
c6880daeb7 soc: rockchip: pvtm: fix undefined reference to rockchip_get_pvtm_value
This patch fixed compilation error when compiled rockchip_linux_defconfig
without CONFIG_ROCKCHIP_PVTM

Change-Id: Icb43485a9ce8dca0e40507b370487b89617813c4
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-07-31 11:12:53 +08:00
Huang, Tao
6ee6d6d68b Merge tag 'lsk-v4.4-17.07-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
LSK 17.07 v4.4-android

* tag 'lsk-v4.4-17.07-android': (402 commits)
  dt/vendor-prefixes: remove redundant vendor
  Linux 4.4.77
  saa7134: fix warm Medion 7134 EEPROM read
  x86/mm/pat: Don't report PAT on CPUs that don't support it
  ext4: check return value of kstrtoull correctly in reserved_clusters_store
  staging: comedi: fix clean-up of comedi_class in comedi_init()
  staging: vt6556: vnt_start Fix missing call to vnt_key_init_table.
  tcp: fix tcp_mark_head_lost to check skb len before fragmenting
  md: fix super_offset endianness in super_1_rdev_size_change
  md: fix incorrect use of lexx_to_cpu in does_sb_need_changing
  perf tools: Use readdir() instead of deprecated readdir_r() again
  perf tests: Remove wrong semicolon in while loop in CQM test
  perf trace: Do not process PERF_RECORD_LOST twice
  perf dwarf: Guard !x86_64 definitions under #ifdef else clause
  perf pmu: Fix misleadingly indented assignment (whitespace)
  perf annotate browser: Fix behaviour of Shift-Tab with nothing focussed
  perf tools: Remove duplicate const qualifier
  perf script: Use readdir() instead of deprecated readdir_r()
  perf thread_map: Use readdir() instead of deprecated readdir_r()
  perf tools: Use readdir() instead of deprecated readdir_r()
  ...

Conflicts:
	Makefile
	drivers/Kconfig
	drivers/Makefile
	drivers/usb/dwc3/gadget.c

Change-Id: Ib4aae2e34ebbf0d7953c748a33f673acb3e744fc
2017-07-26 19:32:04 +08:00
Omar Sandoval
f31b9c8fe7 UPSTREAM: debugfs: add debugfs_lookup()
We don't always have easy access to the dentry of a file or directory we
created in debugfs. Add a helper which allows us to get a dentry we
previously created.

The motivation for this change is a problem with blktrace and the blk-mq
debugfs entries introduced in 07e4fead45 ("blk-mq: create debugfs
directory tree"). Namely, in some cases, the directory that blktrace
needs to create may already exist, but in other cases, it may not. We
_could_ rely on a bunch of implied knowledge to decide whether to create
the directory or not, but it's much cleaner on our end to just look it
up.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit a7c5437b0b)

Change-Id: I77b6f2c7df32f904099d23771a53065315cfdc12
2017-07-26 15:07:32 +08:00
WeiYong Bi
925e706521 drm/rockchip: hdmi: Add support for rk3366
Change-Id: I086533ed5c94110f913ab88f4760d452beaf12d1
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
2017-07-20 14:38:47 +08:00
Mark Yao
cb4f52e156 drm/panel: support drm_find_panel_by_connector
Change-Id: Iee970e013ff8b1558a060f334c700dea36c38d0f
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-07-19 14:49:25 +08:00
Mark Yao
ea5e704026 drm/rockchip: add cabc support
CABC(Content Adaptive Backlight Control) is used to
increase the contrast of such LCD-screens the backlight
can be (globally) dimmed when the image to be displayed
is dark (i.e. not comprising high intensity image data)
while the image data is numerically corrected and adapted
to the reduced backlight intensity.

Change-Id: I0bd84375264675943f1b601f0cac8b843567087d
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-07-19 14:34:00 +08:00
shengfei Xu
ce4e02a88b mfd: rk808: add rk816 support
include sub modules: regulator, rtc, gpio, pwrkey

Change-Id: I59cc4b943403f1e0b1210a314cfcbf61fc193bdf
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-07-19 14:33:51 +08:00
Mark Yao
20a7783dc7 drm/atomic: export drm_atomic_replace_property_blob_from_id
Change-Id: Iebca91e396f6770b0b2ce588093119ea321f3fb5
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-07-19 14:33:49 +08:00