Commit 51a19621 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman

staging: octeon-usb: cvmx_usb_port_status_t -> struct cvmx_usb_port_status

Replace cvmx_usb_port_status_t with struct cvmx_usb_port_status.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 03f9adf4
...@@ -196,7 +196,7 @@ typedef struct { ...@@ -196,7 +196,7 @@ typedef struct {
cvmx_usb_callback_func_t callback[__CVMX_USB_CALLBACK_END]; /**< User global callbacks */ cvmx_usb_callback_func_t callback[__CVMX_USB_CALLBACK_END]; /**< User global callbacks */
void *callback_data[__CVMX_USB_CALLBACK_END]; /**< User data for each callback */ void *callback_data[__CVMX_USB_CALLBACK_END]; /**< User data for each callback */
int indent; /**< Used by debug output to indent functions */ int indent; /**< Used by debug output to indent functions */
cvmx_usb_port_status_t port_status; /**< Last port status used for change notification */ struct cvmx_usb_port_status port_status; /**< Last port status used for change notification */
cvmx_usb_pipe_list_t free_pipes; /**< List of all pipes that are currently closed */ cvmx_usb_pipe_list_t free_pipes; /**< List of all pipes that are currently closed */
cvmx_usb_pipe_list_t idle_pipes; /**< List of open pipes that have no transactions */ cvmx_usb_pipe_list_t idle_pipes; /**< List of open pipes that have no transactions */
cvmx_usb_pipe_list_t active_pipes[4]; /**< Active pipes indexed by transfer type */ cvmx_usb_pipe_list_t active_pipes[4]; /**< Active pipes indexed by transfer type */
...@@ -971,10 +971,10 @@ int cvmx_usb_disable(cvmx_usb_state_t *state) ...@@ -971,10 +971,10 @@ int cvmx_usb_disable(cvmx_usb_state_t *state)
* *
* Returns: Port status information * Returns: Port status information
*/ */
cvmx_usb_port_status_t cvmx_usb_get_status(cvmx_usb_state_t *state) struct cvmx_usb_port_status cvmx_usb_get_status(cvmx_usb_state_t *state)
{ {
cvmx_usbcx_hprt_t usbc_hprt; cvmx_usbcx_hprt_t usbc_hprt;
cvmx_usb_port_status_t result; struct cvmx_usb_port_status result;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state;
memset(&result, 0, sizeof(result)); memset(&result, 0, sizeof(result));
...@@ -1003,7 +1003,7 @@ cvmx_usb_port_status_t cvmx_usb_get_status(cvmx_usb_state_t *state) ...@@ -1003,7 +1003,7 @@ cvmx_usb_port_status_t cvmx_usb_get_status(cvmx_usb_state_t *state)
* @port_status: * @port_status:
* Port status to set, most like returned by cvmx_usb_get_status() * Port status to set, most like returned by cvmx_usb_get_status()
*/ */
void cvmx_usb_set_status(cvmx_usb_state_t *state, cvmx_usb_port_status_t port_status) void cvmx_usb_set_status(cvmx_usb_state_t *state, struct cvmx_usb_port_status port_status)
{ {
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state;
usb->port_status = port_status; usb->port_status = port_status;
...@@ -2964,7 +2964,7 @@ static int __cvmx_usb_poll_channel(cvmx_usb_internal_state_t *usb, int channel) ...@@ -2964,7 +2964,7 @@ static int __cvmx_usb_poll_channel(cvmx_usb_internal_state_t *usb, int channel)
pipe->next_tx_frame = usb->frame_number + pipe->interval - pipe->next_tx_frame = usb->frame_number + pipe->interval -
(usb->frame_number - pipe->next_tx_frame) % pipe->interval; (usb->frame_number - pipe->next_tx_frame) % pipe->interval;
} else { } else {
cvmx_usb_port_status_t port; struct cvmx_usb_port_status port;
port = cvmx_usb_get_status((cvmx_usb_state_t *)usb); port = cvmx_usb_get_status((cvmx_usb_state_t *)usb);
if (port.port_enabled) { if (port.port_enabled) {
/* We'll retry the exact same transaction again */ /* We'll retry the exact same transaction again */
......
...@@ -310,18 +310,29 @@ enum cvmx_usb_complete { ...@@ -310,18 +310,29 @@ enum cvmx_usb_complete {
}; };
/** /**
* Structure returned containing the USB port status information. * struct cvmx_usb_port_status - the USB port status information
*
* @port_enabled: 1 = Usb port is enabled, 0 = disabled
* @port_over_current: 1 = Over current detected, 0 = Over current not
* detected. Octeon doesn't support over current detection.
* @port_powered: 1 = Port power is being supplied to the device, 0 =
* power is off. Octeon doesn't support turning port power
* off.
* @port_speed: Current port speed.
* @connected: 1 = A device is connected to the port, 0 = No device is
* connected.
* @connect_change: 1 = Device connected state changed since the last set
* status call.
*/ */
typedef struct struct cvmx_usb_port_status {
{ uint32_t reserved : 25;
uint32_t reserved : 25; uint32_t port_enabled : 1;
uint32_t port_enabled : 1; /**< 1 = Usb port is enabled, 0 = disabled */ uint32_t port_over_current : 1;
uint32_t port_over_current : 1; /**< 1 = Over current detected, 0 = Over current not detected. Octeon doesn't support over current detection */ uint32_t port_powered : 1;
uint32_t port_powered : 1; /**< 1 = Port power is being supplied to the device, 0 = power is off. Octeon doesn't support turning port power off */ enum cvmx_usb_speed port_speed : 2;
enum cvmx_usb_speed port_speed : 2; /**< Current port speed */ uint32_t connected : 1;
uint32_t connected : 1; /**< 1 = A device is connected to the port, 0 = No device is connected */ uint32_t connect_change : 1;
uint32_t connect_change : 1; /**< 1 = Device connected state changed since the last set status call */ };
} cvmx_usb_port_status_t;
/** /**
* This is the structure of a Control packet header * This is the structure of a Control packet header
...@@ -463,8 +474,8 @@ extern int cvmx_usb_initialize(cvmx_usb_state_t *state, int usb_port_number, ...@@ -463,8 +474,8 @@ extern int cvmx_usb_initialize(cvmx_usb_state_t *state, int usb_port_number,
extern int cvmx_usb_shutdown(cvmx_usb_state_t *state); extern int cvmx_usb_shutdown(cvmx_usb_state_t *state);
extern int cvmx_usb_enable(cvmx_usb_state_t *state); extern int cvmx_usb_enable(cvmx_usb_state_t *state);
extern int cvmx_usb_disable(cvmx_usb_state_t *state); extern int cvmx_usb_disable(cvmx_usb_state_t *state);
extern cvmx_usb_port_status_t cvmx_usb_get_status(cvmx_usb_state_t *state); extern struct cvmx_usb_port_status cvmx_usb_get_status(cvmx_usb_state_t *state);
extern void cvmx_usb_set_status(cvmx_usb_state_t *state, cvmx_usb_port_status_t port_status); extern void cvmx_usb_set_status(cvmx_usb_state_t *state, struct cvmx_usb_port_status port_status);
extern int cvmx_usb_open_pipe(cvmx_usb_state_t *state, extern int cvmx_usb_open_pipe(cvmx_usb_state_t *state,
enum cvmx_usb_pipe_flags flags, enum cvmx_usb_pipe_flags flags,
int device_addr, int endpoint_num, int device_addr, int endpoint_num,
......
...@@ -440,7 +440,7 @@ static void octeon_usb_endpoint_disable(struct usb_hcd *hcd, struct usb_host_end ...@@ -440,7 +440,7 @@ static void octeon_usb_endpoint_disable(struct usb_hcd *hcd, struct usb_host_end
static int octeon_usb_hub_status_data(struct usb_hcd *hcd, char *buf) static int octeon_usb_hub_status_data(struct usb_hcd *hcd, char *buf)
{ {
struct octeon_hcd *priv = hcd_to_octeon(hcd); struct octeon_hcd *priv = hcd_to_octeon(hcd);
cvmx_usb_port_status_t port_status; struct cvmx_usb_port_status port_status;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags);
...@@ -456,7 +456,7 @@ static int octeon_usb_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -456,7 +456,7 @@ static int octeon_usb_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
{ {
struct octeon_hcd *priv = hcd_to_octeon(hcd); struct octeon_hcd *priv = hcd_to_octeon(hcd);
struct device *dev = hcd->self.controller; struct device *dev = hcd->self.controller;
cvmx_usb_port_status_t usb_port_status; struct cvmx_usb_port_status usb_port_status;
int port_status; int port_status;
struct usb_hub_descriptor *desc; struct usb_hub_descriptor *desc;
unsigned long flags; unsigned long flags;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment