Commit 44a6481d authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

V4L/DVB (6162): cx23885: whitespace cleanups

Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 70ebd705
...@@ -171,7 +171,8 @@ void cx23885_card_setup(struct cx23885_dev *dev) ...@@ -171,7 +171,8 @@ void cx23885_card_setup(struct cx23885_dev *dev)
if (dev->i2c_bus[0].i2c_rc == 0) { if (dev->i2c_bus[0].i2c_rc == 0) {
dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1; dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1;
tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom, sizeof(eeprom)); tveeprom_read(&dev->i2c_bus[0].i2c_client,
eeprom, sizeof(eeprom));
} }
switch (dev->board) { switch (dev->board) {
......
This diff is collapsed.
...@@ -53,11 +53,11 @@ static int dvb_buf_setup(struct videobuf_queue *q, ...@@ -53,11 +53,11 @@ static int dvb_buf_setup(struct videobuf_queue *q,
return 0; return 0;
} }
static int dvb_buf_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb, static int dvb_buf_prepare(struct videobuf_queue *q,
enum v4l2_field field) struct videobuf_buffer *vb, enum v4l2_field field)
{ {
struct cx23885_tsport *port = q->priv_data; struct cx23885_tsport *port = q->priv_data;
return cx23885_buf_prepare(q, port, (struct cx23885_buffer*)vb,field); return cx23885_buf_prepare(q, port, (struct cx23885_buffer*)vb, field);
} }
static void dvb_buf_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) static void dvb_buf_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
...@@ -66,7 +66,8 @@ static void dvb_buf_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) ...@@ -66,7 +66,8 @@ static void dvb_buf_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
cx23885_buf_queue(port, (struct cx23885_buffer*)vb); cx23885_buf_queue(port, (struct cx23885_buffer*)vb);
} }
static void dvb_buf_release(struct videobuf_queue *q, struct videobuf_buffer *vb) static void dvb_buf_release(struct videobuf_queue *q,
struct videobuf_buffer *vb)
{ {
cx23885_free_buffer(q, (struct cx23885_buffer*)vb); cx23885_free_buffer(q, (struct cx23885_buffer*)vb);
} }
...@@ -116,26 +117,22 @@ static int dvb_register(struct cx23885_tsport *port) ...@@ -116,26 +117,22 @@ static int dvb_register(struct cx23885_tsport *port)
switch (dev->board) { switch (dev->board) {
case CX23885_BOARD_HAUPPAUGE_HVR1800lp: case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
port->dvb.frontend = dvb_attach(s5h1409_attach, port->dvb.frontend = dvb_attach(s5h1409_attach,
&hauppauge_hvr1800lp_config, &hauppauge_hvr1800lp_config,
&dev->i2c_bus[0].i2c_adap); &dev->i2c_bus[0].i2c_adap);
if (port->dvb.frontend != NULL) { if (port->dvb.frontend != NULL) {
dvb_attach(mt2131_attach, dvb_attach(mt2131_attach, port->dvb.frontend,
port->dvb.frontend, &dev->i2c_bus[0].i2c_adap,
&dev->i2c_bus[0].i2c_adap, &hauppauge_hvr1800lp_rev2_tunerconfig, 0);
&hauppauge_hvr1800lp_rev2_tunerconfig,
0);
} }
break; break;
case CX23885_BOARD_HAUPPAUGE_HVR1800: case CX23885_BOARD_HAUPPAUGE_HVR1800:
port->dvb.frontend = dvb_attach(s5h1409_attach, port->dvb.frontend = dvb_attach(s5h1409_attach,
&hauppauge_hvr1800_config, &hauppauge_hvr1800_config,
&dev->i2c_bus[0].i2c_adap); &dev->i2c_bus[0].i2c_adap);
if (port->dvb.frontend != NULL) { if (port->dvb.frontend != NULL) {
dvb_attach(mt2131_attach, dvb_attach(mt2131_attach, port->dvb.frontend,
port->dvb.frontend, &dev->i2c_bus[0].i2c_adap,
&dev->i2c_bus[0].i2c_adap, &hauppauge_hvr1800_tunerconfig, 0);
&hauppauge_hvr1800_tunerconfig,
0);
} }
break; break;
default: default:
...@@ -152,7 +149,8 @@ static int dvb_register(struct cx23885_tsport *port) ...@@ -152,7 +149,8 @@ static int dvb_register(struct cx23885_tsport *port)
cx23885_call_i2c_clients (&dev->i2c_bus[0], TUNER_SET_STANDBY, NULL); cx23885_call_i2c_clients (&dev->i2c_bus[0], TUNER_SET_STANDBY, NULL);
/* register everything */ /* register everything */
return videobuf_dvb_register(&port->dvb, THIS_MODULE, port, &dev->pci->dev); return videobuf_dvb_register(&port->dvb, THIS_MODULE, port,
&dev->pci->dev);
} }
int cx23885_dvb_register(struct cx23885_tsport *port) int cx23885_dvb_register(struct cx23885_tsport *port)
...@@ -160,8 +158,8 @@ int cx23885_dvb_register(struct cx23885_tsport *port) ...@@ -160,8 +158,8 @@ int cx23885_dvb_register(struct cx23885_tsport *port)
struct cx23885_dev *dev = port->dev; struct cx23885_dev *dev = port->dev;
int err; int err;
dprintk( 1, "%s\n", __FUNCTION__); dprintk(1, "%s\n", __FUNCTION__);
dprintk( 1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n", dprintk(1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n",
dev->board, dev->board,
dev->name, dev->name,
dev->pci_bus, dev->pci_bus,
...@@ -173,15 +171,9 @@ int cx23885_dvb_register(struct cx23885_tsport *port) ...@@ -173,15 +171,9 @@ int cx23885_dvb_register(struct cx23885_tsport *port)
/* dvb stuff */ /* dvb stuff */
printk("%s: cx23885 based dvb card\n", dev->name); printk("%s: cx23885 based dvb card\n", dev->name);
videobuf_queue_init( videobuf_queue_init(&port->dvb.dvbq, &dvb_qops, dev->pci, &port->slock,
&port->dvb.dvbq, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_TOP,
&dvb_qops, sizeof(struct cx23885_buffer), port);
dev->pci,
&port->slock,
V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_TOP,
sizeof(struct cx23885_buffer),
port);
err = dvb_register(port); err = dvb_register(port);
if (err != 0) if (err != 0)
printk("%s() dvb_register failed err = %d\n", __FUNCTION__, err); printk("%s() dvb_register failed err = %d\n", __FUNCTION__, err);
...@@ -198,3 +190,10 @@ int cx23885_dvb_unregister(struct cx23885_tsport *port) ...@@ -198,3 +190,10 @@ int cx23885_dvb_unregister(struct cx23885_tsport *port)
return 0; return 0;
} }
/*
* Local variables:
* c-basic-offset: 8
* End:
* kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off
*/
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
static unsigned int i2c_debug = 2; static unsigned int i2c_debug = 2;
module_param(i2c_debug, int, 0644); module_param(i2c_debug, int, 0644);
MODULE_PARM_DESC(i2c_debug,"enable debug messages [i2c]"); MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]");
static unsigned int i2c_scan = 0; static unsigned int i2c_scan = 0;
module_param(i2c_scan, int, 0444); module_param(i2c_scan, int, 0444);
MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time");
#define dprintk(level,fmt, arg...) if (i2c_debug >= level) \ #define dprintk(level,fmt, arg...) if (i2c_debug >= level) \
printk(KERN_DEBUG "%s: " fmt, dev->name , ## arg) printk(KERN_DEBUG "%s: " fmt, dev->name , ## arg)
...@@ -76,7 +76,8 @@ static int i2c_wait_done(struct i2c_adapter *i2c_adap) ...@@ -76,7 +76,8 @@ static int i2c_wait_done(struct i2c_adapter *i2c_adap)
return 1; return 1;
} }
static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg, int last) static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
const struct i2c_msg *msg, int last)
{ {
struct cx23885_i2c *bus = i2c_adap->algo_data; struct cx23885_i2c *bus = i2c_adap->algo_data;
struct cx23885_dev *dev = bus->dev; struct cx23885_dev *dev = bus->dev;
...@@ -150,11 +151,12 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg ...@@ -150,11 +151,12 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg
eio: eio:
retval = -EIO; retval = -EIO;
err: err:
printk(" ERR: %d\n",retval); printk(" ERR: %d\n", retval);
return retval; return retval;
} }
static int i2c_readbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg, int last) static int i2c_readbytes(struct i2c_adapter *i2c_adap,
const struct i2c_msg *msg, int last)
{ {
struct cx23885_i2c *bus = i2c_adap->algo_data; struct cx23885_i2c *bus = i2c_adap->algo_data;
struct cx23885_dev *dev = bus->dev; struct cx23885_dev *dev = bus->dev;
...@@ -206,11 +208,12 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg ...@@ -206,11 +208,12 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg
eio: eio:
retval = -EIO; retval = -EIO;
err: err:
printk(" ERR: %d\n",retval); printk(" ERR: %d\n", retval);
return retval; return retval;
} }
static int i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) static int i2c_xfer(struct i2c_adapter *i2c_adap,
struct i2c_msg *msgs, int num)
{ {
struct cx23885_i2c *bus = i2c_adap->algo_data; struct cx23885_i2c *bus = i2c_adap->algo_data;
struct cx23885_dev *dev = bus->dev; struct cx23885_dev *dev = bus->dev;
...@@ -219,8 +222,8 @@ static int i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) ...@@ -219,8 +222,8 @@ static int i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
dprintk(1, "%s(num = %d)\n", __FUNCTION__, num); dprintk(1, "%s(num = %d)\n", __FUNCTION__, num);
for (i = 0 ; i < num; i++) { for (i = 0 ; i < num; i++) {
dprintk(1, "%s(num = %d) addr = 0x%02x len = 0x%x\n" dprintk(1, "%s(num = %d) addr = 0x%02x len = 0x%x\n",
, __FUNCTION__, num, msgs[i].addr, msgs[i].len); __FUNCTION__, num, msgs[i].addr, msgs[i].len);
if (msgs[i].flags & I2C_M_RD) { if (msgs[i].flags & I2C_M_RD) {
/* read */ /* read */
retval = i2c_readbytes(i2c_adap, &msgs[i], i+1 == num); retval = i2c_readbytes(i2c_adap, &msgs[i], i+1 == num);
...@@ -261,7 +264,8 @@ static int detach_inform(struct i2c_client *client) ...@@ -261,7 +264,8 @@ static int detach_inform(struct i2c_client *client)
return 0; return 0;
} }
void cx23885_call_i2c_clients(struct cx23885_i2c *bus, unsigned int cmd, void *arg) void cx23885_call_i2c_clients(struct cx23885_i2c *bus,
unsigned int cmd, void *arg)
{ {
// struct cx23885_dev *dev = bus->dev; // struct cx23885_dev *dev = bus->dev;
...@@ -316,11 +320,11 @@ static char *i2c_devs[128] = { ...@@ -316,11 +320,11 @@ static char *i2c_devs[128] = {
static void do_i2c_scan(char *name, struct i2c_client *c) static void do_i2c_scan(char *name, struct i2c_client *c)
{ {
unsigned char buf; unsigned char buf;
int i,rc; int i, rc;
for (i = 0; i < 128; i++) { for (i = 0; i < 128; i++) {
c->addr = i; c->addr = i;
rc = i2c_master_recv(c,&buf,0); rc = i2c_master_recv(c, &buf, 0);
if (rc < 0) if (rc < 0)
continue; continue;
printk("%s: i2c scan: found device @ 0x%x [%s]\n", printk("%s: i2c scan: found device @ 0x%x [%s]\n",
...@@ -335,13 +339,17 @@ int cx23885_i2c_register(struct cx23885_i2c *bus) ...@@ -335,13 +339,17 @@ int cx23885_i2c_register(struct cx23885_i2c *bus)
dprintk(1, "%s(bus = %d)\n", __FUNCTION__, bus->nr); dprintk(1, "%s(bus = %d)\n", __FUNCTION__, bus->nr);
memcpy(&bus->i2c_adap, &cx23885_i2c_adap_template, sizeof(bus->i2c_adap)); memcpy(&bus->i2c_adap, &cx23885_i2c_adap_template,
memcpy(&bus->i2c_algo, &cx23885_i2c_algo_template, sizeof(bus->i2c_algo)); sizeof(bus->i2c_adap));
memcpy(&bus->i2c_client, &cx23885_i2c_client_template, sizeof(bus->i2c_client)); memcpy(&bus->i2c_algo, &cx23885_i2c_algo_template,
sizeof(bus->i2c_algo));
memcpy(&bus->i2c_client, &cx23885_i2c_client_template,
sizeof(bus->i2c_client));
bus->i2c_adap.dev.parent = &dev->pci->dev; bus->i2c_adap.dev.parent = &dev->pci->dev;
strlcpy(bus->i2c_adap.name, bus->dev->name, sizeof(bus->i2c_adap.name)); strlcpy(bus->i2c_adap.name, bus->dev->name,
sizeof(bus->i2c_adap.name));
bus->i2c_algo.data = bus; bus->i2c_algo.data = bus;
bus->i2c_adap.algo_data = bus; bus->i2c_adap.algo_data = bus;
i2c_add_adapter(&bus->i2c_adap); i2c_add_adapter(&bus->i2c_adap);
......
...@@ -183,7 +183,7 @@ struct cx23885_dev { ...@@ -183,7 +183,7 @@ struct cx23885_dev {
//u32 shadow[SHADOW_MAX]; //u32 shadow[SHADOW_MAX];
int pci_irqmask; int pci_irqmask;
/* I2C adapters: Master 1 and 2 (External) and Master 3 (Internal only) */ /* I2C adapters: Master 1 & 2 (External) & Master 3 (Internal only) */
struct cx23885_i2c i2c_bus[3]; struct cx23885_i2c i2c_bus[3];
int nr; int nr;
...@@ -268,17 +268,22 @@ extern void cx23885_card_setup_pre_i2c(struct cx23885_dev *dev); ...@@ -268,17 +268,22 @@ extern void cx23885_card_setup_pre_i2c(struct cx23885_dev *dev);
extern int cx23885_dvb_register(struct cx23885_tsport *port); extern int cx23885_dvb_register(struct cx23885_tsport *port);
extern int cx23885_dvb_unregister(struct cx23885_tsport *port); extern int cx23885_dvb_unregister(struct cx23885_tsport *port);
extern int cx23885_buf_prepare(struct videobuf_queue *q, struct cx23885_tsport *port, extern int cx23885_buf_prepare(struct videobuf_queue *q,
struct cx23885_buffer *buf, enum v4l2_field field); struct cx23885_tsport *port,
struct cx23885_buffer *buf,
enum v4l2_field field);
extern void cx23885_buf_queue(struct cx23885_tsport *port, struct cx23885_buffer *buf); extern void cx23885_buf_queue(struct cx23885_tsport *port,
extern void cx23885_free_buffer(struct videobuf_queue *q, struct cx23885_buffer *buf); struct cx23885_buffer *buf);
extern void cx23885_free_buffer(struct videobuf_queue *q,
struct cx23885_buffer *buf);
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
/* cx23885-i2c.c */ /* cx23885-i2c.c */
extern int cx23885_i2c_register(struct cx23885_i2c *bus); extern int cx23885_i2c_register(struct cx23885_i2c *bus);
extern int cx23885_i2c_unregister(struct cx23885_i2c *bus); extern int cx23885_i2c_unregister(struct cx23885_i2c *bus);
extern void cx23885_call_i2c_clients(struct cx23885_i2c *bus, unsigned int cmd, void *arg); extern void cx23885_call_i2c_clients(struct cx23885_i2c *bus, unsigned int cmd,
void *arg);
/* /*
* Local variables: * Local variables:
......
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