mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 12:43:55 +08:00
[media] iguanair: ignore unsupported firmware versions
Firmware versions lower than 0x0205 use a different interface which is not supported. Also report the firmware version in the standard format. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
e99a7cfe93
commit
0797b4802b
@ -264,8 +264,12 @@ config IR_IGUANA
|
|||||||
depends on RC_CORE
|
depends on RC_CORE
|
||||||
select USB
|
select USB
|
||||||
---help---
|
---help---
|
||||||
Say Y here if you want to use the IgaunaWorks USB IR Transceiver.
|
Say Y here if you want to use the IguanaWorks USB IR Transceiver.
|
||||||
Both infrared receive and send are supported.
|
Both infrared receive and send are supported. If you want to
|
||||||
|
change the ID or the pin config, use the user space driver from
|
||||||
|
IguanaWorks.
|
||||||
|
|
||||||
|
Only firmware 0x0205 and later is supported.
|
||||||
|
|
||||||
To compile this driver as a module, choose M here: the module will
|
To compile this driver as a module, choose M here: the module will
|
||||||
be called iguanair.
|
be called iguanair.
|
||||||
|
@ -36,8 +36,8 @@ struct iguanair {
|
|||||||
struct usb_device *udev;
|
struct usb_device *udev;
|
||||||
|
|
||||||
int pipe_out;
|
int pipe_out;
|
||||||
|
uint16_t version;
|
||||||
uint8_t bufsize;
|
uint8_t bufsize;
|
||||||
uint8_t version[2];
|
|
||||||
|
|
||||||
struct mutex lock;
|
struct mutex lock;
|
||||||
|
|
||||||
@ -97,8 +97,8 @@ static void process_ir_data(struct iguanair *ir, unsigned len)
|
|||||||
switch (ir->buf_in[3]) {
|
switch (ir->buf_in[3]) {
|
||||||
case CMD_GET_VERSION:
|
case CMD_GET_VERSION:
|
||||||
if (len == 6) {
|
if (len == 6) {
|
||||||
ir->version[0] = ir->buf_in[4];
|
ir->version = (ir->buf_in[5] << 8) |
|
||||||
ir->version[1] = ir->buf_in[5];
|
ir->buf_in[4];
|
||||||
complete(&ir->completion);
|
complete(&ir->completion);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -110,8 +110,7 @@ static void process_ir_data(struct iguanair *ir, unsigned len)
|
|||||||
break;
|
break;
|
||||||
case CMD_GET_FEATURES:
|
case CMD_GET_FEATURES:
|
||||||
if (len > 5) {
|
if (len > 5) {
|
||||||
if (ir->version[0] >= 4)
|
ir->cycle_overhead = ir->buf_in[5];
|
||||||
ir->cycle_overhead = ir->buf_in[5];
|
|
||||||
complete(&ir->completion);
|
complete(&ir->completion);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -219,6 +218,12 @@ static int iguanair_get_features(struct iguanair *ir)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ir->version < 0x205) {
|
||||||
|
dev_err(ir->dev, "firmware 0x%04x is too old\n", ir->version);
|
||||||
|
rc = -ENODEV;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
ir->bufsize = 150;
|
ir->bufsize = 150;
|
||||||
ir->cycle_overhead = 65;
|
ir->cycle_overhead = 65;
|
||||||
|
|
||||||
@ -230,9 +235,6 @@ static int iguanair_get_features(struct iguanair *ir)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ir->version[0] == 0 || ir->version[1] == 0)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
packet.cmd = CMD_GET_FEATURES;
|
packet.cmd = CMD_GET_FEATURES;
|
||||||
|
|
||||||
rc = iguanair_send(ir, &packet, sizeof(packet));
|
rc = iguanair_send(ir, &packet, sizeof(packet));
|
||||||
@ -485,8 +487,7 @@ static int __devinit iguanair_probe(struct usb_interface *intf,
|
|||||||
goto out2;
|
goto out2;
|
||||||
|
|
||||||
snprintf(ir->name, sizeof(ir->name),
|
snprintf(ir->name, sizeof(ir->name),
|
||||||
"IguanaWorks USB IR Transceiver version %d.%d",
|
"IguanaWorks USB IR Transceiver version 0x%04x", ir->version);
|
||||||
ir->version[0], ir->version[1]);
|
|
||||||
|
|
||||||
usb_make_path(ir->udev, ir->phys, sizeof(ir->phys));
|
usb_make_path(ir->udev, ir->phys, sizeof(ir->phys));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user