All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Nirujogi, Pratap" <pnirujog@amd.com>
Cc: Pratap Nirujogi <pratap.nirujogi@amd.com>,
	mchehab@kernel.org, sakari.ailus@linux.intel.com,
	hverkuil@xs4all.nl, bryan.odonoghue@linaro.org, krzk@kernel.org,
	dave.stevenson@raspberrypi.com, hdegoede@redhat.com,
	jai.luthra@ideasonboard.com, tomi.valkeinen@ideasonboard.com,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	benjamin.chan@amd.com, bin.du@amd.com, grosikop@amd.com,
	king.li@amd.com, dantony@amd.com, vengutta@amd.com,
	Svetoslav.Stoilov@amd.com, Yana.Zheleva@amd.com,
	Mehdi Djait <mehdi.djait@linux.intel.com>
Subject: Re: [PATCH v3 RESEND] media: i2c: Add OV05C10 camera sensor driver
Date: Tue, 24 Jun 2025 22:00:18 +0300	[thread overview]
Message-ID: <20250624190018.GF20757@pendragon.ideasonboard.com> (raw)
In-Reply-To: <d2a1d937-9db2-46e4-bc73-f810a3e86f20@amd.com>

On Tue, Jun 24, 2025 at 02:49:36PM -0400, Nirujogi, Pratap wrote:
> On 6/23/2025 8:19 PM, Laurent Pinchart wrote:
> > On Mon, Jun 23, 2025 at 07:28:46PM -0400, Nirujogi, Pratap wrote:
> >> On 6/23/2025 6:05 PM, Laurent Pinchart wrote:
> >>> On Mon, Jun 23, 2025 at 05:51:48PM -0400, Nirujogi, Pratap wrote:
> >>>> On 6/16/2025 6:49 PM, Nirujogi, Pratap wrote:
> >>>>>>> +static int ov05c10_probe(struct i2c_client *client)
> >>>>>>> +{
> >>>>>>> +     struct ov05c10 *ov05c10;
> >>>>>>> +     u32 clkfreq;
> >>>>>>> +     int ret;
> >>>>>>> +
> >>>>>>> +     ov05c10 = devm_kzalloc(&client->dev, sizeof(*ov05c10),
> >>>>>>> GFP_KERNEL);
> >>>>>>> +     if (!ov05c10)
> >>>>>>> +             return -ENOMEM;
> >>>>>>> +
> >>>>>>> +     struct fwnode_handle *fwnode = dev_fwnode(&client->dev);
> >>>>>>> +
> >>>>>>> +     ret = fwnode_property_read_u32(fwnode, "clock-frequency",
> >>>>>>> &clkfreq);
> >>>>>>> +     if (ret)
> >>>>>>> +             return  dev_err_probe(&client->dev, -EINVAL,
> >>>>>>> +                                   "fail to get clock freq\n");
> >>>>>>
> >>>>>> Let's try to land
> >>>>>> https://lore.kernel.org/linux-media/20250521104115.176950-1-
> >>>>>> mehdi.djait@linux.intel.com/
> >>>>>> and replace the code above with devm_v4l2_sensor_clk_get().
> >>>>>>
> >>>>> Ok, we will verify on our side.
> >>>>
> >>>> We tried using devm_v4l2_sensor_clk_get() and found its required to add
> >>>> support for software_node to make it work with this driver.
> >>>
> >>> Why is that ?
> >>
> >> Its because the i2c_client device is initialized with swnode in the
> >> x86/platform driver.
> >>
> >> https://github.com/torvalds/linux/blob/master/drivers/platform/x86/amd/amd_isp4.c#L235
> > 
> > So there's no information provided in the _DSD for the sensor ?
> 
> yes, camera device was not properly described in the current model, we 
> are going to address this issue for future models following the MIPI 
> DisCo Imaging spec.

Any idea how far in the future that will be ? I suppose it won't be done
overnight, how many new machine models will get to the market with a
need for a platform driver ?

Will the Windows driver team also switch to MIPI DisCo Imaging ?

> > Looking at that platform driver, it matches the device based on the
> > sensor ACPI HID only ("OMNI5C10"). That doesn't seem quite right, I
> > think you need a DMI match as well. You can't assume that OMNI5C10,
> > which identifies the sensor, will always map to specific platform
> > integration data (connected to an AMD ISP, using a particular link
> > frequency, ...), can you ?
> 
> Initally we had dmi checks, but as the driver matured through review 
> iterations, we switched to ACPI driver approach and felt the bus 
> traversal to find the matching HID device and dmi checks are no longer 
> required. The (_HID, "OMNI5C10") used is specific to this platform and 
> shouldn't be impacting other platform even though the dmi checks are 
> skipped. Please see [A].

How do you guarantee that the same sensor will not be used with the
OMNI5C10 ACPI HID on another AMD-based laptop that would require a
different link frequency or use a different number of data lanes ?

> [A] https://lore.kernel.org/lkml/8d892845-e134-4553-a6af-55d785c1ae98@amd.com/
> 
> >>>> Please refer
> >>>> the changes below and let us know if these should be submitted as a
> >>>> separate patch.
> >>>
> >>> Mehdi, do you have any comment ?
> >>>
> >>>> ---
> >>>> @@ -645,16 +645,16 @@ struct clk *devm_v4l2_sensor_clk_get(struct device
> >>>> *dev, const char *id)
> >>>>            const char *clk_id __free(kfree) = NULL;
> >>>>            struct clk_hw *clk_hw;
> >>>>            struct clk *clk;
> >>>> -       bool acpi_node;
> >>>> +       bool is_node;
> >>>>            u32 rate;
> >>>>            int ret;
> >>>>
> >>>>            clk = devm_clk_get_optional(dev, id);
> >>>>            ret = device_property_read_u32(dev, "clock-frequency", &rate);
> >>>> -       acpi_node = is_acpi_node(dev_fwnode(dev));
> >>>> +       is_node = is_acpi_node(dev_fwnode(dev)) || is_software_node(dev_fwnode(dev));
> >>>>
> >>>>            if (clk) {
> >>>> -               if (!ret && acpi_node) {
> >>>> +               if (!ret && is_node) {
> >>>>                            ret = clk_set_rate(clk, rate);
> >>>>                            if (ret) {
> >>>>                                    dev_err(dev, "Failed to set clock rate: %u\n",
> >>>> @@ -668,7 +668,7 @@ struct clk *devm_v4l2_sensor_clk_get(struct device
> >>>> *dev, const char *id)
> >>>>            if (ret)
> >>>>                    return ERR_PTR(ret);
> >>>>
> >>>> -       if (!IS_ENABLED(CONFIG_COMMON_CLK) || !acpi_node)
> >>>> +       if (!IS_ENABLED(CONFIG_COMMON_CLK) || !is_node)
> >>>>                    return ERR_PTR(-ENOENT);
> >>>>
> >>>>            if (!id) {
> >>>> ----

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2025-06-24 19:00 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 19:42 [PATCH v3 RESEND] media: i2c: Add OV05C10 camera sensor driver Pratap Nirujogi
2025-06-13  4:55 ` Hao Yao
2025-06-13 11:02   ` Kieran Bingham
2025-06-13 12:05     ` Bryan O'Donoghue
2025-06-16 23:15       ` Nirujogi, Pratap
2025-06-16 23:46     ` Nirujogi, Pratap
2025-06-28 19:23       ` Sakari Ailus
2025-06-13 22:02   ` Sakari Ailus
2025-06-14 22:52     ` Laurent Pinchart
2025-06-16 22:33       ` Nirujogi, Pratap
2025-06-29  7:40         ` Sakari Ailus
2025-06-30 22:31           ` Nirujogi, Pratap
2025-07-02  6:08             ` Yan, Dongcheng
2025-07-02  6:12               ` Sakari Ailus
2025-07-02 16:47                 ` Nirujogi, Pratap
2025-07-03  6:24                   ` Yan, Dongcheng
2025-07-05 11:45                     ` Nirujogi, Pratap
2025-07-06  9:11                   ` Sakari Ailus
2025-07-08 15:31                     ` Nirujogi, Pratap
2025-06-23 11:27       ` Sakari Ailus
2025-06-23 12:06         ` Laurent Pinchart
2025-06-23 21:53           ` Nirujogi, Pratap
2025-06-23 22:11             ` Laurent Pinchart
2025-06-16 23:12     ` Nirujogi, Pratap
2025-06-23 12:09       ` Laurent Pinchart
2025-06-23 13:22         ` Sakari Ailus
2025-06-23 13:42           ` Laurent Pinchart
2025-06-23 21:55             ` Nirujogi, Pratap
2025-06-23 22:06               ` Laurent Pinchart
2025-06-23 23:21                 ` Nirujogi, Pratap
2025-06-25 22:06               ` Nirujogi, Pratap
2025-06-26 11:11                 ` Kieran Bingham
2025-06-26 12:23                   ` Laurent Pinchart
2025-06-26 18:22                     ` Nirujogi, Pratap
2025-06-26 18:56                       ` Laurent Pinchart
2025-06-26 19:21                         ` Nirujogi, Pratap
2025-06-26 18:14                   ` Nirujogi, Pratap
2025-06-17  0:19   ` Nirujogi, Pratap
2025-06-15  0:09 ` Laurent Pinchart
2025-06-16 22:49   ` Nirujogi, Pratap
2025-06-23 21:51     ` Nirujogi, Pratap
2025-06-23 22:05       ` Laurent Pinchart
2025-06-23 23:28         ` Nirujogi, Pratap
2025-06-24  0:19           ` Laurent Pinchart
2025-06-24 18:49             ` Nirujogi, Pratap
2025-06-24 19:00               ` Laurent Pinchart [this message]
2025-06-24 19:49                 ` Nirujogi, Pratap
2025-06-24  8:35         ` Mehdi Djait
2025-06-24 10:19           ` Sakari Ailus
2025-06-24 10:20             ` Sakari Ailus
2025-06-24 10:27               ` Laurent Pinchart
2025-06-24 11:27                 ` Mehdi Djait
2025-06-24 11:33                   ` Laurent Pinchart
2025-06-24 11:46                   ` Sakari Ailus
2025-06-24 16:34                     ` Mehdi Djait
2025-06-24 20:24                       ` Nirujogi, Pratap
2025-06-25  6:11                       ` Sakari Ailus
2025-06-24 18:26                   ` Nirujogi, Pratap
2025-06-24 20:01                     ` Nirujogi, Pratap
  -- strict thread matches above, loose matches on Subject: below --
2025-05-15 22:41 Pratap Nirujogi

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=20250624190018.GF20757@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=Svetoslav.Stoilov@amd.com \
    --cc=Yana.Zheleva@amd.com \
    --cc=benjamin.chan@amd.com \
    --cc=bin.du@amd.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=dantony@amd.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=grosikop@amd.com \
    --cc=hdegoede@redhat.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jai.luthra@ideasonboard.com \
    --cc=king.li@amd.com \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mehdi.djait@linux.intel.com \
    --cc=pnirujog@amd.com \
    --cc=pratap.nirujogi@amd.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=vengutta@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.