forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Signed-off-by: MyungJoo Ham <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> -- Changes from V5: - Updated sysfs format Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information
Showing
3 changed files
with
160 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,10 @@ Description: | |
may have both HDMI and Charger attached, or analog audio, | ||
video, and USB cables attached simulteneously. | ||
|
||
If there are cables mutually exclusive with each other, | ||
such binary relations may be expressed with extcon_dev's | ||
mutually_exclusive array. | ||
|
||
What: /sys/class/extcon/.../name | ||
Date: February 2012 | ||
Contact: MyungJoo Ham <[email protected]> | ||
|
@@ -73,3 +77,21 @@ Description: | |
state of cable "x" (integer between 0 and 31) of an extcon | ||
device. The state value is either 0 (detached) or 1 | ||
(attached). | ||
|
||
What: /sys/class/extcon/.../mutually_exclusive/... | ||
Date: December 2011 | ||
Contact: MyungJoo Ham <[email protected]> | ||
Description: | ||
Shows the relations of mutually exclusiveness. For example, | ||
if the mutually_exclusive array of extcon_dev is | ||
{0x3, 0x5, 0xC, 0x0}, the, the output is: | ||
# ls mutually_exclusive/ | ||
0x3 | ||
0x5 | ||
0xc | ||
# | ||
|
||
Note that mutually_exclusive is a sub-directory of the extcon | ||
device and the file names under the mutually_exclusive | ||
directory show the mutually-exclusive sets, not the contents | ||
of the files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters