am2315.c (1cb0d06a00f2ec0ed8f926ec62f53bc9e12ea55e) | am2315.c (cdd469ad9e008a58ed465efa09f8594f1387e8ce) |
---|---|
1/** 2 * Aosong AM2315 relative humidity and temperature 3 * 4 * Copyright (c) 2016, Intel Corporation. 5 * 6 * This file is subject to the terms and conditions of version 2 of 7 * the GNU General Public License. See the file COPYING in the main 8 * directory of this archive for more details. --- 151 unchanged lines hidden (view full) --- 160 int ret; 161 int bit; 162 struct iio_poll_func *pf = p; 163 struct iio_dev *indio_dev = pf->indio_dev; 164 struct am2315_data *data = iio_priv(indio_dev); 165 struct am2315_sensor_data sensor_data; 166 167 ret = am2315_read_data(data, &sensor_data); | 1/** 2 * Aosong AM2315 relative humidity and temperature 3 * 4 * Copyright (c) 2016, Intel Corporation. 5 * 6 * This file is subject to the terms and conditions of version 2 of 7 * the GNU General Public License. See the file COPYING in the main 8 * directory of this archive for more details. --- 151 unchanged lines hidden (view full) --- 160 int ret; 161 int bit; 162 struct iio_poll_func *pf = p; 163 struct iio_dev *indio_dev = pf->indio_dev; 164 struct am2315_data *data = iio_priv(indio_dev); 165 struct am2315_sensor_data sensor_data; 166 167 ret = am2315_read_data(data, &sensor_data); |
168 if (ret < 0) | 168 if (ret < 0) { 169 mutex_unlock(&data->lock); |
169 goto err; | 170 goto err; |
171 } |
|
170 171 mutex_lock(&data->lock); 172 if (*(indio_dev->active_scan_mask) == AM2315_ALL_CHANNEL_MASK) { 173 data->buffer[0] = sensor_data.hum_data; 174 data->buffer[1] = sensor_data.temp_data; 175 } else { 176 i = 0; 177 for_each_set_bit(bit, indio_dev->active_scan_mask, --- 93 unchanged lines hidden (view full) --- 271 272 return 0; 273} 274 275static const struct i2c_device_id am2315_i2c_id[] = { 276 {"am2315", 0}, 277 {} 278}; | 172 173 mutex_lock(&data->lock); 174 if (*(indio_dev->active_scan_mask) == AM2315_ALL_CHANNEL_MASK) { 175 data->buffer[0] = sensor_data.hum_data; 176 data->buffer[1] = sensor_data.temp_data; 177 } else { 178 i = 0; 179 for_each_set_bit(bit, indio_dev->active_scan_mask, --- 93 unchanged lines hidden (view full) --- 273 274 return 0; 275} 276 277static const struct i2c_device_id am2315_i2c_id[] = { 278 {"am2315", 0}, 279 {} 280}; |
281MODULE_DEVICE_TABLE(i2c, am2315_i2c_id); |
|
279 280static const struct acpi_device_id am2315_acpi_id[] = { 281 {"AOS2315", 0}, 282 {} 283}; 284 285MODULE_DEVICE_TABLE(acpi, am2315_acpi_id); 286 --- 15 unchanged lines hidden --- | 282 283static const struct acpi_device_id am2315_acpi_id[] = { 284 {"AOS2315", 0}, 285 {} 286}; 287 288MODULE_DEVICE_TABLE(acpi, am2315_acpi_id); 289 --- 15 unchanged lines hidden --- |