From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C656A937 for ; Sun, 19 Apr 2026 07:38:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776584333; cv=none; b=G9X03lGD8pU1ixvx3UQD27NtvKI/RczZKQwrPw3Vfw8kMMSUf/q1ZjRRtM8DlQCRZEHz7KUOqpcbrj51CQgqKgPxnbvt2smXPLFSHxKrGN07yMQuKGArlr1Zv0n+/JjSZxafZuQvWSdNiACFs8WBRGQx8pjaQ8t5eLdKmezD2cc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776584333; c=relaxed/simple; bh=hDfKe0QMUmSalyAwjaCmL53DF1u9pssVZ/2QrwkgfMg=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=tlwQ354ilY19KA/6wRkscxwvushK4HPFZApEqZrF09IgZxPcMUTgQnTbERF3AGsl7TJWxyEhCynsozhCzf/UewpJNZKSzp3hQ1FPc1YU/b7xIcsug079qPN1yA6bdW9q6MEc1myG+bbPiCRkAYb5vC0fJIPwlrjzotSA+PD1KmI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QeX+t3M9; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QeX+t3M9" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-35da1af3e10so2059386a91.3 for ; Sun, 19 Apr 2026 00:38:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776584331; x=1777189131; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=tdU7DYFMoYT+EMFZxBQxJC/c8a6HCHPZlnWvXhWBPfQ=; b=QeX+t3M92MJNPij25UczB2EKzFI77ewSGI43N4Yb6dB2W3Fu2zo4qqzmQxqYhagXnx wd9fRT3k8rpyG3MKWvImjokFsPtvzlypHdAbFr2WeXnEzmezrF35NQq3cB6bjD6sAlqH IiRbL71B3xKfQaUCKWkTepo3mC3hnXg9HIt88inr8O2KZOLAEKa4npCYN9+Qhrj8KH6o EojiWMtdyvp9W7RkYCs2ik9T5VfEb2qe6HAOyB8y9lYn8gh5H+Q72Qu/ojSgLuDmzt2H 15hDsexYFlPqoIHjKCylyUj/919PAyMBrc5ctxAQ8dAWdkV61gQZbBEFPISKU/9gV+iB yVWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776584331; x=1777189131; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tdU7DYFMoYT+EMFZxBQxJC/c8a6HCHPZlnWvXhWBPfQ=; b=FoobYh7A1XfdIbJ/D6yfJ+R3+P14Za/HHck1qDvf8J7V5MZr0ohN0XsUXTjW/pU1rE kRpRGkDPoQIg73x1g4YJi1G7J46Mhqiut36Z7ReL9JdTjOUwsjK9iJ42pENMzavGc55V LgfsBsA4jjVFGs1nY46CT+x/xZC3VxyODKaPwJS6CZoGi1oNxTAsPfhg88NnlmIEi8+x uLVgMkcVVbnErftcaQmYFxoWovAtZVal+DFhCv56zgqMEJR9fu6T3b/nLDLW3dBmnYvw uHP4/NaNNOKUoP1tJwY4X+SbQaIXbM4V/D5o6XNCnIE1pUGIASsZmDFZZipmXGGBTVGP Rqlw== X-Forwarded-Encrypted: i=1; AFNElJ9mJjRBOF9fLfeZdIMGARMPUE/wJHusWX9p05kOA9tsW9io29F1FqYEJgBLos0Sfq5QsFhInY6dyV619CY=@vger.kernel.org X-Gm-Message-State: AOJu0YyAWOoi15oY23SQEWD8PyLXxBooYgus91KqWt52qfe7RwFcCLPp 2EB+nsdIHZmOWbFXp9PhgN0/unpLgyewHJj6NsovA6WKRuw0g6FM2HaFfo7Urw== X-Gm-Gg: AeBDievsBnkeoLHL6VrcZnWBKMVtXUKOO2eBR2jcepCOhOn4CU14y4pd1QjBBFEwZj+ m6sULq5gRgroEMZb8tgj/45PePFMvIfuHbDMYVxOzLdUlLips9rShW5NhBOcBySkF7sAFb4XRjH SS5lvWtZBbPhB+tfi5FoEk2RJ2PMsYaOK9Oy2Bz5BJuiaVsibNt672k7CI9uLzTlPnK/myZGhYv +fHbstsurxoH8UcvZ50mputZwerDX9oG8ar/fAysVzL6LtjUYVBz/M+85isRM0tMebhgbW0UPHi NmgDRmKdYwcgyvGbkt4vbNhHifnHoRBS6dYYRdXZ8vWuZPvGHVF16KZ/8cxGEuOMRh4sSxrCOs0 aDw6PSU+brWJMO9c1Wy6141NOybqdicF/ExbzPjWyhkIXjmkIV6ka5RjFTkYIM55gaQo6suiO6j ZuYS/H06sqUpNyrAb9t8AjUAbh5aChxUarVgEWuPGK3ysSw9yoYaKm1EsG9w== X-Received: by 2002:a17:90b:3c82:b0:34c:2db6:578f with SMTP id 98e67ed59e1d1-36140478642mr9692065a91.19.1776584331391; Sun, 19 Apr 2026 00:38:51 -0700 (PDT) Received: from ehlo.thunderbird.net ([2401:4900:ac30:da43:8bfb:2c2f:1693:9900]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b5faa30134sm69244655ad.30.2026.04.19.00.38.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Apr 2026 00:38:50 -0700 (PDT) Date: Sun, 19 Apr 2026 13:08:45 +0530 From: Sanjay Chitroda To: Hans de Goede , sakari.ailus@linux.intel.com, mchehab@kernel.org CC: hverkuil+cisco@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] media: i2c: gc0310: Use devm_v4l2_sensor_clk_get() User-Agent: Thunderbird for Android In-Reply-To: <404149fe-761e-4c8c-90f0-12850c5b049c@kernel.org> References: <20260401181657.654055-1-sanjayembedded@gmail.com> <20260401181657.654055-4-sanjayembedded@gmail.com> <404149fe-761e-4c8c-90f0-12850c5b049c@kernel.org> Message-ID: <34BAB686-0D85-481C-ADF1-8597FDD85AD7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2 April 2026 12:50:20=E2=80=AFam IST, Hans de Goede wrote: >Hi, > >On 1-Apr-26 20:16, Sanjay Chitroda wrote: >> From: Sanjay Chitroda >>=20 >> Several camera sensor drivers access the "clock-frequency" property >> directly to retrieve the external clock rate or handle the external >> clock manually in the driver=2E While this is valid on a subset of ACPI >> platforms, implementing this logic directly in drivers is deprecated >> and can lead to inconsistent behaviour across drivers=2E >>=20 >> This driver supports ACPI platforms only=2E It currently retrieves the >> external clock rate from the "clock-frequency" property and fails >> probing if the rate does not match the expected value, which is the >> correct policy for ACPI platforms=2E >>=20 >> Switch to using the devm_v4l2_sensor_clk_get() helper to standardise >> clock handling=2E This preserves the existing behaviour on ACPI >> platforms that specify a clock-frequency property without providing >> a clock=2E On platforms that provide a clock, the helper will program >> the clock to the rate specified by clock-frequency, which is also >> consistent with the driver's expectations=2E >>=20 >> Signed-off-by: Sanjay Chitroda > >Thanks, patch looks good to me: > >Reviewed-by: Hans de Goede > >Regards, > >Hans > > Hi maintainer, It looks this change is not reflected in the media-next, is there pending = to update or information required on the same to proceed further ? Thanks, Sanjay Chitroda > >> --- >> drivers/media/i2c/gc0310=2Ec | 29 +++++++++++++---------------- >> 1 file changed, 13 insertions(+), 16 deletions(-) >>=20 >> diff --git a/drivers/media/i2c/gc0310=2Ec b/drivers/media/i2c/gc0310=2E= c >> index e538479fee2e=2E=2Ee9e67bd73f51 100644 >> --- a/drivers/media/i2c/gc0310=2Ec >> +++ b/drivers/media/i2c/gc0310=2Ec >> @@ -6,6 +6,7 @@ >> * Copyright (c) 2023-2025 Hans de Goede >> */ >> =20 >> +#include >> #include >> #include >> #include >> @@ -84,6 +85,7 @@ >> #define to_gc0310_sensor(x) container_of(x, struct gc0310_device, sd) >> =20 >> struct gc0310_device { >> + struct clk *clk; >> struct device *dev; >> struct i2c_client *client; >> =20 >> @@ -634,7 +636,6 @@ static int gc0310_check_hwcfg(struct device *dev) >> }; >> struct fwnode_handle *ep_fwnode; >> unsigned long link_freq_bitmap; >> - u32 mclk; >> int ret; >> =20 >> /* >> @@ -646,21 +647,6 @@ static int gc0310_check_hwcfg(struct device *dev) >> return dev_err_probe(dev, -EPROBE_DEFER, >> "waiting for fwnode graph endpoint\n"); >> =20 >> - ret =3D fwnode_property_read_u32(dev_fwnode(dev), "clock-frequency", >> - &mclk); >> - if (ret) { >> - fwnode_handle_put(ep_fwnode); >> - return dev_err_probe(dev, ret, >> - "reading clock-frequency property\n"); >> - } >> - >> - if (mclk !=3D GC0310_MCLK_FREQ) { >> - fwnode_handle_put(ep_fwnode); >> - return dev_err_probe(dev, -EINVAL, >> - "external clock %u is not supported\n", >> - mclk); >> - } >> - >> ret =3D v4l2_fwnode_endpoint_alloc_parse(ep_fwnode, &bus_cfg); >> fwnode_handle_put(ep_fwnode); >> if (ret) >> @@ -684,6 +670,7 @@ static int gc0310_check_hwcfg(struct device *dev) >> static int gc0310_probe(struct i2c_client *client) >> { >> struct gc0310_device *sensor; >> + unsigned long freq; >> int ret; >> =20 >> ret =3D gc0310_check_hwcfg(&client->dev); >> @@ -697,6 +684,16 @@ static int gc0310_probe(struct i2c_client *client) >> sensor->client =3D client; >> sensor->dev =3D &client->dev; >> =20 >> + sensor->clk =3D devm_v4l2_sensor_clk_get(sensor->dev, NULL); >> + if (IS_ERR(sensor->clk)) >> + return dev_err_probe(sensor->dev, PTR_ERR(sensor->clk), >> + "failed to get clock\n"); >> + >> + freq =3D clk_get_rate(sensor->clk); >> + if (freq !=3D GC0310_MCLK_FREQ) >> + return dev_err_probe(sensor->dev, -EINVAL, >> + "external clock %lu is not supported\n", freq); >> + >> sensor->reset =3D devm_gpiod_get(sensor->dev, "reset", GPIOD_OUT_HIGH= ); >> if (IS_ERR(sensor->reset)) { >> return dev_err_probe(sensor->dev, PTR_ERR(sensor->reset), >