Commit 705dc617 authored by Martin Kepplinger's avatar Martin Kepplinger Committed by Angus Ainslie (Purism)

Revert "iio: imu: st_lsm6sdx: move some register definitions to sensor_settings struct"

This reverts commit 4f371197.

It'll be added from the upstream iio testing branch.
parent 33235caf
......@@ -196,9 +196,6 @@ struct st_lsm6dsx_ext_dev_settings {
/**
* struct st_lsm6dsx_settings - ST IMU sensor settings
* @wai: Sensor WhoAmI default value.
* @reg_int1_addr: Control Register address for INT1
* @reg_int2_addr: Control Register address for INT2
* @reg_reset_addr: register address for reset/reboot
* @max_fifo_size: Sensor max fifo length in FIFO words.
* @id: List of hw id/device name supported by the driver configuration.
* @decimator: List of decimator register info (addr + mask).
......@@ -209,9 +206,6 @@ struct st_lsm6dsx_ext_dev_settings {
*/
struct st_lsm6dsx_settings {
u8 wai;
u8 reg_int1_addr;
u8 reg_int2_addr;
u8 reg_reset_addr;
u16 max_fifo_size;
struct {
enum st_lsm6dsx_hw_id hw_id;
......
......@@ -49,12 +49,17 @@
#include "st_lsm6dsx.h"
#define ST_LSM6DSX_REG_INT1_ADDR 0x0d
#define ST_LSM6DSX_REG_INT2_ADDR 0x0e
#define ST_LSM6DSX_REG_FIFO_FTH_IRQ_MASK BIT(3)
#define ST_LSM6DSX_REG_WHOAMI_ADDR 0x0f
#define ST_LSM6DSX_REG_RESET_ADDR 0x12
#define ST_LSM6DSX_REG_RESET_MASK BIT(0)
#define ST_LSM6DSX_REG_BOOT_MASK BIT(7)
#define ST_LSM6DSX_REG_BDU_ADDR 0x12
#define ST_LSM6DSX_REG_BDU_MASK BIT(6)
#define ST_LSM6DSX_REG_INT2_ON_INT1_ADDR 0x13
#define ST_LSM6DSX_REG_INT2_ON_INT1_MASK BIT(5)
#define ST_LSM6DSX_REG_ACC_OUT_X_L_ADDR 0x28
#define ST_LSM6DSX_REG_ACC_OUT_Y_L_ADDR 0x2a
......@@ -117,9 +122,6 @@ static const struct st_lsm6dsx_fs_table_entry st_lsm6dsx_fs_table[] = {
static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
{
.wai = 0x69,
.reg_int1_addr = 0x0d,
.reg_int2_addr = 0x0e,
.reg_reset_addr = 0x12,
.max_fifo_size = 1365,
.id = {
{
......@@ -170,9 +172,6 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
},
{
.wai = 0x69,
.reg_int1_addr = 0x0d,
.reg_int2_addr = 0x0e,
.reg_reset_addr = 0x12,
.max_fifo_size = 682,
.id = {
{
......@@ -223,9 +222,6 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
},
{
.wai = 0x6a,
.reg_int1_addr = 0x0d,
.reg_int2_addr = 0x0e,
.reg_reset_addr = 0x12,
.max_fifo_size = 682,
.id = {
{
......@@ -282,9 +278,6 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
},
{
.wai = 0x6c,
.reg_int1_addr = 0x0d,
.reg_int2_addr = 0x0e,
.reg_reset_addr = 0x12,
.max_fifo_size = 512,
.id = {
{
......@@ -356,9 +349,6 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
},
{
.wai = 0x6b,
.reg_int1_addr = 0x0d,
.reg_int2_addr = 0x0e,
.reg_reset_addr = 0x12,
.max_fifo_size = 512,
.id = {
{
......@@ -401,9 +391,6 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
},
{
.wai = 0x6b,
.reg_int1_addr = 0x0d,
.reg_int2_addr = 0x0e,
.reg_reset_addr = 0x12,
.max_fifo_size = 512,
.id = {
{
......@@ -886,10 +873,10 @@ static int st_lsm6dsx_get_drdy_reg(struct st_lsm6dsx_hw *hw, u8 *drdy_reg)
switch (drdy_pin) {
case 1:
*drdy_reg = hw->settings->reg_int1_addr;
*drdy_reg = ST_LSM6DSX_REG_INT1_ADDR;
break;
case 2:
*drdy_reg = hw->settings->reg_int2_addr;
*drdy_reg = ST_LSM6DSX_REG_INT2_ADDR;
break;
default:
dev_err(hw->dev, "unsupported data ready pin\n");
......@@ -989,7 +976,7 @@ static int st_lsm6dsx_init_device(struct st_lsm6dsx_hw *hw)
int err;
/* device sw reset */
err = regmap_update_bits(hw->regmap, hw->settings->reg_reset_addr,
err = regmap_update_bits(hw->regmap, ST_LSM6DSX_REG_RESET_ADDR,
ST_LSM6DSX_REG_RESET_MASK,
FIELD_PREP(ST_LSM6DSX_REG_RESET_MASK, 1));
if (err < 0)
......@@ -998,7 +985,7 @@ static int st_lsm6dsx_init_device(struct st_lsm6dsx_hw *hw)
msleep(50);
/* reload trimming parameter */
err = regmap_update_bits(hw->regmap, hw->settings->reg_reset_addr,
err = regmap_update_bits(hw->regmap, ST_LSM6DSX_REG_RESET_ADDR,
ST_LSM6DSX_REG_BOOT_MASK,
FIELD_PREP(ST_LSM6DSX_REG_BOOT_MASK, 1));
if (err < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment