Linux IIO development
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: Fabrizio Lamarque <fl.scratchpad@gmail.com>,
	alexandru.tachici@analog.com
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH 2/2] ad7192 driver: fixed unexpected internal clock fallback when no mclk clock is defined.
Date: Wed, 29 Mar 2023 17:15:11 +0200	[thread overview]
Message-ID: <4ef51234de8e496791bcb7cd190a7ccf31626c1e.camel@gmail.com> (raw)
In-Reply-To: <CAPJMGm4StRvJ4zTyrOb7ebo47LrR9bBuZ46p7VOxkDfwWSG=PA@mail.gmail.com>

On Mon, 2023-03-27 at 22:21 +0200, Fabrizio Lamarque wrote:
> Allow the use of external clock when mclk clock is defined.
> When defining a mclk clock source in device tree with adi,clock-xtal
> property, the external crystal oscillator is not turned on.
> Without the change, the driver always uses the internal clock even
> when mclk clock is defined.
> 
> Current implementation seems to contain a typo, since it expected
> st->mclk to be NULL within ad7192_of_clock_select() in order to
> select
> the external clock, but, if null, external clock cannot loaded
> correctly (out of bounds due to invalid mclk) in ad7192_probe().
> 
> I believe this patch follows the author's intended behavior.
>  After applying this patch, the external oscillator is started as
> expected.
> 

Yes, looks like a valid fix... Just missing a Fixes tag.
> I kindly ask your feedback, I may adjust the patch according to your
> suggestions. I could also follow up with another patch on
> documentation, containing the following (related) issues:
> 
> - adi,int-clock-output-enable is undocumented
> - adi,clock-xtal is undocumented
> - regulator name avdd and its description is quite misleading, since
> this is unrelated to the AVdd pin (#20) of AD7192; it is used instead
> as reference voltage (REFIN1 on #15/#16 or REFIN2 on #7/#8). See
> int_vref_mv variable within driver implementation.
> 

Don't think the above text belongs to this commit message. That said,
it would be great if you could follow up with a couple of patches to
document the undocumented properties. As for the regular name, I think
it's not so trivial to change it's name because there could be already
users using the property like this. So, I guess we have two ways:

1) Just add some description in the property to state what's this
regulator really is about.
2) This one is more complex but might be the right one... Deprecrate
the current property (you can mark a property as deprecated in the
bindings) and add the new one with a proper name. Then, you need to
change the driver accordingly keeping in mind that it must still work
with the old, deprecrated property.

Was lazy to ckeck but I'm assuming the bindings are already in yaml...

> Signed-off-by: Fabrizio Lamarque <fl.scratchpad@gmail.com>
> --- linux/drivers/iio/adc/ad7192.c  2023-03-13 19:32:42.646239506

Anyways, for this patch and with a proper fixes tag (and with the
unrelated text removed from the commit message):

Reviewed-by: nuno.sa@analog.com



  reply	other threads:[~2023-03-29 15:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 20:21 [PATCH 2/2] ad7192 driver: fixed unexpected internal clock fallback when no mclk clock is defined Fabrizio Lamarque
2023-03-29 15:15 ` Nuno Sá [this message]
2023-03-29 21:23   ` Fabrizio Lamarque
2023-03-30  7:53     ` Nuno Sá
2023-04-01 14:37       ` Jonathan Cameron
2023-04-04  7:20         ` Fabrizio Lamarque
2023-04-08 10:37           ` Jonathan Cameron

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=4ef51234de8e496791bcb7cd190a7ccf31626c1e.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=alexandru.tachici@analog.com \
    --cc=fl.scratchpad@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    /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