Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
08fa6db
pinctrl: mediatek: init mt6320 driver
akku1139 Jan 3, 2026
2c78263
dt-bindings: soc: mediatek: pwrap: Add compatible for MT6589 SoC
akku1139 Jan 18, 2026
b6f885a
arm: dts: mediatek: mt6589: add pwrap node
akku1139 Jan 18, 2026
911359f
arm: dts: mediatek: mt6589: add pwrap reset
akku1139 Jan 18, 2026
a5e8252
arm: dts: mediatek: mt6589: add pwrap-bridge reset
akku1139 Jan 18, 2026
c54f917
wip: soc: mediatek: pwrap: add mt6589 support
akku1139 Jan 18, 2026
cc4d0a0
wip: soc: mediatek: pwrap: fix mt6589
akku1139 Jan 18, 2026
a845b14
wip: soc: mediatek: pwrap: mt6589 and mt6320 porting
akku1139 Jan 18, 2026
1e6d174
wip: soc: mediatek: pwrap: add mt6320 regs
akku1139 Jan 18, 2026
8458e12
wip: soc: mediatek: pwrap: add mt6589 regs
akku1139 Jan 18, 2026
72a1f8e
soc: mediatek: pwrap: rename PWRAP_MT8135_BRIDGE_* to PWRAP_BRIDGE_*
akku1139 Feb 25, 2026
49e6c51
soc: mediatek: pwrap: fix dew_regs for MT6589
akku1139 Feb 25, 2026
f9b9262
soc: mediatek: pwrap: add more PERI_PWRAP_BRIDGE registers
akku1139 Feb 25, 2026
046664d
soc: mediatek: pwrap: fix pwrap_regs for MT6589
akku1139 Feb 25, 2026
0b6b334
soc: mediatek: pwrap: mt6589 cleanup
akku1139 Feb 25, 2026
7142f92
soc: mediatek: pwrap: fix MT6320 regops
akku1139 Feb 25, 2026
e238dad
mfd: mt6320: add register index
akku1139 Feb 25, 2026
52a07f0
arm: dts: mediatek: mt6589-lenovo-blade: add pmic
akku1139 Feb 25, 2026
67fcd4e
dt-bindings: soc: mediatek: pwrap: PMIC peripherals for MT6589
akku1139 Feb 25, 2026
b9265fc
dt-bindings: mfd: mediatek: add MT6320 binding
akku1139 Feb 25, 2026
b4004a1
arm: configs: lenovo-blade: enable PWAP
akku1139 Feb 26, 2026
05ca408
soc: mediatek: fix mt6589/mt6320
akku1139 Feb 26, 2026
9d5dee8
clk: mediatek: reindex mt6589 clocks
akku1139 Feb 26, 2026
d679e00
dt-bindings: mfd: mediatek: move mt6320
akku1139 Feb 26, 2026
1c15e6d
mfd: mt6397: Add initial support for MT6320 (maybe broken)
akku1139 Feb 26, 2026
6097e64
pinctrl: mediatek: add MT6320 support
akku1139 Feb 26, 2026
9599f8f
arm: configs: lenovo-blade: add CONFIG_MFD_MT6397
akku1139 Feb 26, 2026
9860fb8
arm: dts: lenovo-blade: add MT6320 Pinctrl
akku1139 Feb 26, 2026
3ef41a8
dt-bindings: reset: mt6589: format
akku1139 Feb 26, 2026
99ad9f1
mfd: mt6397-core: add MT6320
akku1139 Feb 26, 2026
cb9f9c2
mfd: mt6397-core: add mt6320 includes
akku1139 Feb 26, 2026
47aa4f6
mfd: mt6397-core: add mt6320 rtc defs
akku1139 Feb 26, 2026
646705d
dt-bindings: mfd: mt6397: add mediatek,mt6320-rtc
akku1139 Feb 26, 2026
c27addb
arm: dts: mediatek: mt6589-lenovo-blade: add rtc
akku1139 Feb 26, 2026
daea345
mfd: mt6320: add irq enum
akku1139 Feb 26, 2026
7c6f2a5
mdf: rtc-mt6397: add mt6320 support
akku1139 Feb 26, 2026
c57f9c8
dt-bindings: input: mediatek,pmic-keys: add mediatek,mt6320-keys
akku1139 Feb 26, 2026
1f6430e
mfd: mt6397-core: add mt6320-keys
akku1139 Feb 26, 2026
c3159b5
arm: dts: mediatek: mt6589-lenovo-blade: add mt6320keys
akku1139 Feb 26, 2026
547bba0
mfd: mt6320: fix syntax
akku1139 Feb 26, 2026
f4139ca
mfd: mt6397-core: fix mt6320 rtc
akku1139 Feb 26, 2026
2352782
mfd: mt6397: Properly fix CID of MT6328, MT6331 and MT6332
akku1139 Feb 28, 2026
b11ebef
mfd: mt6320: fix
akku1139 Mar 1, 2026
d74dd63
arm: dts: mediatek: split mt6320
akku1139 Mar 1, 2026
ba8d029
arm: dts: mediatek: mt6320: add license header
akku1139 Mar 1, 2026
c75adc7
arm: configs: lenovo-blade: add CONFIG_POWER_RESET_MT6323
akku1139 Mar 1, 2026
7a5bac5
arm: dts: mediatek: mt6320: fix fix
akku1139 Mar 1, 2026
f592f9d
Merge remote-tracking branch 'origin/blade/v6.16' into dev/v6.16/mt6320
akku1139 Mar 1, 2026
33ce716
arm: dts: mediatek: mt6320: fix fix fix
akku1139 Mar 1, 2026
6e580ea
arm: configs: lenovo-blade: add CONFIG_PINCTRL_MT6320
akku1139 Mar 1, 2026
fddb922
pinctrl: mt6320: Add pinfunc header file for mt6320
akku1139 Mar 1, 2026
f8318a5
dt-bindings: mfd: mt6397: add mediatek,mt6320-regulator
akku1139 Mar 1, 2026
68acf06
mfd: mt6397-core: add mt6320-regulator
akku1139 Mar 1, 2026
f75e7b4
arm: configs: lenovo-blade: add needed
akku1139 Mar 1, 2026
cf91e1b
Input: mtk-pmic-keys: add mt6320 support
akku1139 Mar 1, 2026
4c6828e
WIP: MT6320 regulator
akku1139 Mar 1, 2026
755098c
regulator: mt6320: add header
akku1139 Mar 1, 2026
c89aefb
regulator: mt6320: replace based on mt6323
akku1139 Mar 1, 2026
a727b15
wip: regulator: mt6320: early porting
akku1139 Mar 1, 2026
b691632
regulator: mt6320: todo note
akku1139 Mar 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ description: |
properties:
compatible:
enum:
- mediatek,mt6320-keys
- mediatek,mt6323-keys
- mediatek,mt6328-keys
- mediatek,mt6331-keys
Expand Down
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ properties:
compatible:
oneOf:
- enum:
- mediatek,mt6320
- mediatek,mt6323
- mediatek,mt6331 # "mediatek,mt6331" for PMIC MT6331 and MT6332.
- mediatek,mt6328
Expand Down Expand Up @@ -64,6 +65,7 @@ properties:
compatible:
oneOf:
- enum:
- mediatek,mt6320-rtc
- mediatek,mt6323-rtc
- mediatek,mt6331-rtc
- mediatek,mt6358-rtc
Expand All @@ -88,6 +90,7 @@ properties:
compatible:
oneOf:
- enum:
- mediatek,mt6320-regulator
- mediatek,mt6323-regulator
- mediatek,mt6328-regulator
- mediatek,mt6358-regulator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ properties:
enum:
- mediatek,mt2701-pinctrl
- mediatek,mt2712-pinctrl
- mediatek,mt6320-pinctrl
- mediatek,mt6397-pinctrl
- mediatek,mt6589-pinctrl
- mediatek,mt7623-pinctrl
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/mediatek,mt6320-regulator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MediaTek MT6320 Regulator

maintainers:
- Akari Tsuyukusa <akkun11.open@gmail.com>

description:
Regulator function of MT6320 PMIC.

properties:
compatible:
items:
- const: mediatek,mt6320-regulator

patternProperties:

required:
- compatible

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>

mt6320_regulators: regulators {
compatible = "mediatek,mt6320-regulator";
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ description:

IP Pairing

On MT8135 the pins of some SoC internal peripherals can be on the PMIC.
On MT6589 and MT8135 the pins of some SoC internal peripherals can be on the PMIC.
The signals of these pins are routed over the SPI bus using the pwrap
bridge. In the binding description below the properties needed for bridging
are marked with "IP Pairing". These are optional on SoCs which do not support
Expand All @@ -31,6 +31,7 @@ properties:
- items:
- enum:
- mediatek,mt2701-pwrap
- mediatek,mt6589-pwrap
- mediatek,mt6765-pwrap
- mediatek,mt6779-pwrap
- mediatek,mt6795-pwrap
Expand Down
44 changes: 44 additions & 0 deletions arch/arm/boot/dts/mediatek/mt6320.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (c) 2026 Akari Tsuyukusa <akkun11.open@gmail.com>
*/

#include <dt-bindings/input/input.h>

&pwrap {
pmic: mt6320 {
compatible = "mediatek,mt6320";

interrupt-parent = <&pio>;
interrupts = <43 IRQ_TYPE_LEVEL_HIGH>;
interrupt-controller;
#interrupt-cells = <2>;

pio6320: pinctrl {
compatible = "mediatek,mt6320-pinctrl";
gpio-controller;
#gpio-cells = <2>;
};

power-controller {
compatible = "mediatek,mt6323-pwrc";
};

rtc {
compatible = "mediatek,mt6320-rtc";
};

mt6320keys: keys {
compatible = "mediatek,mt6320-keys";

power {
linux,keycodes = <KEY_POWER>;
wakeup-source;
};

home {
linux,keycodes = <KEY_HOME>;
};
};
};
};
1 change: 1 addition & 0 deletions arch/arm/boot/dts/mediatek/mt6589-lenovo-blade.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/dts-v1/;
#include "mt6589.dtsi"
#include "mt6320.dtsi"

/ {
#address-cells = <1>;
Expand Down
15 changes: 15 additions & 0 deletions arch/arm/boot/dts/mediatek/mt6589.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/mt6589-clk.h>
#include <dt-bindings/reset/mt6589-resets.h>

/ {
#address-cells = <1>;
Expand Down Expand Up @@ -178,6 +179,20 @@
clock-names = "system-clk", "rtc-clk";
};

pwrap: pwrap@1000f000 {
compatible = "mediatek,mt6589-pwrap";
reg = <0x1000f000 0x1000>,
<0x11017000 0x1000>;
reg-names = "pwrap", "pwrap-bridge";
interrupts = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&infracfg CLK_INFRA_PMICSPI>,
<&infracfg CLK_INFRA_PMICWRAP>;
clock-names = "spi", "wrap";
resets = <&infracfg MT6589_INFRA_PMIC_WRAP_RST>,
<&pericfg MT6589_PERI_PWRAP_BRIDGE_SW_RST>;
reset-names = "pwrap", "pwrap-bridge";
};

sysirq: interrupt-controller@10200100 {
compatible = "mediatek,mt6589-sysirq",
"mediatek,mt6577-sysirq";
Expand Down
18 changes: 13 additions & 5 deletions arch/arm/configs/lenovo-blade_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ CONFIG_PINCTRL=y
CONFIG_PINCTRL_MTK=y
CONFIG_EINT_MTK=y
CONFIG_PINCTRL_MT6589=y
CONFIG_PINCTRL_MT6320=y

## GPIO

Expand All @@ -105,14 +106,21 @@ CONFIG_MMC_MTK=y
#CONFIG_TOUCHSCREEN_S7300=y # not ported

## PMIC
#CONFIG_MTK_PMIC_WRAP=y
CONFIG_MTK_PMIC_WRAP=y
CONFIG_MFD_MT6397=y
CONFIG_REGULATOR_MT6320=y

## Power ?
#CONFIG_POWER_RESET=y
## Power
CONFIG_POWER_RESET=y
CONFIG_POWER_RESET_MT6323=y

## Reset
#CONFIG_RESET_CONTROLLER

## Input
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_MTK_PMIC=y

## Battery

## Audio
Expand All @@ -138,8 +146,8 @@ CONFIG_MMC_MTK=y
#CONFIG_PWM_MTK_DISP=y

## RTC
#CONFIG_RTC_CLASS=y
#CONFIG_RTC_DRV_MT7622=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_MT6397=y

## Android
#CONFIG_ANDROID_BINDER_IPC=y
Expand Down
15 changes: 15 additions & 0 deletions drivers/input/keyboard/mtk-pmic-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/mfd/mt6320/registers.h>
#include <linux/mfd/mt6323/registers.h>
#include <linux/mfd/mt6331/registers.h>
#include <linux/mfd/mt6357/registers.h>
Expand Down Expand Up @@ -56,6 +57,17 @@ struct mtk_pmic_regs {
u32 rst_lprst_mask; /* Long-press reset timeout bitmask */
};

static const struct mtk_pmic_regs mt6320_regs = {
.keys_regs[MTK_PMIC_PWRKEY_INDEX] =
MTK_PMIC_KEYS_REGS(MT6320_CHRSTATUS,
0x8, MT6320_INT_RSV, 0x10, MTK_PMIC_PWRKEY_RST),
.keys_regs[MTK_PMIC_HOMEKEY_INDEX] =
MTK_PMIC_KEYS_REGS(MT6320_OCSTATUS2,
0x10, MT6320_INT_RSV, 0x8, MTK_PMIC_HOMEKEY_RST),
.pmic_rst_reg = MT6320_TOP_RST_MISC,
.rst_lprst_mask = MTK_PMIC_RST_DU_MASK,
};

static const struct mtk_pmic_regs mt6397_regs = {
.keys_regs[MTK_PMIC_PWRKEY_INDEX] =
MTK_PMIC_KEYS_REGS(MT6397_CHRSTATUS,
Expand Down Expand Up @@ -282,6 +294,9 @@ static DEFINE_SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend,

static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {
{
.compatible = "mediatek,mt6320-keys",
.data = &mt6320_regs,
}, {
.compatible = "mediatek,mt6397-keys",
.data = &mt6397_regs,
}, {
Expand Down
47 changes: 45 additions & 2 deletions drivers/mfd/mt6397-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/mfd/core.h>
#include <linux/mfd/mt6320/core.h>
#include <linux/mfd/mt6323/core.h>
#include <linux/mfd/mt6328/core.h>
#include <linux/mfd/mt6331/core.h>
#include <linux/mfd/mt6357/core.h>
#include <linux/mfd/mt6358/core.h>
#include <linux/mfd/mt6359/core.h>
#include <linux/mfd/mt6397/core.h>
#include <linux/mfd/mt6320/registers.h>
#include <linux/mfd/mt6323/registers.h>
#include <linux/mfd/mt6328/registers.h>
#include <linux/mfd/mt6331/registers.h>
Expand All @@ -27,6 +29,9 @@
#include <linux/mfd/mt6359/registers.h>
#include <linux/mfd/mt6397/registers.h>

#define MT6320_RTC_BASE 0xe000
#define MT6320_RTC_SIZE 0x3f

#define MT6323_RTC_BASE 0x8000
#define MT6323_RTC_SIZE 0x40

Expand All @@ -45,6 +50,11 @@
#define MT6323_PWRC_BASE 0x8000
#define MT6323_PWRC_SIZE 0x40

static const struct resource mt6320_rtc_resources[] = {
DEFINE_RES_MEM(MT6320_RTC_BASE, MT6320_RTC_SIZE),
DEFINE_RES_IRQ(MT6320_IRQ_RTC),
};

static const struct resource mt6323_rtc_resources[] = {
DEFINE_RES_MEM(MT6323_RTC_BASE, MT6323_RTC_SIZE),
DEFINE_RES_IRQ(MT6323_IRQ_STATUS_RTC),
Expand All @@ -70,6 +80,11 @@ static const struct resource mt6397_rtc_resources[] = {
DEFINE_RES_IRQ(MT6397_IRQ_RTC),
};

static const struct resource mt6320_keys_resources[] = {
DEFINE_RES_IRQ_NAMED(MT6320_IRQ_PWRKEY, "powerkey"),
DEFINE_RES_IRQ_NAMED(MT6320_IRQ_HOMEKEY, "homekey"),
};

static const struct resource mt6358_keys_resources[] = {
DEFINE_RES_IRQ_NAMED(MT6358_IRQ_PWRKEY, "powerkey"),
DEFINE_RES_IRQ_NAMED(MT6358_IRQ_HOMEKEY, "homekey"),
Expand Down Expand Up @@ -123,6 +138,23 @@ static const struct resource mt6323_pwrc_resources[] = {
DEFINE_RES_MEM(MT6323_PWRC_BASE, MT6323_PWRC_SIZE),
};

static const struct mfd_cell mt6320_devs[] = {
{
.name = "mt6320-rtc",
.num_resources = ARRAY_SIZE(mt6320_rtc_resources),
.resources = mt6320_rtc_resources,
.of_compatible = "mediatek,mt6320-rtc",
}, {
.name = "mt6320-regulator",
.of_compatible = "mediatek,mt6320-regulator"
}, {
.name = "mtk-pmic-keys",
.num_resources = ARRAY_SIZE(mt6320_keys_resources),
.resources = mt6320_keys_resources,
.of_compatible = "mediatek,mt6320-keys",
},
};

static const struct mfd_cell mt6323_devs[] = {
{
.name = "mt6323-rtc",
Expand Down Expand Up @@ -287,6 +319,14 @@ struct chip_data {
int (*irq_init)(struct mt6397_chip *chip);
};

static const struct chip_data mt6320_core = {
.cid_addr = MT6320_CID,
.cid_shift = 0,
.cells = mt6320_devs,
.cell_size = ARRAY_SIZE(mt6320_devs),
.irq_init = mt6397_irq_init,
};

static const struct chip_data mt6323_core = {
.cid_addr = MT6323_CID,
.cid_shift = 0,
Expand All @@ -297,7 +337,7 @@ static const struct chip_data mt6323_core = {

static const struct chip_data mt6328_core = {
.cid_addr = MT6328_HWCID,
.cid_shift = 0,
.cid_shift = 8,
.cells = mt6328_devs,
.cell_size = ARRAY_SIZE(mt6328_devs),
.irq_init = mt6397_irq_init,
Expand All @@ -313,7 +353,7 @@ static const struct chip_data mt6357_core = {

static const struct chip_data mt6331_mt6332_core = {
.cid_addr = MT6331_HWCID,
.cid_shift = 0,
.cid_shift = 8,
.cells = mt6331_mt6332_devs,
.cell_size = ARRAY_SIZE(mt6331_mt6332_devs),
.irq_init = mt6397_irq_init,
Expand Down Expand Up @@ -399,6 +439,9 @@ static int mt6397_probe(struct platform_device *pdev)

static const struct of_device_id mt6397_of_match[] = {
{
.compatible = "mediatek,mt6320",
.data = &mt6320_core,
}, {
.compatible = "mediatek,mt6323",
.data = &mt6323_core,
}, {
Expand Down
8 changes: 8 additions & 0 deletions drivers/mfd/mt6397-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/suspend.h>
#include <linux/mfd/mt6320/core.h>
#include <linux/mfd/mt6320/registers.h>
#include <linux/mfd/mt6323/core.h>
#include <linux/mfd/mt6323/registers.h>
#include <linux/mfd/mt6328/core.h>
Expand Down Expand Up @@ -176,6 +178,12 @@ int mt6397_irq_init(struct mt6397_chip *chip)
mutex_init(&chip->irqlock);

switch (chip->chip_id) {
case MT6320_CHIP_ID:
chip->int_con[0] = MT6320_INT_CON0;
chip->int_con[1] = MT6320_INT_CON1;
chip->int_status[0] = MT6320_INT_STATUS0;
chip->int_status[1] = MT6320_INT_STATUS1;
break;
case MT6323_CHIP_ID:
chip->int_con[0] = MT6323_INT_CON0;
chip->int_con[1] = MT6323_INT_CON1;
Expand Down
Loading