mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Ruslan Koreev <koreev.r@gmail.com>
Cc: benjamin.mugnier@foss.st.com, sylvain.petinot@foss.st.com,
	dan.scally@ideasonboard.com, mchehab@kernel.org,
	hansg@kernel.org, ilpo.jarvinen@linux.intel.com,
	gregkh@linuxfoundation.org, linux-media@vger.kernel.org,
	platform-driver-x86@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Peter Marshall <pm@petermarshall.ca>
Subject: Re: [PATCH 3/4] media: i2c: vd55g1: Add ACPI support for the Lenovo TBE20A1 HID
Date: Fri, 25 Sep 2026 11:50:16 +0300	[thread overview]
Message-ID: <arY1yBWSAD-6IkQD@kekkonen.localdomain> (raw)
In-Reply-To: <20260924171820.1179823-4-koreev.r@gmail.com>

Hi Ruslan,

Thanks for the set.

On Thu, Sep 24, 2026 at 08:18:19PM +0300, Ruslan Koreev wrote:
> The IR camera of the Lenovo ThinkPad X1 Carbon Gen 14 is an ST VD55G1
> enumerated by ACPI as TBE20A1, connected to the Intel IPU7 with one
> CSI-2 lane and powered through an INT3472 discrete device. Match the
> HID and take the sensor version from the match data, as for OF. Only
> the analog supply is switchable on this platform; vcore and vddio are
> always on and fall back to dummy regulators.
> 
> On these platforms the CSI-2 endpoint is a software node that
> ipu-bridge attaches to the sensor device when the IPU driver probes,
> which can happen after the sensor driver has been bound. Defer probing
> instead of failing when there is no endpoint yet, as the other sensor
> drivers used with the IPU bridge do and as v4l2_fwnode_endpoint_parse()
> itself does for a missing endpoint.
> 
> Tested on a ThinkPad X1 Carbon Gen 14 (Core Ultra X7 358H, IPU7),
> streaming 804x704 through libcamera.

Please describe here what the patch does; most of the above goes to the
cover letter.

I'd split the endpoint handling changes into a separate patch, too.

> 
> Signed-off-by: Ruslan Koreev <koreev.r@gmail.com>
> ---
>  drivers/media/i2c/vd55g1.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
> index 6f458f611..64889c35d 100644
> --- a/drivers/media/i2c/vd55g1.c
> +++ b/drivers/media/i2c/vd55g1.c
> @@ -1903,10 +1903,9 @@ static int vd55g1_parse_dt(struct vd55g1 *sensor)
>  
>  	endpoint = fwnode_graph_get_endpoint_by_id(dev_fwnode(sensor->dev),
>  						   0, 0, 0);
> -	if (!endpoint) {
> -		dev_err(sensor->dev, "Endpoint node not found\n");
> -		return -EINVAL;
> -	}
> +	if (!endpoint)
> +		return dev_err_probe(sensor->dev, -EPROBE_DEFER,
> +				     "waiting for fwnode graph endpoint\n");

I'd drop the check here and return v4l2_fwnode_endpoint_alloc_parse()'s
return value in vd55g1_check_csi_conf(). Then -EPROBE_DEFER is returned
when appropriate.

>  
>  	ret = vd55g1_check_csi_conf(sensor, endpoint);
>  	fwnode_handle_put(endpoint);
> @@ -2084,6 +2083,13 @@ static const struct of_device_id vd55g1_dt_ids[] = {
>  };
>  MODULE_DEVICE_TABLE(of, vd55g1_dt_ids);
>  
> +static const struct acpi_device_id vd55g1_acpi_ids[] = {
> +	/* Lenovo ThinkPad X1 Carbon Gen 14 IR camera, Intel IPU7 */

No need for such a comment here, I think it's enough it's documented in the
IPU bridge.

> +	{ "TBE20A1", (kernel_ulong_t)&vd55g1_versions[0] },
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(acpi, vd55g1_acpi_ids);
> +
>  static const struct dev_pm_ops vd55g1_pm_ops = {
>  	SET_RUNTIME_PM_OPS(vd55g1_power_off, vd55g1_power_on, NULL)
>  };
> @@ -2092,6 +2098,7 @@ static struct i2c_driver vd55g1_i2c_driver = {
>  	.driver = {
>  		.name  = "vd55g1",
>  		.of_match_table = vd55g1_dt_ids,
> +		.acpi_match_table = vd55g1_acpi_ids,
>  		.pm = &vd55g1_pm_ops,
>  	},
>  	.probe = vd55g1_probe,

-- 
Kind regrds,

Sakari Ailus

  reply	other threads:[~2026-09-25  8:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 17:18 [PATCH 0/4] Lenovo ThinkPad X1 Carbon Gen 14 IR camera: ST VD55G1 on Intel IPU7 Ruslan Koreev
2026-09-24 17:18 ` [PATCH 1/4] platform/x86: int3472: Map the VD55G1 power enable GPIO to "vana" Ruslan Koreev
2026-09-24 17:18 ` [PATCH 2/4] media: ipu-bridge: Add the ST VD55G1 (TBE20A1) Ruslan Koreev
2026-09-24 17:18 ` [PATCH 3/4] media: i2c: vd55g1: Add ACPI support for the Lenovo TBE20A1 HID Ruslan Koreev
2026-09-25  8:50   ` Sakari Ailus [this message]
2026-09-24 17:18 ` [PATCH 4/4] media: staging/ipu7: Add monochrome pixel formats Ruslan Koreev
2026-09-25  8:51   ` Sakari Ailus

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=arY1yBWSAD-6IkQD@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=benjamin.mugnier@foss.st.com \
    --cc=dan.scally@ideasonboard.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=koreev.r@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=pm@petermarshall.ca \
    --cc=sylvain.petinot@foss.st.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

all inboxes | Powered by JetHome®