Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2f1756d authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  [media] fix saa7111 non-detection
  [media] rc/streamzap: fix reporting response times
  [media] mceusb: really fix remaining keybounce issues
  [media] rc: use time unit conversion macros correctly
  [media] rc/ir-lirc-codec: add back debug spew
  [media] ir-kbd-i2c: improve remote behavior with z8 behind usb
  [media] lirc_zilog: z8 on usb doesn't like back-to-back i2c_master_send
  [media] hdpvr: fix up i2c device registration
  [media] rc/mce: add mappings for missing keys
  [media] gspca - zc3xx: Discard the partial frames
  [media] gspca - zc3xx: Fix bad images with the sensor hv7131r
  [media] gspca - zc3xx: Bad delay when given by a table
parents b8ef289d bed3c1de
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
/* ir-lirc-codec.c - ir-core to classic lirc interface bridge
/* ir-lirc-codec.c - rc-core to classic lirc interface bridge
 *
 * Copyright (C) 2010 by Jarod Wilson <jarod@redhat.com>
 *
@@ -47,6 +47,7 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev)
	/* Carrier reports */
	if (ev.carrier_report) {
		sample = LIRC_FREQUENCY(ev.carrier);
		IR_dprintk(2, "carrier report (freq: %d)\n", sample);

	/* Packet end */
	} else if (ev.timeout) {
@@ -62,6 +63,7 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev)
			return 0;

		sample = LIRC_TIMEOUT(ev.duration / 1000);
		IR_dprintk(2, "timeout report (duration: %d)\n", sample);

	/* Normal sample */
	} else {
@@ -85,6 +87,8 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev)

		sample = ev.pulse ? LIRC_PULSE(ev.duration / 1000) :
					LIRC_SPACE(ev.duration / 1000);
		IR_dprintk(2, "delivering %uus %s to lirc_dev\n",
			   TO_US(ev.duration), TO_STR(ev.pulse));
	}

	lirc_buffer_write(dev->raw->lirc.drv->rbuf,
+6 −0
Original line number Diff line number Diff line
@@ -3,6 +3,9 @@
 *
 * Copyright (c) 2010 by Jarod Wilson <jarod@redhat.com>
 *
 * See http://mediacenterguides.com/book/export/html/31 for details on
 * key mappings.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
@@ -60,6 +63,9 @@ static struct rc_map_table rc6_mce[] = {
	{ 0x800f0426, KEY_EPG },		/* Guide */
	{ 0x800f0427, KEY_ZOOM },		/* Aspect */

	{ 0x800f0432, KEY_MODE },		/* Visualization */
	{ 0x800f0433, KEY_PRESENTATION },	/* Slide Show */
	{ 0x800f0434, KEY_EJECTCD },
	{ 0x800f043a, KEY_BRIGHTNESSUP },

	{ 0x800f0446, KEY_TV },
+6 −3
Original line number Diff line number Diff line
@@ -816,7 +816,7 @@ static void mceusb_handle_command(struct mceusb_dev *ir, int index)
	switch (ir->buf_in[index]) {
	/* 2-byte return value commands */
	case MCE_CMD_S_TIMEOUT:
		ir->rc->timeout = MS_TO_NS((hi << 8 | lo) / 2);
		ir->rc->timeout = US_TO_NS((hi << 8 | lo) / 2);
		break;

	/* 1-byte return value commands */
@@ -855,9 +855,10 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
			break;
		case PARSE_IRDATA:
			ir->rem--;
			init_ir_raw_event(&rawir);
			rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0);
			rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK)
					 * MS_TO_US(MCE_TIME_UNIT);
					 * US_TO_NS(MCE_TIME_UNIT);

			dev_dbg(ir->dev, "Storing %s with duration %d\n",
				rawir.pulse ? "pulse" : "space",
@@ -883,6 +884,8 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
					     i, ir->rem + 1, false);
			if (ir->rem)
				ir->parser_state = PARSE_IRDATA;
			else
				ir_raw_event_reset(ir->rc);
			break;
		}

@@ -1060,7 +1063,7 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir)
	rc->priv = ir;
	rc->driver_type = RC_DRIVER_IR_RAW;
	rc->allowed_protos = RC_TYPE_ALL;
	rc->timeout = MS_TO_NS(1000);
	rc->timeout = US_TO_NS(1000);
	if (!ir->flags.no_tx) {
		rc->s_tx_mask = mceusb_set_tx_mask;
		rc->s_tx_carrier = mceusb_set_tx_carrier;
+3 −3
Original line number Diff line number Diff line
@@ -460,7 +460,7 @@ static u32 nvt_rx_carrier_detect(struct nvt_dev *nvt)
		return 0;
	}

	carrier = (count * 1000000) / duration;
	carrier = MS_TO_NS(count) / duration;

	if ((carrier > MAX_CARRIER) || (carrier < MIN_CARRIER))
		nvt_dbg("WTF? Carrier frequency out of range!");
@@ -612,8 +612,8 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt)
		sample = nvt->buf[i];

		rawir.pulse = ((sample & BUF_PULSE_BIT) != 0);
		rawir.duration = (sample & BUF_LEN_MASK)
					* SAMPLE_PERIOD * 1000;
		rawir.duration = US_TO_NS((sample & BUF_LEN_MASK)
					  * SAMPLE_PERIOD);

		if ((sample & BUF_LEN_MASK) == BUF_LEN_MASK) {
			if (nvt->rawir.pulse == rawir.pulse)
+8 −6
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ static void sz_push_full_pulse(struct streamzap_ir *sz,
				sz->signal_start.tv_usec -
				sz->signal_last.tv_usec);
			rawir.duration -= sz->sum;
			rawir.duration *= 1000;
			rawir.duration = US_TO_NS(rawir.duration);
			rawir.duration &= IR_MAX_DURATION;
		}
		sz_push(sz, rawir);
@@ -177,7 +177,7 @@ static void sz_push_full_pulse(struct streamzap_ir *sz,
	rawir.duration = ((int) value) * SZ_RESOLUTION;
	rawir.duration += SZ_RESOLUTION / 2;
	sz->sum += rawir.duration;
	rawir.duration *= 1000;
	rawir.duration = US_TO_NS(rawir.duration);
	rawir.duration &= IR_MAX_DURATION;
	sz_push(sz, rawir);
}
@@ -197,7 +197,7 @@ static void sz_push_full_space(struct streamzap_ir *sz,
	rawir.duration = ((int) value) * SZ_RESOLUTION;
	rawir.duration += SZ_RESOLUTION / 2;
	sz->sum += rawir.duration;
	rawir.duration *= 1000;
	rawir.duration = US_TO_NS(rawir.duration);
	sz_push(sz, rawir);
}

@@ -273,6 +273,7 @@ static void streamzap_callback(struct urb *urb)
				if (sz->timeout_enabled)
					sz_push(sz, rawir);
				ir_raw_event_handle(sz->rdev);
				ir_raw_event_reset(sz->rdev);
			} else {
				sz_push_full_space(sz, sz->buf_in[i]);
			}
@@ -290,6 +291,7 @@ static void streamzap_callback(struct urb *urb)
		}
	}

	ir_raw_event_handle(sz->rdev);
	usb_submit_urb(urb, GFP_ATOMIC);

	return;
@@ -430,13 +432,13 @@ static int __devinit streamzap_probe(struct usb_interface *intf,
	sz->decoder_state = PulseSpace;
	/* FIXME: don't yet have a way to set this */
	sz->timeout_enabled = true;
	sz->rdev->timeout = (((SZ_TIMEOUT * SZ_RESOLUTION * 1000) &
	sz->rdev->timeout = ((US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION) &
				IR_MAX_DURATION) | 0x03000000);
	#if 0
	/* not yet supported, depends on patches from maxim */
	/* see also: LIRC_GET_REC_RESOLUTION and LIRC_SET_REC_TIMEOUT */
	sz->min_timeout = SZ_TIMEOUT * SZ_RESOLUTION * 1000;
	sz->max_timeout = SZ_TIMEOUT * SZ_RESOLUTION * 1000;
	sz->min_timeout = US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION);
	sz->max_timeout = US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION);
	#endif

	do_gettimeofday(&sz->signal_start);
Loading