diff options
author | Stefan Ringel <stefan.ringel@arcor.de> | 2010-04-02 12:52:49 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:57:32 -0400 |
commit | 2f7908848642c177b16b71a2ed52b57d614637ef (patch) | |
tree | 8f647ad66f480b9c4a238e492c37351c398469b0 | |
parent | f1434f4e90cec0bc57616c2f5f7de6985d7920d9 (diff) |
V4L/DVB: tm6000: request labeling board version check
request labeling board version check
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/staging/tm6000/tm6000-cards.c | 4 | ||||
-rw-r--r-- | drivers/staging/tm6000/tm6000-core.c | 18 | ||||
-rw-r--r-- | drivers/staging/tm6000/tm6000.h | 1 |
3 files changed, 19 insertions, 4 deletions
diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c index f5732f56e67b..fad0aef082b6 100644 --- a/drivers/staging/tm6000/tm6000-cards.c +++ b/drivers/staging/tm6000/tm6000-cards.c | |||
@@ -480,9 +480,9 @@ int tm6000_cards_setup(struct tm6000_core *dev) | |||
480 | } | 480 | } |
481 | 481 | ||
482 | if (!i) { | 482 | if (!i) { |
483 | rc = tm6000_get_reg16(dev, 0x40, 0, 0); | 483 | rc = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0); |
484 | if (rc >= 0) | 484 | if (rc >= 0) |
485 | printk(KERN_DEBUG "board=%d\n", rc); | 485 | printk(KERN_DEBUG "board=0x%08x\n", rc); |
486 | } | 486 | } |
487 | } | 487 | } |
488 | 488 | ||
diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c index d9cade00bc99..0b4dc6491ab3 100644 --- a/drivers/staging/tm6000/tm6000-core.c +++ b/drivers/staging/tm6000/tm6000-core.c | |||
@@ -139,6 +139,20 @@ int tm6000_get_reg16 (struct tm6000_core *dev, u8 req, u16 value, u16 index) | |||
139 | return buf[1]|buf[0]<<8; | 139 | return buf[1]|buf[0]<<8; |
140 | } | 140 | } |
141 | 141 | ||
142 | int tm6000_get_reg32 (struct tm6000_core *dev, u8 req, u16 value, u16 index) | ||
143 | { | ||
144 | int rc; | ||
145 | u8 buf[4]; | ||
146 | |||
147 | rc=tm6000_read_write_usb (dev, USB_DIR_IN | USB_TYPE_VENDOR, req, | ||
148 | value, index, buf, 4); | ||
149 | |||
150 | if (rc<0) | ||
151 | return rc; | ||
152 | |||
153 | return buf[3] | buf[2] << 8 | buf[1] << 16 | buf[0] << 24; | ||
154 | } | ||
155 | |||
142 | void tm6000_set_fourcc_format(struct tm6000_core *dev) | 156 | void tm6000_set_fourcc_format(struct tm6000_core *dev) |
143 | { | 157 | { |
144 | if (dev->dev_type == TM6010) { | 158 | if (dev->dev_type == TM6010) { |
@@ -455,9 +469,9 @@ int tm6000_init (struct tm6000_core *dev) | |||
455 | msleep(5); /* Just to be conservative */ | 469 | msleep(5); /* Just to be conservative */ |
456 | 470 | ||
457 | /* Check board version - maybe 10Moons specific */ | 471 | /* Check board version - maybe 10Moons specific */ |
458 | board=tm6000_get_reg16 (dev, 0x40, 0, 0); | 472 | board=tm6000_get_reg32 (dev, REQ_40_GET_VERSION, 0, 0); |
459 | if (board >=0) { | 473 | if (board >=0) { |
460 | printk (KERN_INFO "Board version = 0x%04x\n",board); | 474 | printk (KERN_INFO "Board version = 0x%08x\n",board); |
461 | } else { | 475 | } else { |
462 | printk (KERN_ERR "Error %i while retrieving board version\n",board); | 476 | printk (KERN_ERR "Error %i while retrieving board version\n",board); |
463 | } | 477 | } |
diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h index 7fcc7478c69b..3d1cf46b53bb 100644 --- a/drivers/staging/tm6000/tm6000.h +++ b/drivers/staging/tm6000/tm6000.h | |||
@@ -225,6 +225,7 @@ int tm6000_read_write_usb (struct tm6000_core *dev, u8 reqtype, u8 req, | |||
225 | u16 value, u16 index, u8 *buf, u16 len); | 225 | u16 value, u16 index, u8 *buf, u16 len); |
226 | int tm6000_get_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index); | 226 | int tm6000_get_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index); |
227 | int tm6000_get_reg16(struct tm6000_core *dev, u8 req, u16 value, u16 index); | 227 | int tm6000_get_reg16(struct tm6000_core *dev, u8 req, u16 value, u16 index); |
228 | int tm6000_get_reg32(struct tm6000_core *dev, u8 req, u16 value, u16 index); | ||
228 | int tm6000_set_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index); | 229 | int tm6000_set_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index); |
229 | int tm6000_init (struct tm6000_core *dev); | 230 | int tm6000_init (struct tm6000_core *dev); |
230 | 231 | ||