From 350d4585e11dc47728ce050e695c14cb7e14fca9 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Tue, 22 Mar 2016 13:41:59 -0700 Subject: usb: xhci: Add support for secondary interrupters Implement APIs to dynamically allocate and free secondary event rings based upon interrupter number. Also add exported APIs in usb core layer which allows secondary event ring management via remote processor entity. Change-Id: I5ee7d44d6cad8e35e22d3c1a027a1eec5d208585 Signed-off-by: Hemant Kumar --- include/linux/usb.h | 4 ++++ include/linux/usb/hcd.h | 6 ++++++ 2 files changed, 10 insertions(+) (limited to 'include/linux') diff --git a/include/linux/usb.h b/include/linux/usb.h index b79925dd2b41..a2e367de268d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -734,6 +734,10 @@ static inline bool usb_device_no_sg_constraint(struct usb_device *udev) /* for drivers using iso endpoints */ extern int usb_get_current_frame_number(struct usb_device *usb_dev); +extern int usb_sec_event_ring_setup(struct usb_device *dev, + unsigned intr_num); +extern int usb_sec_event_ring_cleanup(struct usb_device *dev, + unsigned intr_num); /* Sets up a group of bulk endpoints to support multiple stream IDs. */ extern int usb_alloc_streams(struct usb_interface *interface, diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index f89c24bd53a4..56c7fba6dcdf 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h @@ -396,6 +396,8 @@ struct hc_driver { /* Call for power on/off the port if necessary */ int (*port_power)(struct usb_hcd *hcd, int portnum, bool enable); + int (*sec_event_ring_setup)(struct usb_hcd *hcd, unsigned intr_num); + int (*sec_event_ring_cleanup)(struct usb_hcd *hcd, unsigned intr_num); }; static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd) @@ -434,6 +436,10 @@ extern int usb_hcd_alloc_bandwidth(struct usb_device *udev, struct usb_host_interface *old_alt, struct usb_host_interface *new_alt); extern int usb_hcd_get_frame_number(struct usb_device *udev); +extern int usb_hcd_sec_event_ring_setup(struct usb_device *udev, + unsigned intr_num); +extern int usb_hcd_sec_event_ring_cleanup(struct usb_device *udev, + unsigned intr_num); extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver, struct device *dev, const char *bus_name); -- cgit v1.2.3 From acb4a107998491e4bd0444a4f0d41dadecb50652 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Tue, 22 Mar 2016 19:34:20 -0700 Subject: usb: xhci: Add helper APIs to return xhci dma addresses dma address of secondary event ring, transfer ring and device context base address are required to pass to remote entity. Remote entity uses these addresses to program xhci controller registers. Change-Id: Ie0756d646a396a11b41b93e886bca9aff636ee5d Signed-off-by: Hemant Kumar --- include/linux/usb.h | 7 +++++++ include/linux/usb/hcd.h | 13 +++++++++++++ 2 files changed, 20 insertions(+) (limited to 'include/linux') diff --git a/include/linux/usb.h b/include/linux/usb.h index a2e367de268d..246945be000c 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -739,6 +739,13 @@ extern int usb_sec_event_ring_setup(struct usb_device *dev, extern int usb_sec_event_ring_cleanup(struct usb_device *dev, unsigned intr_num); +extern dma_addr_t +usb_get_sec_event_ring_dma_addr(struct usb_device *dev, + unsigned intr_num); +extern dma_addr_t usb_get_dcba_dma_addr(struct usb_device *dev); +extern dma_addr_t usb_get_xfer_ring_dma_addr(struct usb_device *dev, + struct usb_host_endpoint *ep); + /* Sets up a group of bulk endpoints to support multiple stream IDs. */ extern int usb_alloc_streams(struct usb_interface *interface, struct usb_host_endpoint **eps, unsigned int num_eps, diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 56c7fba6dcdf..3740366d9fc5 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h @@ -398,6 +398,12 @@ struct hc_driver { int (*sec_event_ring_setup)(struct usb_hcd *hcd, unsigned intr_num); int (*sec_event_ring_cleanup)(struct usb_hcd *hcd, unsigned intr_num); + dma_addr_t (*get_sec_event_ring_dma_addr)(struct usb_hcd *hcd, + unsigned intr_num); + dma_addr_t (*get_xfer_ring_dma_addr)(struct usb_hcd *hcd, + struct usb_device *udev, struct usb_host_endpoint *ep); + dma_addr_t (*get_dcba_dma_addr)(struct usb_hcd *hcd, + struct usb_device *udev); }; static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd) @@ -440,6 +446,13 @@ extern int usb_hcd_sec_event_ring_setup(struct usb_device *udev, unsigned intr_num); extern int usb_hcd_sec_event_ring_cleanup(struct usb_device *udev, unsigned intr_num); +extern dma_addr_t +usb_hcd_get_sec_event_ring_dma_addr(struct usb_device *udev, + unsigned intr_num); +extern dma_addr_t usb_hcd_get_dcba_dma_addr(struct usb_device *udev); +extern dma_addr_t +usb_hcd_get_xfer_ring_dma_addr(struct usb_device *udev, + struct usb_host_endpoint *ep); extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver, struct device *dev, const char *bus_name); -- cgit v1.2.3 From 154574cfc68dc28ca6a04b5bcf58c77adc67f73c Mon Sep 17 00:00:00 2001 From: Devesh Jhunjhunwala Date: Wed, 29 Jun 2016 17:48:12 -0700 Subject: leds: qpnp-flash-v2: Add operational current property Add the qcom,current-ma property to specify the operational current for the flash led. Also limit the minimum flash current to 25mA since currents below this value cause unstable flash operation. CRs-Fixed: 1033071 Change-Id: Ia133b6c0cf0c21484f61631f04cba0d1112c9d48 Signed-off-by: Devesh Jhunjhunwala --- include/linux/leds-qpnp-flash-v2.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/leds-qpnp-flash-v2.h b/include/linux/leds-qpnp-flash-v2.h index 353466f6c108..ae36a163ed21 100644 --- a/include/linux/leds-qpnp-flash-v2.h +++ b/include/linux/leds-qpnp-flash-v2.h @@ -26,13 +26,14 @@ struct flash_node_data { struct pinctrl_state *gpio_state_active; struct pinctrl_state *gpio_state_suspend; int ires_ua; - u16 prgm_current; + int max_current; + int current_ma; u8 duration; u8 id; u8 type; u8 ires; u8 hdrm_val; - u8 brightness; + u8 current_reg_val; bool led_on; }; -- cgit v1.2.3