| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * MAX44000 Ambient and Infrared Proximity Sensor |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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. |
|---|
| 9 | 6 | * |
|---|
| 10 | 7 | * Data sheet: https://datasheets.maximintegrated.com/en/ds/MAX44000.pdf |
|---|
| 11 | 8 | * |
|---|
| .. | .. |
|---|
| 104 | 101 | * Handling this internally is also required for buffer support because the |
|---|
| 105 | 102 | * channel's scan_type can't be modified dynamically. |
|---|
| 106 | 103 | */ |
|---|
| 107 | | -static const int max44000_alstim_shift[] = {0, 2, 4, 6}; |
|---|
| 108 | 104 | #define MAX44000_ALSTIM_SHIFT(alstim) (2 * (alstim)) |
|---|
| 109 | 105 | |
|---|
| 110 | 106 | /* Available integration times with pretty manual alignment: */ |
|---|
| .. | .. |
|---|
| 478 | 474 | } |
|---|
| 479 | 475 | |
|---|
| 480 | 476 | static const struct regmap_config max44000_regmap_config = { |
|---|
| 481 | | - .reg_bits = 8, |
|---|
| 482 | | - .val_bits = 8, |
|---|
| 477 | + .reg_bits = 8, |
|---|
| 478 | + .val_bits = 8, |
|---|
| 483 | 479 | |
|---|
| 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, |
|---|
| 489 | 485 | |
|---|
| 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, |
|---|
| 492 | 489 | }; |
|---|
| 493 | 490 | |
|---|
| 494 | 491 | static irqreturn_t max44000_trigger_handler(int irq, void *p) |
|---|
| .. | .. |
|---|
| 545 | 542 | |
|---|
| 546 | 543 | i2c_set_clientdata(client, indio_dev); |
|---|
| 547 | 544 | mutex_init(&data->lock); |
|---|
| 548 | | - indio_dev->dev.parent = &client->dev; |
|---|
| 549 | 545 | indio_dev->info = &max44000_info; |
|---|
| 550 | 546 | indio_dev->name = MAX44000_DRV_NAME; |
|---|
| 551 | 547 | indio_dev->channels = max44000_channels; |
|---|