.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * MMC35240 - MEMSIC 3-axis Magnetic Sensor |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (c) 2015, 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 | * IIO driver for MMC35240 (7-bit I2C slave address 0x30). |
---|
11 | 8 | * |
---|
.. | .. |
---|
56 | 53 | #define MMC35240_CTRL1_BW_SHIFT 0 |
---|
57 | 54 | |
---|
58 | 55 | #define MMC35240_WAIT_CHARGE_PUMP 50000 /* us */ |
---|
59 | | -#define MMC53240_WAIT_SET_RESET 1000 /* us */ |
---|
| 56 | +#define MMC35240_WAIT_SET_RESET 1000 /* us */ |
---|
60 | 57 | |
---|
61 | 58 | /* |
---|
62 | 59 | * Memsic OTP process code piece is put here for reference: |
---|
.. | .. |
---|
228 | 225 | ret = mmc35240_hw_set(data, true); |
---|
229 | 226 | if (ret < 0) |
---|
230 | 227 | return ret; |
---|
231 | | - usleep_range(MMC53240_WAIT_SET_RESET, MMC53240_WAIT_SET_RESET + 1); |
---|
| 228 | + usleep_range(MMC35240_WAIT_SET_RESET, MMC35240_WAIT_SET_RESET + 1); |
---|
232 | 229 | |
---|
233 | 230 | ret = mmc35240_hw_set(data, false); |
---|
234 | 231 | if (ret < 0) |
---|
.. | .. |
---|
242 | 239 | return ret; |
---|
243 | 240 | |
---|
244 | 241 | ret = regmap_bulk_read(data->regmap, MMC35240_OTP_START_ADDR, |
---|
245 | | - (u8 *)otp_data, sizeof(otp_data)); |
---|
| 242 | + otp_data, sizeof(otp_data)); |
---|
246 | 243 | if (ret < 0) |
---|
247 | 244 | return ret; |
---|
248 | 245 | |
---|
.. | .. |
---|
298 | 295 | if (ret < 0) |
---|
299 | 296 | return ret; |
---|
300 | 297 | |
---|
301 | | - return regmap_bulk_read(data->regmap, MMC35240_REG_XOUT_L, (u8 *)buf, |
---|
| 298 | + return regmap_bulk_read(data->regmap, MMC35240_REG_XOUT_L, buf, |
---|
302 | 299 | 3 * sizeof(__le16)); |
---|
303 | 300 | } |
---|
304 | 301 | |
---|
305 | 302 | /** |
---|
306 | 303 | * mmc35240_raw_to_mgauss - convert raw readings to milli gauss. Also apply |
---|
307 | | - compensation for output value. |
---|
| 304 | + * compensation for output value. |
---|
308 | 305 | * |
---|
309 | 306 | * @data: device private data |
---|
310 | 307 | * @index: axis index for which we want the conversion |
---|
.. | .. |
---|
462 | 459 | } |
---|
463 | 460 | } |
---|
464 | 461 | |
---|
465 | | -static struct reg_default mmc35240_reg_defaults[] = { |
---|
| 462 | +static const struct reg_default mmc35240_reg_defaults[] = { |
---|
466 | 463 | { MMC35240_REG_CTRL0, 0x00 }, |
---|
467 | 464 | { MMC35240_REG_CTRL1, 0x00 }, |
---|
468 | 465 | }; |
---|
.. | .. |
---|
510 | 507 | |
---|
511 | 508 | mutex_init(&data->mutex); |
---|
512 | 509 | |
---|
513 | | - indio_dev->dev.parent = &client->dev; |
---|
514 | 510 | indio_dev->info = &mmc35240_info; |
---|
515 | 511 | indio_dev->name = MMC35240_DRV_NAME; |
---|
516 | 512 | indio_dev->channels = mmc35240_channels; |
---|