• Home
  • Raw
  • Download

Lines Matching +full:autosuspend +full:- +full:delay +full:- +full:ms

13 #include <linux/delay.h>
33 /* power on settling time in ms */
35 /* max time before value available in ms */
44 int ret = i2c_smbus_write_byte_data(bh1780->client, in bh1780_write()
48 dev_err(&bh1780->client->dev, in bh1780_write()
57 int ret = i2c_smbus_read_byte_data(bh1780->client, in bh1780_read()
60 dev_err(&bh1780->client->dev, in bh1780_read()
69 int ret = i2c_smbus_read_word_data(bh1780->client, in bh1780_read_word()
72 dev_err(&bh1780->client->dev, in bh1780_read_word()
107 switch (chan->type) { in bh1780_read_raw()
109 pm_runtime_get_sync(&bh1780->client->dev); in bh1780_read_raw()
113 pm_runtime_mark_last_busy(&bh1780->client->dev); in bh1780_read_raw()
114 pm_runtime_put_autosuspend(&bh1780->client->dev); in bh1780_read_raw()
119 return -EINVAL; in bh1780_read_raw()
126 return -EINVAL; in bh1780_read_raw()
148 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); in bh1780_probe()
152 return -EIO; in bh1780_probe()
154 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*bh1780)); in bh1780_probe()
156 return -ENOMEM; in bh1780_probe()
159 bh1780->client = client; in bh1780_probe()
167 pm_runtime_get_noresume(&client->dev); in bh1780_probe()
168 pm_runtime_set_active(&client->dev); in bh1780_probe()
169 pm_runtime_enable(&client->dev); in bh1780_probe()
174 dev_info(&client->dev, in bh1780_probe()
179 * As the device takes 250 ms to even come up with a fresh in bh1780_probe()
180 * measurement after power-on, do not shut it down unnecessarily. in bh1780_probe()
181 * Set autosuspend to a five seconds. in bh1780_probe()
183 pm_runtime_set_autosuspend_delay(&client->dev, 5000); in bh1780_probe()
184 pm_runtime_use_autosuspend(&client->dev); in bh1780_probe()
185 pm_runtime_put(&client->dev); in bh1780_probe()
187 indio_dev->dev.parent = &client->dev; in bh1780_probe()
188 indio_dev->info = &bh1780_info; in bh1780_probe()
189 indio_dev->name = "bh1780"; in bh1780_probe()
190 indio_dev->channels = bh1780_channels; in bh1780_probe()
191 indio_dev->num_channels = ARRAY_SIZE(bh1780_channels); in bh1780_probe()
192 indio_dev->modes = INDIO_DIRECT_MODE; in bh1780_probe()
200 pm_runtime_put_noidle(&client->dev); in bh1780_probe()
201 pm_runtime_disable(&client->dev); in bh1780_probe()
212 pm_runtime_get_sync(&client->dev); in bh1780_remove()
213 pm_runtime_put_noidle(&client->dev); in bh1780_remove()
214 pm_runtime_disable(&client->dev); in bh1780_remove()
217 dev_err(&client->dev, "failed to power off\n"); in bh1780_remove()