aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7127.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa7127.c')
-rw-r--r--drivers/media/video/saa7127.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c
index 3428e1ed0032..bca6ed0e2752 100644
--- a/drivers/media/video/saa7127.c
+++ b/drivers/media/video/saa7127.c
@@ -69,7 +69,8 @@ MODULE_PARM_DESC(test_image, "test_image (0-1)");
69#define saa7127_dbg(fmt, arg...) \ 69#define saa7127_dbg(fmt, arg...) \
70 do { \ 70 do { \
71 if (debug >= 1) \ 71 if (debug >= 1) \
72 printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ 72 printk(KERN_INFO "%s debug %d-%04x: " fmt, \
73 client->driver->driver.name, \
73 i2c_adapter_id(client->adapter), client->addr , ## arg); \ 74 i2c_adapter_id(client->adapter), client->addr , ## arg); \
74 } while (0) 75 } while (0)
75 76
@@ -77,15 +78,16 @@ MODULE_PARM_DESC(test_image, "test_image (0-1)");
77#define saa7127_dbg_highvol(fmt, arg...) \ 78#define saa7127_dbg_highvol(fmt, arg...) \
78 do { \ 79 do { \
79 if (debug == 2) \ 80 if (debug == 2) \
80 printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ 81 printk(KERN_INFO "%s debug %d-%04x: " fmt, \
82 client->driver->driver.name, \
81 i2c_adapter_id(client->adapter), client->addr , ## arg); \ 83 i2c_adapter_id(client->adapter), client->addr , ## arg); \
82 } while (0) 84 } while (0)
83 85
84#define saa7127_err(fmt, arg...) do { \ 86#define saa7127_err(fmt, arg...) do { \
85 printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \ 87 printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \
86 i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) 88 i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
87#define saa7127_info(fmt, arg...) do { \ 89#define saa7127_info(fmt, arg...) do { \
88 printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \ 90 printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \
89 i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) 91 i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
90 92
91static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END }; 93static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END };
@@ -389,7 +391,7 @@ static int saa7127_set_vps(struct i2c_client *client, struct v4l2_sliced_vbi_dat
389static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data *data) 391static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data *data)
390{ 392{
391 struct saa7127_state *state = i2c_get_clientdata(client); 393 struct saa7127_state *state = i2c_get_clientdata(client);
392 u16 cc = data->data[0] << 8 | data->data[1]; 394 u16 cc = data->data[1] << 8 | data->data[0];
393 int enable = (data->line != 0); 395 int enable = (data->line != 0);
394 396
395 if (enable && (data->field != 0 || data->line != 21)) 397 if (enable && (data->field != 0 || data->line != 21))
@@ -397,7 +399,7 @@ static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data
397 if (state->cc_enable != enable) { 399 if (state->cc_enable != enable) {
398 saa7127_dbg("Turn CC %s\n", enable ? "on" : "off"); 400 saa7127_dbg("Turn CC %s\n", enable ? "on" : "off");
399 saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, 401 saa7127_write(client, SAA7127_REG_CLOSED_CAPTION,
400 (enable << 6) | 0x11); 402 (state->xds_enable << 7) | (enable << 6) | 0x11);
401 state->cc_enable = enable; 403 state->cc_enable = enable;
402 } 404 }
403 if (!enable) 405 if (!enable)
@@ -423,7 +425,7 @@ static int saa7127_set_xds(struct i2c_client *client, struct v4l2_sliced_vbi_dat
423 if (state->xds_enable != enable) { 425 if (state->xds_enable != enable) {
424 saa7127_dbg("Turn XDS %s\n", enable ? "on" : "off"); 426 saa7127_dbg("Turn XDS %s\n", enable ? "on" : "off");
425 saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, 427 saa7127_write(client, SAA7127_REG_CLOSED_CAPTION,
426 (enable << 7) | 0x11); 428 (enable << 7) | (state->cc_enable << 6) | 0x11);
427 state->xds_enable = enable; 429 state->xds_enable = enable;
428 } 430 }
429 if (!enable) 431 if (!enable)
@@ -719,7 +721,6 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind)
719 client->addr = address; 721 client->addr = address;
720 client->adapter = adapter; 722 client->adapter = adapter;
721 client->driver = &i2c_driver_saa7127; 723 client->driver = &i2c_driver_saa7127;
722 client->flags = I2C_CLIENT_ALLOW_USE;
723 snprintf(client->name, sizeof(client->name) - 1, "saa7127"); 724 snprintf(client->name, sizeof(client->name) - 1, "saa7127");
724 725
725 saa7127_dbg("detecting saa7127 client on address 0x%x\n", address << 1); 726 saa7127_dbg("detecting saa7127 client on address 0x%x\n", address << 1);
@@ -819,13 +820,13 @@ static int saa7127_detach(struct i2c_client *client)
819/* ----------------------------------------------------------------------- */ 820/* ----------------------------------------------------------------------- */
820 821
821static struct i2c_driver i2c_driver_saa7127 = { 822static struct i2c_driver i2c_driver_saa7127 = {
822 .name = "saa7127", 823 .driver = {
824 .name = "saa7127",
825 },
823 .id = I2C_DRIVERID_SAA7127, 826 .id = I2C_DRIVERID_SAA7127,
824 .flags = I2C_DF_NOTIFY,
825 .attach_adapter = saa7127_probe, 827 .attach_adapter = saa7127_probe,
826 .detach_client = saa7127_detach, 828 .detach_client = saa7127_detach,
827 .command = saa7127_command, 829 .command = saa7127_command,
828 .owner = THIS_MODULE,
829}; 830};
830 831
831 832