| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * STMicroelectronics st_lsm6dsx spi driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Lorenzo Bianconi <lorenzo.bianconi@st.com> |
|---|
| 7 | 8 | * Denis Ciocca <denis.ciocca@st.com> |
|---|
| 8 | | - * |
|---|
| 9 | | - * Licensed under the GPL-2. |
|---|
| 10 | 9 | */ |
|---|
| 11 | 10 | |
|---|
| 12 | 11 | #include <linux/kernel.h> |
|---|
| 13 | 12 | #include <linux/module.h> |
|---|
| 14 | 13 | #include <linux/spi/spi.h> |
|---|
| 15 | 14 | #include <linux/slab.h> |
|---|
| 16 | | -#include <linux/of.h> |
|---|
| 17 | 15 | #include <linux/regmap.h> |
|---|
| 18 | 16 | |
|---|
| 19 | 17 | #include "st_lsm6dsx.h" |
|---|
| .. | .. |
|---|
| 36 | 34 | return PTR_ERR(regmap); |
|---|
| 37 | 35 | } |
|---|
| 38 | 36 | |
|---|
| 39 | | - return st_lsm6dsx_probe(&spi->dev, spi->irq, |
|---|
| 40 | | - hw_id, id->name, regmap); |
|---|
| 37 | + return st_lsm6dsx_probe(&spi->dev, spi->irq, hw_id, regmap); |
|---|
| 41 | 38 | } |
|---|
| 42 | 39 | |
|---|
| 43 | 40 | static const struct of_device_id st_lsm6dsx_spi_of_match[] = { |
|---|
| .. | .. |
|---|
| 61 | 58 | .compatible = "st,ism330dlc", |
|---|
| 62 | 59 | .data = (void *)ST_ISM330DLC_ID, |
|---|
| 63 | 60 | }, |
|---|
| 61 | + { |
|---|
| 62 | + .compatible = "st,lsm6dso", |
|---|
| 63 | + .data = (void *)ST_LSM6DSO_ID, |
|---|
| 64 | + }, |
|---|
| 65 | + { |
|---|
| 66 | + .compatible = "st,asm330lhh", |
|---|
| 67 | + .data = (void *)ST_ASM330LHH_ID, |
|---|
| 68 | + }, |
|---|
| 69 | + { |
|---|
| 70 | + .compatible = "st,lsm6dsox", |
|---|
| 71 | + .data = (void *)ST_LSM6DSOX_ID, |
|---|
| 72 | + }, |
|---|
| 73 | + { |
|---|
| 74 | + .compatible = "st,lsm6dsr", |
|---|
| 75 | + .data = (void *)ST_LSM6DSR_ID, |
|---|
| 76 | + }, |
|---|
| 77 | + { |
|---|
| 78 | + .compatible = "st,lsm6ds3tr-c", |
|---|
| 79 | + .data = (void *)ST_LSM6DS3TRC_ID, |
|---|
| 80 | + }, |
|---|
| 81 | + { |
|---|
| 82 | + .compatible = "st,ism330dhcx", |
|---|
| 83 | + .data = (void *)ST_ISM330DHCX_ID, |
|---|
| 84 | + }, |
|---|
| 85 | + { |
|---|
| 86 | + .compatible = "st,lsm9ds1-imu", |
|---|
| 87 | + .data = (void *)ST_LSM9DS1_ID, |
|---|
| 88 | + }, |
|---|
| 89 | + { |
|---|
| 90 | + .compatible = "st,lsm6ds0", |
|---|
| 91 | + .data = (void *)ST_LSM6DS0_ID, |
|---|
| 92 | + }, |
|---|
| 93 | + { |
|---|
| 94 | + .compatible = "st,lsm6dsrx", |
|---|
| 95 | + .data = (void *)ST_LSM6DSRX_ID, |
|---|
| 96 | + }, |
|---|
| 64 | 97 | {}, |
|---|
| 65 | 98 | }; |
|---|
| 66 | 99 | MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match); |
|---|
| .. | .. |
|---|
| 71 | 104 | { ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID }, |
|---|
| 72 | 105 | { ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID }, |
|---|
| 73 | 106 | { ST_ISM330DLC_DEV_NAME, ST_ISM330DLC_ID }, |
|---|
| 107 | + { ST_LSM6DSO_DEV_NAME, ST_LSM6DSO_ID }, |
|---|
| 108 | + { ST_ASM330LHH_DEV_NAME, ST_ASM330LHH_ID }, |
|---|
| 109 | + { ST_LSM6DSOX_DEV_NAME, ST_LSM6DSOX_ID }, |
|---|
| 110 | + { ST_LSM6DSR_DEV_NAME, ST_LSM6DSR_ID }, |
|---|
| 111 | + { ST_LSM6DS3TRC_DEV_NAME, ST_LSM6DS3TRC_ID }, |
|---|
| 112 | + { ST_ISM330DHCX_DEV_NAME, ST_ISM330DHCX_ID }, |
|---|
| 113 | + { ST_LSM9DS1_DEV_NAME, ST_LSM9DS1_ID }, |
|---|
| 114 | + { ST_LSM6DS0_DEV_NAME, ST_LSM6DS0_ID }, |
|---|
| 115 | + { ST_LSM6DSRX_DEV_NAME, ST_LSM6DSRX_ID }, |
|---|
| 74 | 116 | {}, |
|---|
| 75 | 117 | }; |
|---|
| 76 | 118 | MODULE_DEVICE_TABLE(spi, st_lsm6dsx_spi_id_table); |
|---|
| .. | .. |
|---|
| 79 | 121 | .driver = { |
|---|
| 80 | 122 | .name = "st_lsm6dsx_spi", |
|---|
| 81 | 123 | .pm = &st_lsm6dsx_pm_ops, |
|---|
| 82 | | - .of_match_table = of_match_ptr(st_lsm6dsx_spi_of_match), |
|---|
| 124 | + .of_match_table = st_lsm6dsx_spi_of_match, |
|---|
| 83 | 125 | }, |
|---|
| 84 | 126 | .probe = st_lsm6dsx_spi_probe, |
|---|
| 85 | 127 | .id_table = st_lsm6dsx_spi_id_table, |
|---|