Re: [PATCH v5 04/10] iio: dac: mcp47feb02: Increase EEPROM Programming Write Cycle Time

From: Andy Shevchenko

Date: Thu Sep 10 2026 - 02:14:45 EST


On Wed, Sep 09, 2026 at 05:18:47PM +0300, Ariana Lazar wrote:
> Increase the EEPROM write polling timeout to prevent -ETIMEDOUT errors and
> incomplete nonvolatile write cycle, according to the time specified in the
> datasheets (11-16 ms).

...

> ret = regmap_read_poll_timeout(data->regmap, MCP47FEB02_GAIN_CTRL_STATUS_REG_ADDR,
> eewa_val,
> !(eewa_val & MCP47FEB02_GAIN_BIT_STATUS_EEWA_MASK),
> - USEC_PER_MSEC, USEC_PER_MSEC * 5);
> + USEC_PER_MSEC, USEC_PER_MSEC * 1500);

While at it, make it clearer with

1 * USEC_PER_MSEC, 1500 * USEC_PER_MSEC);

(note that some editors marks numeric constants with distinguishable colour).

> if (ret)
> return ret;

...

> ret = regmap_read_poll_timeout(data->regmap, MCP47FEB02_GAIN_CTRL_STATUS_REG_ADDR, eewa_val,
> !(eewa_val & MCP47FEB02_GAIN_BIT_STATUS_EEWA_MASK),
> - USEC_PER_MSEC, USEC_PER_MSEC * 5);
> + USEC_PER_MSEC, USEC_PER_MSEC * 1500);

Ditto.

> if (ret)
> return ret;

--
With Best Regards,
Andy Shevchenko