Commit 0da2df3d authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Vojtech Pavlik

input: adjust file2alias utility to export aliases for

       serio drivers (serio:tyNprNidNexN).
       Move serio_device_id from serio.h to mod_devicetable.h
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
Signed-off-by: default avatarVojtech Pavlik <vojtech@suse.cz>
parent cfac99f2
......@@ -165,4 +165,14 @@ struct pnp_card_device_id {
};
#define SERIO_ANY 0xff
struct serio_device_id {
__u8 type;
__u8 extra;
__u8 id;
__u8 proto;
};
#endif /* LINUX_MOD_DEVICETABLE_H */
......@@ -19,13 +19,7 @@
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/device.h>
struct serio_device_id {
unsigned char type;
unsigned char extra;
unsigned char id;
unsigned char proto;
};
#include <linux/mod_devicetable.h>
struct serio {
void *port_data;
......@@ -174,8 +168,6 @@ static inline void serio_unpin_driver(struct serio *serio)
#define SERIO_PARITY 2
#define SERIO_FRAME 4
#define SERIO_ANY 0xff
/*
* Serio types
*/
......
......@@ -4,7 +4,7 @@
*
* Copyright 2002-2003 Rusty Russell, IBM Corporation
* 2003 Kai Germaschewski
*
*
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
......@@ -181,6 +181,24 @@ static int do_ccw_entry(const char *filename,
return 1;
}
/* Looks like: "serio:tyNprNidNexN" */
static int do_serio_entry(const char *filename,
struct serio_device_id *id, char *alias)
{
id->type = TO_NATIVE(id->type);
id->proto = TO_NATIVE(id->proto);
id->id = TO_NATIVE(id->id);
id->extra = TO_NATIVE(id->extra);
strcpy(alias, "serio:");
ADD(alias, "ty", id->type != SERIO_ANY, id->type);
ADD(alias, "pr", id->proto != SERIO_ANY, id->proto);
ADD(alias, "id", id->id != SERIO_ANY, id->id);
ADD(alias, "ex", id->extra != SERIO_ANY, id->extra);
return 1;
}
/* looks like: "pnp:dD" */
static int do_pnp_entry(const char *filename,
struct pnp_device_id *id, char *alias)
......@@ -270,6 +288,9 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
else if (sym_is(symname, "__mod_ccw_device_table"))
do_table(symval, sym->st_size, sizeof(struct ccw_device_id),
do_ccw_entry, mod);
else if (sym_is(symname, "__mod_serio_device_table"))
do_table(symval, sym->st_size, sizeof(struct serio_device_id),
do_serio_entry, mod);
else if (sym_is(symname, "__mod_pnp_device_table"))
do_table(symval, sym->st_size, sizeof(struct pnp_device_id),
do_pnp_entry, mod);
......
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