Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: mpl3115: rename CTRL_REG1 field macros

Rename the bitfield macros of CTRL_REG1, so that their names clearly
indicate their relation to CTRL_REG1.

This is a preparation for introducing the support for the DRDY interrupt
which requires the usage of other control registers.

Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Antoni Pokusinski and committed by
Jonathan Cameron
b4105b20 f692f0bf

+9 -9
+9 -9
drivers/iio/pressure/mpl3115.c
··· 30 30 #define MPL3115_STATUS_PRESS_RDY BIT(2) 31 31 #define MPL3115_STATUS_TEMP_RDY BIT(1) 32 32 33 - #define MPL3115_CTRL_RESET BIT(2) /* software reset */ 34 - #define MPL3115_CTRL_OST BIT(1) /* initiate measurement */ 35 - #define MPL3115_CTRL_ACTIVE BIT(0) /* continuous measurement */ 36 - #define MPL3115_CTRL_OS_258MS (BIT(5) | BIT(4)) /* 64x oversampling */ 33 + #define MPL3115_CTRL1_RESET BIT(2) /* software reset */ 34 + #define MPL3115_CTRL1_OST BIT(1) /* initiate measurement */ 35 + #define MPL3115_CTRL1_ACTIVE BIT(0) /* continuous measurement */ 36 + #define MPL3115_CTRL1_OS_258MS GENMASK(5, 4) /* 64x oversampling */ 37 37 38 38 struct mpl3115_data { 39 39 struct i2c_client *client; ··· 47 47 48 48 /* trigger measurement */ 49 49 ret = i2c_smbus_write_byte_data(data->client, MPL3115_CTRL_REG1, 50 - data->ctrl_reg1 | MPL3115_CTRL_OST); 50 + data->ctrl_reg1 | MPL3115_CTRL1_OST); 51 51 if (ret < 0) 52 52 return ret; 53 53 ··· 56 56 if (ret < 0) 57 57 return ret; 58 58 /* wait for data ready, i.e. OST cleared */ 59 - if (!(ret & MPL3115_CTRL_OST)) 59 + if (!(ret & MPL3115_CTRL1_OST)) 60 60 break; 61 61 msleep(20); 62 62 } ··· 268 268 269 269 /* software reset, I2C transfer is aborted (fails) */ 270 270 i2c_smbus_write_byte_data(client, MPL3115_CTRL_REG1, 271 - MPL3115_CTRL_RESET); 271 + MPL3115_CTRL1_RESET); 272 272 msleep(50); 273 273 274 - data->ctrl_reg1 = MPL3115_CTRL_OS_258MS; 274 + data->ctrl_reg1 = MPL3115_CTRL1_OS_258MS; 275 275 ret = i2c_smbus_write_byte_data(client, MPL3115_CTRL_REG1, 276 276 data->ctrl_reg1); 277 277 if (ret < 0) ··· 295 295 static int mpl3115_standby(struct mpl3115_data *data) 296 296 { 297 297 return i2c_smbus_write_byte_data(data->client, MPL3115_CTRL_REG1, 298 - data->ctrl_reg1 & ~MPL3115_CTRL_ACTIVE); 298 + data->ctrl_reg1 & ~MPL3115_CTRL1_ACTIVE); 299 299 } 300 300 301 301 static void mpl3115_remove(struct i2c_client *client)