Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53309
b: refs/heads/master
c: fffe52e
h: refs/heads/master
i:
  53307: 84f2147
v: v3
  • Loading branch information
Geert Uytterhoeven authored and Linus Torvalds committed May 5, 2007
1 parent 3b3ff22 commit 8d26f7e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bd685ac8e78b9bfd4a0145be22a7ff11ab11adef
refs/heads/master: fffe52e86b4ad5f8bdcb284c4ea6c87402967f3d
29 changes: 22 additions & 7 deletions trunk/drivers/ps3/ps3av.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,24 @@
static int timeout = 5000; /* in msec ( 5 sec ) */
module_param(timeout, int, 0644);

static struct ps3av ps3av;
static struct ps3av {
int available;
struct mutex mutex;
struct work_struct work;
struct completion done;
struct workqueue_struct *wq;
int open_count;
struct ps3_vuart_port_device *dev;

int region;
struct ps3av_pkt_av_get_hw_conf av_hw_conf;
u32 av_port[PS3AV_AV_PORT_MAX + PS3AV_OPT_PORT_MAX];
u32 opt_port[PS3AV_OPT_PORT_MAX];
u32 head[PS3AV_HEAD_MAX];
u32 audio_port;
int ps3av_mode;
int ps3av_mode_old;
} ps3av;

static struct ps3_vuart_port_device ps3av_dev = {
.match_id = PS3_MATCH_ID_AV_SETTINGS
Expand Down Expand Up @@ -250,7 +267,7 @@ int ps3av_do_pkt(u32 cid, u16 send_len, size_t usr_buf_size,
struct ps3av_send_hdr *buf)
{
int res = 0;
union {
static union {
struct ps3av_reply_hdr reply_hdr;
u8 raw[PS3AV_BUF_SIZE];
} recv_buf;
Expand All @@ -259,8 +276,7 @@ int ps3av_do_pkt(u32 cid, u16 send_len, size_t usr_buf_size,

BUG_ON(!ps3av.available);

if (down_interruptible(&ps3av.sem))
return -ERESTARTSYS;
mutex_lock(&ps3av.mutex);

table = ps3av_search_cmd_table(cid, PS3AV_CID_MASK);
BUG_ON(!table);
Expand Down Expand Up @@ -290,11 +306,11 @@ int ps3av_do_pkt(u32 cid, u16 send_len, size_t usr_buf_size,
goto err;
}

up(&ps3av.sem);
mutex_unlock(&ps3av.mutex);
return 0;

err:
up(&ps3av.sem);
mutex_unlock(&ps3av.mutex);
printk(KERN_ERR "%s: failed cid:%x res:%d\n", __FUNCTION__, cid, res);
return res;
}
Expand Down Expand Up @@ -872,7 +888,6 @@ static int ps3av_probe(struct ps3_vuart_port_device *dev)

memset(&ps3av, 0, sizeof(ps3av));

init_MUTEX(&ps3av.sem);
mutex_init(&ps3av.mutex);
ps3av.ps3av_mode = 0;
ps3av.dev = dev;
Expand Down
22 changes: 1 addition & 21 deletions trunk/include/asm-powerpc/ps3av.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#ifndef _ASM_POWERPC_PS3AV_H_
#define _ASM_POWERPC_PS3AV_H_

#include <linux/mutex.h>

/** command for ioctl() **/
#define PS3AV_VERSION 0x205 /* version of ps3av command */

Expand Down Expand Up @@ -643,25 +641,6 @@ struct ps3av_pkt_avb_param {
u8 buf[PS3AV_PKT_AVB_PARAM_MAX_BUF_SIZE];
};

struct ps3av {
int available;
struct semaphore sem;
struct work_struct work;
struct completion done;
struct workqueue_struct *wq;
struct mutex mutex;
int open_count;
struct ps3_vuart_port_device *dev;

int region;
struct ps3av_pkt_av_get_hw_conf av_hw_conf;
u32 av_port[PS3AV_AV_PORT_MAX + PS3AV_OPT_PORT_MAX];
u32 opt_port[PS3AV_OPT_PORT_MAX];
u32 head[PS3AV_HEAD_MAX];
u32 audio_port;
int ps3av_mode;
int ps3av_mode_old;
};

/** command status **/
#define PS3AV_STATUS_SUCCESS 0x0000 /* success */
Expand Down Expand Up @@ -719,6 +698,7 @@ static inline void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_
extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *,
u32);

struct ps3_vuart_port_device;
extern int ps3av_vuart_write(struct ps3_vuart_port_device *dev,
const void *buf, unsigned long size);
extern int ps3av_vuart_read(struct ps3_vuart_port_device *dev, void *buf,
Expand Down

0 comments on commit 8d26f7e

Please sign in to comment.