[PATCH v9 6/6] iio: magnetometer: Add mmc5633 sensor

Andy Shevchenko andriy.shevchenko at intel.com
Mon Nov 3 00:13:58 PST 2025


On Fri, Oct 31, 2025 at 12:39:18PM -0400, Frank Li wrote:
> Add mmc5633 sensor basic support.
> - Support read 20 bits X/Y/Z magnetic.
> - Support I3C HDR mode to send start measurememt command.
> - Support I3C HDR mode to read all sensors data by one command.

...

> - 1 -> ARRAY_SIZE()

Maybe I missed the answer, but why are the arrays to begin with?

...

> +#define MMC5633_REG_YOUT_H	0x03
> +#define MMC5633_REG_ZOUT_L	0x04
> +#define MMC5633_REG_ZOUT_H	0x05
> +#define MMC5633_REG_XOUT_2	0x06
> +#define MMC5633_REG_YOUT_2	0x07
> +#define MMC5633_REG_ZOUT_2	0x08
> +#define MMC5633_REG_TOUT	0x09

Are those _L, _H, _2 come from the datasheet?

...

> +struct mmc5633_data {
> +	struct i3c_device *i3cdev;
> +	struct mutex mutex; /* protect to finish one whole measurement */
> +	struct regmap *regmap;

Btw, have you experimented to shuffle this to put regmap to be the first
member, for example? Does it affect the binary (compiled object) size?

> +};

...

> +	regmap = devm_regmap_init_i2c(client, &mmc5633_regmap_config);
> +	if (IS_ERR(regmap))
> +		return dev_err_probe(dev, PTR_ERR(regmap), "regmap init failed");

Missing trailing \n. Please, double check all messages for this.

...

> +	ret = regmap_attach_dev(dev, regmap, &mmc5633_regmap_config);
> +	if (ret)
> +		return ret;

Why?

...

> +	ret = regmap_attach_dev(dev, regmap, &mmc5633_regmap_config);
> +	if (ret)
> +		return ret;


Ditto.

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-i3c mailing list