iio: accel: kx022a: Support KX134-1211
The ROHM KX134-1211 has very similar register interface as KX132-1211 does. The main differencies are the content of the "Who am I" identification register and different g-ranges. The KX132-1211 can measure ranges from +/- 2g to +/-16g where the KX134-1211 supports measuring ranges +/- 8g to +/- 64g. Support the ROHM KX134-1211. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://patch.msgid.link/6e95af6b425df6a5ff5218825ec8923f1341f7c3.1732783834.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>pull/1134/merge
parent
046b460d05
commit
0ecb42a16c
|
|
@ -38,6 +38,7 @@ static int kx022a_i2c_probe(struct i2c_client *i2c)
|
|||
static const struct i2c_device_id kx022a_i2c_id[] = {
|
||||
{ .name = "kx022a", .driver_data = (kernel_ulong_t)&kx022a_chip_info },
|
||||
{ .name = "kx132-1211", .driver_data = (kernel_ulong_t)&kx132_chip_info },
|
||||
{ .name = "kx134-1211", .driver_data = (kernel_ulong_t)&kx134_chip_info },
|
||||
{ .name = "kx132acr-lbz", .driver_data = (kernel_ulong_t)&kx132acr_chip_info },
|
||||
{ .name = "kx134acr-lbz", .driver_data = (kernel_ulong_t)&kx134acr_chip_info },
|
||||
{ }
|
||||
|
|
@ -47,6 +48,7 @@ MODULE_DEVICE_TABLE(i2c, kx022a_i2c_id);
|
|||
static const struct of_device_id kx022a_of_match[] = {
|
||||
{ .compatible = "kionix,kx022a", .data = &kx022a_chip_info },
|
||||
{ .compatible = "kionix,kx132-1211", .data = &kx132_chip_info },
|
||||
{ .compatible = "kionix,kx134-1211", .data = &kx134_chip_info },
|
||||
{ .compatible = "rohm,kx132acr-lbz", .data = &kx132acr_chip_info },
|
||||
{ .compatible = "rohm,kx134acr-lbz", .data = &kx134acr_chip_info },
|
||||
{ }
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ static int kx022a_spi_probe(struct spi_device *spi)
|
|||
static const struct spi_device_id kx022a_id[] = {
|
||||
{ .name = "kx022a", .driver_data = (kernel_ulong_t)&kx022a_chip_info },
|
||||
{ .name = "kx132-1211", .driver_data = (kernel_ulong_t)&kx132_chip_info },
|
||||
{ .name = "kx134-1211", .driver_data = (kernel_ulong_t)&kx134_chip_info },
|
||||
{ .name = "kx132acr-lbz", .driver_data = (kernel_ulong_t)&kx132acr_chip_info },
|
||||
{ .name = "kx134acr-lbz", .driver_data = (kernel_ulong_t)&kx134acr_chip_info },
|
||||
{ }
|
||||
|
|
@ -47,6 +48,7 @@ MODULE_DEVICE_TABLE(spi, kx022a_id);
|
|||
static const struct of_device_id kx022a_of_match[] = {
|
||||
{ .compatible = "kionix,kx022a", .data = &kx022a_chip_info },
|
||||
{ .compatible = "kionix,kx132-1211", .data = &kx132_chip_info },
|
||||
{ .compatible = "kionix,kx134-1211", .data = &kx134_chip_info },
|
||||
{ .compatible = "rohm,kx132acr-lbz", .data = &kx132acr_chip_info },
|
||||
{ .compatible = "rohm,kx134acr-lbz", .data = &kx134acr_chip_info },
|
||||
{ }
|
||||
|
|
|
|||
|
|
@ -1209,6 +1209,35 @@ const struct kx022a_chip_info kx132_chip_info = {
|
|||
};
|
||||
EXPORT_SYMBOL_NS_GPL(kx132_chip_info, "IIO_KX022A");
|
||||
|
||||
const struct kx022a_chip_info kx134_chip_info = {
|
||||
.name = "kx134-1211",
|
||||
.regmap_config = &kx132_regmap_config,
|
||||
.channels = kx132_channels,
|
||||
.num_channels = ARRAY_SIZE(kx132_channels),
|
||||
.scale_table = kx134acr_lbz_scale_table,
|
||||
.scale_table_size = ARRAY_SIZE(kx134acr_lbz_scale_table) *
|
||||
ARRAY_SIZE(kx134acr_lbz_scale_table[0]),
|
||||
.fifo_length = KX132_FIFO_LENGTH,
|
||||
.who = KX132_REG_WHO,
|
||||
.id = KX134_1211_ID,
|
||||
.cntl = KX132_REG_CNTL,
|
||||
.cntl2 = KX132_REG_CNTL2,
|
||||
.odcntl = KX132_REG_ODCNTL,
|
||||
.buf_cntl1 = KX132_REG_BUF_CNTL1,
|
||||
.buf_cntl2 = KX132_REG_BUF_CNTL2,
|
||||
.buf_clear = KX132_REG_BUF_CLEAR,
|
||||
.buf_status1 = KX132_REG_BUF_STATUS_1,
|
||||
.buf_smp_lvl_mask = KX132_MASK_BUF_SMP_LVL,
|
||||
.buf_read = KX132_REG_BUF_READ,
|
||||
.inc1 = KX132_REG_INC1,
|
||||
.inc4 = KX132_REG_INC4,
|
||||
.inc5 = KX132_REG_INC5,
|
||||
.inc6 = KX132_REG_INC6,
|
||||
.xout_l = KX132_REG_XOUT_L,
|
||||
.get_fifo_bytes_available = kx132_get_fifo_bytes_available,
|
||||
};
|
||||
EXPORT_SYMBOL_NS_GPL(kx134_chip_info, "IIO_KX022A");
|
||||
|
||||
/*
|
||||
* Despite the naming, KX132ACR-LBZ is not similar to KX132-1211 but it is
|
||||
* exact subset of KX022A. KX132ACR-LBZ is meant to be used for industrial
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@
|
|||
|
||||
#define KX132_REG_WHO 0x13
|
||||
#define KX132_ID 0x3d
|
||||
#define KX134_1211_ID 0x46
|
||||
|
||||
#define KX132_FIFO_LENGTH 86
|
||||
|
||||
|
|
@ -190,6 +191,7 @@ int kx022a_probe_internal(struct device *dev, const struct kx022a_chip_info *chi
|
|||
|
||||
extern const struct kx022a_chip_info kx022a_chip_info;
|
||||
extern const struct kx022a_chip_info kx132_chip_info;
|
||||
extern const struct kx022a_chip_info kx134_chip_info;
|
||||
extern const struct kx022a_chip_info kx132acr_chip_info;
|
||||
extern const struct kx022a_chip_info kx134acr_chip_info;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue