Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation: i2c: Use PM ops instead of legacy suspend/resume

New drivers should use PM ops instead of the legacy suspend/resume
callbacks. Update the I2C device driver guides to reflect this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

authored by

Lars-Peter Clausen and committed by
Wolfram Sang
5f835cef 530834b1

+6 -8
+2 -4
Documentation/i2c/upgrading-clients
··· 79 79 .driver = { 80 80 .owner = THIS_MODULE, 81 81 .name = "example", 82 + .pm = &example_pm_ops, 82 83 }, 83 84 .attach_adapter = example_attach_adapter, 84 85 .detach_client = example_detach, 85 - .suspend = example_suspend, 86 - .resume = example_resume, 87 86 }; 88 87 89 88 ··· 271 272 .driver = { 272 273 .owner = THIS_MODULE, 273 274 .name = "example", 275 + .pm = &example_pm_ops, 274 276 }, 275 277 .id_table = example_idtable, 276 278 .probe = example_probe, 277 279 .remove = example_remove, 278 - .suspend = example_suspend, 279 - .resume = example_resume, 280 280 };
+4 -4
Documentation/i2c/writing-clients
··· 36 36 static struct i2c_driver foo_driver = { 37 37 .driver = { 38 38 .name = "foo", 39 + .pm = &foo_pm_ops, /* optional */ 39 40 }, 40 41 41 42 .id_table = foo_idtable, ··· 48 47 .address_list = normal_i2c, 49 48 50 49 .shutdown = foo_shutdown, /* optional */ 51 - .suspend = foo_suspend, /* optional */ 52 - .resume = foo_resume, /* optional */ 53 50 .command = foo_command, /* optional, deprecated */ 54 51 } 55 52 ··· 278 279 279 280 If your I2C device needs special handling when entering a system low 280 281 power state -- like putting a transceiver into a low power mode, or 281 - activating a system wakeup mechanism -- do that in the suspend() method. 282 - The resume() method should reverse what the suspend() method does. 282 + activating a system wakeup mechanism -- do that by implementing the 283 + appropriate callbacks for the dev_pm_ops of the driver (like suspend 284 + and resume). 283 285 284 286 These are standard driver model calls, and they work just like they 285 287 would for any other driver stack. The calls can sleep, and can use