Commit 1506f3cd authored by Hartmut Knaack's avatar Hartmut Knaack Committed by Jonathan Cameron

iio:magnetometer:bmc150_magn: use descriptive name for mask

Define and use a descriptive name for the repetition registers data mask,
instead of a 'magic' value.
Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
Acked-by: default avatarIrina Tirdea <irina.tirdea@intel.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 3021678a
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
#define BMC150_MAGN_REG_HIGH_THRESH 0x50 #define BMC150_MAGN_REG_HIGH_THRESH 0x50
#define BMC150_MAGN_REG_REP_XY 0x51 #define BMC150_MAGN_REG_REP_XY 0x51
#define BMC150_MAGN_REG_REP_Z 0x52 #define BMC150_MAGN_REG_REP_Z 0x52
#define BMC150_MAGN_REG_REP_DATAMASK GENMASK(7, 0)
#define BMC150_MAGN_REG_TRIM_START 0x5D #define BMC150_MAGN_REG_TRIM_START 0x5D
#define BMC150_MAGN_REG_TRIM_END 0x71 #define BMC150_MAGN_REG_TRIM_END 0x71
...@@ -559,7 +560,7 @@ static int bmc150_magn_write_raw(struct iio_dev *indio_dev, ...@@ -559,7 +560,7 @@ static int bmc150_magn_write_raw(struct iio_dev *indio_dev,
} }
ret = regmap_update_bits(data->regmap, ret = regmap_update_bits(data->regmap,
BMC150_MAGN_REG_REP_XY, BMC150_MAGN_REG_REP_XY,
0xFF, BMC150_MAGN_REG_REP_DATAMASK,
BMC150_MAGN_REPXY_TO_REGVAL BMC150_MAGN_REPXY_TO_REGVAL
(val)); (val));
mutex_unlock(&data->mutex); mutex_unlock(&data->mutex);
...@@ -575,7 +576,7 @@ static int bmc150_magn_write_raw(struct iio_dev *indio_dev, ...@@ -575,7 +576,7 @@ static int bmc150_magn_write_raw(struct iio_dev *indio_dev,
} }
ret = regmap_update_bits(data->regmap, ret = regmap_update_bits(data->regmap,
BMC150_MAGN_REG_REP_Z, BMC150_MAGN_REG_REP_Z,
0xFF, BMC150_MAGN_REG_REP_DATAMASK,
BMC150_MAGN_REPZ_TO_REGVAL BMC150_MAGN_REPZ_TO_REGVAL
(val)); (val));
mutex_unlock(&data->mutex); mutex_unlock(&data->mutex);
......
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