Linux IIO development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Gabriel Braga Lagrotaria <gabrielblo@ime.usp.br>
Cc: andy@kernel.org, dlechner@baylibre.com,
	javier.carrasco.cruz@gmail.com, jic23@kernel.org,
	nuno.sa@analog.com, ricardo.kojo@ime.usp.br,
	elliancarlos@gmail.com, linux-iio@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iio: light: veml6030: Generalize hw_init for veml6030 and veml6035
Date: Mon, 4 May 2026 17:14:56 +0300	[thread overview]
Message-ID: <afip4G46Bkj4iEka@ashevche-desk.local> (raw)
In-Reply-To: <20260502234348.131563-3-gabrielblo@ime.usp.br>

On Sat, May 02, 2026 at 08:41:04PM -0300, Gabriel Braga Lagrotaria wrote:
> Modify veml6030_hw_init() function to deduplicate the setup logic
> for veml6030_hw_init() and veml6035_hw_init(), and remove
> veml6035_hw_init().
> 
> Additionally, introduce struct veml6030_hw_init_config_desc to store and
> pass the custom configuration values specific to each device variation.

...

> @@ -963,61 +972,21 @@ static int veml6030_regfield_init(struct iio_dev *indio_dev)
>  	return 0;
>  }
>  
> +

I can argue that this is a stray change, but I'm not objecting to having it.

>  /*
>   * Set ALS gain to 1/8, integration time to 100 ms, PSM to mode 2,
>   * persistence to 1 x integration time and the threshold
>   * interrupt disabled by default. First shutdown the sensor,
>   * update registers and then power on the sensor.
>   */

...

> +static const struct veml6030_hw_init_config_desc veml6030_hw_init_config = {
> +	.gain_sel = veml6030_gain_sel,
> +	.gain_sel_size = ARRAY_SIZE(veml6030_gain_sel),
> +	.gain_max_scale_int = 2,
> +	.gain_max_scale_nano = 150400000,
> +	.reg_als_conf_value = 0x1001,
> +};
>  
> -	return ret;
> -}
>  

Now here are two blank lines? One is enough.

...

> @@ -1074,9 +1051,11 @@ static int veml6035_hw_init(struct iio_dev *indio_dev, struct device *dev)
>  		return dev_err_probe(dev, ret,
>  				     "can't clear als interrupt status\n");
>  
> -	return 0;
> +	return ret;
>  }
>  
> +
> +

Ditto.

>  static int veml6030_probe(struct i2c_client *client)
>  {
>  	int ret;
> @@ -1167,6 +1146,7 @@ static int veml6030_runtime_resume(struct device *dev)
>  static DEFINE_RUNTIME_DEV_PM_OPS(veml6030_pm_ops, veml6030_runtime_suspend,
>  				 veml6030_runtime_resume, NULL);
>  
> +

Stray change.

>  static const struct veml6030_chip_desc veml6030_chip = {
>  	.name = "veml6030",
>  	.channels = veml6030_channels,

-- 
With Best Regards,
Andy Shevchenko



  parent reply	other threads:[~2026-05-04 14:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-02 23:41 [PATCH v2 0/2] iio: light: veml6030: Generalize hw_init and cleanup naming Gabriel Braga Lagrotaria
2026-05-02 23:41 ` [PATCH v2 1/2] iio: light: veml6030: Remove 'x' wildcard usages in file Gabriel Braga Lagrotaria
2026-05-03  9:23   ` Joshua Crofts
2026-05-02 23:41 ` [PATCH v2 2/2] iio: light: veml6030: Generalize hw_init for veml6030 and veml6035 Gabriel Braga Lagrotaria
2026-05-03  0:02   ` Maxwell Doose
2026-05-04 14:14   ` Andy Shevchenko [this message]
2026-05-04 16:28     ` Jonathan Cameron
2026-05-04 16:35   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afip4G46Bkj4iEka@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=elliancarlos@gmail.com \
    --cc=gabrielblo@ime.usp.br \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=ricardo.kojo@ime.usp.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox