Commit 75c86e74 authored by Geoff Levand's avatar Geoff Levand Committed by Paul Mackerras

[POWERPC] PS3: Vuart cleanups

Cleanups for the PS3 vuart driver.

- Hide driver private data from external interface with new structure
  ps3_vuart_port_priv.
- Fix masking bug in ps3_vuart_get_interrupt_status().
- Add new helper routine ps3_vuart_clear_rx_bytes() to flush rx buffer.
- Add new variable probe_mutex to serialize probe and destroy routines.
- Rename some symbols.
- Add platform check in ps3_vuart_bus_init().
Signed-off-by: default avatarGeoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 724339d7
This diff is collapsed.
...@@ -21,6 +21,36 @@ ...@@ -21,6 +21,36 @@
#if !defined(_PS3_VUART_H) #if !defined(_PS3_VUART_H)
#define _PS3_VUART_H #define _PS3_VUART_H
#include <asm/ps3.h>
struct ps3_vuart_stats {
unsigned long bytes_written;
unsigned long bytes_read;
unsigned long tx_interrupts;
unsigned long rx_interrupts;
unsigned long disconnect_interrupts;
};
/**
* struct ps3_vuart_port_priv - private vuart device data.
*/
struct ps3_vuart_port_priv {
unsigned int port_number;
u64 interrupt_mask;
struct {
spinlock_t lock;
struct list_head head;
} tx_list;
struct {
unsigned long bytes_held;
spinlock_t lock;
struct list_head head;
} rx_list;
struct ps3_vuart_stats stats;
};
/** /**
* struct ps3_vuart_port_driver - a driver for a device on a vuart port * struct ps3_vuart_port_driver - a driver for a device on a vuart port
*/ */
......
...@@ -355,13 +355,7 @@ extern struct bus_type ps3_system_bus_type; ...@@ -355,13 +355,7 @@ extern struct bus_type ps3_system_bus_type;
/* vuart routines */ /* vuart routines */
struct ps3_vuart_stats { struct ps3_vuart_port_priv;
unsigned long bytes_written;
unsigned long bytes_read;
unsigned long tx_interrupts;
unsigned long rx_interrupts;
unsigned long disconnect_interrupts;
};
/** /**
* struct ps3_vuart_port_device - a device on a vuart port * struct ps3_vuart_port_device - a device on a vuart port
...@@ -370,20 +364,8 @@ struct ps3_vuart_stats { ...@@ -370,20 +364,8 @@ struct ps3_vuart_stats {
struct ps3_vuart_port_device { struct ps3_vuart_port_device {
enum ps3_match_id match_id; enum ps3_match_id match_id;
struct device core; struct device core;
struct ps3_vuart_port_priv* priv; /* private driver variables */
/* private driver variables */
unsigned int port_number;
u64 interrupt_mask;
struct {
spinlock_t lock;
struct list_head head;
} tx_list;
struct {
unsigned long bytes_held;
spinlock_t lock;
struct list_head head;
} rx_list;
struct ps3_vuart_stats stats;
}; };
int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev); int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev);
......
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