* [PATCH 0/1] iio: proximity: cleanup fixes for vl53l1x-i2c @ 2026-06-08 3:32 Siratul Islam 2026-06-08 3:32 ` [PATCH 1/1] " Siratul Islam 0 siblings, 1 reply; 5+ messages in thread From: Siratul Islam @ 2026-06-08 3:32 UTC (permalink / raw) To: jic23; +Cc: dlechner, nuno.sa, andy, linux-iio, linux-kernel, Siratul Islam This patch addresses the style changes suggested by Andy on the initial patch series introducing this driver. The changes include: - Sort register defines list - Extract vl53l1x_wait_data_ready() polling logic - Logically split regmap_read_poll_timeout() No functional changes. Link: https://lore.kernel.org/linux-iio/acUHDGUqg4RdI7fW@ashevche-desk.local/#t Siratul Islam (1): iio: proximity: cleanup fixes for vl53l1x-i2c drivers/iio/proximity/vl53l1x-i2c.c | 36 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 19 deletions(-) -- 2.54.0 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] iio: proximity: cleanup fixes for vl53l1x-i2c 2026-06-08 3:32 [PATCH 0/1] iio: proximity: cleanup fixes for vl53l1x-i2c Siratul Islam @ 2026-06-08 3:32 ` Siratul Islam 2026-06-08 11:39 ` Andy Shevchenko 0 siblings, 1 reply; 5+ messages in thread From: Siratul Islam @ 2026-06-08 3:32 UTC (permalink / raw) To: jic23 Cc: dlechner, nuno.sa, andy, linux-iio, linux-kernel, Siratul Islam, Andy Shevchenko - Sort register defines list - Extract vl53l1x_wait_data_ready() polling logic - Logically split regmap_read_poll_timeout() Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Siratul Islam <email@sirat.me> --- drivers/iio/proximity/vl53l1x-i2c.c | 36 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/drivers/iio/proximity/vl53l1x-i2c.c b/drivers/iio/proximity/vl53l1x-i2c.c index 4d9cb3983dba..ed83999cf735 100644 --- a/drivers/iio/proximity/vl53l1x-i2c.c +++ b/drivers/iio/proximity/vl53l1x-i2c.c @@ -43,6 +43,7 @@ #define VL53L1X_REG_SOFT_RESET 0x0000 #define VL53L1X_REG_VHV_CONFIG__TIMEOUT_MACROP_LOOP_BOUND 0x0008 #define VL53L1X_REG_VHV_CONFIG__INIT 0x000B +#define VL53L1X_REG_DEFAULT_CONFIG 0x002D #define VL53L1X_REG_GPIO_HV_MUX__CTRL 0x0030 #define VL53L1X_REG_GPIO__TIO_HV_STATUS 0x0031 #define VL53L1X_REG_SYSTEM__INTERRUPT_CONFIG_GPIO 0x0046 @@ -64,7 +65,6 @@ #define VL53L1X_REG_RESULT__OSC_CALIBRATE_VAL 0x00DE #define VL53L1X_REG_FIRMWARE__SYSTEM_STATUS 0x00E5 #define VL53L1X_REG_IDENTIFICATION__MODEL_ID 0x010F -#define VL53L1X_REG_DEFAULT_CONFIG 0x002D #define VL53L1X_MODEL_ID_VAL 0xEACC @@ -191,6 +191,17 @@ static int vl53l1x_stop_ranging(struct vl53l1x_data *data) VL53L1X_MODE_START_STOP); } +static int vl53l1x_wait_data_ready(struct vl53l1x_data *data) +{ + unsigned int val; + + /* 1ms poll, 1s timeout covers max timing budgets (per ST Ultra Lite Driver) */ + return regmap_read_poll_timeout(data->regmap, + VL53L1X_REG_GPIO__TIO_HV_STATUS, + val, (val & 1) != data->gpio_polarity, + 1 * USEC_PER_MSEC, 1 * USEC_PER_SEC); +} + /* * Default configuration blob from ST's VL53L1X Ultra Lite Driver * (STSW-IMG009). @@ -230,10 +241,9 @@ static int vl53l1x_chip_init(struct vl53l1x_data *data) } ret = regmap_read_poll_timeout(data->regmap, - VL53L1X_REG_FIRMWARE__SYSTEM_STATUS, val, - val & BIT(0), - 1 * USEC_PER_MSEC, - 100 * USEC_PER_MSEC); + VL53L1X_REG_FIRMWARE__SYSTEM_STATUS, + val, val & BIT(0), + 1 * USEC_PER_MSEC, 100 * USEC_PER_MSEC); if (ret) return dev_err_probe(dev, ret, "firmware boot timeout\n"); @@ -261,12 +271,7 @@ static int vl53l1x_chip_init(struct vl53l1x_data *data) if (ret) return ret; - /* 1ms poll, 1s timeout covers max timing budgets (per ST Ultra Lite Driver) */ - ret = regmap_read_poll_timeout(data->regmap, - VL53L1X_REG_GPIO__TIO_HV_STATUS, val, - (val & 1) != data->gpio_polarity, - 1 * USEC_PER_MSEC, - 1000 * USEC_PER_MSEC); + ret = vl53l1x_wait_data_ready(data); if (ret) return ret; @@ -461,14 +466,7 @@ static int vl53l1x_read_proximity(struct vl53l1x_data *data, int *val) if (!wait_for_completion_timeout(&data->completion, HZ)) return -ETIMEDOUT; } else { - unsigned int rdy; - - /* 1ms poll, 1s timeout covers max timing budgets (per ST Ultra Lite Driver) */ - ret = regmap_read_poll_timeout(data->regmap, - VL53L1X_REG_GPIO__TIO_HV_STATUS, rdy, - (rdy & 1) != data->gpio_polarity, - 1 * USEC_PER_MSEC, - 1000 * USEC_PER_MSEC); + ret = vl53l1x_wait_data_ready(data); if (ret) return ret; } -- 2.54.0 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] iio: proximity: cleanup fixes for vl53l1x-i2c 2026-06-08 3:32 ` [PATCH 1/1] " Siratul Islam @ 2026-06-08 11:39 ` Andy Shevchenko 2026-06-08 12:15 ` Sirat 0 siblings, 1 reply; 5+ messages in thread From: Andy Shevchenko @ 2026-06-08 11:39 UTC (permalink / raw) To: Siratul Islam; +Cc: jic23, dlechner, nuno.sa, andy, linux-iio, linux-kernel On Mon, Jun 08, 2026 at 09:32:06AM +0600, Siratul Islam wrote: > - Sort register defines list > - Extract vl53l1x_wait_data_ready() polling logic > - Logically split regmap_read_poll_timeout() You may want to rephrase the commit message as in the current form it feels like it has to be split to a few patches. In practice, it's basically one with small amendments in the code that may or may not be split depending on the Jonathan's preferences. Also, you don't need a cover letter for a single patch. The cover letter makes sense for the series and rarely for a single patch. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] iio: proximity: cleanup fixes for vl53l1x-i2c 2026-06-08 11:39 ` Andy Shevchenko @ 2026-06-08 12:15 ` Sirat 2026-06-08 17:39 ` Jonathan Cameron 0 siblings, 1 reply; 5+ messages in thread From: Sirat @ 2026-06-08 12:15 UTC (permalink / raw) To: Andy Shevchenko; +Cc: jic23, dlechner, nuno.sa, andy, linux-iio, linux-kernel On Mon, Jun 8, 2026 at 5:39 PM Andy Shevchenko <andriy.shevchenko@intel.com> wrote: > > On Mon, Jun 08, 2026 at 09:32:06AM +0600, Siratul Islam wrote: > > - Sort register defines list > > - Extract vl53l1x_wait_data_ready() polling logic > > - Logically split regmap_read_poll_timeout() > > You may want to rephrase the commit message as in the current form it feels > like it has to be split to a few patches. In practice, it's basically one with > small amendments in the code that may or may not be split depending on the > Jonathan's preferences. > I will rephrase the commit message to be simpler. It is very small change and I don't think it needs to be multiple commits. > > Also, you don't need a cover letter for a single patch. The cover letter makes > sense for the series and rarely for a single patch. > I will remember that. > > Thanks Sirat ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] iio: proximity: cleanup fixes for vl53l1x-i2c 2026-06-08 12:15 ` Sirat @ 2026-06-08 17:39 ` Jonathan Cameron 0 siblings, 0 replies; 5+ messages in thread From: Jonathan Cameron @ 2026-06-08 17:39 UTC (permalink / raw) To: Sirat; +Cc: Andy Shevchenko, dlechner, nuno.sa, andy, linux-iio, linux-kernel On Mon, 8 Jun 2026 18:15:17 +0600 Sirat <email@sirat.me> wrote: > On Mon, Jun 8, 2026 at 5:39 PM Andy Shevchenko > <andriy.shevchenko@intel.com> wrote: > > > > On Mon, Jun 08, 2026 at 09:32:06AM +0600, Siratul Islam wrote: > > > - Sort register defines list > > > - Extract vl53l1x_wait_data_ready() polling logic > > > - Logically split regmap_read_poll_timeout() > > > > You may want to rephrase the commit message as in the current form it feels > > like it has to be split to a few patches. In practice, it's basically one with > > small amendments in the code that may or may not be split depending on the > > Jonathan's preferences. > > > I will rephrase the commit message to be simpler. It is very small > change and I don't think it needs to be multiple commits. > > > > Also, you don't need a cover letter for a single patch. The cover letter makes > > sense for the series and rarely for a single patch. > > > I will remember that. > > > > > Thanks > Sirat Hi Sirat I'd suggest slowing down. Generally, even for a small patch wait a few days to allow for multiple reviews (and I'd have expressed my preference to split this up saving us both a little time) thanks, Jonathan ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-08 17:39 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-06-08 3:32 [PATCH 0/1] iio: proximity: cleanup fixes for vl53l1x-i2c Siratul Islam 2026-06-08 3:32 ` [PATCH 1/1] " Siratul Islam 2026-06-08 11:39 ` Andy Shevchenko 2026-06-08 12:15 ` Sirat 2026-06-08 17:39 ` Jonathan Cameron
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®