From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Ryan Brue <ryanbrue.dev@gmail.com>,
Sen Chu <sen.chu@mediatek.com>,
Sean Wang <sean.wang@mediatek.com>,
Macpaul Lin <macpaul.lin@mediatek.com>,
Lee Jones <lee@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Eddie Huang <eddie.huang@mediatek.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-pm@vger.kernel.org, mfd@lists.linux.dev,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-rtc@vger.kernel.org
Subject: Re: [PATCH v3 0/2] rtc: mt6397: provide the RTC's 32 kHz output as a clock
Date: Tue, 17 Nov 2026 12:30:15 +0100 [thread overview]
Message-ID: <fc0bb114-8781-43d2-bdfe-45135259a548@collabora.com> (raw)
In-Reply-To: <20261116-rbrue-suez-upstreaming-mt6397-rtc-32k-v3-0-179145eb7e89@gmail.com>
On 11/16/26 19:46, Ryan Brue wrote:
> The MT6397 RTC drives a 32 kHz clock out of the PMIC, which boards use as
> the sleep clock of a Wi-Fi/Bluetooth combo chip. RTC_CON.F32KOB gates it,
> and mainline never touches that bit, so the chip only works if the
> bootloader happened to turn the output on.
>
Not just mt6397, but way more than that - upstream never touches this one
because the main targets have always been platforms both without any modem
and without any *tight* power optimization (historically, chromebooks, and
Genio IoT boards, where the first are equipped with big batteries, and the
latter is typically powered with an AC-DC brick until it gets thunderstruck).
Nice to see this getting upstreamed.
Both patches of this series are
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cheers,
Angelo
> On the Amazon Fire HD 10 (2017), which can boot through U-Boot instead of
> the vendor's LK, nothing sets it in the former - LK sets the bit at every
> boot, and the MT6630 combo chip's Wi-Fi and Bluetooth never come up.
> Letting the RTC provide the output as a clock lets the chip's
> mmc-pwrseq-simple enable it. With the clock wired up both came up on that
> board in two boots out of two, and in none of three without it.
>
> The driver registers the clock only when the RTC node has #clock-cells,
> so no existing board changes. The MT6323 shares the MT6397's driver data
> and gets it too; every MediaTek PMIC RTC whose registers I could read has
> F32KOB at bit 5 of RTC_CON, but for the MT6323 that is inferred from the
> shared driver data rather than read from a datasheet.
>
> Lee has applied the binding to mfd [1], so v3 is the driver part only:
> patch 1 gives the existing write trigger member a name that says what it
> is, as Lee asked for the new one, and patch 2 adds the clock. Both are
> for rtc.
>
> The board's devicetree that uses the clock is not upstream yet and follows
> separately.
>
> This series was developed with the help of an LLM.
>
> [1] https://lore.kernel.org/all/179459615032.87488.12726056214378307165.b4-ty@b4/
>
> Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
> ---
> Changes in v3:
> - rtc: name the new struct mtk_rtc_data member control_reg, rename wrtgr
> to write_trigger_reg in a patch of its own, and the local con to
> control (Lee)
> - dt-bindings: dropped, applied by Lee
> - rebased onto v7.4-rc2
> - Link to v2: https://lore.kernel.org/r/20261102-rbrue-suez-upstreaming-mt6397-rtc-32k-v2-0-19ca72815374@gmail.com
>
> Changes in v2:
> - rtc: check for #clock-cells before reading the driver data, which is
> NULL when the PMIC has no RTC node, as on mt8173-evb (Sashiko)
> - dt-bindings: add Krzysztof's Reviewed-by
> - Link to v1: https://lore.kernel.org/r/20261101-rbrue-suez-upstreaming-mt6397-rtc-32k-v1-0-9758f38d7053@gmail.com
>
> ---
> Ryan Brue (2):
> rtc: mt6397: rename the write trigger register offset
> rtc: mt6397: provide the 32 kHz output as a clock
>
> drivers/rtc/rtc-mt6397.c | 95 ++++++++++++++++++++++++++++++++++++++++--
> include/linux/mfd/mt6397/rtc.h | 8 +++-
> 2 files changed, 99 insertions(+), 4 deletions(-)
> ---
> base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
> change-id: 20261024-rbrue-suez-upstreaming-mt6397-rtc-32k-0a1c16f63383
>
> Best regards,
prev parent reply other threads:[~2026-11-17 11:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 18:46 [PATCH v3 0/2] rtc: mt6397: provide the RTC's 32 kHz output as a clock Ryan Brue
2026-11-16 18:46 ` [PATCH v3 1/2] rtc: mt6397: rename the write trigger register offset Ryan Brue
2026-11-16 18:49 ` sashiko-bot
2026-11-16 18:46 ` [PATCH v3 2/2] rtc: mt6397: provide the 32 kHz output as a clock Ryan Brue
2026-11-16 18:58 ` sashiko-bot
2026-11-17 11:30 ` AngeloGioacchino Del Regno [this message]
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=fc0bb114-8781-43d2-bdfe-45135259a548@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=alexandre.belloni@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eddie.huang@mediatek.com \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=macpaul.lin@mediatek.com \
--cc=matthias.bgg@gmail.com \
--cc=mfd@lists.linux.dev \
--cc=robh@kernel.org \
--cc=ryanbrue.dev@gmail.com \
--cc=sean.wang@mediatek.com \
--cc=sen.chu@mediatek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.