Lines Matching +full:loss +full:- +full:of +full:- +full:lock
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * IIO driver for Lite-On LTR390 ALS and UV sensor
4 * (7-bit I2C slave address 0x53)
6 * Based on the work of:
12 …* https://optoelectronics.liteon.com/upload/download/DS86-2015-0004/LTR-390UV_Final_%20DS_V1%201…
15 * - Support for configurable gain and resolution
16 * - Sensor suspend/resume support
17 * - Add support for reading the ALS
18 * - Interrupt support
42 * At 20-bit resolution (integration time: 400ms) and 18x gain, 2300 counts of
45 * For the default resolution of 18-bit (integration time: 100ms) and default
46 * gain of 3x, the counts/uvi are calculated as follows:
53 * tinted ink. This is to compensate for the light loss due to the lower
54 * transmission rate of the window glass and helps * in calculating lux.
62 struct mutex lock; member
74 struct device *dev = &data->client->dev; in ltr390_register_read()
78 guard(mutex)(&data->lock); in ltr390_register_read()
80 ret = regmap_bulk_read(data->regmap, register_address, recieve_buffer, in ltr390_register_read()
109 return -EINVAL; in ltr390_read_raw()
129 dev = &client->dev; in ltr390_probe()
132 return -ENOMEM; in ltr390_probe()
136 data->regmap = devm_regmap_init_i2c(client, <r390_regmap_config); in ltr390_probe()
137 if (IS_ERR(data->regmap)) in ltr390_probe()
138 return dev_err_probe(dev, PTR_ERR(data->regmap), in ltr390_probe()
141 data->client = client; in ltr390_probe()
142 mutex_init(&data->lock); in ltr390_probe()
144 indio_dev->info = <r390_info; in ltr390_probe()
145 indio_dev->channels = <r390_channel; in ltr390_probe()
146 indio_dev->num_channels = 1; in ltr390_probe()
147 indio_dev->name = "ltr390"; in ltr390_probe()
149 ret = regmap_read(data->regmap, LTR390_PART_ID, &part_number); in ltr390_probe()
153 /* Lower 4 bits of `part_number` change with hardware revisions */ in ltr390_probe()
159 regmap_set_bits(data->regmap, LTR390_MAIN_CTRL, LTR390_SW_RESET); in ltr390_probe()
164 ret = regmap_set_bits(data->regmap, LTR390_MAIN_CTRL, in ltr390_probe()
182 MODULE_DEVICE_TABLE(of, ltr390_of_table);
195 MODULE_DESCRIPTION("Lite-On LTR390 ALS and UV sensor Driver");