aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-11-30 11:52:31 -0500
committerWolfram Sang <wsa@the-dreams.de>2014-12-04 13:09:03 -0500
commit5f835cef770fc71263ace29198a9e6743033a705 (patch)
treea87214fb62079c6766f97950386e40dd28aee807 /Documentation
parent530834b13feff543a49b214eb750e97fbd7a22be (diff)
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>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/i2c/upgrading-clients6
-rw-r--r--Documentation/i2c/writing-clients8
2 files changed, 6 insertions, 8 deletions
diff --git a/Documentation/i2c/upgrading-clients b/Documentation/i2c/upgrading-clients
index 8e5fbd88c7d1..ccba3ffd6e80 100644
--- a/Documentation/i2c/upgrading-clients
+++ b/Documentation/i2c/upgrading-clients
@@ -79,11 +79,10 @@ static struct i2c_driver example_driver = {
79 .driver = { 79 .driver = {
80 .owner = THIS_MODULE, 80 .owner = THIS_MODULE,
81 .name = "example", 81 .name = "example",
82 .pm = &example_pm_ops,
82 }, 83 },
83 .attach_adapter = example_attach_adapter, 84 .attach_adapter = example_attach_adapter,
84 .detach_client = example_detach, 85 .detach_client = example_detach,
85 .suspend = example_suspend,
86 .resume = example_resume,
87}; 86};
88 87
89 88
@@ -272,10 +271,9 @@ static struct i2c_driver example_driver = {
272 .driver = { 271 .driver = {
273 .owner = THIS_MODULE, 272 .owner = THIS_MODULE,
274 .name = "example", 273 .name = "example",
274 .pm = &example_pm_ops,
275 }, 275 },
276 .id_table = example_idtable, 276 .id_table = example_idtable,
277 .probe = example_probe, 277 .probe = example_probe,
278 .remove = example_remove, 278 .remove = example_remove,
279 .suspend = example_suspend,
280 .resume = example_resume,
281}; 279};
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index 6b344b516bff..a755b141fa4a 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -36,6 +36,7 @@ MODULE_DEVICE_TABLE(i2c, foo_idtable);
36static struct i2c_driver foo_driver = { 36static struct i2c_driver foo_driver = {
37 .driver = { 37 .driver = {
38 .name = "foo", 38 .name = "foo",
39 .pm = &foo_pm_ops, /* optional */
39 }, 40 },
40 41
41 .id_table = foo_idtable, 42 .id_table = foo_idtable,
@@ -47,8 +48,6 @@ static struct i2c_driver foo_driver = {
47 .address_list = normal_i2c, 48 .address_list = normal_i2c,
48 49
49 .shutdown = foo_shutdown, /* optional */ 50 .shutdown = foo_shutdown, /* optional */
50 .suspend = foo_suspend, /* optional */
51 .resume = foo_resume, /* optional */
52 .command = foo_command, /* optional, deprecated */ 51 .command = foo_command, /* optional, deprecated */
53} 52}
54 53
@@ -279,8 +278,9 @@ Power Management
279 278
280If your I2C device needs special handling when entering a system low 279If your I2C device needs special handling when entering a system low
281power state -- like putting a transceiver into a low power mode, or 280power state -- like putting a transceiver into a low power mode, or
282activating a system wakeup mechanism -- do that in the suspend() method. 281activating a system wakeup mechanism -- do that by implementing the
283The resume() method should reverse what the suspend() method does. 282appropriate callbacks for the dev_pm_ops of the driver (like suspend
283and resume).
284 284
285These are standard driver model calls, and they work just like they 285These are standard driver model calls, and they work just like they
286would for any other driver stack. The calls can sleep, and can use 286would for any other driver stack. The calls can sleep, and can use