- Depending on the platform, i2c bus may be shutdown
as we shutdown the systme
- In such a case, any lingering workqueue would slowdown
the system, as the access will be made to the i2c bus
which has been shutdown
- To mitigate the above, cancel all workqueue jobs as we shutdown
Bug
1522172
Change-Id: Idebab822c0ef8ddad7352ef25a546acb3f3e5870
Signed-off-by: Sang-Hun Lee <sanlee@nvidia.com>
Reviewed-on: http://git-master/r/420889
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Sri Krishna Chowdary <schowdary@nvidia.com>
MODULE_DEVICE_TABLE(i2c, cm3217_i2c_device_id);
+static void cm3217_shutdown(struct i2c_client *client)
+{
+ struct iio_dev *indio_dev = i2c_get_clientdata(client);
+ struct cm3217_inf *inf = iio_priv(indio_dev);
+ inf->als_state = CHIP_POWER_OFF;
+ smp_wmb();
+ cancel_delayed_work_sync(&inf->dw);
+ cm3217_vreg_exit(inf);
+}
+
#ifdef CONFIG_OF
static const struct of_device_id cm3217_of_match[] = {
{ .compatible = "capella,cm3217", },
.of_match_table = of_match_ptr(cm3217_of_match),
.pm = CM3217_PM_OPS,
},
+ .shutdown = cm3217_shutdown,
};
module_i2c_driver(cm3217_driver);