264
|
|
|
Ritesh Raj Saarraf |
|
12 years ago
|
|
|
263
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
262
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
261
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
260
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
259
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
258
|
|
|
Ritesh Raj Saarraf |
1.57 |
13 years ago
|
|
|
257
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
256
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
255
|
|
|
Ritesh Raj Saarraf |
1.56 |
13 years ago
|
|
|
254
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
253
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
252
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
251
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
250
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
249
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
248
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
247
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
246
|
|
Add initial basic support for hotplug events
Currently, laptop-mode-tools only runs on AC plug in and plug out. However, we want to have it run when USB devices are attached. This patch allows us to efficiently run laptop_mode on only the new devices.
There are three changes:
1. laptop_mode can now take two new command line parameters, modules=<list of modules> and devices=<list of devices>.
The modules list is intended to limit laptop_mode to running only the given module scripts. For example, laptop_mode modules="usb-autosuspend lcd-brightness" will only run those two scripts and nothing else. If no modules list is given, all modules will be run (pre-patch behavior).
The devices parameter list is intended to limit the module scripts to running over only the listed devices. For example, laptop_mode devices="1-1 1-2" will provide the list as a variable $DEVICES to all module scripts. The module scripts that support the list are to run nothing but the listed devices. If they don't run those devices in the first place, it still has the effect of masking out all the other devices. However, it is not meant to be used this way; the devices list should be used in conjunction with the modules parameter, and be passed only to the module(s) that support those devices. For example, "1-1 and 1-2" are usb devices and should only be used alongside a modules list of usb scripts, like usb-autosuspend.
2. In this patch, the only module script that has been changed to use the device list is usb-autosuspend. In the future, other modules can be modified to use the device list as well. However, they should follow the same usage described in #1 -- run over only the listed devices, but do not run on any device that would not otherwise be run; and if no device list is given, run just like before. The device list is basically a mask rather than an imperative list. ("Do not run for any device that is not listed", rather than "must run for all these devices.")
Example: suppose there are two modules, foo and bar. foo runs over devices foo-0, foo-1, foo-2, and bar-0. bar runs over bar-0, bar-1, bar-2, and foo-0. If we pass in devices="foo-0 foo-1 foo-2 bar-0", foo will run all 4 devices, but bar will only run bar-0 and foo-0. It will NOT be forced to run over foo-1 and foo-2 because it doesn't support them.
To summarize, this patch retains backward compatibility. If the modules param is not specified, it runs all modules. If a module script is not given a device list, it should run over the entire set of devices that it operates on.
3. Added a udev rule that uses laptop_mode to invoke only usb-autosuspend for only a limited set of device(s), when it detects new usb devices. This is so usb-autosuspend can give new usb devices the correct setting. However, this patch does not provide for installing this rule file. It is up to build/integration scripts to pick out the rule file and install it.
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|
245
|
|
|
Ritesh Raj Saarraf |
|
13 years ago
|
|
|