<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/include/linux/mfd/mt6397, branch stable</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/include/linux/mfd/mt6397?h=stable</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/include/linux/mfd/mt6397?h=stable'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2026-09-30T14:40:41Z</updated>
<entry>
<title>rtc: mt6397: expose the spare bytes of the alarm registers as nvmem</title>
<updated>2026-09-30T14:40:41Z</updated>
<author>
<name>Ryan Brue</name>
<email>ryanbrue.dev@gmail.com</email>
</author>
<published>2026-09-18T04:57:47Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=1aaaf94a61eeaab1ab1f872fc818f6f688c7dd7f'/>
<id>urn:sha1:1aaaf94a61eeaab1ab1f872fc818f6f688c7dd7f</id>
<content type='text'>
Each alarm field lives in the low bits of its register and the driver
masks its writes accordingly, so the high byte of four of them is storage
the RTC never touches. MediaTek names these RTC_NEW_SPARE0 to
RTC_NEW_SPARE3 and gives the first to a fuel gauge, which is how its PMIC
battery drivers carry a state of charge over a reboot.

Offer all four as a battery-backed nvmem provider, so that a consumer does
not have to reach into this block behind the driver's back. Doing it here
is what makes it safe: a write lands under the same lock the alarm paths
take, so it can neither be lost inside mtk_rtc_set_alarm()'s
read-modify-write nor fire the write trigger in the middle of one.

The nvmem core does not range check a cell against the provider size, so
the callbacks check the offset themselves.

Tested on an MT6397; MediaTek's spare map for mt6323 matches, and the
alarm field masks are common to every compatible this driver binds.

Assisted-by: LLM
Signed-off-by: Ryan Brue &lt;ryanbrue.dev@gmail.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Link: https://patch.msgid.link/20260917-rbrue-suez-upstreaming-mt6397-rtc-nvmem-v1-2-558b8f95cfbc@gmail.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mfd: mt6397: Properly fix CID of MT6328, MT6331 and MT6332</title>
<updated>2026-03-25T12:45:09Z</updated>
<author>
<name>Akari Tsuyukusa</name>
<email>akkun11.open@gmail.com</email>
</author>
<published>2026-03-02T14:00:45Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=a09506820afa391e0a8ecc4b05c954f21e50b1de'/>
<id>urn:sha1:a09506820afa391e0a8ecc4b05c954f21e50b1de</id>
<content type='text'>
CIDs set for MT6328, MT6331 and MT6332 are not appropriate.
Many Android downstream kernels define CID as below,

MT6328:

    #define PMIC6328_E1_CID_CODE    0x2810
    #define PMIC6328_E2_CID_CODE    0x2820
    #define PMIC6328_E3_CID_CODE    0x2830

MT6331/MT6332:

    #define PMIC6331_E1_CID_CODE    0x3110
    #define PMIC6331_E2_CID_CODE    0x3120
    #define PMIC6331_E3_CID_CODE    0x3130

    #define PMIC6332_E1_CID_CODE    0x3210
    #define PMIC6332_E2_CID_CODE    0x3220
    #define PMIC6332_E3_CID_CODE    0x3230

The current configuration incorrectly uses the revision code as the CID.
Therefore, the driver cannot detect the same PMIC of different revisions.
(E1/E2 for MT6328, E1/E3 for MT6331/MT6332)
Based on these, the CID of MT6328, MT6331 and MT6332 should be corrected.

Additionally, the incorrect MT6331/MT6332 CID overlaps with the MT6320's
actual CID:

    #define PMIC6320_E1_CID_CODE    0x1020
    #define PMIC6320_E2_CID_CODE    0x2020

This causes a conflict in the switch-case statement of mt6397-irq.c,
this prevents adding support for MT6320.

Signed-off-by: Akari Tsuyukusa &lt;akkun11.open@gmail.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Link: https://patch.msgid.link/20260302140045.651727-1-akkun11.open@gmail.com
Signed-off-by: Lee Jones &lt;lee@kernel.org&gt;
</content>
</entry>
<entry>
<title>rtc: mt6397: drop unused defines</title>
<updated>2025-04-01T10:03:39Z</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@bootlin.com</email>
</author>
<published>2025-03-03T22:36:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=c2004b6efb1c891b80bef186771a3668fc25f6b3'/>
<id>urn:sha1:c2004b6efb1c891b80bef186771a3668fc25f6b3</id>
<content type='text'>
RTC_NUM_YEARS has never been used, the other defines are not used since
commit 34bbdc12d04e ("rtc: mt6359: Add RTC hardware range and add support
for start-year")

Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Link: https://lore.kernel.org/r/20250303223637.1135362-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>mfd: mt6397: Add initial support for MT6328</title>
<updated>2024-10-31T16:25:03Z</updated>
<author>
<name>Yassine Oudjana</name>
<email>y.oudjana@protonmail.com</email>
</author>
<published>2024-10-18T08:10:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=6e31bb8d3a63bb2c3efab2fb6bcfccac677a4581'/>
<id>urn:sha1:6e31bb8d3a63bb2c3efab2fb6bcfccac677a4581</id>
<content type='text'>
The MT6328 PMIC is commonly used with the MT6735 SoC. Add initial
support for this PMIC.

Signed-off-by: Yassine Oudjana &lt;y.oudjana@protonmail.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Link: https://lore.kernel.org/r/20241018081050.23592-5-y.oudjana@protonmail.com
Signed-off-by: Lee Jones &lt;lee@kernel.org&gt;
</content>
</entry>
<entry>
<title>mfd: mt6397: Add basic support for MT6331+MT6332 PMIC</title>
<updated>2022-07-19T09:54:41Z</updated>
<author>
<name>AngeloGioacchino Del Regno</name>
<email>angelogioacchino.delregno@collabora.com</email>
</author>
<published>2022-06-27T12:39:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=d9cd0bc604705eb01497c3e483f8820a9677c682'/>
<id>urn:sha1:d9cd0bc604705eb01497c3e483f8820a9677c682</id>
<content type='text'>
Add support for the MT6331 PMIC with MT6332 Companion PMIC, found
in MT6795 Helio X10 smartphone platforms.

This combo has support for multiple devices but, for a start,
only the following have been implemented:
- Regulators (two instances, one in MT6331, one in MT6332)
- RTC (MT6331)
- Keys (MT6331)
- Interrupts (MT6331 also dispatches MT6332's interrupts)

There's more to be implemented, especially for MT6332, which
will come at a later stage.

Signed-off-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: Matthias Brugger &lt;matthias.bgg@gmail.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Link: https://lore.kernel.org/r/20220627123954.64299-1-angelogioacchino.delregno@collabora.com
</content>
</entry>
<entry>
<title>mfd: mt6358-irq: Add MT6357 PMIC support</title>
<updated>2022-07-19T09:54:39Z</updated>
<author>
<name>Fabien Parent</name>
<email>fparent@baylibre.com</email>
</author>
<published>2022-05-31T12:49:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=738654be3cf7af4a0a131bd92142db045f0660dc'/>
<id>urn:sha1:738654be3cf7af4a0a131bd92142db045f0660dc</id>
<content type='text'>
Add MT6357 PMIC IRQ support.

Signed-off-by: Fabien Parent &lt;fparent@baylibre.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Link: https://lore.kernel.org/r/20220531124959.202787-6-fparent@baylibre.com
</content>
</entry>
<entry>
<title>mfd: Add support for the MediaTek MT6366 PMIC</title>
<updated>2022-03-07T14:59:44Z</updated>
<author>
<name>Johnson Wang</name>
<email>johnson.wang@mediatek.com</email>
</author>
<published>2022-01-06T06:54:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=c47383f849097c2b3547e28365578cd9e5811378'/>
<id>urn:sha1:c47383f849097c2b3547e28365578cd9e5811378</id>
<content type='text'>
This adds support for the MediaTek MT6366 PMIC. This is a
multifunction device with the following sub modules:

- Regulator
- RTC
- Codec
- Interrupt

It is interfaced to the host controller using SPI interface
by a proprietary hardware called PMIC wrapper or pwrap.
MT6366 MFD is a child device of the pwrap.

Signed-off-by: Johnson Wang &lt;johnson.wang@mediatek.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Link: https://lore.kernel.org/r/20220106065407.16036-2-johnson.wang@mediatek.com
</content>
</entry>
<entry>
<title>mfd: Add support for the MediaTek MT6359 PMIC</title>
<updated>2021-06-01T15:44:23Z</updated>
<author>
<name>Hsin-Hsiung Wang</name>
<email>hsin-hsiung.wang@mediatek.com</email>
</author>
<published>2021-05-26T06:52:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=e545b8f380a96174df40db4203d09156e096ee89'/>
<id>urn:sha1:e545b8f380a96174df40db4203d09156e096ee89</id>
<content type='text'>
This adds support for the MediaTek MT6359 PMIC. This is a
multifunction device with the following sub modules:

- Codec
- Interrupt
- Regulator
- RTC

It is interfaced to the host controller using SPI interface
by a proprietary hardware called PMIC wrapper or pwrap.
MT6359 MFD is a child device of the pwrap.

Signed-off-by: Hsin-Hsiung Wang &lt;hsin-hsiung.wang@mediatek.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>rtc: mt6397: refine RTC_TC_MTH</title>
<updated>2021-06-01T15:44:09Z</updated>
<author>
<name>Hsin-Hsiung Wang</name>
<email>hsin-hsiung.wang@mediatek.com</email>
</author>
<published>2021-05-26T06:52:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=be60652f0260c2f371670ec90f1ac55e2671f793'/>
<id>urn:sha1:be60652f0260c2f371670ec90f1ac55e2671f793</id>
<content type='text'>
This patch adds RTC_TC_MTH_MASK to support new chips.

Signed-off-by: Yuchen Huang &lt;yuchen.huang@mediatek.com&gt;
Signed-off-by: Hsin-Hsiung Wang &lt;hsin-hsiung.wang@mediatek.com&gt;
Acked-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>rtc: mt6397: Remove unused member dev</title>
<updated>2020-10-15T10:01:29Z</updated>
<author>
<name>Fei Shao</name>
<email>fshao@chromium.org</email>
</author>
<published>2020-10-08T09:34:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=770c03e6dabacd5b9f57bba93c4311d32b618640'/>
<id>urn:sha1:770c03e6dabacd5b9f57bba93c4311d32b618640</id>
<content type='text'>
Removing the struct member "dev" in mt6397 RTC driver because it's not
initialized and the only usage is for one debugging message.

Also fixed a typo in the error message.

Signed-off-by: Fei Shao &lt;fshao@chromium.org&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20201008093414.1911699-1-fshao@chromium.org
</content>
</entry>
</feed>
