Commit ed8c34d7 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

media: rc: report receiver and transmitter type on device register

On the raspberry pi, we might have two lirc devices; one for sending and
one for receiving. This change makes it much more apparent which one
is which.
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 536f0f55
......@@ -18,7 +18,7 @@ Example dmesg output upon a driver registering w/LIRC:
.. code-block:: none
$ dmesg |grep lirc_dev
rc rc0: lirc_dev: driver mceusb registered at minor = 0
rc rc0: lirc_dev: driver mceusb registered at minor = 0, raw IR receiver, raw IR transmitter
What you should see for a chardev:
......
......@@ -735,6 +735,7 @@ static void lirc_release_device(struct device *ld)
int ir_lirc_register(struct rc_dev *dev)
{
const char *rx_type, *tx_type;
int err, minor;
minor = ida_simple_get(&lirc_ida, 0, RC_DEV_MAX, GFP_KERNEL);
......@@ -759,8 +760,25 @@ int ir_lirc_register(struct rc_dev *dev)
get_device(&dev->dev);
dev_info(&dev->dev, "lirc_dev: driver %s registered at minor = %d",
dev->driver_name, minor);
switch (dev->driver_type) {
case RC_DRIVER_SCANCODE:
rx_type = "scancode";
break;
case RC_DRIVER_IR_RAW:
rx_type = "raw IR";
break;
default:
rx_type = "no";
break;
}
if (dev->tx_ir)
tx_type = "raw IR";
else
tx_type = "no";
dev_info(&dev->dev, "lirc_dev: driver %s registered at minor = %d, %s receiver, %s transmitter",
dev->driver_name, minor, rx_type, tx_type);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment