Merge tag 'usb-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB/PHY driver updates from Greg KH: "Here is the large USB and PHY driver update for 4.14-rc1. Not all that exciting, a few new PHY drivers, the usual mess of gadget driver updates and fixes, and of course, xhci updates to try to tame that beast. A number of usb-serial updates and other small fixes all over the USB driver tree are in here as well. Full details are in the shortlog. All of these have been in linux-next for a while with no reported issues" * tag 'usb-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (171 commits) usbip: vhci-hcd: make vhci_hc_driver const usb: phy: Avoid unchecked dereference warning usb: imx21-hcd: make imx21_hc_driver const usb: host: make ehci_fsl_overrides const and __initconst dt-bindings: mt8173-mtu3: add generic compatible and rename file dt-bindings: mt8173-xhci: add generic compatible and rename file usb: xhci-mtk: add generic compatible string usbip: auto retry for concurrent attach USB: serial: option: simplify 3 D-Link device entries USB: serial: option: add support for D-Link DWM-157 C1 usb: core: usbport: fix "BUG: key not in .data" when lockdep is enabled usb: chipidea: usb2: check memory allocation failure usb: Add device quirk for Logitech HD Pro Webcam C920-C usb: misc: lvstest: add entry to place port in compliance mode usb: xhci: Support enabling of compliance mode for xhci 1.1 usb:xhci:Fix regression when ATI chipsets detected usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard usb: gadget: make snd_pcm_hardware const usb: common: use of_property_read_bool() USB: core: constify vm_operations_struct ...
This commit is contained in:
@@ -362,6 +362,12 @@ struct hid_item {
|
||||
#define HID_GROUP_WACOM 0x0101
|
||||
#define HID_GROUP_LOGITECH_DJ_DEVICE 0x0102
|
||||
|
||||
/*
|
||||
* HID protocol status
|
||||
*/
|
||||
#define HID_REPORT_PROTOCOL 1
|
||||
#define HID_BOOT_PROTOCOL 0
|
||||
|
||||
/*
|
||||
* This is the global environment of the parser. This information is
|
||||
* persistent for main-items. The global environment can be saved and
|
||||
|
@@ -58,6 +58,7 @@ struct ci_hdrc_platform_data {
|
||||
#define CI_HDRC_OVERRIDE_TX_BURST BIT(10)
|
||||
#define CI_HDRC_OVERRIDE_RX_BURST BIT(11)
|
||||
#define CI_HDRC_OVERRIDE_PHY_CONTROL BIT(12) /* Glue layer manages phy */
|
||||
#define CI_HDRC_REQUIRES_ALIGNED_DMA BIT(13)
|
||||
enum usb_dr_mode dr_mode;
|
||||
#define CI_HDRC_CONTROLLER_RESET_EVENT 0
|
||||
#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
|
||||
|
@@ -48,6 +48,7 @@ struct usb_ep;
|
||||
* by adding a zero length packet as needed;
|
||||
* @short_not_ok: When reading data, makes short packets be
|
||||
* treated as errors (queue stops advancing till cleanup).
|
||||
* @dma_mapped: Indicates if request has been mapped to DMA (internal)
|
||||
* @complete: Function called when request completes, so this request and
|
||||
* its buffer may be re-used. The function will always be called with
|
||||
* interrupts disabled, and it must not sleep.
|
||||
@@ -103,6 +104,7 @@ struct usb_request {
|
||||
unsigned no_interrupt:1;
|
||||
unsigned zero:1;
|
||||
unsigned short_not_ok:1;
|
||||
unsigned dma_mapped:1;
|
||||
|
||||
void (*complete)(struct usb_ep *ep,
|
||||
struct usb_request *req);
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#include <linux/extcon.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/usb.h>
|
||||
#include <uapi/linux/usb/charger.h>
|
||||
|
||||
enum usb_phy_interface {
|
||||
USBPHY_INTERFACE_MODE_UNKNOWN,
|
||||
@@ -72,6 +73,17 @@ struct usb_phy_io_ops {
|
||||
int (*write)(struct usb_phy *x, u32 val, u32 reg);
|
||||
};
|
||||
|
||||
struct usb_charger_current {
|
||||
unsigned int sdp_min;
|
||||
unsigned int sdp_max;
|
||||
unsigned int dcp_min;
|
||||
unsigned int dcp_max;
|
||||
unsigned int cdp_min;
|
||||
unsigned int cdp_max;
|
||||
unsigned int aca_min;
|
||||
unsigned int aca_max;
|
||||
};
|
||||
|
||||
struct usb_phy {
|
||||
struct device *dev;
|
||||
const char *label;
|
||||
@@ -91,6 +103,13 @@ struct usb_phy {
|
||||
struct extcon_dev *id_edev;
|
||||
struct notifier_block vbus_nb;
|
||||
struct notifier_block id_nb;
|
||||
struct notifier_block type_nb;
|
||||
|
||||
/* Support USB charger */
|
||||
enum usb_charger_type chg_type;
|
||||
enum usb_charger_state chg_state;
|
||||
struct usb_charger_current chg_cur;
|
||||
struct work_struct chg_work;
|
||||
|
||||
/* for notification of usb_phy_events */
|
||||
struct atomic_notifier_head notifier;
|
||||
@@ -129,6 +148,12 @@ struct usb_phy {
|
||||
enum usb_device_speed speed);
|
||||
int (*notify_disconnect)(struct usb_phy *x,
|
||||
enum usb_device_speed speed);
|
||||
|
||||
/*
|
||||
* Charger detection method can be implemented if you need to
|
||||
* manually detect the charger type.
|
||||
*/
|
||||
enum usb_charger_type (*charger_detect)(struct usb_phy *x);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -219,6 +244,12 @@ extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
|
||||
extern int usb_bind_phy(const char *dev_name, u8 index,
|
||||
const char *phy_dev_name);
|
||||
extern void usb_phy_set_event(struct usb_phy *x, unsigned long event);
|
||||
extern void usb_phy_set_charger_current(struct usb_phy *usb_phy,
|
||||
unsigned int mA);
|
||||
extern void usb_phy_get_charger_current(struct usb_phy *usb_phy,
|
||||
unsigned int *min, unsigned int *max);
|
||||
extern void usb_phy_set_charger_state(struct usb_phy *usb_phy,
|
||||
enum usb_charger_state state);
|
||||
#else
|
||||
static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
|
||||
{
|
||||
@@ -270,12 +301,33 @@ static inline int usb_bind_phy(const char *dev_name, u8 index,
|
||||
static inline void usb_phy_set_event(struct usb_phy *x, unsigned long event)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void usb_phy_set_charger_current(struct usb_phy *usb_phy,
|
||||
unsigned int mA)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void usb_phy_get_charger_current(struct usb_phy *usb_phy,
|
||||
unsigned int *min,
|
||||
unsigned int *max)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void usb_phy_set_charger_state(struct usb_phy *usb_phy,
|
||||
enum usb_charger_state state)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int
|
||||
usb_phy_set_power(struct usb_phy *x, unsigned mA)
|
||||
{
|
||||
if (x && x->set_power)
|
||||
if (!x)
|
||||
return 0;
|
||||
|
||||
usb_phy_set_charger_current(x, mA);
|
||||
|
||||
if (x->set_power)
|
||||
return x->set_power(x, mA);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user