diff options
author | Cecil Hugh Watson <knoppmyth@gmail.com> | 2010-09-05 06:13:57 (GMT) |
---|---|---|
committer | Cecil Hugh Watson <knoppmyth@gmail.com> | 2010-09-05 06:13:57 (GMT) |
commit | b172f79fadb565ecfbcec9508f9377d8618a4f4c (patch) | |
tree | bf8823b07e3313c3afa000a9b31e4f9a735cb818 /abs/core/lirc | |
parent | f9d54ab7c3853208484e304bc6cf40ab0f79d400 (diff) | |
parent | 5e7027c6194237ca1dc5fcbb3648483a970fb500 (diff) | |
download | linhes_pkgbuild-b172f79fadb565ecfbcec9508f9377d8618a4f4c.zip linhes_pkgbuild-b172f79fadb565ecfbcec9508f9377d8618a4f4c.tar.gz linhes_pkgbuild-b172f79fadb565ecfbcec9508f9377d8618a4f4c.tar.bz2 |
Merge branch 'HEAD' of ssh://cesman@knoppmyth.net/mount/repository/LinHES-PKGBUILD
Diffstat (limited to 'abs/core/lirc')
-rw-r--r-- | abs/core/lirc/lirc_mod_mce.patch | 98 |
1 files changed, 94 insertions, 4 deletions
diff --git a/abs/core/lirc/lirc_mod_mce.patch b/abs/core/lirc/lirc_mod_mce.patch index 314f2d7..1dc6644 100644 --- a/abs/core/lirc/lirc_mod_mce.patch +++ b/abs/core/lirc/lirc_mod_mce.patch @@ -1,6 +1,6 @@ -diff -Naru lirc_mod_mce.orig/lirc_mod_mce.c lirc_mod_mce/lirc_mod_mce.c ---- lirc_mod_mce.orig/lirc_mod_mce.c 2008-04-18 02:12:28.000000000 +0930 -+++ lirc_mod_mce/lirc_mod_mce.c 2009-05-28 07:53:10.000000000 +0930 +diff -Naru lirc_mod_mce/lirc_mod_mce.c lirc_mod_mce_new/lirc_mod_mce.c +--- lirc_mod_mce/lirc_mod_mce.c 2008-04-18 02:12:28.000000000 +0930 ++++ lirc_mod_mce_new/lirc_mod_mce.c 2009-11-22 18:45:24.000000000 +1030 @@ -171,17 +171,76 @@ #define VENDOR_TATUNG 0x1460 #define VENDOR_GATEWAY 0x107b @@ -86,7 +86,97 @@ diff -Naru lirc_mod_mce.orig/lirc_mod_mce.c lirc_mod_mce/lirc_mod_mce.c }; static unsigned char usb_kbd_keycode[256] = { -@@ -1108,7 +1167,7 @@ +@@ -252,6 +311,8 @@ + struct semaphore lock; + char name[NAME_BUFSIZE]; + char phys[NAME_BUFSIZE]; ++ ++ unsigned int carrier_freq; + }; + + /* init strings */ +@@ -889,6 +950,51 @@ + } + } + ++/* Sets the send carrier frequency */ ++static int set_send_carrier(struct irctl *ir, int carrier) ++{ ++ int clk = 10000000; ++ int prescaler = 0, divisor = 0; ++ unsigned char cmdbuf[] = { 0x9F, 0x06, 0x01, 0x80 }; ++ ++ /* Carrier is changed */ ++ if (ir->carrier_freq != carrier) { ++ ++ if (carrier <= 0) { ++ ir->carrier_freq = carrier; ++ dprintk(DRIVER_NAME "[%d]: SET_CARRIER disabling " ++ "carrier modulation\n", ir->devnum); ++ request_packet_async(ir, ir->usb_ep_out, ++ cmdbuf, sizeof(cmdbuf), ++ PHILUSB_OUTBOUND); ++ return carrier; ++ } ++ ++ for (prescaler = 0; prescaler < 4; ++prescaler) { ++ divisor = (clk >> (2 * prescaler)) / carrier; ++ if (divisor <= 0xFF) { ++ ir->carrier_freq = carrier; ++ cmdbuf[2] = prescaler; ++ cmdbuf[3] = divisor; ++ dprintk(DRIVER_NAME "[%d]: SET_CARRIER " ++ "requesting %d Hz\n", ++ ir->devnum, carrier); ++ ++ /* Transmit new carrier to mce device */ ++ request_packet_async(ir, ir->usb_ep_out, ++ cmdbuf, sizeof(cmdbuf), ++ PHILUSB_OUTBOUND); ++ return carrier; ++ } ++ } ++ ++ return -EINVAL; ++ ++ } ++ ++ return carrier; ++} ++ + static int input_open(struct input_dev *id) + { + return 0; +@@ -945,6 +1051,18 @@ + if(lvalue!=(LIRC_MODE_PULSE&LIRC_CAN_SEND_MASK)) return -EINVAL; + break; + ++ case LIRC_SET_SEND_CARRIER: ++ /* Retrieve lirc_plugin data for the device */ ++ ir=lirc_get_pdata(filep); ++ if (!ir && !ir->usb_ep_out) return -EFAULT; ++ ++ result = get_user(ivalue, (unsigned int *) arg); ++ if (result) ++ return result; ++ ++ set_send_carrier(ir, ivalue); ++ break; ++ + default: + return -ENOIOCTLCMD; + } +@@ -1047,7 +1165,8 @@ + plugin->minor = -1; + plugin->features = LIRC_CAN_SEND_PULSE | + LIRC_CAN_SET_TRANSMITTER_MASK | +- LIRC_CAN_REC_MODE2; ++ LIRC_CAN_REC_MODE2 | ++ LIRC_CAN_SET_SEND_CARRIER; + plugin->data = ir; + plugin->rbuf = rbuf; + plugin->set_use_inc = &set_use_inc; +@@ -1108,7 +1227,7 @@ input_dev->name = ir->name; input_dev->phys = ir->phys; usb_to_input_id(dev, &input_dev->id); |