[RFC][PATCH] Enable async suspend/resume of i2c devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This improves our resume time when we have devices on an i2c bus
that are slow to resume.  In particular we have a light sensor that
adds about 50ms of resume time on one device. We have to enable it
both on the i2c master and i2c client side and then we get fully async
suspend/resume.  I suspect we'll see nice gains on systems with more
i2c devices and will test that out soon.

Signed-off-by: Sonny Rao <sonnyrao@xxxxxxxxxxxx>
---
 drivers/i2c/i2c-core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index e5f76a0..bbe7569 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -547,6 +547,7 @@ i2c_new_device(struct i2c_adapter *adap, struct
i2c_board_info const *info)

        dev_dbg(&adap->dev, "client [%s] registered with bus id %s\n",
                client->name, dev_name(&client->dev));
+       device_enable_async_suspend(&client->dev);

        return client;

@@ -857,6 +858,7 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
                dev_warn(&adap->dev,
                         "Failed to create compatibility class link\n");
 #endif
+       device_enable_async_suspend(&adap->dev);

        /* create pre-declared device nodes */
        if (adap->nr < __i2c_first_dynamic_bus_num)
-- 
1.7.3.1
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux