Re: [PATCH v5 3/5] iio: adc: versal-sysmon: add I2C driver

From: Andy Shevchenko

Date: Tue Jun 09 2026 - 13:39:23 EST


On Mon, Jun 08, 2026 at 07:37:59PM +0100, Salih Erim wrote:
> Add an I2C transport driver for the Versal SysMon block. The SysMon
> provides an I2C slave interface that allows an external master to
> read voltage and temperature measurements through the same register
> map used by the MMIO path.
>
> The I2C command frame is an 8-byte structure containing a 4-byte data
> payload, a 2-byte register offset, and a 1-byte instruction field.
> Read operations send the frame with a read instruction, then receive
> a 4-byte response containing the register value.
>
> Events are not supported on the I2C path because there is no
> interrupt line and the I2C regmap backend cannot be called from
> atomic context.

...

> +#include <linux/bits.h>
> +#include <linux/err.h>
> +#include <linux/i2c.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/module.h>
> +#include <linux/regmap.h>

+ types.h // uXX

> +#include <linux/unaligned.h>
> +
> +#include "versal-sysmon.h"

...

> +static int sysmon_i2c_probe(struct i2c_client *client)
> +{

struct device *dev = &client->dev;

> + struct regmap *regmap;
> +
> + regmap = devm_regmap_init(&client->dev, NULL, client,
> + &sysmon_i2c_regmap_config);

regmap = devm_regmap_init(dev, NULL, client, &sysmon_i2c_regmap_config);

(exactly 80 characters, so inside the limit).

> + if (IS_ERR(regmap))
> + return PTR_ERR(regmap);
> +
> + /* I2C has no IRQ connection; events are not supported */
> + return sysmon_core_probe(&client->dev, regmap);
> +}

--
With Best Regards,
Andy Shevchenko