diff options
author | Bernhard Walle <bwalle@suse.de> | 2007-05-06 17:48:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:12:50 -0400 |
commit | 6179b5562d5d17c7c09b54cb11dd925ca308d7a9 (patch) | |
tree | 2f740d0f653678557a5601c6dffed1287b9aa513 /Documentation/pcmcia/driver.txt | |
parent | 02c83595b86480ee4d61665beb13f76685d40239 (diff) |
add new_id to PCMCIA drivers
PCI drivers have the new_id file in sysfs which allows new IDs to be added
at runtime. The advantage is to avoid re-compilation of a driver that
works for a new device, but it's ID table doesn't contain the new device.
This mechanism is only meant for testing, after the driver has been tested
successfully, the ID should be added in source code so that new revisions
of the kernel automatically detect the device.
The implementation follows the PCI implementation. The interface is documented
in Documentation/pcmcia/driver.txt. Computations should be done in userspace,
so the sysfs string contains the raw structure members for matching.
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/pcmcia/driver.txt')
-rw-r--r-- | Documentation/pcmcia/driver.txt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Documentation/pcmcia/driver.txt b/Documentation/pcmcia/driver.txt new file mode 100644 index 000000000000..0ac167920778 --- /dev/null +++ b/Documentation/pcmcia/driver.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | PCMCIA Driver | ||
2 | ------------- | ||
3 | |||
4 | |||
5 | sysfs | ||
6 | ----- | ||
7 | |||
8 | New PCMCIA IDs may be added to a device driver pcmcia_device_id table at | ||
9 | runtime as shown below: | ||
10 | |||
11 | echo "match_flags manf_id card_id func_id function device_no \ | ||
12 | prod_id_hash[0] prod_id_hash[1] prod_id_hash[2] prod_id_hash[3]" > \ | ||
13 | /sys/bus/pcmcia/drivers/{driver}/new_id | ||
14 | |||
15 | All fields are passed in as hexadecimal values (no leading 0x). | ||
16 | The meaning is described in the PCMCIA specification, the match_flags is | ||
17 | a bitwise or-ed combination from PCMCIA_DEV_ID_MATCH_* constants | ||
18 | defined in include/linux/mod_devicetable.h. | ||
19 | |||
20 | Once added, the driver probe routine will be invoked for any unclaimed | ||
21 | PCMCIA device listed in its (newly updated) pcmcia_device_id list. | ||
22 | |||
23 | A common use-case is to add a new device according to the manufacturer ID | ||
24 | and the card ID (form the manf_id and card_id file in the device tree). | ||
25 | For this, just use: | ||
26 | |||
27 | echo "0x3 manf_id card_id 0 0 0 0 0 0 0" > \ | ||
28 | /sys/bus/pcmcia/drivers/{driver}/new_id | ||
29 | |||
30 | after loading the driver. | ||