From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71688307496; Tue, 24 Jun 2025 19:00:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750791643; cv=none; b=gdNdrEP6TLIuhTGm2noJl+Se6cSuYHTJaBX4NDlmmjBPh3H9ZVqPNabKjikaBEHtQi7GfU2K0SHklXspVUW/NxvGGZPAG+GDl20NG4hOAGsmPNKRbVVZtDxabb5RDeu3WLQQUQWhgTiZoUjuM/FPsEwQuuLa7hgmCFrYEd80fwg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750791643; c=relaxed/simple; bh=dek6edVzC9rHjfF3sdmCDOihMrRX2UkHtRQT5JT/Tlg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aYDY33lhcMCHvg0lnXP8WWKo0HciVL2JtbyDrDsrQejcHCK0va8Dt0WYe/I3kubZnY8oHYtQnqQtYxo7bg/lVY8eV35jkGogRqlG+E5sDKkn3D7TCrXJXqVuPA7BrcusCclEO7xgoLhW1umj42xLmteYMfjXP3SveeNWoVrzfy4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=lCWpzA1N; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="lCWpzA1N" Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id AAC856F3; Tue, 24 Jun 2025 21:00:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1750791621; bh=dek6edVzC9rHjfF3sdmCDOihMrRX2UkHtRQT5JT/Tlg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lCWpzA1N+IwYJHIAQlIOneNrl9lrGyjbq+XlQWJEGMuxGXiKrmihpNIkRi6cYzKxt zRDXZUTk2KrrXU/FDK8sbLxTymOk4DJC3Xut3mXCyUvk3XY4SnlgdneJ86aFohTHTH dJ7KLWQFVv/x23y3W5lzGTTMPhNyZMXd52gZBj+k= Date: Tue, 24 Jun 2025 22:00:18 +0300 From: Laurent Pinchart To: "Nirujogi, Pratap" Cc: Pratap Nirujogi , 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 Subject: Re: [PATCH v3 RESEND] media: i2c: Add OV05C10 camera sensor driver Message-ID: <20250624190018.GF20757@pendragon.ideasonboard.com> References: <20250609194321.1611419-1-pratap.nirujogi@amd.com> <20250615000915.GQ10542@pendragon.ideasonboard.com> <53674c5f-6b68-49e7-bbb0-fd06fff344c3@amd.com> <8b16675a-c6ac-4619-aabe-ad2a4be6c964@amd.com> <20250623220503.GA15951@pendragon.ideasonboard.com> <163655af-2a3d-4489-ac7a-4ee31d3980e2@amd.com> <20250624001942.GF15951@pendragon.ideasonboard.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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