| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * isl29125.c - Support for Intersil ISL29125 RGB light sensor |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2014 Peter Meerwald <pmeerw@pmeerw.net> |
|---|
| 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. |
|---|
| 9 | 6 | * |
|---|
| 10 | 7 | * RGB light sensor with 16-bit channels for red, green, blue); |
|---|
| 11 | 8 | * 7-bit I2C slave address 0x44 |
|---|
| .. | .. |
|---|
| 220 | 217 | .attrs = &isl29125_attribute_group, |
|---|
| 221 | 218 | }; |
|---|
| 222 | 219 | |
|---|
| 223 | | -static int isl29125_buffer_preenable(struct iio_dev *indio_dev) |
|---|
| 220 | +static int isl29125_buffer_postenable(struct iio_dev *indio_dev) |
|---|
| 224 | 221 | { |
|---|
| 225 | 222 | struct isl29125_data *data = iio_priv(indio_dev); |
|---|
| 226 | 223 | |
|---|
| .. | .. |
|---|
| 232 | 229 | static int isl29125_buffer_predisable(struct iio_dev *indio_dev) |
|---|
| 233 | 230 | { |
|---|
| 234 | 231 | struct isl29125_data *data = iio_priv(indio_dev); |
|---|
| 235 | | - int ret; |
|---|
| 236 | | - |
|---|
| 237 | | - ret = iio_triggered_buffer_predisable(indio_dev); |
|---|
| 238 | | - if (ret < 0) |
|---|
| 239 | | - return ret; |
|---|
| 240 | 232 | |
|---|
| 241 | 233 | data->conf1 &= ~ISL29125_MODE_MASK; |
|---|
| 242 | 234 | data->conf1 |= ISL29125_MODE_PD; |
|---|
| .. | .. |
|---|
| 245 | 237 | } |
|---|
| 246 | 238 | |
|---|
| 247 | 239 | static const struct iio_buffer_setup_ops isl29125_buffer_setup_ops = { |
|---|
| 248 | | - .preenable = isl29125_buffer_preenable, |
|---|
| 249 | | - .postenable = &iio_triggered_buffer_postenable, |
|---|
| 240 | + .postenable = isl29125_buffer_postenable, |
|---|
| 250 | 241 | .predisable = isl29125_buffer_predisable, |
|---|
| 251 | 242 | }; |
|---|
| 252 | 243 | |
|---|
| .. | .. |
|---|
| 265 | 256 | i2c_set_clientdata(client, indio_dev); |
|---|
| 266 | 257 | data->client = client; |
|---|
| 267 | 258 | |
|---|
| 268 | | - indio_dev->dev.parent = &client->dev; |
|---|
| 269 | 259 | indio_dev->info = &isl29125_info; |
|---|
| 270 | 260 | indio_dev->name = ISL29125_DRV_NAME; |
|---|
| 271 | 261 | indio_dev->channels = isl29125_channels; |
|---|