From fa6672095926c3a9607f3e70bb40bb0d715a424f Mon Sep 17 00:00:00 2001 From: Sean Young Date: Mon, 13 Aug 2012 08:59:40 -0300 Subject: [PATCH] --- yaml --- r: 330797 b: refs/heads/master c: 0797b4802b57ce88e9361c8d64b0980508370649 h: refs/heads/master i: 330795: 52e4cbb3dda0632b176ffd55814105a91d0c2395 v: v3 --- [refs] | 2 +- trunk/drivers/media/rc/Kconfig | 8 ++++++-- trunk/drivers/media/rc/iguanair.c | 21 +++++++++++---------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index a4c664fd60e2..bb6eb2fcdb12 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e99a7cfe93fd9b853d80e7dda8b86ecca71c22bb +refs/heads/master: 0797b4802b57ce88e9361c8d64b0980508370649 diff --git a/trunk/drivers/media/rc/Kconfig b/trunk/drivers/media/rc/Kconfig index 5180390be7ab..2e91e664d024 100644 --- a/trunk/drivers/media/rc/Kconfig +++ b/trunk/drivers/media/rc/Kconfig @@ -264,8 +264,12 @@ config IR_IGUANA depends on RC_CORE select USB ---help--- - Say Y here if you want to use the IgaunaWorks USB IR Transceiver. - Both infrared receive and send are supported. + Say Y here if you want to use the IguanaWorks USB IR Transceiver. + 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 be called iguanair. diff --git a/trunk/drivers/media/rc/iguanair.c b/trunk/drivers/media/rc/iguanair.c index bdd526df0b74..58854004db88 100644 --- a/trunk/drivers/media/rc/iguanair.c +++ b/trunk/drivers/media/rc/iguanair.c @@ -36,8 +36,8 @@ struct iguanair { struct usb_device *udev; int pipe_out; + uint16_t version; uint8_t bufsize; - uint8_t version[2]; struct mutex lock; @@ -97,8 +97,8 @@ static void process_ir_data(struct iguanair *ir, unsigned len) switch (ir->buf_in[3]) { case CMD_GET_VERSION: if (len == 6) { - ir->version[0] = ir->buf_in[4]; - ir->version[1] = ir->buf_in[5]; + ir->version = (ir->buf_in[5] << 8) | + ir->buf_in[4]; complete(&ir->completion); } break; @@ -110,8 +110,7 @@ static void process_ir_data(struct iguanair *ir, unsigned len) break; case CMD_GET_FEATURES: 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); } break; @@ -219,6 +218,12 @@ static int iguanair_get_features(struct iguanair *ir) 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->cycle_overhead = 65; @@ -230,9 +235,6 @@ static int iguanair_get_features(struct iguanair *ir) goto out; } - if (ir->version[0] == 0 || ir->version[1] == 0) - goto out; - packet.cmd = CMD_GET_FEATURES; rc = iguanair_send(ir, &packet, sizeof(packet)); @@ -485,8 +487,7 @@ static int __devinit iguanair_probe(struct usb_interface *intf, goto out2; snprintf(ir->name, sizeof(ir->name), - "IguanaWorks USB IR Transceiver version %d.%d", - ir->version[0], ir->version[1]); + "IguanaWorks USB IR Transceiver version 0x%04x", ir->version); usb_make_path(ir->udev, ir->phys, sizeof(ir->phys));