Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164989
b: refs/heads/master
c: 5128a66
h: refs/heads/master
i:
  164987: 7c56071
v: v3
  • Loading branch information
Ondrej Zary authored and Greg Kroah-Hartman committed Sep 23, 2009
1 parent 0078625 commit a83ca99
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b4361f0848193ddc36dfb2c9a7391c56a9df2ad
refs/heads/master: 5128a66c6605d8178f69b7a8f2a70060933a26b4
24 changes: 23 additions & 1 deletion trunk/drivers/usb/serial/ark3116.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,20 @@ static int debug;

static struct usb_device_id id_table [] = {
{ USB_DEVICE(0x6547, 0x0232) },
{ USB_DEVICE(0x18ec, 0x3118) }, /* USB to IrDA adapter */
{ },
};
MODULE_DEVICE_TABLE(usb, id_table);

static int is_irda(struct usb_serial *serial)
{
struct usb_device *dev = serial->dev;
if (le16_to_cpu(dev->descriptor.idVendor) == 0x18ec &&
le16_to_cpu(dev->descriptor.idProduct) == 0x3118)
return 1;
return 0;
}

static inline void ARK3116_SND(struct usb_serial *serial, int seq,
__u8 request, __u8 requesttype,
__u16 value, __u16 index)
Expand Down Expand Up @@ -84,11 +94,21 @@ static int ark3116_attach(struct usb_serial *serial)
return -ENOMEM;
}

if (is_irda(serial))
dbg("IrDA mode");

/* 3 */
ARK3116_SND(serial, 3, 0xFE, 0x40, 0x0008, 0x0002);
ARK3116_SND(serial, 4, 0xFE, 0x40, 0x0008, 0x0001);
ARK3116_SND(serial, 5, 0xFE, 0x40, 0x0000, 0x0008);
ARK3116_SND(serial, 6, 0xFE, 0x40, 0x0000, 0x000B);
ARK3116_SND(serial, 6, 0xFE, 0x40, is_irda(serial) ? 0x0001 : 0x0000,
0x000B);

if (is_irda(serial)) {
ARK3116_SND(serial, 1001, 0xFE, 0x40, 0x0000, 0x000C);
ARK3116_SND(serial, 1002, 0xFE, 0x40, 0x0041, 0x000D);
ARK3116_SND(serial, 1003, 0xFE, 0x40, 0x0001, 0x000A);
}

/* <-- seq7 */
ARK3116_RCV(serial, 7, 0xFE, 0xC0, 0x0000, 0x0003, 0x00, buf);
Expand Down Expand Up @@ -125,6 +145,8 @@ static int ark3116_attach(struct usb_serial *serial)
ARK3116_SND(serial, 147, 0xFE, 0x40, 0x0083, 0x0003);
ARK3116_SND(serial, 148, 0xFE, 0x40, 0x0038, 0x0000);
ARK3116_SND(serial, 149, 0xFE, 0x40, 0x0001, 0x0001);
if (is_irda(serial))
ARK3116_SND(serial, 1004, 0xFE, 0x40, 0x0000, 0x0009);
ARK3116_SND(serial, 150, 0xFE, 0x40, 0x0003, 0x0003);
ARK3116_RCV(serial, 151, 0xFE, 0xC0, 0x0000, 0x0004, 0x03, buf);
ARK3116_SND(serial, 152, 0xFE, 0x40, 0x0000, 0x0003);
Expand Down

0 comments on commit a83ca99

Please sign in to comment.