From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Dennis Lambe Jr <dennis@sparkcharge.io>
Cc: "Alessandro Zummo" <a.zummo@towertech.it>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Rob Herring" <robh+dt@kernel.org>,
"Atsushi Nemoto" <atsushi.nemoto@sord.co.jp>,
"Mylène Josserand" <mylene.josserand@free-electrons.com>,
"Gary Bisson" <gary.bisson@boundarydevices.com>,
"Javier Martinez Canillas" <javier@osg.samsung.com>,
"Troy Kisky" <troy.kisky@boundarydevices.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rtc@vger.kernel.org
Subject: Re: [PATCH v3 0/3] rtc: Set M41T82 & M41T83 xtal load capacitance from DT
Date: Thu, 19 Jan 2023 23:17:58 +0100 [thread overview]
Message-ID: <Y8nBloQfBPK3t5ce@mail.local> (raw)
In-Reply-To: <20230119213903.899756-1-dennis@sparkcharge.io>
On 19/01/2023 21:39:00+0000, Dennis Lambe Jr wrote:
> Other than adding a sign-off to one of the changelogs, this is a RESEND.
>
> Alexandre Belloni, what do you need for this before you'd want to apply
> it? In case it's additional reviewers, I have CC'd some more
> potentially-interested parties this time and updated Atsushi Nemoto's
> email address to one that's hopefully more current.
>
I need to find time to think about it because while setting the analog
trimming statically from the device tree solves your immediate problem,
it will also remove the possibility to handle it from userspace later
on. I would really prefer this uses the offset interface or a better
interface that unfortunately doesn't exist yet.
> I think the original author listed in the header for this driver,
> Alexander Bigga, is inaccurate. It looks to me like his name got copied
> over by Atsushi Nemoto when he created m41t82.c by deriving it from a
> similar driver. At any rate, Alexander Bigga's listed email address
> bounces, I didn't find a newer one for him, and he doesn't show up in
> the kernel commit log after 2007. I don't think he can be considered the
> maintainer for this driver anymore if he ever was.
>
> Changes in v3:
> * dt-bindings: added Krzysztof Kozlowski sign-off to changelog
>
> Changes in v2:
> * dt-bindings: remove accidental wakeup-sources line
> suggested by Krzysztof Kozlowski
> * spelling fixes in changelogs
>
> The m41t82 and m41t83 have an adjustable internal capacitance that
> defaults to 25 pF per xtal pin. This patch series adds the ability to
> configure it via the devicetree.
>
> Patch 1 just changes `#ifdef CONFIG_OF` to `if (IS_ENABLED(CONFIG_OF))`
> in m41t80_probe() so that I don't need to use __maybe_unused on my new
> functions and variables.
>
> Patch 2 is the dt-bindings.
>
> Patch 3 is the actual feature implementation.
>
> The desired capacitance comes from the quartz-load-femtofarads property,
> following the example of two other RTC ICs that have adjustable internal
> load capacitance, the NXP pcf85063 and pcf8523. The m41t82 and m41t83
> support much finer-grained control over the capacitance than those
> chips, and ST calls the feature "analog calibration", but it looks to me
> like it's essentially the same kind of thing.
>
> My use case for this is:
>
> ST specifies not to add any additional external load capacitance[1], but
> the MikroElektronika RTC 9 Click board[2] has a 22 pF cap on each xtal
> pin[3]. The resulting combined capacitance appears to be outside of the
> operating range of the xtal, because when power is removed from the
> boards I'm testing with, the RTC reports an Oscillator-Fail flag on the
> next power on.
>
> I found I could work around the problem by reducing the internal load
> capacitance as low as it will go.
>
> References:
> [1] https://www.st.com/resource/en/application_note/an3060-applications-guide-for-serial-realtime-clocks-rtcs-stmicroelectronics.pdf
> [2] https://www.mikroe.com/rtc-9-click
> [3] https://download.mikroe.com/documents/add-on-boards/click/rtc-9/rtc-9-click-schematic-v100.pdf
>
> Previous versions:
> v1: https://lore.kernel.org/linux-rtc/20221219190915.3912384-1-dennis@sparkcharge.io/T/
>
> Dennis Lambe Jr (3):
> rtc: m41t80: probe: use IS_ENABLED for CONFIG_OF
> dt-bindings: m41t80: add xtal load capacitance
> rtc: m41t80: set xtal load capacitance from DT
>
> .../devicetree/bindings/rtc/st,m41t80.yaml | 16 ++++
> drivers/rtc/rtc-m41t80.c | 84 +++++++++++++++++--
> 2 files changed, 92 insertions(+), 8 deletions(-)
>
> --
> 2.25.1
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2023-01-19 22:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-19 21:39 [PATCH v3 0/3] rtc: Set M41T82 & M41T83 xtal load capacitance from DT Dennis Lambe Jr
2023-01-19 21:39 ` [PATCH v3 1/3] rtc: m41t80: probe: use IS_ENABLED for CONFIG_OF Dennis Lambe Jr
2023-01-19 22:20 ` Alexandre Belloni
2023-01-19 23:17 ` Dennis Lambe
2023-01-19 21:39 ` [PATCH v3 2/3] dt-bindings: m41t80: add xtal load capacitance Dennis Lambe Jr
2023-01-19 21:39 ` [PATCH v3 3/3] rtc: m41t80: set xtal load capacitance from DT Dennis Lambe Jr
2023-01-19 22:17 ` Alexandre Belloni [this message]
2023-01-19 23:27 ` [PATCH v3 0/3] rtc: Set M41T82 & M41T83 " Dennis Lambe
2023-01-19 23:52 ` Alexandre Belloni
2023-01-20 19:12 ` Dennis Lambe
2023-01-20 2:36 ` Atsushi Nemoto
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=Y8nBloQfBPK3t5ce@mail.local \
--to=alexandre.belloni@bootlin.com \
--cc=a.zummo@towertech.it \
--cc=atsushi.nemoto@sord.co.jp \
--cc=dennis@sparkcharge.io \
--cc=devicetree@vger.kernel.org \
--cc=gary.bisson@boundarydevices.com \
--cc=javier@osg.samsung.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=mylene.josserand@free-electrons.com \
--cc=robh+dt@kernel.org \
--cc=troy.kisky@boundarydevices.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 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).