diff options
author | Janne Grunau <j@jannau.net> | 2010-07-27 10:03:35 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-21 05:56:03 -0400 |
commit | 35b53664d5d0331c8ec2ef44e74eaf4d18f00c06 (patch) | |
tree | 1baad1375c8971f2ab9e817e16bb63ba3bb54bfa /drivers/media/video | |
parent | 74a558b1f441c03b025cd6c11e79a94e99368856 (diff) |
[media] hdpvr: add two known to work firmware versions
refine the firmware version test and print the version only once
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/hdpvr/hdpvr-core.c | 25 | ||||
-rw-r--r-- | drivers/media/video/hdpvr/hdpvr.h | 6 |
2 files changed, 18 insertions, 13 deletions
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c index baddbcfd276f..d75fe5582f26 100644 --- a/drivers/media/video/hdpvr/hdpvr-core.c +++ b/drivers/media/video/hdpvr/hdpvr-core.c | |||
@@ -156,19 +156,22 @@ static int device_authorization(struct hdpvr_device *dev) | |||
156 | v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n", | 156 | v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n", |
157 | dev->usbc_buf[1], &dev->usbc_buf[2]); | 157 | dev->usbc_buf[1], &dev->usbc_buf[2]); |
158 | 158 | ||
159 | if (dev->usbc_buf[1] == HDPVR_FIRMWARE_VERSION) { | 159 | switch (dev->usbc_buf[1]) { |
160 | case HDPVR_FIRMWARE_VERSION: | ||
160 | dev->flags &= ~HDPVR_FLAG_AC3_CAP; | 161 | dev->flags &= ~HDPVR_FLAG_AC3_CAP; |
161 | } else if (dev->usbc_buf[1] == HDPVR_FIRMWARE_VERSION_AC3) { | 162 | break; |
163 | case HDPVR_FIRMWARE_VERSION_AC3: | ||
164 | case HDPVR_FIRMWARE_VERSION_0X12: | ||
165 | case HDPVR_FIRMWARE_VERSION_0X15: | ||
162 | dev->flags |= HDPVR_FLAG_AC3_CAP; | 166 | dev->flags |= HDPVR_FLAG_AC3_CAP; |
163 | } else if (dev->usbc_buf[1] > HDPVR_FIRMWARE_VERSION_AC3) { | 167 | break; |
164 | v4l2_info(&dev->v4l2_dev, "untested firmware version 0x%x, " | 168 | default: |
165 | "the driver might not work\n", dev->usbc_buf[1]); | 169 | v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might" |
166 | dev->flags |= HDPVR_FLAG_AC3_CAP; | 170 | " not work.\n"); |
167 | } else { | 171 | if (dev->usbc_buf[1] >= HDPVR_FIRMWARE_VERSION_AC3) |
168 | v4l2_err(&dev->v4l2_dev, "unknown firmware version 0x%x\n", | 172 | dev->flags |= HDPVR_FLAG_AC3_CAP; |
169 | dev->usbc_buf[1]); | 173 | else |
170 | ret = -EINVAL; | 174 | dev->flags &= ~HDPVR_FLAG_AC3_CAP; |
171 | goto unlock; | ||
172 | } | 175 | } |
173 | 176 | ||
174 | response = dev->usbc_buf+38; | 177 | response = dev->usbc_buf+38; |
diff --git a/drivers/media/video/hdpvr/hdpvr.h b/drivers/media/video/hdpvr/hdpvr.h index b0f046df3cd8..3a4e4e116f54 100644 --- a/drivers/media/video/hdpvr/hdpvr.h +++ b/drivers/media/video/hdpvr/hdpvr.h | |||
@@ -36,8 +36,10 @@ | |||
36 | 36 | ||
37 | #define NUM_BUFFERS 64 | 37 | #define NUM_BUFFERS 64 |
38 | 38 | ||
39 | #define HDPVR_FIRMWARE_VERSION 0x8 | 39 | #define HDPVR_FIRMWARE_VERSION 0x08 |
40 | #define HDPVR_FIRMWARE_VERSION_AC3 0xd | 40 | #define HDPVR_FIRMWARE_VERSION_AC3 0x0d |
41 | #define HDPVR_FIRMWARE_VERSION_0X12 0x12 | ||
42 | #define HDPVR_FIRMWARE_VERSION_0X15 0x15 | ||
41 | 43 | ||
42 | /* #define HDPVR_DEBUG */ | 44 | /* #define HDPVR_DEBUG */ |
43 | 45 | ||