2012-04-20 05:16:22 +00:00
|
|
|
What: /sys/class/extcon/.../
|
Extcon: support multiple states at a device.
One switch device (e.g., MUIC(MAX8997, MAX77686, ...), and some 30-pin
devices) may have multiple cables attached. For example, one
30-pin port may inhabit a USB cable, an HDMI cable, and a mic.
Thus, one switch device requires multiple state bits each representing
a type of cable.
For such purpose, we use the 32bit state variable; thus, up to 32
different type of cables may be defined for a switch device. The list of
possible cables is defined by the array of cable names in the switch_dev
struct given to the class.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
--
Changes from V7
- Bugfixed in _call_per_cable() (incorrect nb) (Chanwoo Choi)
- Compiler error in header for !CONFIG_EXTCON (Chanwoo Choi)
Changes from V5
- Sysfs style reformed: subdirectory per cable.
- Updated standard cable names
- Removed unnecessary printf
- Bugfixes after testing
Changes from V4
- Bugfixes after more testing at Exynos4412 boards with userspace
processses.
Changes from V3
- Bugfixes after more testing at Exynos4412 boards.
Changes from V2
- State can be stored by user
- Documentation updated
Changes from RFC
- Switch is renamed to extcon
- Added kerneldoc comments
- Added APIs to support "standard" cable names
- Added helper APIs to support notifier block registration with cable
name.
- Regrouped function list in the header file.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20 05:16:25 +00:00
|
|
|
Date: February 2012
|
2012-04-20 05:16:22 +00:00
|
|
|
Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
|
|
|
|
Description:
|
|
|
|
Provide a place in sysfs for the extcon objects.
|
|
|
|
This allows accessing extcon specific variables.
|
|
|
|
The name of extcon object denoted as ... is the name given
|
|
|
|
with extcon_dev_register.
|
|
|
|
|
Extcon: support multiple states at a device.
One switch device (e.g., MUIC(MAX8997, MAX77686, ...), and some 30-pin
devices) may have multiple cables attached. For example, one
30-pin port may inhabit a USB cable, an HDMI cable, and a mic.
Thus, one switch device requires multiple state bits each representing
a type of cable.
For such purpose, we use the 32bit state variable; thus, up to 32
different type of cables may be defined for a switch device. The list of
possible cables is defined by the array of cable names in the switch_dev
struct given to the class.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
--
Changes from V7
- Bugfixed in _call_per_cable() (incorrect nb) (Chanwoo Choi)
- Compiler error in header for !CONFIG_EXTCON (Chanwoo Choi)
Changes from V5
- Sysfs style reformed: subdirectory per cable.
- Updated standard cable names
- Removed unnecessary printf
- Bugfixes after testing
Changes from V4
- Bugfixes after more testing at Exynos4412 boards with userspace
processses.
Changes from V3
- Bugfixes after more testing at Exynos4412 boards.
Changes from V2
- State can be stored by user
- Documentation updated
Changes from RFC
- Switch is renamed to extcon
- Added kerneldoc comments
- Added APIs to support "standard" cable names
- Added helper APIs to support notifier block registration with cable
name.
- Regrouped function list in the header file.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20 05:16:25 +00:00
|
|
|
One extcon device denotes a single external connector
|
|
|
|
port. An external connector may have multiple cables
|
|
|
|
attached simultaneously. Many of docks, cradles, and
|
|
|
|
accessory cables have such capability. For example,
|
|
|
|
the 30-pin port of Nuri board (/arch/arm/mach-exynos)
|
|
|
|
may have both HDMI and Charger attached, or analog audio,
|
|
|
|
video, and USB cables attached simulteneously.
|
|
|
|
|
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>
2012-04-20 05:16:26 +00:00
|
|
|
If there are cables mutually exclusive with each other,
|
|
|
|
such binary relations may be expressed with extcon_dev's
|
|
|
|
mutually_exclusive array.
|
|
|
|
|
2012-04-20 05:16:22 +00:00
|
|
|
What: /sys/class/extcon/.../name
|
Extcon: support multiple states at a device.
One switch device (e.g., MUIC(MAX8997, MAX77686, ...), and some 30-pin
devices) may have multiple cables attached. For example, one
30-pin port may inhabit a USB cable, an HDMI cable, and a mic.
Thus, one switch device requires multiple state bits each representing
a type of cable.
For such purpose, we use the 32bit state variable; thus, up to 32
different type of cables may be defined for a switch device. The list of
possible cables is defined by the array of cable names in the switch_dev
struct given to the class.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
--
Changes from V7
- Bugfixed in _call_per_cable() (incorrect nb) (Chanwoo Choi)
- Compiler error in header for !CONFIG_EXTCON (Chanwoo Choi)
Changes from V5
- Sysfs style reformed: subdirectory per cable.
- Updated standard cable names
- Removed unnecessary printf
- Bugfixes after testing
Changes from V4
- Bugfixes after more testing at Exynos4412 boards with userspace
processses.
Changes from V3
- Bugfixes after more testing at Exynos4412 boards.
Changes from V2
- State can be stored by user
- Documentation updated
Changes from RFC
- Switch is renamed to extcon
- Added kerneldoc comments
- Added APIs to support "standard" cable names
- Added helper APIs to support notifier block registration with cable
name.
- Regrouped function list in the header file.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20 05:16:25 +00:00
|
|
|
Date: February 2012
|
2012-04-20 05:16:22 +00:00
|
|
|
Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
|
|
|
|
Description:
|
|
|
|
The /sys/class/extcon/.../name shows the name of the extcon
|
|
|
|
object. If the extcon object has an optional callback
|
|
|
|
"show_name" defined, the callback will provide the name with
|
|
|
|
this sysfs node.
|
|
|
|
|
|
|
|
What: /sys/class/extcon/.../state
|
Extcon: support multiple states at a device.
One switch device (e.g., MUIC(MAX8997, MAX77686, ...), and some 30-pin
devices) may have multiple cables attached. For example, one
30-pin port may inhabit a USB cable, an HDMI cable, and a mic.
Thus, one switch device requires multiple state bits each representing
a type of cable.
For such purpose, we use the 32bit state variable; thus, up to 32
different type of cables may be defined for a switch device. The list of
possible cables is defined by the array of cable names in the switch_dev
struct given to the class.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
--
Changes from V7
- Bugfixed in _call_per_cable() (incorrect nb) (Chanwoo Choi)
- Compiler error in header for !CONFIG_EXTCON (Chanwoo Choi)
Changes from V5
- Sysfs style reformed: subdirectory per cable.
- Updated standard cable names
- Removed unnecessary printf
- Bugfixes after testing
Changes from V4
- Bugfixes after more testing at Exynos4412 boards with userspace
processses.
Changes from V3
- Bugfixes after more testing at Exynos4412 boards.
Changes from V2
- State can be stored by user
- Documentation updated
Changes from RFC
- Switch is renamed to extcon
- Added kerneldoc comments
- Added APIs to support "standard" cable names
- Added helper APIs to support notifier block registration with cable
name.
- Regrouped function list in the header file.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20 05:16:25 +00:00
|
|
|
Date: February 2012
|
|
|
|
Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
|
|
|
|
Description:
|
|
|
|
The /sys/class/extcon/.../state shows and stores the cable
|
|
|
|
attach/detach information of the corresponding extcon object.
|
|
|
|
If the extcon object has an optional callback "show_state"
|
|
|
|
defined, the showing function is overriden with the optional
|
|
|
|
callback.
|
|
|
|
|
|
|
|
If the default callback for showing function is used, the
|
|
|
|
format is like this:
|
|
|
|
# cat state
|
|
|
|
USB_OTG=1
|
|
|
|
HDMI=0
|
|
|
|
TA=1
|
|
|
|
EAR_JACK=0
|
|
|
|
#
|
|
|
|
In this example, the extcon device have USB_OTG and TA
|
|
|
|
cables attached and HDMI and EAR_JACK cables detached.
|
|
|
|
|
|
|
|
In order to update the state of an extcon device, enter a hex
|
|
|
|
state number starting with 0x.
|
|
|
|
echo 0xHEX > state
|
|
|
|
|
|
|
|
This updates the whole state of the extcon dev.
|
|
|
|
Inputs of all the methods are required to meet the
|
|
|
|
mutually_exclusive contidions if they exist.
|
|
|
|
|
|
|
|
It is recommended to use this "global" state interface if
|
|
|
|
you need to enter the value atomically. The later state
|
|
|
|
interface associated with each cable cannot update
|
|
|
|
multiple cable states of an extcon device simultaneously.
|
|
|
|
|
|
|
|
What: /sys/class/extcon/.../cable.x/name
|
|
|
|
Date: February 2012
|
|
|
|
Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
|
|
|
|
Description:
|
|
|
|
The /sys/class/extcon/.../cable.x/name shows the name of cable
|
|
|
|
"x" (integer between 0 and 31) of an extcon device.
|
|
|
|
|
|
|
|
What: /sys/class/extcon/.../cable.x/state
|
|
|
|
Date: February 2012
|
2012-04-20 05:16:22 +00:00
|
|
|
Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
|
|
|
|
Description:
|
Extcon: support multiple states at a device.
One switch device (e.g., MUIC(MAX8997, MAX77686, ...), and some 30-pin
devices) may have multiple cables attached. For example, one
30-pin port may inhabit a USB cable, an HDMI cable, and a mic.
Thus, one switch device requires multiple state bits each representing
a type of cable.
For such purpose, we use the 32bit state variable; thus, up to 32
different type of cables may be defined for a switch device. The list of
possible cables is defined by the array of cable names in the switch_dev
struct given to the class.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
--
Changes from V7
- Bugfixed in _call_per_cable() (incorrect nb) (Chanwoo Choi)
- Compiler error in header for !CONFIG_EXTCON (Chanwoo Choi)
Changes from V5
- Sysfs style reformed: subdirectory per cable.
- Updated standard cable names
- Removed unnecessary printf
- Bugfixes after testing
Changes from V4
- Bugfixes after more testing at Exynos4412 boards with userspace
processses.
Changes from V3
- Bugfixes after more testing at Exynos4412 boards.
Changes from V2
- State can be stored by user
- Documentation updated
Changes from RFC
- Switch is renamed to extcon
- Added kerneldoc comments
- Added APIs to support "standard" cable names
- Added helper APIs to support notifier block registration with cable
name.
- Regrouped function list in the header file.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20 05:16:25 +00:00
|
|
|
The /sys/class/extcon/.../cable.x/name shows and stores the
|
|
|
|
state of cable "x" (integer between 0 and 31) of an extcon
|
|
|
|
device. The state value is either 0 (detached) or 1
|
|
|
|
(attached).
|
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>
2012-04-20 05:16:26 +00:00
|
|
|
|
|
|
|
What: /sys/class/extcon/.../mutually_exclusive/...
|
|
|
|
Date: December 2011
|
|
|
|
Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
|
|
|
|
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.
|