Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Gwendal Grignou <gwendal@chromium.org>
Cc: swboyd@chromium.org, linux-iio@vger.kernel.org
Subject: Re: [PATCH v2] iio: proximity: sx_common: Add old register mapping
Date: Fri, 23 Dec 2022 15:40:17 +0000	[thread overview]
Message-ID: <20221223154017.20f25396@jic23-huawei> (raw)
In-Reply-To: <20221220193926.126366-1-gwendal@chromium.org>

On Tue, 20 Dec 2022 11:39:26 -0800
Gwendal Grignou <gwendal@chromium.org> wrote:

> Older firmwares still send sensor configuration using a list of
> registers with opaque values defined during sensor tuning.
> sx9234 and sx9360 sensor on ACPI based devices are concerned.
> More schema to configure the sensors will be needed to support devices
> designed for windows, like Samsung Galaxy Book2.
> 
> Support schema is: "<_HID>.<register_name>". For instance
> "STH9324,reg_adv_ctrl2" in:
> 
>     Scope (\_SB.PCI0.I2C2)
>     {
>         Device (SX28)
>         {
>             Name (_HID, "STH9324")  // _HID: Hardware ID
> ...
>             Name (_DSD, Package (0x02)  // _DSD: Device-Specific Data
>             {
>                 ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301") /*
> Device Properties for _DSD */,
>                 Package (0x3F)
>                 {
> ...
>                     Package (0x02)
>                     {
>                         "STH9324,reg_adv_ctrl2",
>                         Zero
>                     },`
> 
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
LGTM with one exception. See below.  I can fix that whilst applying, but
would like to leave time for Stephen to take a look anyway.

...

>  
> @@ -101,6 +105,7 @@ struct sx_common_chip_info {
>   * @client:		I2C client structure.
>   * @trig:		IIO trigger object.
>   * @regmap:		Register map.
> + * @acpi_id: ACPI device entry when the device is using APCI, NULL otherwise.

The lack of num_default_regs below made me suspicious enough to open the code.
This is the wrong documentation block.

>   * @num_default_regs:	Number of default registers to set at init.
>   * @supplies:		Power supplies object.
>   * @chan_prox_stat:	Last reading of the proximity status for each channel.
> @@ -119,6 +124,7 @@ struct sx_common_data {
>  	struct i2c_client *client;
>  	struct iio_trigger *trig;
>  	struct regmap *regmap;
> +	const struct acpi_device_id *acpi_id;
>  
>  	struct regulator_bulk_data supplies[2];
>  	unsigned long chan_prox_stat;
> @@ -151,6 +157,10 @@ int sx_common_probe(struct i2c_client *client,
>  		    const struct sx_common_chip_info *chip_info,
>  		    const struct regmap_config *regmap_config);
>  
> +void sx_common_get_raw_register_config(struct device *dev,
> +				       const struct acpi_device_id *id,
> +				       struct sx_common_reg_default *reg_def);
> +
>  /* 3 is the number of events defined by a single phase. */
>  extern const struct iio_event_spec sx_common_events[3];
>  


  reply	other threads:[~2022-12-23 15:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20 19:39 [PATCH v2] iio: proximity: sx_common: Add old register mapping Gwendal Grignou
2022-12-23 15:40 ` Jonathan Cameron [this message]
2023-01-14 17:24   ` Jonathan Cameron
2023-01-11 18:45 ` Stephen Boyd
2023-01-15 18:24 ` andy.shevchenko
2023-01-16 17:33   ` 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=20221223154017.20f25396@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=gwendal@chromium.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=swboyd@chromium.org \
    /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