forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/iio/light/max44000.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * MAX44000 Ambient and Infrared Proximity Sensor
34 *
45 * 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.
96 *
107 * Data sheet: https://datasheets.maximintegrated.com/en/ds/MAX44000.pdf
118 *
....@@ -104,7 +101,6 @@
104101 * Handling this internally is also required for buffer support because the
105102 * channel's scan_type can't be modified dynamically.
106103 */
107
-static const int max44000_alstim_shift[] = {0, 2, 4, 6};
108104 #define MAX44000_ALSTIM_SHIFT(alstim) (2 * (alstim))
109105
110106 /* Available integration times with pretty manual alignment: */
....@@ -478,17 +474,18 @@
478474 }
479475
480476 static const struct regmap_config max44000_regmap_config = {
481
- .reg_bits = 8,
482
- .val_bits = 8,
477
+ .reg_bits = 8,
478
+ .val_bits = 8,
483479
484
- .max_register = MAX44000_REG_PRX_DATA,
485
- .readable_reg = max44000_readable_reg,
486
- .writeable_reg = max44000_writeable_reg,
487
- .volatile_reg = max44000_volatile_reg,
488
- .precious_reg = max44000_precious_reg,
480
+ .max_register = MAX44000_REG_PRX_DATA,
481
+ .readable_reg = max44000_readable_reg,
482
+ .writeable_reg = max44000_writeable_reg,
483
+ .volatile_reg = max44000_volatile_reg,
484
+ .precious_reg = max44000_precious_reg,
489485
490
- .use_single_rw = 1,
491
- .cache_type = REGCACHE_RBTREE,
486
+ .use_single_read = true,
487
+ .use_single_write = true,
488
+ .cache_type = REGCACHE_RBTREE,
492489 };
493490
494491 static irqreturn_t max44000_trigger_handler(int irq, void *p)
....@@ -545,7 +542,6 @@
545542
546543 i2c_set_clientdata(client, indio_dev);
547544 mutex_init(&data->lock);
548
- indio_dev->dev.parent = &client->dev;
549545 indio_dev->info = &max44000_info;
550546 indio_dev->name = MAX44000_DRV_NAME;
551547 indio_dev->channels = max44000_channels;