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

Commit 62d7a292 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (31 commits)
  Revert "[media] af9015: limit I2C access to keep FW happy"
  [media] s5p-fimc: Fix camera input configuration in subdev operations
  [media] m5mols: Fix logic in sanity check
  [media] ati_remote: switch to single-byte scancodes
  [media] V4L: mt9m111: fix uninitialised mutex
  [media] V4L: omap1_camera: fix missing <linux/module.h> include
  [media] V4L: mt9t112: use after free in mt9t112_probe()
  [media] V4L: soc-camera: fix compiler warnings on 64-bit platforms
  [media] s5p_mfc_enc: fix s/H264/H263/ typo
  [media] omap_vout: Fix compile error in 3.1
  [media] au0828: add missing models 72101, 72201 & 72261 to the model matrix
  [media] au0828: add missing USB ID 2040:7213
  [media] au0828: add missing USB ID 2040:7260
  [media] [trivial] omap24xxcam-dma: Fix logical test
  [media] omap_vout: fix crash if no driver for a display
  [media] media: video: s5p-tv: fix build break
  [media] omap3isp: fix compilation of ispvideo.c
  [media] m5mols: Fix set_fmt to return proper pixel format code
  [media] s5p-fimc: Use correct fourcc for RGB565 colour format
  [media] s5p-fimc: Fail driver probing when sensor configuration is wrong
  ...
parents 3d3c8f93 4b5d8da8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4281,7 +4281,9 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
S:	Maintained
F:	Documentation/dvb/
F:	Documentation/video4linux/
F:	Documentation/DocBook/media/
F:	drivers/media/
F:	drivers/staging/media/
F:	include/media/
F:	include/linux/dvb/
F:	include/linux/videodev*.h
+2 −1
Original line number Diff line number Diff line
@@ -488,9 +488,10 @@ static int mxl5007t_write_regs(struct mxl5007t_state *state,

static int mxl5007t_read_reg(struct mxl5007t_state *state, u8 reg, u8 *val)
{
	u8 buf[2] = { 0xfb, reg };
	struct i2c_msg msg[] = {
		{ .addr = state->i2c_props.addr, .flags = 0,
		  .buf = &reg, .len = 1 },
		  .buf = buf, .len = 2 },
		{ .addr = state->i2c_props.addr, .flags = I2C_M_RD,
		  .buf = val, .len = 1 },
	};
+1 −1
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ static int tda18218_set_params(struct dvb_frontend *fe,
	switch (params->u.ofdm.bandwidth) {
	case BANDWIDTH_6_MHZ:
		LP_Fc = 0;
		LO_Frac = params->frequency + 4000000;
		LO_Frac = params->frequency + 3000000;
		break;
	case BANDWIDTH_7_MHZ:
		LP_Fc = 1;
+51 −60
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ struct ati_remote {
	dma_addr_t inbuf_dma;
	dma_addr_t outbuf_dma;

	unsigned char old_data[2];  /* Detect duplicate events */
	unsigned char old_data;     /* Detect duplicate events */
	unsigned long old_jiffies;
	unsigned long acc_jiffies;  /* handle acceleration */
	unsigned long first_jiffies;
@@ -221,35 +221,35 @@ struct ati_remote {
/* Translation table from hardware messages to input events. */
static const struct {
	short kind;
	unsigned char data1, data2;
	unsigned char data;
	int type;
	unsigned int code;
	int value;
}  ati_remote_tbl[] = {
	/* Directional control pad axes */
	{KIND_ACCEL,   0x35, 0x70, EV_REL, REL_X, -1},	 /* left */
	{KIND_ACCEL,   0x36, 0x71, EV_REL, REL_X, 1},    /* right */
	{KIND_ACCEL,   0x37, 0x72, EV_REL, REL_Y, -1},	 /* up */
	{KIND_ACCEL,   0x38, 0x73, EV_REL, REL_Y, 1},    /* down */
	{KIND_ACCEL,   0x70, EV_REL, REL_X, -1},   /* left */
	{KIND_ACCEL,   0x71, EV_REL, REL_X, 1},    /* right */
	{KIND_ACCEL,   0x72, EV_REL, REL_Y, -1},   /* up */
	{KIND_ACCEL,   0x73, EV_REL, REL_Y, 1},    /* down */
	/* Directional control pad diagonals */
	{KIND_LU,      0x39, 0x74, EV_REL, 0, 0},        /* left up */
	{KIND_RU,      0x3a, 0x75, EV_REL, 0, 0},        /* right up */
	{KIND_LD,      0x3c, 0x77, EV_REL, 0, 0},        /* left down */
	{KIND_RD,      0x3b, 0x76, EV_REL, 0, 0},        /* right down */
	{KIND_LU,      0x74, EV_REL, 0, 0},        /* left up */
	{KIND_RU,      0x75, EV_REL, 0, 0},        /* right up */
	{KIND_LD,      0x77, EV_REL, 0, 0},        /* left down */
	{KIND_RD,      0x76, EV_REL, 0, 0},        /* right down */

	/* "Mouse button" buttons */
	{KIND_LITERAL, 0x3d, 0x78, EV_KEY, BTN_LEFT, 1}, /* left btn down */
	{KIND_LITERAL, 0x3e, 0x79, EV_KEY, BTN_LEFT, 0}, /* left btn up */
	{KIND_LITERAL, 0x41, 0x7c, EV_KEY, BTN_RIGHT, 1},/* right btn down */
	{KIND_LITERAL, 0x42, 0x7d, EV_KEY, BTN_RIGHT, 0},/* right btn up */
	{KIND_LITERAL, 0x78, EV_KEY, BTN_LEFT, 1}, /* left btn down */
	{KIND_LITERAL, 0x79, EV_KEY, BTN_LEFT, 0}, /* left btn up */
	{KIND_LITERAL, 0x7c, EV_KEY, BTN_RIGHT, 1},/* right btn down */
	{KIND_LITERAL, 0x7d, EV_KEY, BTN_RIGHT, 0},/* right btn up */

	/* Artificial "doubleclick" events are generated by the hardware.
	 * They are mapped to the "side" and "extra" mouse buttons here. */
	{KIND_FILTERED, 0x3f, 0x7a, EV_KEY, BTN_SIDE, 1}, /* left dblclick */
	{KIND_FILTERED, 0x43, 0x7e, EV_KEY, BTN_EXTRA, 1},/* right dblclick */
	{KIND_FILTERED, 0x7a, EV_KEY, BTN_SIDE, 1}, /* left dblclick */
	{KIND_FILTERED, 0x7e, EV_KEY, BTN_EXTRA, 1},/* right dblclick */

	/* Non-mouse events are handled by rc-core */
	{KIND_END, 0x00, 0x00, EV_MAX + 1, 0, 0}
	{KIND_END, 0x00, EV_MAX + 1, 0, 0}
};

/* Local function prototypes */
@@ -396,25 +396,6 @@ static int ati_remote_sendpacket(struct ati_remote *ati_remote, u16 cmd, unsigne
	return retval;
}

/*
 *	ati_remote_event_lookup
 */
static int ati_remote_event_lookup(int rem, unsigned char d1, unsigned char d2)
{
	int i;

	for (i = 0; ati_remote_tbl[i].kind != KIND_END; i++) {
		/*
		 * Decide if the table entry matches the remote input.
		 */
		if (ati_remote_tbl[i].data1 == d1 &&
		    ati_remote_tbl[i].data2 == d2)
			return i;

	}
	return -1;
}

/*
 *	ati_remote_compute_accel
 *
@@ -463,7 +444,15 @@ static void ati_remote_input_report(struct urb *urb)
	int index = -1;
	int acc;
	int remote_num;
	unsigned char scancode[2];
	unsigned char scancode;
	int i;

	/*
	 * data[0] = 0x14
	 * data[1] = data[2] + data[3] + 0xd5 (a checksum byte)
	 * data[2] = the key code (with toggle bit in MSB with some models)
	 * data[3] = channel << 4 (the low 4 bits must be zero)
	 */

	/* Deal with strange looking inputs */
	if ( (urb->actual_length != 4) || (data[0] != 0x14) ||
@@ -472,6 +461,13 @@ static void ati_remote_input_report(struct urb *urb)
		return;
	}

	if (data[1] != ((data[2] + data[3] + 0xd5) & 0xff)) {
		dbginfo(&ati_remote->interface->dev,
			"wrong checksum in input: %02x %02x %02x %02x\n",
			data[0], data[1], data[2], data[3]);
		return;
	}

	/* Mask unwanted remote channels.  */
	/* note: remote_num is 0-based, channel 1 on remote == 0 here */
	remote_num = (data[3] >> 4) & 0x0f;
@@ -482,31 +478,30 @@ static void ati_remote_input_report(struct urb *urb)
		return;
	}

	scancode[0] = (((data[1] - ((remote_num + 1) << 4)) & 0xf0) | (data[1] & 0x0f));

	/*
	 * Some devices (e.g. SnapStream Firefly) use 8080 as toggle code,
	 * so we have to clear them. The first bit is a bit tricky as the
	 * "non-toggled" state depends on remote_num, so we xor it with the
	 * second bit which is only used for toggle.
	 * MSB is a toggle code, though only used by some devices
	 * (e.g. SnapStream Firefly)
	 */
	scancode[0] ^= (data[2] & 0x80);
	scancode = data[2] & 0x7f;

	scancode[1] = data[2] & ~0x80;

	/* Look up event code index in mouse translation table. */
	index = ati_remote_event_lookup(remote_num, scancode[0], scancode[1]);
	/* Look up event code index in the mouse translation table. */
	for (i = 0; ati_remote_tbl[i].kind != KIND_END; i++) {
		if (scancode == ati_remote_tbl[i].data) {
			index = i;
			break;
		}
	}

	if (index >= 0) {
		dbginfo(&ati_remote->interface->dev,
			"channel 0x%02x; mouse data %02x,%02x; index %d; keycode %d\n",
			remote_num, data[1], data[2], index, ati_remote_tbl[index].code);
			"channel 0x%02x; mouse data %02x; index %d; keycode %d\n",
			remote_num, data[2], index, ati_remote_tbl[index].code);
		if (!dev)
			return; /* no mouse device */
	} else
		dbginfo(&ati_remote->interface->dev,
			"channel 0x%02x; key data %02x,%02x, scancode %02x,%02x\n",
			remote_num, data[1], data[2], scancode[0], scancode[1]);
			"channel 0x%02x; key data %02x, scancode %02x\n",
			remote_num, data[2], scancode);


	if (index >= 0 && ati_remote_tbl[index].kind == KIND_LITERAL) {
@@ -523,8 +518,7 @@ static void ati_remote_input_report(struct urb *urb)
		unsigned long now = jiffies;

		/* Filter duplicate events which happen "too close" together. */
		if (ati_remote->old_data[0] == data[1] &&
		    ati_remote->old_data[1] == data[2] &&
		if (ati_remote->old_data == data[2] &&
		    time_before(now, ati_remote->old_jiffies +
				     msecs_to_jiffies(repeat_filter))) {
			ati_remote->repeat_count++;
@@ -533,8 +527,7 @@ static void ati_remote_input_report(struct urb *urb)
			ati_remote->first_jiffies = now;
		}

		ati_remote->old_data[0] = data[1];
		ati_remote->old_data[1] = data[2];
		ati_remote->old_data = data[2];
		ati_remote->old_jiffies = now;

		/* Ensure we skip at least the 4 first duplicate events (generated
@@ -549,14 +542,13 @@ static void ati_remote_input_report(struct urb *urb)

		if (index < 0) {
			/* Not a mouse event, hand it to rc-core. */
			u32 rc_code = (scancode[0] << 8) | scancode[1];

			/*
			 * We don't use the rc-core repeat handling yet as
			 * it would cause ghost repeats which would be a
			 * regression for this driver.
			 */
			rc_keydown_notimeout(ati_remote->rdev, rc_code,
			rc_keydown_notimeout(ati_remote->rdev, scancode,
					     data[2]);
			rc_keyup(ati_remote->rdev);
			return;
@@ -607,8 +599,7 @@ static void ati_remote_input_report(struct urb *urb)
		input_sync(dev);

		ati_remote->old_jiffies = jiffies;
		ati_remote->old_data[0] = data[1];
		ati_remote->old_data[1] = data[2];
		ati_remote->old_data = data[2];
	}
}

+48 −48
Original line number Diff line number Diff line
@@ -27,55 +27,55 @@
#include <media/rc-map.h>

static struct rc_map_table ati_x10[] = {
	{ 0xd20d, KEY_1 },
	{ 0xd30e, KEY_2 },
	{ 0xd40f, KEY_3 },
	{ 0xd510, KEY_4 },
	{ 0xd611, KEY_5 },
	{ 0xd712, KEY_6 },
	{ 0xd813, KEY_7 },
	{ 0xd914, KEY_8 },
	{ 0xda15, KEY_9 },
	{ 0xdc17, KEY_0 },
	{ 0xc500, KEY_A },
	{ 0xc601, KEY_B },
	{ 0xde19, KEY_C },
	{ 0xe01b, KEY_D },
	{ 0xe621, KEY_E },
	{ 0xe823, KEY_F },
	{ 0x0d, KEY_1 },
	{ 0x0e, KEY_2 },
	{ 0x0f, KEY_3 },
	{ 0x10, KEY_4 },
	{ 0x11, KEY_5 },
	{ 0x12, KEY_6 },
	{ 0x13, KEY_7 },
	{ 0x14, KEY_8 },
	{ 0x15, KEY_9 },
	{ 0x17, KEY_0 },
	{ 0x00, KEY_A },
	{ 0x01, KEY_B },
	{ 0x19, KEY_C },
	{ 0x1b, KEY_D },
	{ 0x21, KEY_E },
	{ 0x23, KEY_F },

	{ 0xdd18, KEY_KPENTER },    /* "check" */
	{ 0xdb16, KEY_MENU },       /* "menu" */
	{ 0xc702, KEY_POWER },      /* Power */
	{ 0xc803, KEY_TV },         /* TV */
	{ 0xc904, KEY_DVD },        /* DVD */
	{ 0xca05, KEY_WWW },        /* WEB */
	{ 0xcb06, KEY_BOOKMARKS },  /* "book" */
	{ 0xcc07, KEY_EDIT },       /* "hand" */
	{ 0xe11c, KEY_COFFEE },     /* "timer" */
	{ 0xe520, KEY_FRONT },      /* "max" */
	{ 0xe21d, KEY_LEFT },       /* left */
	{ 0xe41f, KEY_RIGHT },      /* right */
	{ 0xe722, KEY_DOWN },       /* down */
	{ 0xdf1a, KEY_UP },         /* up */
	{ 0xe31e, KEY_OK },         /* "OK" */
	{ 0xce09, KEY_VOLUMEDOWN }, /* VOL + */
	{ 0xcd08, KEY_VOLUMEUP },   /* VOL - */
	{ 0xcf0a, KEY_MUTE },       /* MUTE  */
	{ 0xd00b, KEY_CHANNELUP },  /* CH + */
	{ 0xd10c, KEY_CHANNELDOWN },/* CH - */
	{ 0xec27, KEY_RECORD },     /* ( o) red */
	{ 0xea25, KEY_PLAY },       /* ( >) */
	{ 0xe924, KEY_REWIND },     /* (<<) */
	{ 0xeb26, KEY_FORWARD },    /* (>>) */
	{ 0xed28, KEY_STOP },       /* ([]) */
	{ 0xee29, KEY_PAUSE },      /* ('') */
	{ 0xf02b, KEY_PREVIOUS },   /* (<-) */
	{ 0xef2a, KEY_NEXT },       /* (>+) */
	{ 0xf22d, KEY_INFO },       /* PLAYING */
	{ 0xf32e, KEY_HOME },       /* TOP */
	{ 0xf42f, KEY_END },        /* END */
	{ 0xf530, KEY_SELECT },     /* SELECT */
	{ 0x18, KEY_KPENTER },    /* "check" */
	{ 0x16, KEY_MENU },       /* "menu" */
	{ 0x02, KEY_POWER },      /* Power */
	{ 0x03, KEY_TV },         /* TV */
	{ 0x04, KEY_DVD },        /* DVD */
	{ 0x05, KEY_WWW },        /* WEB */
	{ 0x06, KEY_BOOKMARKS },  /* "book" */
	{ 0x07, KEY_EDIT },       /* "hand" */
	{ 0x1c, KEY_COFFEE },     /* "timer" */
	{ 0x20, KEY_FRONT },      /* "max" */
	{ 0x1d, KEY_LEFT },       /* left */
	{ 0x1f, KEY_RIGHT },      /* right */
	{ 0x22, KEY_DOWN },       /* down */
	{ 0x1a, KEY_UP },         /* up */
	{ 0x1e, KEY_OK },         /* "OK" */
	{ 0x09, KEY_VOLUMEDOWN }, /* VOL + */
	{ 0x08, KEY_VOLUMEUP },   /* VOL - */
	{ 0x0a, KEY_MUTE },       /* MUTE  */
	{ 0x0b, KEY_CHANNELUP },  /* CH + */
	{ 0x0c, KEY_CHANNELDOWN },/* CH - */
	{ 0x27, KEY_RECORD },     /* ( o) red */
	{ 0x25, KEY_PLAY },       /* ( >) */
	{ 0x24, KEY_REWIND },     /* (<<) */
	{ 0x26, KEY_FORWARD },    /* (>>) */
	{ 0x28, KEY_STOP },       /* ([]) */
	{ 0x29, KEY_PAUSE },      /* ('') */
	{ 0x2b, KEY_PREVIOUS },   /* (<-) */
	{ 0x2a, KEY_NEXT },       /* (>+) */
	{ 0x2d, KEY_INFO },       /* PLAYING */
	{ 0x2e, KEY_HOME },       /* TOP */
	{ 0x2f, KEY_END },        /* END */
	{ 0x30, KEY_SELECT },     /* SELECT */
};

static struct rc_map_list ati_x10_map = {
Loading