Commit e202c15b authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB: ir-core: rename sysfs remote controller class from ir to rc

IR is an alias for Infrared Remote, while RC is an alias for Remote
Controller.

While currently all implementations are with Infrared Remote Controller,
this subsystem is not meant to be used only by IR type of RC's. So,
as discussed on both linux-media and linux-input, the better is to
rename the subsystem as Remote Controller.

While, currently, the only application that uses the /sys/class/irrcv is
ir-keytable application, and its sysfs support works only with the
current linux-next code, it is still possible to change the userspace API
without the risk of breaking applications. So, better to rename this
sooner than later.

Later patches will be needed to rename the files and to move them away
from drivers/media, but this is not a critical issue. So, for now,
let's just change the name of the sysfs class/nodes.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d89b4bd2
...@@ -22,14 +22,14 @@ ...@@ -22,14 +22,14 @@
/* bit array to represent IR sysfs device number */ /* bit array to represent IR sysfs device number */
static unsigned long ir_core_dev_number; static unsigned long ir_core_dev_number;
/* class for /sys/class/irrcv */ /* class for /sys/class/rc */
static char *ir_devnode(struct device *dev, mode_t *mode) static char *ir_devnode(struct device *dev, mode_t *mode)
{ {
return kasprintf(GFP_KERNEL, "irrcv/%s", dev_name(dev)); return kasprintf(GFP_KERNEL, "rc/%s", dev_name(dev));
} }
static struct class ir_input_class = { static struct class ir_input_class = {
.name = "irrcv", .name = "rc",
.devnode = ir_devnode, .devnode = ir_devnode,
}; };
...@@ -40,7 +40,7 @@ static struct class ir_input_class = { ...@@ -40,7 +40,7 @@ static struct class ir_input_class = {
* @buf: a pointer to the output buffer * @buf: a pointer to the output buffer
* *
* This routine is a callback routine for input read the IR protocol type. * This routine is a callback routine for input read the IR protocol type.
* it is trigged by reading /sys/class/irrcv/irrcv?/current_protocol. * it is trigged by reading /sys/class/rc/rcrcv?/current_protocol.
* It returns the protocol name, as understood by the driver. * It returns the protocol name, as understood by the driver.
*/ */
static ssize_t show_protocol(struct device *d, static ssize_t show_protocol(struct device *d,
...@@ -75,7 +75,7 @@ static ssize_t show_protocol(struct device *d, ...@@ -75,7 +75,7 @@ static ssize_t show_protocol(struct device *d,
* @len: length of the input buffer * @len: length of the input buffer
* *
* This routine is a callback routine for changing the IR protocol type. * This routine is a callback routine for changing the IR protocol type.
* it is trigged by reading /sys/class/irrcv/irrcv?/current_protocol. * it is trigged by reading /sys/class/rc/rcrcv?/current_protocol.
* It changes the IR the protocol name, if the IR type is recognized * It changes the IR the protocol name, if the IR type is recognized
* by the driver. * by the driver.
* If an unknown protocol name is used, returns -EINVAL. * If an unknown protocol name is used, returns -EINVAL.
...@@ -172,7 +172,7 @@ static struct device_type ir_dev_type = { ...@@ -172,7 +172,7 @@ static struct device_type ir_dev_type = {
}; };
/** /**
* ir_register_class() - creates the sysfs for /sys/class/irrcv/irrcv? * ir_register_class() - creates the sysfs for /sys/class/rc/rcrcv?
* @input_dev: the struct input_dev descriptor of the device * @input_dev: the struct input_dev descriptor of the device
* *
* This routine is used to register the syfs code for IR class * This routine is used to register the syfs code for IR class
...@@ -192,7 +192,7 @@ int ir_register_class(struct input_dev *input_dev) ...@@ -192,7 +192,7 @@ int ir_register_class(struct input_dev *input_dev)
ir_dev->dev.type = &ir_dev_type; ir_dev->dev.type = &ir_dev_type;
ir_dev->dev.class = &ir_input_class; ir_dev->dev.class = &ir_input_class;
ir_dev->dev.parent = input_dev->dev.parent; ir_dev->dev.parent = input_dev->dev.parent;
dev_set_name(&ir_dev->dev, "irrcv%d", devno); dev_set_name(&ir_dev->dev, "rcrcv%d", devno);
dev_set_drvdata(&ir_dev->dev, ir_dev); dev_set_drvdata(&ir_dev->dev, ir_dev);
rc = device_register(&ir_dev->dev); rc = device_register(&ir_dev->dev);
if (rc) if (rc)
...@@ -223,7 +223,7 @@ int ir_register_class(struct input_dev *input_dev) ...@@ -223,7 +223,7 @@ int ir_register_class(struct input_dev *input_dev)
/** /**
* ir_unregister_class() - removes the sysfs for sysfs for * ir_unregister_class() - removes the sysfs for sysfs for
* /sys/class/irrcv/irrcv? * /sys/class/rc/rcrcv?
* @input_dev: the struct input_dev descriptor of the device * @input_dev: the struct input_dev descriptor of the device
* *
* This routine is used to unregister the syfs code for IR class * This routine is used to unregister the syfs code for IR class
...@@ -240,14 +240,14 @@ void ir_unregister_class(struct input_dev *input_dev) ...@@ -240,14 +240,14 @@ void ir_unregister_class(struct input_dev *input_dev)
} }
/* /*
* Init/exit code for the module. Basically, creates/removes /sys/class/irrcv * Init/exit code for the module. Basically, creates/removes /sys/class/rc
*/ */
static int __init ir_core_init(void) static int __init ir_core_init(void)
{ {
int rc = class_register(&ir_input_class); int rc = class_register(&ir_input_class);
if (rc) { if (rc) {
printk(KERN_ERR "ir_core: unable to register irrcv class\n"); printk(KERN_ERR "ir_core: unable to register rc class\n");
return rc; return rc;
} }
......
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