Extcon: support mutually exclusive relation between cables.
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 20 Apr 2012 05:16:26 +0000 (14:16 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Apr 2012 16:24:03 +0000 (09:24 -0700)
commitbde68e60b18208978c50c6fb9bdf29826d2887f3
tree62b48807d48c2454c374bede680c9e9c6cf71a0d
parent806d9dd71ff52ef09764585baaeec23afbb98560
Extcon: support mutually exclusive relation between cables.

There could be cables that t recannot be attaches simulatenously. Extcon
device drivers may express such information via mutually_exclusive in
struct extcon_dev.

For example, for an extcon device with 16 cables (bits 0 to 15 are
available), if mutually_exclusive = { 0x7, 0xC0, 0x81, 0 }, then, the
following attachments are prohibitted.
{0, 1}
{0, 2}
{1, 2}
{6, 7}
{0, 7}
and every attachment set that are superset of one of the above.
For the detail, please refer to linux/include/linux/extcon.h.

The concept is suggested by NeilBrown <neilb@suse.de>

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
--
Changes from V5:
- Updated sysfs format
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/ABI/testing/sysfs-class-extcon
drivers/extcon/extcon_class.c
include/linux/extcon.h