aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/mceusb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/rc/mceusb.c')
-rw-r--r--drivers/media/rc/mceusb.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index d289fd42729f..a5c6c1c2af82 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -791,10 +791,6 @@ static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
791 int i, ret = 0; 791 int i, ret = 0;
792 int cmdcount = 0; 792 int cmdcount = 0;
793 unsigned char *cmdbuf; /* MCE command buffer */ 793 unsigned char *cmdbuf; /* MCE command buffer */
794 long signal_duration = 0; /* Singnal length in us */
795 struct timeval start_time, end_time;
796
797 do_gettimeofday(&start_time);
798 794
799 cmdbuf = kzalloc(sizeof(unsigned) * MCE_CMDBUF_SIZE, GFP_KERNEL); 795 cmdbuf = kzalloc(sizeof(unsigned) * MCE_CMDBUF_SIZE, GFP_KERNEL);
800 if (!cmdbuf) 796 if (!cmdbuf)
@@ -807,7 +803,6 @@ static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
807 803
808 /* Generate mce packet data */ 804 /* Generate mce packet data */
809 for (i = 0; (i < count) && (cmdcount < MCE_CMDBUF_SIZE); i++) { 805 for (i = 0; (i < count) && (cmdcount < MCE_CMDBUF_SIZE); i++) {
810 signal_duration += txbuf[i];
811 txbuf[i] = txbuf[i] / MCE_TIME_UNIT; 806 txbuf[i] = txbuf[i] / MCE_TIME_UNIT;
812 807
813 do { /* loop to support long pulses/spaces > 127*50us=6.35ms */ 808 do { /* loop to support long pulses/spaces > 127*50us=6.35ms */
@@ -850,19 +845,6 @@ static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
850 /* Transmit the command to the mce device */ 845 /* Transmit the command to the mce device */
851 mce_async_out(ir, cmdbuf, cmdcount); 846 mce_async_out(ir, cmdbuf, cmdcount);
852 847
853 /*
854 * The lircd gap calculation expects the write function to
855 * wait the time it takes for the ircommand to be sent before
856 * it returns.
857 */
858 do_gettimeofday(&end_time);
859 signal_duration -= (end_time.tv_usec - start_time.tv_usec) +
860 (end_time.tv_sec - start_time.tv_sec) * 1000000;
861
862 /* delay with the closest number of ticks */
863 set_current_state(TASK_INTERRUPTIBLE);
864 schedule_timeout(usecs_to_jiffies(signal_duration));
865
866out: 848out:
867 kfree(cmdbuf); 849 kfree(cmdbuf);
868 return ret ? ret : count; 850 return ret ? ret : count;