Lines Matching +full:fine +full:- +full:tune

1 // SPDX-License-Identifier: GPL-2.0-or-later
9 * Copyright (C) 2012-2013 Martin Liska <marxin.liska@gmail.com>
12 * Copyright (C) 2013-2014 Marek Vasut <marex@denx.de>
29 #define ACPI_ALS_DEVICE_NAME "acpi-als"
73 * The _ALR property returns tables that can be used to fine-tune the values
90 status = acpi_evaluate_integer(als->device->handle, prop, NULL, in acpi_als_read_value()
94 acpi_evaluation_failure_warn(als->device->handle, prop, status); in acpi_als_read_value()
95 return -EIO; in acpi_als_read_value()
111 iio_trigger_poll_nested(als->trig); in acpi_als_notify()
115 dev_dbg(&device->dev, in acpi_als_notify()
131 return -EINVAL; in acpi_als_read_raw()
134 if (chan->type != IIO_LIGHT) in acpi_als_read_raw()
135 return -EINVAL; in acpi_als_read_raw()
153 struct iio_dev *indio_dev = pf->indio_dev; in acpi_als_trigger_handler()
155 s32 *buffer = als->evt_buffer; in acpi_als_trigger_handler()
159 mutex_lock(&als->lock); in acpi_als_trigger_handler()
174 if (!pf->timestamp) in acpi_als_trigger_handler()
175 pf->timestamp = iio_get_time_ns(indio_dev); in acpi_als_trigger_handler()
177 iio_push_to_buffers_with_timestamp(indio_dev, buffer, pf->timestamp); in acpi_als_trigger_handler()
179 mutex_unlock(&als->lock); in acpi_als_trigger_handler()
180 iio_trigger_notify_done(indio_dev->trig); in acpi_als_trigger_handler()
187 struct device *dev = &device->dev; in acpi_als_add()
194 return -ENOMEM; in acpi_als_add()
198 device->driver_data = indio_dev; in acpi_als_add()
199 als->device = device; in acpi_als_add()
200 mutex_init(&als->lock); in acpi_als_add()
202 indio_dev->name = ACPI_ALS_DEVICE_NAME; in acpi_als_add()
203 indio_dev->info = &acpi_als_info; in acpi_als_add()
204 indio_dev->channels = acpi_als_channels; in acpi_als_add()
205 indio_dev->num_channels = ARRAY_SIZE(acpi_als_channels); in acpi_als_add()
207 als->trig = devm_iio_trigger_alloc(dev, "%s-dev%d", indio_dev->name, in acpi_als_add()
209 if (!als->trig) in acpi_als_add()
210 return -ENOMEM; in acpi_als_add()
212 ret = devm_iio_trigger_register(dev, als->trig); in acpi_als_add()
219 indio_dev->trig = iio_trigger_get(als->trig); in acpi_als_add()