sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget%/translations/zh_CN/driver-api/extconmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/zh_TW/driver-api/extconmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/it_IT/driver-api/extconmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/ja_JP/driver-api/extconmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/ko_KR/driver-api/extconmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/pt_BR/driver-api/extconmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/sp_SP/driver-api/extconmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hExtcon Device Subsystemh]hExtcon Device Subsystem}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhh?/var/lib/git/docbuild/linux/Documentation/driver-api/extcon.rsthKubh)}(hhh](h)}(hOverviewh]hOverview}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hX The Extcon (External Connector) subsystem provides a unified framework for managing external connectors in Linux systems. It allows drivers to report the state of external connectors and provides a standardized interface for userspace to query and monitor these states.h]hX The Extcon (External Connector) subsystem provides a unified framework for managing external connectors in Linux systems. It allows drivers to report the state of external connectors and provides a standardized interface for userspace to query and monitor these states.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hExtcon is particularly useful in modern devices with multiple connectivity options, such as smartphones, tablets, and laptops. It helps manage various types of connectors, including:h]hExtcon is particularly useful in modern devices with multiple connectivity options, such as smartphones, tablets, and laptops. It helps manage various types of connectors, including:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubhenumerated_list)}(hhh](h list_item)}(h'USB connectors (e.g., USB-C, micro-USB)h]h)}(hjh]h'USB connectors (e.g., USB-C, micro-USB)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubj)}(h7Charging ports (e.g., fast charging, wireless charging)h]h)}(hjh]h7Charging ports (e.g., fast charging, wireless charging)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubj)}(h(Audio jacks (e.g., 3.5mm headphone jack)h]h)}(hj1h]h(Audio jacks (e.g., 3.5mm headphone jack)}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj/ubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubj)}(h'Video outputs (e.g., HDMI, DisplayPort)h]h)}(hjHh]h'Video outputs (e.g., HDMI, DisplayPort)}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjFubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubj)}(hDocking stations h]h)}(hDocking stationsh]hDocking stations}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj]ubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1hhhhhhhhKubh)}(hReal-world examples:h]hReal-world examples:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](j)}(hX8Smartphone USB-C port: A single USB-C port on a smartphone can serve multiple functions. Extcon can manage the different states of this port, such as: - USB data connection - Charging (various types like fast charging, USB Power Delivery) - Audio output (USB-C headphones) - Video output (USB-C to HDMI adapter) h]h)}(hX7Smartphone USB-C port: A single USB-C port on a smartphone can serve multiple functions. Extcon can manage the different states of this port, such as: - USB data connection - Charging (various types like fast charging, USB Power Delivery) - Audio output (USB-C headphones) - Video output (USB-C to HDMI adapter)h]hX7Smartphone USB-C port: A single USB-C port on a smartphone can serve multiple functions. Extcon can manage the different states of this port, such as: - USB data connection - Charging (various types like fast charging, USB Power Delivery) - Audio output (USB-C headphones) - Video output (USB-C to HDMI adapter)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubj)}(hLaptop docking station: When a laptop is connected to a docking station, multiple connections are made simultaneously. Extcon can handle the state changes for: - Power delivery - External displays - USB hub connections - Ethernet connectivity h]h)}(hLaptop docking station: When a laptop is connected to a docking station, multiple connections are made simultaneously. Extcon can handle the state changes for: - Power delivery - External displays - USB hub connections - Ethernet connectivityh]hLaptop docking station: When a laptop is connected to a docking station, multiple connections are made simultaneously. Extcon can handle the state changes for: - Power delivery - External displays - USB hub connections - Ethernet connectivity}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubj)}(hWireless charging pad: Extcon can manage the state of a wireless charging connection, allowing the system to respond appropriately when a device is placed on or removed from the charging pad. h]h)}(hWireless charging pad: Extcon can manage the state of a wireless charging connection, allowing the system to respond appropriately when a device is placed on or removed from the charging pad.h]hWireless charging pad: Extcon can manage the state of a wireless charging connection, allowing the system to respond appropriately when a device is placed on or removed from the charging pad.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubj)}(hSmart TV HDMI ports: In a smart TV, Extcon can manage multiple HDMI ports, detecting when devices are connected or disconnected, and potentially identifying the type of device (e.g., gaming console, set-top box, Blu-ray player). h]h)}(hSmart TV HDMI ports: In a smart TV, Extcon can manage multiple HDMI ports, detecting when devices are connected or disconnected, and potentially identifying the type of device (e.g., gaming console, set-top box, Blu-ray player).h]hSmart TV HDMI ports: In a smart TV, Extcon can manage multiple HDMI ports, detecting when devices are connected or disconnected, and potentially identifying the type of device (e.g., gaming console, set-top box, Blu-ray player).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]j{j|j}hj~juh1hhhhhhhhKubh)}(hXAThe Extcon framework simplifies the development of drivers for these complex scenarios by providing a standardized way to report and query connector states, handle mutually exclusive connections, and manage connector properties. This allows for more robust and flexible handling of external connections in modern devices.h]hXAThe Extcon framework simplifies the development of drivers for these complex scenarios by providing a standardized way to report and query connector states, handle mutually exclusive connections, and manage connector properties. This allows for more robust and flexible handling of external connections in modern devices.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hhhhubeh}(h]overviewah ]h"]overviewah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hKey Componentsh]hKey Components}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhK:ubh)}(hhh](h)}(h extcon_devh]h extcon_dev}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK=ubh)}(h2The core structure representing an Extcon device::h]h1The core structure representing an Extcon device:}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hjhhubh literal_block)}(hX3struct extcon_dev { const char *name; const unsigned int *supported_cable; const u32 *mutually_exclusive; /* Internal data */ struct device dev; unsigned int id; struct raw_notifier_head nh_all; struct raw_notifier_head *nh; struct list_head entry; int max_supported; spinlock_t lock; u32 state; /* Sysfs related */ struct device_type extcon_dev_type; struct extcon_cable *cables; struct attribute_group attr_g_muex; struct attribute **attrs_muex; struct device_attribute *d_attrs_muex; };h]hX3struct extcon_dev { const char *name; const unsigned int *supported_cable; const u32 *mutually_exclusive; /* Internal data */ struct device dev; unsigned int id; struct raw_notifier_head nh_all; struct raw_notifier_head *nh; struct list_head entry; int max_supported; spinlock_t lock; u32 state; /* Sysfs related */ struct device_type extcon_dev_type; struct extcon_cable *cables; struct attribute_group attr_g_muex; struct attribute **attrs_muex; struct device_attribute *d_attrs_muex; };}hj?sbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1j=hhhKAhjhhubh)}(h Key fields:h]h Key fields:}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKXhjhhubh bullet_list)}(hhh](j)}(h#``name``: Name of the Extcon deviceh]h)}(hjdh](hliteral)}(h``name``h]hname}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1jihjfubh: Name of the Extcon device}(hjfhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKZhjbubah}(h]h ]h"]h$]h&]uh1hhj_hhhhhNubj)}(h3``supported_cable``: Array of supported cable typesh]h)}(hjh](jj)}(h``supported_cable``h]hsupported_cable}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jihjubh : Array of supported cable types}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK[hjubah}(h]h ]h"]h$]h&]uh1hhj_hhhhhNubj)}(hX``mutually_exclusive``: Array defining mutually exclusive cable types This field is crucial for enforcing hardware constraints. It's an array of 32-bit unsigned integers, where each element represents a set of mutually exclusive cable types. The array should be terminated with a 0. For example: :: static const u32 mutually_exclusive[] = { BIT(0) | BIT(1), /* Cable 0 and 1 are mutually exclusive */ BIT(2) | BIT(3) | BIT(4), /* Cables 2, 3, and 4 are mutually exclusive */ 0 /* Terminator */ }; In this example, cables 0 and 1 cannot be connected simultaneously, and cables 2, 3, and 4 are also mutually exclusive. This is useful for scenarios like a single port that can either be USB or HDMI, but not both at the same time. The Extcon core uses this information to prevent invalid combinations of cable states, ensuring that the reported states are always consistent with the hardware capabilities. h](h)}(hX``mutually_exclusive``: Array defining mutually exclusive cable types This field is crucial for enforcing hardware constraints. It's an array of 32-bit unsigned integers, where each element represents a set of mutually exclusive cable types. The array should be terminated with a 0.h](jj)}(h``mutually_exclusive``h]hmutually_exclusive}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jihjubhX: Array defining mutually exclusive cable types This field is crucial for enforcing hardware constraints. It’s an array of 32-bit unsigned integers, where each element represents a set of mutually exclusive cable types. The array should be terminated with a 0.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK\hjubh)}(h For example:h]h For example:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjubj>)}(hstatic const u32 mutually_exclusive[] = { BIT(0) | BIT(1), /* Cable 0 and 1 are mutually exclusive */ BIT(2) | BIT(3) | BIT(4), /* Cables 2, 3, and 4 are mutually exclusive */ 0 /* Terminator */ };h]hstatic const u32 mutually_exclusive[] = { BIT(0) | BIT(1), /* Cable 0 and 1 are mutually exclusive */ BIT(2) | BIT(3) | BIT(4), /* Cables 2, 3, and 4 are mutually exclusive */ 0 /* Terminator */ };}hjsbah}(h]h ]h"]h$]h&]jMjNuh1j=hhhKehjubh)}(hIn this example, cables 0 and 1 cannot be connected simultaneously, and cables 2, 3, and 4 are also mutually exclusive. This is useful for scenarios like a single port that can either be USB or HDMI, but not both at the same time.h]hIn this example, cables 0 and 1 cannot be connected simultaneously, and cables 2, 3, and 4 are also mutually exclusive. This is useful for scenarios like a single port that can either be USB or HDMI, but not both at the same time.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKkhjubh)}(hThe Extcon core uses this information to prevent invalid combinations of cable states, ensuring that the reported states are always consistent with the hardware capabilities.h]hThe Extcon core uses this information to prevent invalid combinations of cable states, ensuring that the reported states are always consistent with the hardware capabilities.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphjubeh}(h]h ]h"]h$]h&]uh1hhj_hhhhhNubj)}(hE``state``: Current state of the device (bitmap of connected cables) h]h)}(hC``state``: Current state of the device (bitmap of connected cables)h](jj)}(h ``state``h]hstate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jihjubh:: Current state of the device (bitmap of connected cables)}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKthj ubah}(h]h ]h"]h$]h&]uh1hhj_hhhhhNubeh}(h]h ]h"]h$]h&]bullet-uh1j]hhhKZhjhhubeh}(h] extcon-devah ]h"] extcon_devah$]h&]uh1hhj hhhhhK=ubh)}(hhh](h)}(h extcon_cableh]h extcon_cable}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjBhhhhhKxubh)}(h)}(hXstruct extcon_cable { struct extcon_dev *edev; int cable_index; struct attribute_group attr_g; struct device_attribute attr_name; struct device_attribute attr_state; struct attribute *attrs[3]; union extcon_property_value usb_propval[EXTCON_PROP_USB_CNT]; union extcon_property_value chg_propval[EXTCON_PROP_CHG_CNT]; union extcon_property_value jack_propval[EXTCON_PROP_JACK_CNT]; union extcon_property_value disp_propval[EXTCON_PROP_DISP_CNT]; DECLARE_BITMAP(usb_bits, EXTCON_PROP_USB_CNT); DECLARE_BITMAP(chg_bits, EXTCON_PROP_CHG_CNT); DECLARE_BITMAP(jack_bits, EXTCON_PROP_JACK_CNT); DECLARE_BITMAP(disp_bits, EXTCON_PROP_DISP_CNT); };h]hXstruct extcon_cable { struct extcon_dev *edev; int cable_index; struct attribute_group attr_g; struct device_attribute attr_name; struct device_attribute attr_state; struct attribute *attrs[3]; union extcon_property_value usb_propval[EXTCON_PROP_USB_CNT]; union extcon_property_value chg_propval[EXTCON_PROP_CHG_CNT]; union extcon_property_value jack_propval[EXTCON_PROP_JACK_CNT]; union extcon_property_value disp_propval[EXTCON_PROP_DISP_CNT]; DECLARE_BITMAP(usb_bits, EXTCON_PROP_USB_CNT); DECLARE_BITMAP(chg_bits, EXTCON_PROP_CHG_CNT); DECLARE_BITMAP(jack_bits, EXTCON_PROP_JACK_CNT); DECLARE_BITMAP(disp_bits, EXTCON_PROP_DISP_CNT); };}hjasbah}(h]h ]h"]h$]h&]jMjNuh1j=hhhK|hjBhhubeh}(h] extcon-cableah ]h"] extcon_cableah$]h&]uh1hhj hhhhhKxubeh}(h]key-componentsah ]h"]key componentsah$]h&]uh1hhhhhhhhK:ubh)}(hhh](h)}(hCore Functionsh]hCore Functions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singleextcon_get_state (C function)c.extcon_get_statehNtauh1jhjhhhNhNubhdesc)}(hhh](hdesc_signature)}(hEint extcon_get_state (struct extcon_dev *edev, const unsigned int id)h]hdesc_signature_line)}(hDint extcon_get_state(struct extcon_dev *edev, const unsigned int id)h](hdesc_sig_keyword_type)}(hinth]hint}(hjhhhNhNubah}(h]h ]ktah"]h$]h&]uh1jhjhhhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:144: ./drivers/extcon/extcon.chMubhdesc_sig_space)}(h h]h }(hjhhhNhNubah}(h]h ]wah"]h$]h&]uh1jhjhhhjhMubh desc_name)}(hextcon_get_stateh]h desc_sig_name)}(hextcon_get_stateh]hextcon_get_state}(hjhhhNhNubah}(h]h ]nah"]h$]h&]uh1jhjubah}(h]h ](sig-namedescnameeh"]h$]h&]jMjNuh1jhjhhhjhMubhdesc_parameterlist)}(h0(struct extcon_dev *edev, const unsigned int id)h](hdesc_parameter)}(hstruct extcon_dev *edevh](hdesc_sig_keyword)}(hstructh]hstruct}(hjhhhNhNubah}(h]h ]kah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(h extcon_devh]h extcon_dev}(hj"hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomaincreftype identifier reftargetj$modnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]j> ASTIdentifier)}j9jsbc.extcon_get_stateasbuh1hhjubj)}(h h]h }(hjKhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubhdesc_sig_punctuation)}(h*h]h*}(hj[hhhNhNubah}(h]h ]pah"]h$]h&]uh1jYhjubj)}(hedevh]hedev}(hjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjMjNuh1jhjubj)}(hconst unsigned int idh](j)}(hconsth]hconst}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hidh]hid}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjMjNuh1jhjubeh}(h]h ]h"]h$]h&]jMjNuh1jhjhhhjhMubeh}(h]h ]h"]h$]h&]jMjN add_permalinkuh1jsphinx_line_type declaratorhjhhhjhMubah}(h]jah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1jhjhMhjhhubh desc_content)}(hhh]h)}(h'Get the state of an external connector.h]h'Get the state of an external connector.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:144: ./drivers/extcon/extcon.chMhjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMubeh}(h]h ](j7functioneh"]h$]h&]domainj7objtypej#desctypej#noindex noindexentrynocontentsentryuh1jhhhjhNhNubh container)}(h**Parameters** ``struct extcon_dev *edev`` the extcon device ``const unsigned int id`` the unique id indicating an external connector **Description** Returns 0 if success or error number if fail.h](h)}(h**Parameters**h]hstrong)}(hj5h]h Parameters}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj3ubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:144: ./drivers/extcon/extcon.chMhj/ubhdefinition_list)}(hhh](hdefinition_list_item)}(h.``struct extcon_dev *edev`` the extcon device h](hterm)}(h``struct extcon_dev *edev``h]jj)}(hj\h]hstruct extcon_dev *edev}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1jihjZubah}(h]h ]h"]h$]h&]uh1jXhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:144: ./drivers/extcon/extcon.chMhjTubh definition)}(hhh]h)}(hthe extcon deviceh]hthe extcon device}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjqhMhjtubah}(h]h ]h"]h$]h&]uh1jrhjTubeh}(h]h ]h"]h$]h&]uh1jRhjqhMhjOubjS)}(hI``const unsigned int id`` the unique id indicating an external connector h](jY)}(h``const unsigned int id``h]jj)}(hjh]hconst unsigned int id}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jihjubah}(h]h ]h"]h$]h&]uh1jXhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:144: ./drivers/extcon/extcon.chMhjubjs)}(hhh]h)}(h.the unique id indicating an external connectorh]h.the unique id indicating an external connector}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jrhjubeh}(h]h ]h"]h$]h&]uh1jRhjhMhjOubeh}(h]h ]h"]h$]h&]uh1jMhj/ubh)}(h**Description**h]j8)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:144: ./drivers/extcon/extcon.chMhj/ubh)}(h-Returns 0 if success or error number if fail.h]h-Returns 0 if success or error number if fail.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:144: ./drivers/extcon/extcon.chMhj/ubeh}(h]h ] kernelindentah"]h$]h&]uh1j-hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jextcon_set_state (C function)c.extcon_set_statehNtauh1jhjhhhNhNubj)}(hhh](j)}(hKint extcon_set_state (struct extcon_dev *edev, unsigned int id, bool state)h]j)}(hJint extcon_set_state(struct extcon_dev *edev, unsigned int id, bool state)h](j)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:147: ./drivers/extcon/extcon.chMubj)}(h h]h }(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhj%hMubj)}(hextcon_set_stateh]j)}(hextcon_set_stateh]hextcon_set_state}(hj8hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj4ubah}(h]h ](jjeh"]h$]h&]jMjNuh1jhjhhhj%hMubj)}(h6(struct extcon_dev *edev, unsigned int id, bool state)h](j)}(hstruct extcon_dev *edevh](j)}(hjh]hstruct}(hjThhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjPubj)}(h h]h }(hjahhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjPubh)}(hhh]j)}(h extcon_devh]h extcon_dev}(hjrhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjoubah}(h]h ]h"]h$]h&] refdomainj7reftypej9 reftargetjtmodnameN classnameNj=j@)}jC]jF)}j9j:sbc.extcon_set_stateasbuh1hhjPubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjPubjZ)}(hj]h]h*}(hjhhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhjPubj)}(hedevh]hedev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjPubeh}(h]h ]h"]h$]h&]noemphjMjNuh1jhjLubj)}(hunsigned int idh](j)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hidh]hid}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjMjNuh1jhjLubj)}(h bool stateh](j)}(hboolh]hbool}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hj%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hstateh]hstate}(hj3hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjMjNuh1jhjLubeh}(h]h ]h"]h$]h&]jMjNuh1jhjhhhj%hMubeh}(h]h ]h"]h$]h&]jMjNjuh1jjjhjhhhj%hMubah}(h]j ah ](jjeh"]h$]h&]jj)jhuh1jhj%hMhj hhubj)}(hhh]h)}(h'Set the state of an external connector.h]h'Set the state of an external connector.}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:147: ./drivers/extcon/extcon.chMhjZhhubah}(h]h ]h"]h$]h&]uh1jhj hhhj%hMubeh}(h]h ](j7functioneh"]h$]h&]j'j7j(juj)juj*j+j,uh1jhhhjhNhNubj.)}(hX**Parameters** ``struct extcon_dev *edev`` the extcon device ``unsigned int id`` the unique id indicating an external connector ``bool state`` the new state of an external connector. the default semantics is true: attached / false: detached. **Description** Note that this function set the state of an external connector without a notification. To synchronize the state of an external connector, have to use extcon_set_state_sync() and extcon_sync(). Returns 0 if success or error number if fail.h](h)}(h**Parameters**h]j8)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj}ubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:147: ./drivers/extcon/extcon.chMhjyubjN)}(hhh](jS)}(h.``struct extcon_dev *edev`` the extcon device h](jY)}(h``struct extcon_dev *edev``h]jj)}(hjh]hstruct extcon_dev *edev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jihjubah}(h]h ]h"]h$]h&]uh1jXhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:147: ./drivers/extcon/extcon.chMhjubjs)}(hhh]h)}(hthe extcon deviceh]hthe extcon device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jrhjubeh}(h]h ]h"]h$]h&]uh1jRhjhMhjubjS)}(hC``unsigned int id`` the unique id indicating an external connector h](jY)}(h``unsigned int id``h]jj)}(hjh]hunsigned int id}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jihjubah}(h]h ]h"]h$]h&]uh1jXhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:147: ./drivers/extcon/extcon.chMhjubjs)}(hhh]h)}(h.the unique id indicating an external connectorh]h.the unique id indicating an external connector}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jrhjubeh}(h]h ]h"]h$]h&]uh1jRhjhMhjubjS)}(hr``bool state`` the new state of an external connector. the default semantics is true: attached / false: detached. h](jY)}(h``bool state``h]jj)}(hjh]h bool state}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jihjubah}(h]h ]h"]h$]h&]uh1jXhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:147: ./drivers/extcon/extcon.chMhj ubjs)}(hhh]h)}(hbthe new state of an external connector. the default semantics is true: attached / false: detached.h]hbthe new state of an external connector. the default semantics is true: attached / false: detached.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:147: ./drivers/extcon/extcon.chMhj&ubah}(h]h ]h"]h$]h&]uh1jrhj ubeh}(h]h ]h"]h$]h&]uh1jRhj%hMhjubeh}(h]h ]h"]h$]h&]uh1jMhjyubh)}(h**Description**h]j8)}(hjLh]h Description}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjJubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:147: ./drivers/extcon/extcon.chMhjyubh)}(hNote that this function set the state of an external connector without a notification. To synchronize the state of an external connector, have to use extcon_set_state_sync() and extcon_sync().h]hNote that this function set the state of an external connector without a notification. To synchronize the state of an external connector, have to use extcon_set_state_sync() and extcon_sync().}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:147: ./drivers/extcon/extcon.chMhjyubh)}(h-Returns 0 if success or error number if fail.h]h-Returns 0 if success or error number if fail.}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:147: ./drivers/extcon/extcon.chMhjyubeh}(h]h ] kernelindentah"]h$]h&]uh1j-hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j"extcon_set_state_sync (C function)c.extcon_set_state_synchNtauh1jhjhhhNhNubj)}(hhh](j)}(hPint extcon_set_state_sync (struct extcon_dev *edev, unsigned int id, bool state)h]j)}(hOint extcon_set_state_sync(struct extcon_dev *edev, unsigned int id, bool state)h](j)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:150: ./drivers/extcon/extcon.chMKubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMKubj)}(hextcon_set_state_synch]j)}(hextcon_set_state_synch]hextcon_set_state_sync}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jMjNuh1jhjhhhjhMKubj)}(h6(struct extcon_dev *edev, unsigned int id, bool state)h](j)}(hstruct extcon_dev *edevh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(h extcon_devh]h extcon_dev}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainj7reftypej9 reftargetjmodnameN classnameNj=j@)}jC]jF)}j9jsbc.extcon_set_state_syncasbuh1hhjubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjZ)}(hj]h]h*}(hj) hhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhjubj)}(hedevh]hedev}(hj6 hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjMjNuh1jhjubj)}(hunsigned int idh](j)}(hunsignedh]hunsigned}(hjO hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjK ubj)}(h h]h }(hj] hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjK ubj)}(hinth]hint}(hjk hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjK ubj)}(h h]h }(hjy hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjK ubj)}(hidh]hid}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjK ubeh}(h]h ]h"]h$]h&]noemphjMjNuh1jhjubj)}(h bool stateh](j)}(hjh]hbool}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hstateh]hstate}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjMjNuh1jhjubeh}(h]h ]h"]h$]h&]jMjNuh1jhjhhhjhMKubeh}(h]h ]h"]h$]h&]jMjNjuh1jjjhjhhhjhMKubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhMKhjhhubj)}(hhh]h)}(h1Set the state of an external connector with sync.h]h1Set the state of an external connector with sync.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:150: ./drivers/extcon/extcon.chMKhj hhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMKubeh}(h]h ](j7functioneh"]h$]h&]j'j7j(j j)j j*j+j,uh1jhhhjhNhNubj.)}(hX**Parameters** ``struct extcon_dev *edev`` the extcon device ``unsigned int id`` the unique id indicating an external connector ``bool state`` the new state of external connector. the default semantics is true: attached / false: detached. **Description** Note that this function set the state of external connector and synchronize the state by sending a notification. Returns 0 if success or error number if fail.h](h)}(h**Parameters**h]j8)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:150: ./drivers/extcon/extcon.chMOhj ubjN)}(hhh](jS)}(h.``struct extcon_dev *edev`` the extcon device h](jY)}(h``struct extcon_dev *edev``h]jj)}(hj& h]hstruct extcon_dev *edev}(hj( hhhNhNubah}(h]h ]h"]h$]h&]uh1jihj$ ubah}(h]h ]h"]h$]h&]uh1jXhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:150: ./drivers/extcon/extcon.chMLhj ubjs)}(hhh]h)}(hthe extcon deviceh]hthe extcon device}(hj? hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj; hMLhj< ubah}(h]h ]h"]h$]h&]uh1jrhj ubeh}(h]h ]h"]h$]h&]uh1jRhj; hMLhj ubjS)}(hC``unsigned int id`` the unique id indicating an external connector h](jY)}(h``unsigned int id``h]jj)}(hj_ h]hunsigned int id}(hja hhhNhNubah}(h]h ]h"]h$]h&]uh1jihj] ubah}(h]h ]h"]h$]h&]uh1jXhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:150: ./drivers/extcon/extcon.chMMhjY ubjs)}(hhh]h)}(h.the unique id indicating an external connectorh]h.the unique id indicating an external connector}(hjx hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjt hMMhju ubah}(h]h ]h"]h$]h&]uh1jrhjY ubeh}(h]h ]h"]h$]h&]uh1jRhjt hMMhj ubjS)}(ho``bool state`` the new state of external connector. the default semantics is true: attached / false: detached. h](jY)}(h``bool state``h]jj)}(hj h]h bool state}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jihj ubah}(h]h ]h"]h$]h&]uh1jXhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:150: ./drivers/extcon/extcon.chMOhj ubjs)}(hhh]h)}(h_the new state of external connector. the default semantics is true: attached / false: detached.h]h_the new state of external connector. the default semantics is true: attached / false: detached.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:150: ./drivers/extcon/extcon.chMNhj ubah}(h]h ]h"]h$]h&]uh1jrhj ubeh}(h]h ]h"]h$]h&]uh1jRhj hMOhj ubeh}(h]h ]h"]h$]h&]uh1jMhj ubh)}(h**Description**h]j8)}(hj h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:150: ./drivers/extcon/extcon.chMQhj ubh)}(hpNote that this function set the state of external connector and synchronize the state by sending a notification.h]hpNote that this function set the state of external connector and synchronize the state by sending a notification.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:150: ./drivers/extcon/extcon.chMPhj ubh)}(h-Returns 0 if success or error number if fail.h]h-Returns 0 if success or error number if fail.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:150: ./drivers/extcon/extcon.chMShj ubeh}(h]h ] kernelindentah"]h$]h&]uh1j-hjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j extcon_get_property (C function)c.extcon_get_propertyhNtauh1jhjhhhNhNubj)}(hhh](j)}(h|int extcon_get_property (struct extcon_dev *edev, unsigned int id, unsigned int prop, union extcon_property_value *prop_val)h]j)}(h{int extcon_get_property(struct extcon_dev *edev, unsigned int id, unsigned int prop, union extcon_property_value *prop_val)h](j)}(hinth]hint}(hj( hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj$ hhhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:153: ./drivers/extcon/extcon.chMcubj)}(h h]h }(hj7 hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj$ hhhj6 hMcubj)}(hextcon_get_propertyh]j)}(hextcon_get_propertyh]hextcon_get_property}(hjI hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjE ubah}(h]h ](jjeh"]h$]h&]jMjNuh1jhj$ hhhj6 hMcubj)}(hd(struct extcon_dev *edev, unsigned int id, unsigned int prop, union extcon_property_value *prop_val)h](j)}(hstruct extcon_dev *edevh](j)}(hjh]hstruct}(hje hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhja ubj)}(h h]h }(hjr hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhja ubh)}(hhh]j)}(h extcon_devh]h extcon_dev}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&] refdomainj7reftypej9 reftargetj modnameN classnameNj=j@)}jC]jF)}j9jK sbc.extcon_get_propertyasbuh1hhja ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhja ubjZ)}(hj]h]h*}(hj hhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhja ubj)}(hedevh]hedev}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhja ubeh}(h]h ]h"]h$]h&]noemphjMjNuh1jhj] ubj)}(hunsigned int idh](j)}(hunsignedh]hunsigned}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hinth]hint}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(hidh]hid}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjMjNuh1jhj] ubj)}(hunsigned int proph](j)}(hunsignedh]hunsigned}(hj( hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj$ ubj)}(h h]h }(hj6 hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj$ ubj)}(hinth]hint}(hjD hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj$ ubj)}(h h]h }(hjR hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj$ ubj)}(hproph]hprop}(hj` hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj$ ubeh}(h]h ]h"]h$]h&]noemphjMjNuh1jhj] ubj)}(h%union extcon_property_value *prop_valh](j)}(hunionh]hunion}(hjy hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhju ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhju ubh)}(hhh]j)}(hextcon_property_valueh]hextcon_property_value}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&] refdomainj7reftypej9 reftargetj modnameN classnameNj=j@)}jC]j c.extcon_get_propertyasbuh1hhju ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhju ubjZ)}(hj]h]h*}(hj hhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhju ubj)}(hprop_valh]hprop_val}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhju ubeh}(h]h ]h"]h$]h&]noemphjMjNuh1jhj] ubeh}(h]h ]h"]h$]h&]jMjNuh1jhj$ hhhj6 hMcubeh}(h]h ]h"]h$]h&]jMjNjuh1jjjhj hhhj6 hMcubah}(h]j ah ](jjeh"]h$]h&]jj)jhuh1jhj6 hMchj hhubj)}(hhh]h)}(h0Get the property value of an external connector.h]h0Get the property value of an external connector.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:153: ./drivers/extcon/extcon.chMchj hhubah}(h]h ]h"]h$]h&]uh1jhj hhhj6 hMcubeh}(h]h ](j7functioneh"]h$]h&]j'j7j(j j)j j*j+j,uh1jhhhjhNhNubj.)}(hX**Parameters** ``struct extcon_dev *edev`` the extcon device ``unsigned int id`` the unique id indicating an external connector ``unsigned int prop`` the property id indicating an extcon property ``union extcon_property_value *prop_val`` the pointer which store the value of extcon property **Description** Note that when getting the property value of external connector, the external connector should be attached. If detached state, function return 0 without property value. Also, the each property should be included in the list of supported properties according to extcon type. Returns 0 if success or error number if fail.h](h)}(h**Parameters**h]j8)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:153: ./drivers/extcon/extcon.chMghj ubjN)}(hhh](jS)}(h.``struct extcon_dev *edev`` the extcon device h](jY)}(h``struct extcon_dev *edev``h]jj)}(hj< h]hstruct extcon_dev *edev}(hj> hhhNhNubah}(h]h ]h"]h$]h&]uh1jihj: ubah}(h]h ]h"]h$]h&]uh1jXhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:153: ./drivers/extcon/extcon.chMdhj6 ubjs)}(hhh]h)}(hthe extcon deviceh]hthe extcon device}(hjU hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjQ hMdhjR ubah}(h]h ]h"]h$]h&]uh1jrhj6 ubeh}(h]h ]h"]h$]h&]uh1jRhjQ hMdhj3 ubjS)}(hC``unsigned int id`` the unique id indicating an external connector h](jY)}(h``unsigned int id``h]jj)}(hju h]hunsigned int id}(hjw hhhNhNubah}(h]h ]h"]h$]h&]uh1jihjs ubah}(h]h ]h"]h$]h&]uh1jXhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:153: ./drivers/extcon/extcon.chMehjo ubjs)}(hhh]h)}(h.the unique id indicating an external connectorh]h.the unique id indicating an external connector}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMehj ubah}(h]h ]h"]h$]h&]uh1jrhjo ubeh}(h]h ]h"]h$]h&]uh1jRhj hMehj3 ubjS)}(hD``unsigned int prop`` the property id indicating an extcon property h](jY)}(h``unsigned int prop``h]jj)}(hj h]hunsigned int prop}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jihj ubah}(h]h ]h"]h$]h&]uh1jXhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:153: ./drivers/extcon/extcon.chMfhj ubjs)}(hhh]h)}(h-the property id indicating an extcon propertyh]h-the property id indicating an extcon property}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMfhj ubah}(h]h ]h"]h$]h&]uh1jrhj ubeh}(h]h ]h"]h$]h&]uh1jRhj hMfhj3 ubjS)}(h_``union extcon_property_value *prop_val`` the pointer which store the value of extcon property h](jY)}(h)``union extcon_property_value *prop_val``h]jj)}(hj h]h%union extcon_property_value *prop_val}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jihj ubah}(h]h ]h"]h$]h&]uh1jXhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:153: ./drivers/extcon/extcon.chMghj ubjs)}(hhh]h)}(h4the pointer which store the value of extcon propertyh]h4the pointer which store the value of extcon property}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMghj ubah}(h]h ]h"]h$]h&]uh1jrhj ubeh}(h]h ]h"]h$]h&]uh1jRhj hMghj3 ubeh}(h]h ]h"]h$]h&]uh1jMhj ubh)}(h**Description**h]j8)}(hj"h]h Description}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:153: ./drivers/extcon/extcon.chMihj ubh)}(hXNote that when getting the property value of external connector, the external connector should be attached. If detached state, function return 0 without property value. Also, the each property should be included in the list of supported properties according to extcon type.h]hXNote that when getting the property value of external connector, the external connector should be attached. If detached state, function return 0 without property value. Also, the each property should be included in the list of supported properties according to extcon type.}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:153: ./drivers/extcon/extcon.chMhhj ubh)}(h-Returns 0 if success or error number if fail.h]h-Returns 0 if success or error number if fail.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/driver-api/extcon:153: ./drivers/extcon/extcon.chMmhj ubeh}(h]h ] kernelindentah"]h$]h&]uh1j-hjhhhNhNubeh}(h]core-functionsah ]h"]core functionsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hSysfs Interfaceh]hSysfs Interface}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjehhhhhKubh)}(h5Extcon devices expose the following sysfs attributes:h]h5Extcon devices expose the following sysfs attributes:}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjehhubj^)}(hhh](j)}(h#``name``: Name of the Extcon deviceh]h)}(hjh](jj)}(h``name``h]hname}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jihjubh: Name of the Extcon device}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubj)}(h0``state``: Current state of all supported cablesh]h)}(hjh](jj)}(h ``state``h]hstate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jihjubh': Current state of all supported cables}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubj)}(h1``cable.N/name``: Name of the Nth supported cableh]h)}(hjh](jj)}(h``cable.N/name``h]h cable.N/name}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jihjubh!: Name of the Nth supported cable}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubj)}(h4``cable.N/state``: State of the Nth supported cable h]h)}(h3``cable.N/state``: State of the Nth supported cableh](jj)}(h``cable.N/state``h]h cable.N/state}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jihjubh": State of the Nth supported cable}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]j8j9uh1j]hhhKhjehhubh)}(hhh](h)}(h Usage Exampleh]h Usage Example}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"hhhhhKubj>)}(hXo#include #include #include struct my_extcon_data { struct extcon_dev *edev; struct device *dev; }; static const unsigned int my_extcon_cable[] = { EXTCON_USB, EXTCON_USB_HOST, EXTCON_NONE, }; static int my_extcon_probe(struct platform_device *pdev) { struct my_extcon_data *data; int ret; data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; data->dev = &pdev->dev; /* Initialize extcon device */ data->edev = devm_extcon_dev_allocate(data->dev, my_extcon_cable); if (IS_ERR(data->edev)) { dev_err(data->dev, "Failed to allocate extcon device\n"); return PTR_ERR(data->edev); } /* Register extcon device */ ret = devm_extcon_dev_register(data->dev, data->edev); if (ret < 0) { dev_err(data->dev, "Failed to register extcon device\n"); return ret; } platform_set_drvdata(pdev, data); /* Example: Set initial state */ extcon_set_state_sync(data->edev, EXTCON_USB, true); dev_info(data->dev, "My extcon driver probed successfully\n"); return 0; } static int my_extcon_remove(struct platform_device *pdev) { struct my_extcon_data *data = platform_get_drvdata(pdev); /* Example: Clear state before removal */ extcon_set_state_sync(data->edev, EXTCON_USB, false); dev_info(data->dev, "My extcon driver removed\n"); return 0; } static const struct of_device_id my_extcon_of_match[] = { { .compatible = "my,extcon-device", }, { }, }; MODULE_DEVICE_TABLE(of, my_extcon_of_match); static struct platform_driver my_extcon_driver = { .driver = { .name = "my-extcon-driver", .of_match_table = my_extcon_of_match, }, .probe = my_extcon_probe, .remove = my_extcon_remove, }; module_platform_driver(my_extcon_driver);h]hXo#include #include #include struct my_extcon_data { struct extcon_dev *edev; struct device *dev; }; static const unsigned int my_extcon_cable[] = { EXTCON_USB, EXTCON_USB_HOST, EXTCON_NONE, }; static int my_extcon_probe(struct platform_device *pdev) { struct my_extcon_data *data; int ret; data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; data->dev = &pdev->dev; /* Initialize extcon device */ data->edev = devm_extcon_dev_allocate(data->dev, my_extcon_cable); if (IS_ERR(data->edev)) { dev_err(data->dev, "Failed to allocate extcon device\n"); return PTR_ERR(data->edev); } /* Register extcon device */ ret = devm_extcon_dev_register(data->dev, data->edev); if (ret < 0) { dev_err(data->dev, "Failed to register extcon device\n"); return ret; } platform_set_drvdata(pdev, data); /* Example: Set initial state */ extcon_set_state_sync(data->edev, EXTCON_USB, true); dev_info(data->dev, "My extcon driver probed successfully\n"); return 0; } static int my_extcon_remove(struct platform_device *pdev) { struct my_extcon_data *data = platform_get_drvdata(pdev); /* Example: Clear state before removal */ extcon_set_state_sync(data->edev, EXTCON_USB, false); dev_info(data->dev, "My extcon driver removed\n"); return 0; } static const struct of_device_id my_extcon_of_match[] = { { .compatible = "my,extcon-device", }, { }, }; MODULE_DEVICE_TABLE(of, my_extcon_of_match); static struct platform_driver my_extcon_driver = { .driver = { .name = "my-extcon-driver", .of_match_table = my_extcon_of_match, }, .probe = my_extcon_probe, .remove = my_extcon_remove, }; module_platform_driver(my_extcon_driver);}hj3sbah}(h]h ]h"]h$]h&]jMjNforcelanguagej7highlight_args}uh1j=hhhKhj"hhubeh}(h] usage-exampleah ]h"] usage exampleah$]h&]uh1hhjehhhhhKubh)}(hhh](h)}(hThis example demonstrates:h]hThis example demonstrates:}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjMhhhhhKubj^)}(hhh](j)}(h?Defining supported cable types (USB and USB Host in this case).h]h)}(hjch]h?Defining supported cable types (USB and USB Host in this case).}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjaubah}(h]h ]h"]h$]h&]uh1hhj^hhhhhNubj)}(h,Allocating and registering an extcon device.h]h)}(hjzh]h,Allocating and registering an extcon device.}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjxubah}(h]h ]h"]h$]h&]uh1hhj^hhhhhNubj)}(hESetting an initial state for a cable (USB connected in this example).h]h)}(hjh]hESetting an initial state for a cable (USB connected in this example).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj^hhhhhNubj)}(h.Clearing the state when the driver is removed.h]h)}(hjh]h.Clearing the state when the driver is removed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj^hhhhhNubeh}(h]h ]h"]h$]h&]j8j9uh1j]hhhKhjMhhubeh}(h]this-example-demonstratesah ]h"]this example demonstrates:ah$]h&]uh1hhjehhhhhKubeh}(h]sysfs-interfaceah ]h"]sysfs interfaceah$]h&]uh1hhhhhhhhKubeh}(h]extcon-device-subsystemah ]h"]extcon device subsystemah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourcehʌ _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjj jj|jyj?j<jtjqjbj_jjjJjGjju nametypes}(jj j|j?jtjbjjJjuh}(jhjhjyj j<jjqjBj_jjjj jjjj j jjejGj"jjMu footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.