Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179450
b: refs/heads/master
c: e2f67e4
h: refs/heads/master
v: v3
  • Loading branch information
Manu Abraham authored and Mauro Carvalho Chehab committed Jan 17, 2010
1 parent b433873 commit 84acfb0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e4deee04ffda9b44f367a40dbad8306ab88cb321
refs/heads/master: e2f67e4fb931b975058b3bd48eaac43780c92c88
2 changes: 2 additions & 0 deletions trunk/drivers/media/dvb/mantis/mantis_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/mutex.h>

#include "dvbdev.h"
#include "dvb_demux.h"
Expand Down Expand Up @@ -109,6 +110,7 @@ struct mantis_pci {
struct i2c_adapter adapter;
int i2c_rc;
wait_queue_head_t i2c_wq;
struct mutex i2c_lock;

/* DVB stuff */
struct dvb_adapter dvb_adapter;
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/media/dvb/mantis/mantis_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ static int mantis_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, in
struct mantis_pci *mantis;

mantis = i2c_get_adapdata(adapter);
mutex_lock(&mantis->i2c_lock);
for (i = 0; i < num; i++) {
if (msgs[i].flags & I2C_M_RD)
ret = mantis_i2c_read(mantis, &msgs[i]);
Expand All @@ -134,6 +135,7 @@ static int mantis_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, in
if (ret < 0)
return ret;
}
mutex_unlock(&mantis->i2c_lock);

return num;
}
Expand All @@ -160,6 +162,7 @@ int __devinit mantis_i2c_init(struct mantis_pci *mantis)
{
u32 intstat, intmask;

mutex_init(&mantis->i2c_lock);
memcpy(&mantis->adapter, &mantis_i2c_adapter, sizeof (mantis_i2c_adapter));
i2c_set_adapdata(&mantis->adapter, mantis);
mantis->i2c_rc = i2c_add_adapter(&mantis->adapter);
Expand Down

0 comments on commit 84acfb0

Please sign in to comment.