linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "André Apitzsch" <git@apitzsch.eu>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Ricardo Ribalda <ribalda@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	~postmarketos/upstreaming@lists.sr.ht,
	 phone-devel@vger.kernel.org, linux-media@vger.kernel.org,
	 linux-kernel@vger.kernel.org, laurent.pinchart@ideasonboard.com
Subject: Re: [PATCH v2 4/4] media: i2c: imx214: Remove hard-coded external clock frequency
Date: Wed, 14 May 2025 08:46:48 +0200	[thread overview]
Message-ID: <ed4c877531a87d89141b115bcddd2ec7c95b8e2a.camel@apitzsch.eu> (raw)
In-Reply-To: <aBnHI1APgjfcj2xG@kekkonen.localdomain>

Hello Sakari,

Am Dienstag, dem 06.05.2025 um 08:24 +0000 schrieb Sakari Ailus:
> Hi André,
> 
> On Mon, May 05, 2025 at 11:05:56PM +0200, André Apitzsch via B4 Relay
> wrote:
> > From: André Apitzsch <git@apitzsch.eu>
> > 
> > Instead rely on the rate set on the clock (using assigned-clock-
> > rates
> > etc.)
> > 
> > Signed-off-by: André Apitzsch <git@apitzsch.eu>
> > ---
> >  drivers/media/i2c/imx214.c | 6 ------
> >  1 file changed, 6 deletions(-)
> > 
> > diff --git a/drivers/media/i2c/imx214.c
> > b/drivers/media/i2c/imx214.c
> > index
> > 9e9be47394ec768a5b34d44b06b5bbb0988da5a1..c12996e294dccebb18c608254
> > f1e0d14dc064423 100644
> > --- a/drivers/media/i2c/imx214.c
> > +++ b/drivers/media/i2c/imx214.c
> > @@ -32,7 +32,6 @@
> >  
> >  #define IMX214_REG_FAST_STANDBY_CTRL	CCI_REG8(0x0106)
> >  
> > -#define IMX214_DEFAULT_CLK_FREQ	24000000
> >  #define IMX214_DEFAULT_LINK_FREQ	600000000
> >  /* Keep wrong link frequency for backward compatibility */
> >  #define IMX214_DEFAULT_LINK_FREQ_LEGACY	480000000
> > @@ -1405,11 +1404,6 @@ static int imx214_probe(struct i2c_client
> > *client)
> >  		return dev_err_probe(dev, PTR_ERR(imx214->xclk),
> >  				     "failed to get xclk\n");
> >  
> > -	ret = clk_set_rate(imx214->xclk, IMX214_DEFAULT_CLK_FREQ);
> > -	if (ret)
> > -		return dev_err_probe(dev, ret,
> > -				     "failed to set xclk
> > frequency\n");
> > -
> 
> Oops. I missed this is what the driver was doing already. Indeed,
> this is one of the historic sensor drivers that do set the frequency
> in DT systems.
> 
> The driver never used the clock-frequency property and instead used a
> fixed frequency. Changing the behaviour now could be problematic.
> 
> There are options here that I think we could do:
> 
> 1) use your v1 patch (4) which uses "clock-frequency" if it exists
> and otherwise uses the default, fixed frequency or
> 
> 2) set the frequency only if the "clock-frequency" property exists.
> The DT currently requires clock-frequency and the YAML conversion was
> done in 2020 whereas the driver is from 2018. If we do this, the
> clock-frequency should be deprecated (or even removed from bingings).
> 
> I wonder what others think. Cc'd Laurent in any case.

I would go with option 2 and add a patch which updates the bindings,
i.e. which deprecates 'clock-frequency',  to this series.

Best regards,
André
> 
> >  	ret = imx214_get_regulators(dev, imx214);
> >  	if (ret < 0)
> >  		return dev_err_probe(dev, ret, "failed to get
> > regulators\n");
> > 

  reply	other threads:[~2025-05-14  7:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-05 21:05 [PATCH v2 0/4] media: i2c: imx214: Add support for more clock frequencies André Apitzsch via B4 Relay
2025-05-05 21:05 ` [PATCH v2 1/4] media: i2c: imx214: Reorder imx214_parse_fwnode call André Apitzsch via B4 Relay
2025-05-05 21:05 ` [PATCH v2 2/4] media: i2c: imx214: Prepare for variable clock frequency André Apitzsch via B4 Relay
2025-05-05 21:05 ` [PATCH v2 3/4] media: i2c: imx214: Make use of CCS PLL calculator André Apitzsch via B4 Relay
2025-05-06  8:05   ` Sakari Ailus
2025-05-06 20:16     ` André Apitzsch
2025-05-06 20:53       ` Sakari Ailus
2025-05-05 21:05 ` [PATCH v2 4/4] media: i2c: imx214: Remove hard-coded external clock frequency André Apitzsch via B4 Relay
2025-05-06  8:24   ` Sakari Ailus
2025-05-14  6:46     ` André Apitzsch [this message]
2025-05-15  8:58     ` Laurent Pinchart
2025-05-15 11:54       ` Sakari Ailus
2025-05-15 13:03         ` Laurent Pinchart
2025-05-15 21:02           ` Sakari Ailus
2025-05-15 21:21             ` André Apitzsch
2025-05-21 16:50               ` Laurent Pinchart

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=ed4c877531a87d89141b115bcddd2ec7c95b8e2a.camel@apitzsch.eu \
    --to=git@apitzsch.eu \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=ribalda@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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;
as well as URLs for NNTP newsgroup(s).