Lines Matching +full:mutually +full:- +full:exclusive
17 1. USB connectors (e.g., USB-C, micro-USB)
23 Real-world examples:
25 1. Smartphone USB-C port:
26 A single USB-C port on a smartphone can serve multiple functions. Extcon
28 - USB data connection
29 - Charging (various types like fast charging, USB Power Delivery)
30 - Audio output (USB-C headphones)
31 - Video output (USB-C to HDMI adapter)
36 - Power delivery
37 - External displays
38 - USB hub connections
39 - Ethernet connectivity
49 type of device (e.g., gaming console, set-top box, Blu-ray player).
53 states, handle mutually exclusive connections, and manage connector
61 ----------
90 - ``name``: Name of the Extcon device
91 - ``supported_cable``: Array of supported cable types
92 - ``mutually_exclusive``: Array defining mutually exclusive cable types
94 32-bit unsigned integers, where each element represents a set of mutually
95 exclusive cable types. The array should be terminated with a 0.
102 BIT(0) | BIT(1), /* Cable 0 and 1 are mutually exclusive */
103 BIT(2) | BIT(3) | BIT(4), /* Cables 2, 3, and 4 are mutually exclusive */
108 cables 2, 3, and 4 are also mutually exclusive. This is useful for
116 - ``state``: Current state of the device (bitmap of connected cables)
120 ------------
144 .. kernel-doc:: drivers/extcon/extcon.c
147 .. kernel-doc:: drivers/extcon/extcon.c
150 .. kernel-doc:: drivers/extcon/extcon.c
153 .. kernel-doc:: drivers/extcon/extcon.c
162 - ``name``: Name of the Extcon device
163 - ``state``: Current state of all supported cables
164 - ``cable.N/name``: Name of the Nth supported cable
165 - ``cable.N/state``: State of the Nth supported cable
168 -------------
170 .. code-block:: c
192 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
194 return -ENOMEM;
196 data->dev = &pdev->dev;
199 data->edev = devm_extcon_dev_allocate(data->dev, my_extcon_cable);
200 if (IS_ERR(data->edev)) {
201 dev_err(data->dev, "Failed to allocate extcon device\n");
202 return PTR_ERR(data->edev);
206 ret = devm_extcon_dev_register(data->dev, data->edev);
208 dev_err(data->dev, "Failed to register extcon device\n");
215 extcon_set_state_sync(data->edev, EXTCON_USB, true);
217 dev_info(data->dev, "My extcon driver probed successfully\n");
226 extcon_set_state_sync(data->edev, EXTCON_USB, false);
228 dev_info(data->dev, "My extcon driver removed\n");
233 { .compatible = "my,extcon-device", },
240 .name = "my-extcon-driver",
250 ---------------------------
252 - Defining supported cable types (USB and USB Host in this case).
253 - Allocating and registering an extcon device.
254 - Setting an initial state for a cable (USB connected in this example).
255 - Clearing the state when the driver is removed.