Re: [PATCH v8 6/9] iio: accel: mma8452: Add comment block for struct mma8452_data
From: Esben Haabendal
Date: Mon Sep 07 2026 - 12:32:29 EST
"Joshua Crofts" <joshua.crofts1@xxxxxxxxx> writes:
> On Mon, 07 Sep 2026 16:51:01 +0200
> Esben Haabendal <esben@xxxxxxxxxx> wrote:
>
>> The struct mma8452_data is central for this driver, and it makes sense to
>> have a description of the fields in it to make it easier to work with the
>> driver.
>>
>> Signed-off-by: Esben Haabendal <esben@xxxxxxxxxx>
>> ---
>> drivers/iio/accel/mma8452.c | 16 ++++++++++++++++
>> 1 file changed, 16 insertions(+)
>>
>> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
>> index c6af68d2a297..2c1b97b77bc1 100644
>> --- a/drivers/iio/accel/mma8452.c
>> +++ b/drivers/iio/accel/mma8452.c
>> @@ -104,6 +104,22 @@
>>
>> #define MMA8452_AUTO_SUSPEND_DELAY_MS 2000
>>
>> +/**
>> + * struct mma8452_data - IIO device private data structure
>> + * @client: the I2C client object
>> + * @lock: mutex for synchronziation of register
>> + * read-modify-write and holding chip in STANDBY
>> + * mode while writing to registers
>
> Perhaps add the word sequences after read-modify-write (that
> could be a personal preference though)?
Added for next version.
>> + * @orientation: mounting matrix, flipped axis etc
>
> Missing period in etc., but that's a small enough nit :)
Also added :)
>> + * @chip_info: chip specific data
>> + * @vdd_reg: reference to VDD regulator
>> + * @vddio_reg: reference to VDDIO regulator
>> + * @buffer: triggered buffer
>> + * @sleep_val: time in ms to sleep while waiting for drdy
>> + * @ctrl_reg1: CTRL_REG1 register shadow value
>> + * @data_cfg: DATA_CFG register shadow value
>> + * @open_drain: true for irq pin in open-drain mode
>> + */
>> struct mma8452_data {
>> struct i2c_client *client;
>> struct mutex lock;
>>
>
> Either way, with those added in a new version or fixed up
> by Jonathan,
>
> Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
Thanks.
/Esben