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

Commit 50078a90 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab
Browse files

media: rc: replace IR_dprintk() with dev_dbg in IR decoders



Use dev_dbg() rather than custom debug function.

Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 069edf8a
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev)
	if (!geq_margin(ev.duration, JVC_UNIT, JVC_UNIT / 2))
		goto out;

	IR_dprintk(2, "JVC decode started at state %d (%uus %s)\n",
	dev_dbg(&dev->dev, "JVC decode started at state %d (%uus %s)\n",
		data->state, TO_US(ev.duration), TO_STR(ev.pulse));

again:
@@ -136,15 +136,15 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev)
			u32 scancode;
			scancode = (bitrev8((data->bits >> 8) & 0xff) << 8) |
				   (bitrev8((data->bits >> 0) & 0xff) << 0);
			IR_dprintk(1, "JVC scancode 0x%04x\n", scancode);
			dev_dbg(&dev->dev, "JVC scancode 0x%04x\n", scancode);
			rc_keydown(dev, RC_PROTO_JVC, scancode, data->toggle);
			data->first = false;
			data->old_bits = data->bits;
		} else if (data->bits == data->old_bits) {
			IR_dprintk(1, "JVC repeat\n");
			dev_dbg(&dev->dev, "JVC repeat\n");
			rc_repeat(dev);
		} else {
			IR_dprintk(1, "JVC invalid repeat msg\n");
			dev_dbg(&dev->dev, "JVC invalid repeat msg\n");
			break;
		}

@@ -164,7 +164,7 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev)
	}

out:
	IR_dprintk(1, "JVC decode failed at state %d (%uus %s)\n",
	dev_dbg(&dev->dev, "JVC decode failed at state %d (%uus %s)\n",
		data->state, TO_US(ev.duration), TO_STR(ev.pulse));
	data->state = STATE_INACTIVE;
	return -EINVAL;
+31 −29
Original line number Diff line number Diff line
@@ -117,19 +117,19 @@ static unsigned char kbd_keycodes[256] = {

static void mce_kbd_rx_timeout(struct timer_list *t)
{
	struct mce_kbd_dec *mce_kbd = from_timer(mce_kbd, t, rx_timeout);
	int i;
	struct ir_raw_event_ctrl *raw = from_timer(raw, t, mce_kbd.rx_timeout);
	unsigned char maskcode;
	int i;

	IR_dprintk(2, "timer callback clearing all keys\n");
	dev_dbg(&raw->dev->dev, "timer callback clearing all keys\n");

	for (i = 0; i < 7; i++) {
		maskcode = kbd_keycodes[MCIR2_MASK_KEYS_START + i];
		input_report_key(mce_kbd->idev, maskcode, 0);
		input_report_key(raw->mce_kbd.idev, maskcode, 0);
	}

	for (i = 0; i < MCIR2_MASK_KEYS_START; i++)
		input_report_key(mce_kbd->idev, kbd_keycodes[i], 0);
		input_report_key(raw->mce_kbd.idev, kbd_keycodes[i], 0);
}

static enum mce_kbd_mode mce_kbd_mode(struct mce_kbd_dec *data)
@@ -144,15 +144,15 @@ static enum mce_kbd_mode mce_kbd_mode(struct mce_kbd_dec *data)
	}
}

static void ir_mce_kbd_process_keyboard_data(struct input_dev *idev,
					     u32 scancode)
static void ir_mce_kbd_process_keyboard_data(struct rc_dev *dev, u32 scancode)
{
	struct mce_kbd_dec *data = &dev->raw->mce_kbd;
	u8 keydata   = (scancode >> 8) & 0xff;
	u8 shiftmask = scancode & 0xff;
	unsigned char keycode, maskcode;
	int i, keystate;

	IR_dprintk(1, "keyboard: keydata = 0x%02x, shiftmask = 0x%02x\n",
	dev_dbg(&dev->dev, "keyboard: keydata = 0x%02x, shiftmask = 0x%02x\n",
		keydata, shiftmask);

	for (i = 0; i < 7; i++) {
@@ -161,20 +161,21 @@ static void ir_mce_kbd_process_keyboard_data(struct input_dev *idev,
			keystate = 1;
		else
			keystate = 0;
		input_report_key(idev, maskcode, keystate);
		input_report_key(data->idev, maskcode, keystate);
	}

	if (keydata) {
		keycode = kbd_keycodes[keydata];
		input_report_key(idev, keycode, 1);
		input_report_key(data->idev, keycode, 1);
	} else {
		for (i = 0; i < MCIR2_MASK_KEYS_START; i++)
			input_report_key(idev, kbd_keycodes[i], 0);
			input_report_key(data->idev, kbd_keycodes[i], 0);
	}
}

static void ir_mce_kbd_process_mouse_data(struct input_dev *idev, u32 scancode)
static void ir_mce_kbd_process_mouse_data(struct rc_dev *dev, u32 scancode)
{
	struct mce_kbd_dec *data = &dev->raw->mce_kbd;
	/* raw mouse coordinates */
	u8 xdata = (scancode >> 7) & 0x7f;
	u8 ydata = (scancode >> 14) & 0x7f;
@@ -193,14 +194,14 @@ static void ir_mce_kbd_process_mouse_data(struct input_dev *idev, u32 scancode)
	else
		y = ydata;

	IR_dprintk(1, "mouse: x = %d, y = %d, btns = %s%s\n",
	dev_dbg(&dev->dev, "mouse: x = %d, y = %d, btns = %s%s\n",
		x, y, left ? "L" : "", right ? "R" : "");

	input_report_rel(idev, REL_X, x);
	input_report_rel(idev, REL_Y, y);
	input_report_rel(data->idev, REL_X, x);
	input_report_rel(data->idev, REL_Y, y);

	input_report_key(idev, BTN_LEFT, left);
	input_report_key(idev, BTN_RIGHT, right);
	input_report_key(data->idev, BTN_LEFT, left);
	input_report_key(data->idev, BTN_RIGHT, right);
}

/**
@@ -227,7 +228,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev)
		goto out;

again:
	IR_dprintk(2, "started at state %i (%uus %s)\n",
	dev_dbg(&dev->dev, "started at state %i (%uus %s)\n",
		data->state, TO_US(ev.duration), TO_STR(ev.pulse));

	if (!geq_margin(ev.duration, MCIR2_UNIT, MCIR2_UNIT / 2))
@@ -280,7 +281,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev)
			data->wanted_bits = MCIR2_MOUSE_NBITS;
			break;
		default:
			IR_dprintk(1, "not keyboard or mouse data\n");
			dev_dbg(&dev->dev, "not keyboard or mouse data\n");
			goto out;
		}

@@ -319,25 +320,26 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev)
		switch (data->wanted_bits) {
		case MCIR2_KEYBOARD_NBITS:
			scancode = data->body & 0xffff;
			IR_dprintk(1, "keyboard data 0x%08x\n", data->body);
			dev_dbg(&dev->dev, "keyboard data 0x%08x\n",
				data->body);
			if (dev->timeout)
				delay = usecs_to_jiffies(dev->timeout / 1000);
			else
				delay = msecs_to_jiffies(100);
			mod_timer(&data->rx_timeout, jiffies + delay);
			/* Pass data to keyboard buffer parser */
			ir_mce_kbd_process_keyboard_data(data->idev, scancode);
			ir_mce_kbd_process_keyboard_data(dev, scancode);
			lsc.rc_proto = RC_PROTO_MCIR2_KBD;
			break;
		case MCIR2_MOUSE_NBITS:
			scancode = data->body & 0x1fffff;
			IR_dprintk(1, "mouse data 0x%06x\n", scancode);
			dev_dbg(&dev->dev, "mouse data 0x%06x\n", scancode);
			/* Pass data to mouse buffer parser */
			ir_mce_kbd_process_mouse_data(data->idev, scancode);
			ir_mce_kbd_process_mouse_data(dev, scancode);
			lsc.rc_proto = RC_PROTO_MCIR2_MSE;
			break;
		default:
			IR_dprintk(1, "not keyboard or mouse data\n");
			dev_dbg(&dev->dev, "not keyboard or mouse data\n");
			goto out;
		}

@@ -350,7 +352,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev)
	}

out:
	IR_dprintk(1, "failed at state %i (%uus %s)\n",
	dev_dbg(&dev->dev, "failed at state %i (%uus %s)\n",
		data->state, TO_US(ev.duration), TO_STR(ev.pulse));
	data->state = STATE_INACTIVE;
	input_sync(data->idev);
+9 −11
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
		return 0;
	}

	IR_dprintk(2, "NEC decode started at state %d (%uus %s)\n",
	dev_dbg(&dev->dev, "NEC decode started at state %d (%uus %s)\n",
		data->state, TO_US(ev.duration), TO_STR(ev.pulse));

	switch (data->state) {
@@ -99,13 +99,11 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
			break;

		if (data->necx_repeat && data->count == NECX_REPEAT_BITS &&
			geq_margin(ev.duration,
			NEC_TRAILER_SPACE, NEC_UNIT / 2)) {
				IR_dprintk(1, "Repeat last key\n");
		    geq_margin(ev.duration, NEC_TRAILER_SPACE, NEC_UNIT / 2)) {
			dev_dbg(&dev->dev, "Repeat last key\n");
			rc_repeat(dev);
			data->state = STATE_INACTIVE;
			return 0;

		} else if (data->count > NECX_REPEAT_BITS)
			data->necx_repeat = false;

@@ -164,7 +162,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
		return 0;
	}

	IR_dprintk(1, "NEC decode failed at count %d state %d (%uus %s)\n",
	dev_dbg(&dev->dev, "NEC decode failed at count %d state %d (%uus %s)\n",
		data->count, data->state, TO_US(ev.duration), TO_STR(ev.pulse));
	data->state = STATE_INACTIVE;
	return -EINVAL;
+6 −6
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
		goto out;

again:
	IR_dprintk(2, "RC5(x/sz) decode started at state %i (%uus %s)\n",
	dev_dbg(&dev->dev, "RC5(x/sz) decode started at state %i (%uus %s)\n",
		data->state, TO_US(ev.duration), TO_STR(ev.pulse));

	if (!geq_margin(ev.duration, RC5_UNIT, RC5_UNIT / 2))
@@ -157,7 +157,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
		} else
			break;

		IR_dprintk(1, "RC5(x/sz) scancode 0x%06x (p: %u, t: %u)\n",
		dev_dbg(&dev->dev, "RC5(x/sz) scancode 0x%06x (p: %u, t: %u)\n",
			scancode, protocol, toggle);

		rc_keydown(dev, protocol, scancode, toggle);
@@ -166,7 +166,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
	}

out:
	IR_dprintk(1, "RC5(x/sz) decode failed at state %i count %d (%uus %s)\n",
	dev_dbg(&dev->dev, "RC5(x/sz) decode failed at state %i count %d (%uus %s)\n",
		data->state, data->count, TO_US(ev.duration), TO_STR(ev.pulse));
	data->state = STATE_INACTIVE;
	return -EINVAL;
+13 −13
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
		goto out;

again:
	IR_dprintk(2, "RC6 decode started at state %i (%uus %s)\n",
	dev_dbg(&dev->dev, "RC6 decode started at state %i (%uus %s)\n",
		data->state, TO_US(ev.duration), TO_STR(ev.pulse));

	if (!geq_margin(ev.duration, RC6_UNIT, RC6_UNIT / 2))
@@ -170,7 +170,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
			break;

		if (!(data->header & RC6_STARTBIT_MASK)) {
			IR_dprintk(1, "RC6 invalid start bit\n");
			dev_dbg(&dev->dev, "RC6 invalid start bit\n");
			break;
		}

@@ -187,7 +187,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
			data->wanted_bits = RC6_6A_NBITS;
			break;
		default:
			IR_dprintk(1, "RC6 unknown mode\n");
			dev_dbg(&dev->dev, "RC6 unknown mode\n");
			goto out;
		}
		goto again;
@@ -230,13 +230,13 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
			scancode = data->body;
			toggle = data->toggle;
			protocol = RC_PROTO_RC6_0;
			IR_dprintk(1, "RC6(0) scancode 0x%04x (toggle: %u)\n",
			dev_dbg(&dev->dev, "RC6(0) scancode 0x%04x (toggle: %u)\n",
				scancode, toggle);
			break;

		case RC6_MODE_6A:
			if (data->count > CHAR_BIT * sizeof data->body) {
				IR_dprintk(1, "RC6 too many (%u) data bits\n",
				dev_dbg(&dev->dev, "RC6 too many (%u) data bits\n",
					data->count);
				goto out;
			}
@@ -262,15 +262,15 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
				}
				break;
			default:
				IR_dprintk(1, "RC6(6A) unsupported length\n");
				dev_dbg(&dev->dev, "RC6(6A) unsupported length\n");
				goto out;
			}

			IR_dprintk(1, "RC6(6A) proto 0x%04x, scancode 0x%08x (toggle: %u)\n",
			dev_dbg(&dev->dev, "RC6(6A) proto 0x%04x, scancode 0x%08x (toggle: %u)\n",
				protocol, scancode, toggle);
			break;
		default:
			IR_dprintk(1, "RC6 unknown mode\n");
			dev_dbg(&dev->dev, "RC6 unknown mode\n");
			goto out;
		}

@@ -280,7 +280,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
	}

out:
	IR_dprintk(1, "RC6 decode failed at state %i (%uus %s)\n",
	dev_dbg(&dev->dev, "RC6 decode failed at state %i (%uus %s)\n",
		data->state, TO_US(ev.duration), TO_STR(ev.pulse));
	data->state = STATE_INACTIVE;
	return -EINVAL;
Loading