Lines Matching +full:battery +full:- +full:powered
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
9 * - the master/host side Linux-USB kernel driver API;
10 * - the "usbfs" user space API; and
11 * - the Linux "gadget" slave/device/peripheral side driver API.
25 * [b] so that accessing bigger-than-a-bytes fields will never
30 * someone that the two other points are non-issues for that
40 /*-------------------------------------------------------------------------*/
139 * See USB 2.0 spec Table 9-7
153 * See USB 3.0 spec Table 9-7
162 * Suspend Options, Table 9-8 USB 3.0 spec
168 * Interface status, Figure 9-5 USB 3.0 spec
181 * Feature selectors from Table 9-8 USB Power Delivery spec
197 * struct usb_ctrlrequest - SETUP data for a USB device control request
205 * the different fields of the USB 2.0 Spec section 9.3, table 9-2. See the
221 /*-------------------------------------------------------------------------*/
227 * Note that all multi-byte values here are encoded in little endian
229 * through the Linux-USB APIs, they are not converted to cpu byte
269 /* Conventional codes for class-specific descriptors. The convention is
286 /*-------------------------------------------------------------------------*/
339 /*-------------------------------------------------------------------------*/
344 * descriptor type is different. Highspeed-capable devices can look
365 #define USB_CONFIG_ATT_SELFPOWER (1 << 6) /* self powered */
367 #define USB_CONFIG_ATT_BATTERY (1 << 4) /* battery powered */
369 /*-------------------------------------------------------------------------*/
379 __le16 wData[1]; /* UTF-16LE encoded */
386 /*-------------------------------------------------------------------------*/
404 /*-------------------------------------------------------------------------*/
461 /*-------------------------------------------------------------------------*/
464 * usb_endpoint_num - get the endpoint's number
471 return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; in usb_endpoint_num()
475 * usb_endpoint_type - get the endpoint's transfer type
483 return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; in usb_endpoint_type()
487 * usb_endpoint_dir_in - check if the endpoint has IN direction
494 return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN); in usb_endpoint_dir_in()
498 * usb_endpoint_dir_out - check if the endpoint has OUT direction
506 return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT); in usb_endpoint_dir_out()
510 * usb_endpoint_xfer_bulk - check if the endpoint has bulk transfer type
518 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == in usb_endpoint_xfer_bulk()
523 * usb_endpoint_xfer_control - check if the endpoint has control transfer type
531 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == in usb_endpoint_xfer_control()
536 * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type
545 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == in usb_endpoint_xfer_int()
550 * usb_endpoint_xfer_isoc - check if the endpoint has isochronous transfer type
559 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == in usb_endpoint_xfer_isoc()
564 * usb_endpoint_is_bulk_in - check if the endpoint is bulk IN
577 * usb_endpoint_is_bulk_out - check if the endpoint is bulk OUT
590 * usb_endpoint_is_int_in - check if the endpoint is interrupt IN
603 * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT
616 * usb_endpoint_is_isoc_in - check if the endpoint is isochronous IN
629 * usb_endpoint_is_isoc_out - check if the endpoint is isochronous OUT
642 * usb_endpoint_maxp - get endpoint's max packet size
649 return __le16_to_cpu(epd->wMaxPacketSize) & USB_ENDPOINT_MAXP_MASK; in usb_endpoint_maxp()
653 * usb_endpoint_maxp_mult - get endpoint's transactional opportunities
661 int maxp = __le16_to_cpu(epd->wMaxPacketSize); in usb_endpoint_maxp_mult()
669 return epd->bmAttributes & USB_ENDPOINT_INTRTYPE; in usb_endpoint_interrupt_type()
672 /*-------------------------------------------------------------------------*/
686 /*-------------------------------------------------------------------------*/
709 max_streams = comp->bmAttributes & 0x1f; in usb_ss_max_streams()
724 /*-------------------------------------------------------------------------*/
741 /*-------------------------------------------------------------------------*/
758 * in binary-coded decimal(i.e. 2.0 is 0200H)
768 /*-------------------------------------------------------------------------*/
780 /*-------------------------------------------------------------------------*/
797 /*-------------------------------------------------------------------------*/
810 /*-------------------------------------------------------------------------*/
824 /*-------------------------------------------------------------------------*/
833 #define USB_ENC_TYPE_WIRED 1 /* non-wireless mode */
841 /*-------------------------------------------------------------------------*/
843 /* USB_DT_BOS: group of device-level capabilities */
853 /*-------------------------------------------------------------------------*/
945 __u8 ContainerID[16]; /* 128-bit number */
983 /* Provides information on each battery supported by the device */
996 #define USB_PD_CAP_BATTERY_CHARGING (1 << 1) /* supports Battery Charging specification */
1001 #define USB_PD_CAP_TYPE_C_CURRENT (1 << 6) /* supports power capabilities defined in the USB Type-C…
1018 /* Index of string descriptor shall contain the user friendly name for this battery */
1020 /* Index of string descriptor shall contain the Serial Number String for this battery */
1023 __u8 bBatteryId; /* uniquely identifies this battery in status Messages */
1026 * Shall contain the Battery Charge value above which this
1027 * battery is considered to be fully charged but not necessarily
1032 * Shall contain the minimum charge level of this battery such
1034 * able to power up successfully (see Battery Charging 1.2).
1050 #define USB_PD_CAP_CONSUMER_TYPE_C (1 << 2) /* USB Type-C Current */
1054 __le32 dwMaxOperatingPower; /* in 10 mW - operating at steady state */
1055 __le32 dwMaxPeakPower; /* in 10mW units - operating at peak power */
1056 __le32 dwMaxPeakPowerTime; /* in 100ms units - duration of peak */
1069 #define USB_PD_CAP_PROVIDER_TYPE_C (1 << 2) /* USB Type-C Current */
1089 * (SSAC) specified in bmAttributes[4:0]. SSAC is zero-based
1093 /*-------------------------------------------------------------------------*/
1114 /*-------------------------------------------------------------------------*/
1116 /* USB_REQ_SET_HANDSHAKE is a four-way handshake used between a wireless
1130 /*-------------------------------------------------------------------------*/
1133 * A CC may also be set up using non-wireless secure channels (including
1142 /*-------------------------------------------------------------------------*/
1174 * states, returning to POWERED, DEFAULT, ADDRESS, or
1226 /*-------------------------------------------------------------------------*/
1230 * more than 100mA from USB must report itself as bus-powered in