Commit 2f790884 authored by Stefan Ringel's avatar Stefan Ringel Committed by Mauro Carvalho Chehab

V4L/DVB: tm6000: request labeling board version check

request labeling board version check
Signed-off-by: default avatarStefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f1434f4e
...@@ -480,9 +480,9 @@ int tm6000_cards_setup(struct tm6000_core *dev) ...@@ -480,9 +480,9 @@ int tm6000_cards_setup(struct tm6000_core *dev)
} }
if (!i) { if (!i) {
rc = tm6000_get_reg16(dev, 0x40, 0, 0); rc = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0);
if (rc >= 0) if (rc >= 0)
printk(KERN_DEBUG "board=%d\n", rc); printk(KERN_DEBUG "board=0x%08x\n", rc);
} }
} }
......
...@@ -139,6 +139,20 @@ int tm6000_get_reg16 (struct tm6000_core *dev, u8 req, u16 value, u16 index) ...@@ -139,6 +139,20 @@ int tm6000_get_reg16 (struct tm6000_core *dev, u8 req, u16 value, u16 index)
return buf[1]|buf[0]<<8; return buf[1]|buf[0]<<8;
} }
int tm6000_get_reg32 (struct tm6000_core *dev, u8 req, u16 value, u16 index)
{
int rc;
u8 buf[4];
rc=tm6000_read_write_usb (dev, USB_DIR_IN | USB_TYPE_VENDOR, req,
value, index, buf, 4);
if (rc<0)
return rc;
return buf[3] | buf[2] << 8 | buf[1] << 16 | buf[0] << 24;
}
void tm6000_set_fourcc_format(struct tm6000_core *dev) void tm6000_set_fourcc_format(struct tm6000_core *dev)
{ {
if (dev->dev_type == TM6010) { if (dev->dev_type == TM6010) {
...@@ -455,9 +469,9 @@ int tm6000_init (struct tm6000_core *dev) ...@@ -455,9 +469,9 @@ int tm6000_init (struct tm6000_core *dev)
msleep(5); /* Just to be conservative */ msleep(5); /* Just to be conservative */
/* Check board version - maybe 10Moons specific */ /* Check board version - maybe 10Moons specific */
board=tm6000_get_reg16 (dev, 0x40, 0, 0); board=tm6000_get_reg32 (dev, REQ_40_GET_VERSION, 0, 0);
if (board >=0) { if (board >=0) {
printk (KERN_INFO "Board version = 0x%04x\n",board); printk (KERN_INFO "Board version = 0x%08x\n",board);
} else { } else {
printk (KERN_ERR "Error %i while retrieving board version\n",board); printk (KERN_ERR "Error %i while retrieving board version\n",board);
} }
......
...@@ -225,6 +225,7 @@ int tm6000_read_write_usb (struct tm6000_core *dev, u8 reqtype, u8 req, ...@@ -225,6 +225,7 @@ int tm6000_read_write_usb (struct tm6000_core *dev, u8 reqtype, u8 req,
u16 value, u16 index, u8 *buf, u16 len); u16 value, u16 index, u8 *buf, u16 len);
int tm6000_get_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index); int tm6000_get_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index);
int tm6000_get_reg16(struct tm6000_core *dev, u8 req, u16 value, u16 index); int tm6000_get_reg16(struct tm6000_core *dev, u8 req, u16 value, u16 index);
int tm6000_get_reg32(struct tm6000_core *dev, u8 req, u16 value, u16 index);
int tm6000_set_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index); int tm6000_set_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index);
int tm6000_init (struct tm6000_core *dev); int tm6000_init (struct tm6000_core *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