linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Marek Vasut <marex@denx.de>, linux-iio@vger.kernel.org
Cc: Conor Dooley <conor+dt@kernel.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh@kernel.org>,
	Shreeya Patel <shreeya.patel@collabora.com>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] iio: light: ltrf216a: Add LTR-308 support
Date: Fri, 5 Jul 2024 11:40:27 +0200	[thread overview]
Message-ID: <b794ed7c-d3b2-4fcd-94fb-de499de89804@kernel.org> (raw)
In-Reply-To: <20240705091222.86916-2-marex@denx.de>

On 05/07/2024 11:11, Marek Vasut wrote:
> Add LiteOn LTR-308 support into LTR-F216A kernel driver.
> 
> The two devices seem to have almost identical register map, except that
> the LTR-308 does not have three CLEAR_DATA registers, which are unused
> by this driver. Furthermore, LTR-308 and LTR-F216A use different lux
> calculation constants, 0.6 and 0.45 respectively. Both differences are
> handled using chip info data.
> 
> https://optoelectronics.liteon.com/upload/download/DS86-2016-0027/LTR-308ALS_Final_%20DS_V1%201.pdf
> https://optoelectronics.liteon.com/upload/download/DS86-2019-0016/LTR-F216A_Final_DS_V1.4.PDF
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---

...

>  	mutex_init(&data->lock);
>  
> @@ -520,15 +537,27 @@ static int ltrf216a_runtime_resume(struct device *dev)
>  static DEFINE_RUNTIME_DEV_PM_OPS(ltrf216a_pm_ops, ltrf216a_runtime_suspend,
>  				 ltrf216a_runtime_resume, NULL);
>  
> +struct ltr_chip_info ltr308_chip_info = {

static const

> +	.has_clear_data		= false,
> +	.lux_multiplier		= 60,
> +};
> +
> +struct ltr_chip_info ltrf216a_chip_info = {

static const


> +	.has_clear_data		= true,
> +	.lux_multiplier		= 45,
> +};
> +
>  static const struct i2c_device_id ltrf216a_id[] = {
> -	{ "ltrf216a" },
> +	{ "ltr308", .driver_data = (kernel_ulong_t)&ltr308_chip_info },
> +	{ "ltrf216a", .driver_data = (kernel_ulong_t)&ltrf216a_chip_info },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(i2c, ltrf216a_id);
>  
>  static const struct of_device_id ltrf216a_of_match[] = {
> -	{ .compatible = "liteon,ltrf216a" },
> -	{ .compatible = "ltr,ltrf216a" },
> +	{ .compatible = "liteon,ltr308", .data = &ltr308_chip_info },
> +	{ .compatible = "liteon,ltrf216a", .data = &ltrf216a_chip_info },
> +	{ .compatible = "ltr,ltrf216a", .data = &ltrf216a_chip_info },

Drop this one. You cannot have undocumented compatibles - and checkpatch
tells you this - and we do not want to accept stuff just because someone
made something somewhere (e.g. ACPI, out of tree junk etc). There was
similar effort in the past and we made it clear.

Best regards,
Krzysztof


  reply	other threads:[~2024-07-05  9:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05  9:11 [PATCH 1/2] dt-bindings: iio: light: ltrf216a: Document LTR-308 support Marek Vasut
2024-07-05  9:11 ` [PATCH 2/2] iio: light: ltrf216a: Add " Marek Vasut
2024-07-05  9:40   ` Krzysztof Kozlowski [this message]
2024-07-05  9:47     ` Marek Vasut
2024-07-07 13:49   ` Jonathan Cameron
2024-07-08 11:41     ` Marek Vasut

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=b794ed7c-d3b2-4fcd-94fb-de499de89804@kernel.org \
    --to=krzk@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=robh@kernel.org \
    --cc=shreeya.patel@collabora.com \
    /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;
as well as URLs for NNTP newsgroup(s).