CHROMIUM: extcon: extcon-class: add DT support based on cable name

Add DT support to register the extcon notification based on
cable names - extcon handle properties.
The client can get the cable information through its node or extcon name
and once cable infomration is available, it can register for notification
when state gets changed.

The typical dt nodes are:
Driver node:
	extcon: arizona-extcon {
		compatible = "wlf,arizona-extcon";
		#extcon-cells = <1>;
	};
Driver need to specifi the cable ID as
 Cable			ID
 ----------------------------
  Mechanical		0
  Microphone		1
  Headphone		2
  Line-out		3

Here #extcon-cells is must and specifies teh size of extcon cells.

Client node:
Client node can be register it as:
	audio-controller@b0000 {
		reg = <0xb0000 0x2210>;
		interrupts = <19>, <20>;
		extcon-cables = <&extcon 1>, <&extcon 3>;
		extcon-cable-names = "Microphone", "Line-out";
	};

and client driver can register the cable by passing the cable name
as above along with its node.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/428204
(cherry picked from commit 8036789a039a3ed0fe2c59cdd3e55cddfd0b169b)
[bleung : picked from nvidia's android kernel]
Signed-off-by: Benson Leung <bleung@chromium.org>
Reviewed-on: https://chrome-internal-review.googlesource.com/212716
Reviewed-by: Badhri Jagan Sridharan <badhri@google.com>

Change-Id: Iace8f89cf0c78f03edb144fa616fa36bf58c7e01
Reviewed-on: https://chromium-review.googlesource.com/267623
Reviewed-by: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Commit-Queue: David Riley <davidriley@chromium.org>
2 files changed