]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: mpl3115: rename CTRL_REG1 field macros
authorAntoni Pokusinski <apokusinski01@gmail.com>
Thu, 2 Oct 2025 20:02:04 +0000 (22:02 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Oct 2025 10:59:16 +0000 (11:59 +0100)
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>
drivers/iio/pressure/mpl3115.c

index 1da78081ca7eb4f3732f020de5d59194e8f81324..61830edd959b7002d4f5b4d9f7b609fa8f610f69 100644 (file)
 #define MPL3115_STATUS_PRESS_RDY BIT(2)
 #define MPL3115_STATUS_TEMP_RDY BIT(1)
 
-#define MPL3115_CTRL_RESET BIT(2) /* software reset */
-#define MPL3115_CTRL_OST BIT(1) /* initiate measurement */
-#define MPL3115_CTRL_ACTIVE BIT(0) /* continuous measurement */
-#define MPL3115_CTRL_OS_258MS (BIT(5) | BIT(4)) /* 64x oversampling */
+#define MPL3115_CTRL1_RESET BIT(2) /* software reset */
+#define MPL3115_CTRL1_OST BIT(1) /* initiate measurement */
+#define MPL3115_CTRL1_ACTIVE BIT(0) /* continuous measurement */
+#define MPL3115_CTRL1_OS_258MS GENMASK(5, 4) /* 64x oversampling */
 
 struct mpl3115_data {
        struct i2c_client *client;
@@ -47,7 +47,7 @@ static int mpl3115_request(struct mpl3115_data *data)
 
        /* trigger measurement */
        ret = i2c_smbus_write_byte_data(data->client, MPL3115_CTRL_REG1,
-               data->ctrl_reg1 | MPL3115_CTRL_OST);
+               data->ctrl_reg1 | MPL3115_CTRL1_OST);
        if (ret < 0)
                return ret;
 
@@ -56,7 +56,7 @@ static int mpl3115_request(struct mpl3115_data *data)
                if (ret < 0)
                        return ret;
                /* wait for data ready, i.e. OST cleared */
-               if (!(ret & MPL3115_CTRL_OST))
+               if (!(ret & MPL3115_CTRL1_OST))
                        break;
                msleep(20);
        }
@@ -268,10 +268,10 @@ static int mpl3115_probe(struct i2c_client *client)
 
        /* software reset, I2C transfer is aborted (fails) */
        i2c_smbus_write_byte_data(client, MPL3115_CTRL_REG1,
-               MPL3115_CTRL_RESET);
+               MPL3115_CTRL1_RESET);
        msleep(50);
 
-       data->ctrl_reg1 = MPL3115_CTRL_OS_258MS;
+       data->ctrl_reg1 = MPL3115_CTRL1_OS_258MS;
        ret = i2c_smbus_write_byte_data(client, MPL3115_CTRL_REG1,
                data->ctrl_reg1);
        if (ret < 0)
@@ -295,7 +295,7 @@ buffer_cleanup:
 static int mpl3115_standby(struct mpl3115_data *data)
 {
        return i2c_smbus_write_byte_data(data->client, MPL3115_CTRL_REG1,
-               data->ctrl_reg1 & ~MPL3115_CTRL_ACTIVE);
+               data->ctrl_reg1 & ~MPL3115_CTRL1_ACTIVE);
 }
 
 static void mpl3115_remove(struct i2c_client *client)