Skip to content

ASoC: mediatek: add initial MT6572 + MT6323 PMIC audio (PAP5500 DUO + Lenovo A369i)#9

Open
gabin8 wants to merge 13 commits into
mt6572-mainline:masterfrom
gabin8:pap5500-audio
Open

ASoC: mediatek: add initial MT6572 + MT6323 PMIC audio (PAP5500 DUO + Lenovo A369i)#9
gabin8 wants to merge 13 commits into
mt6572-mainline:masterfrom
gabin8:pap5500-audio

Conversation

@gabin8

@gabin8 gabin8 commented Jun 2, 2026

Copy link
Copy Markdown

Audio support for the MT6572 AFE + MT6323 PMIC codec, verified on the Prestigio PAP5500 DUO and the Lenovo A369i.

What it brings up

  • MT6572 AFE DL1 playback front-end (HW-IRQ driven, streams from the on-chip SRAM).
  • MT6323 PMIC analog codec — DAC, headphone output and volume controls, over the MT6397 PMIC-wrapper regmap.
  • Speaker output, board-dependent:
    • PAP5500 DUO — external Yamaha YDA145 amplifier modelled as a generic simple-audio-amplifier aux device, fed from the headphone output.
    • Lenovo A369i — the MT6323's internal class-D amplifier (SPK_CON), driven directly on the SPK_P/SPK_N pins, with an analog "Speaker Volume" control.
  • Headphone-jack detection that auto-routes speaker ↔ headphones (PAP5500 DUO: GPIO142/EINT7; A369i: GPIO136/EINT2).

Tested on hardware

  • PAP5500 DUO — playback on speaker + headphones (aplay), volume (AFE digital gain), jack insert/removal auto-switching.
  • Lenovo A369i — playback on the internal class-D speaker + headphones, the analog "Speaker Volume" control, jack auto-switching.

Structure

The original MT6572 AFE + MT6323 codec + PAP5500 DUO enablement, plus three commits for the Lenovo A369i: internal class-D speaker support in the codec, the board DTS + jack EINT pin, and the README status.

@gabin8 gabin8 changed the title ASoC: mediatek: add MT6572 AFE + MT6323 codec audio support ASoC: mediatek: add initial MT6572 + MT6323 PMIC audio support Jun 3, 2026
- Custom Firmware <gabin278@gmail.com>

description:
The MT6572 Audio Front-End (AFE) is a sub-node of the audsys syscon. It

@rva3 rva3 Jun 3, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop sub-node and syscon wording. dt-bindings should describe hardware, not the kernel stuff.

$ref: /schemas/types.yaml#/definitions/phandle
description: the MT6323 PMIC analog codec DAI.

iram:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be a reg of the AFE?

@gabin8 gabin8 Jun 3, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SRAM is a distinct block at 0x11141000. AFE control window is 0x11140000–0x11140fff, so it's a standard mmio-sram node handed to the DL1.
Making it a reg of the AFE is not correct: AFE has no reg of its own (it maps the parent audsys window).
I can rename the property iram -> mediatek,sram if the name is the concern.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think iram is fine, it's used in few kernel DTs

$ref: /schemas/types.yaml#/definitions/phandle
description: on-chip audio SRAM used for the DL1 playback buffers.

mediatek,speaker-amp:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel this should be separate. AFE is AFE, codec is codec, and the audio is the glue. i found this for mt8186:

    sound: mt8186-sound {
        compatible = "mediatek,mt8186-mt6366-da7219-max98357-sound";
        model = "mt8186_da7219_m98357";
        pinctrl-names = "aud_clk_mosi_off",
                        "aud_clk_mosi_on";
        pinctrl-0 = <&aud_clk_mosi_off>;
        pinctrl-1 = <&aud_clk_mosi_on>;
        mediatek,platform = <&afe>;

        audio-routing =
                "Headphones", "HPL",
                "Headphones", "HPR",
                "MIC", "Headset Mic",
                "Speakers", "Speaker",
                "HDMI1", "TX";

        hs-playback-dai-link {
                link-name = "I2S0";
                dai-format = "i2s";
                mediatek,clk-provider = "cpu";
                codec {
                        sound-dai = <&da7219>;
                };
        };

        hs-capture-dai-link {
                link-name = "I2S1";
                dai-format = "i2s";
                mediatek,clk-provider = "cpu";
                codec {
                        sound-dai = <&da7219>;
                };
        };

        spk-dp-playback-dai-link {
                link-name = "I2S3";
                dai-format = "i2s";
                mediatek,clk-provider = "cpu";
                codec {
                        sound-dai = <&anx_bridge_dp>, <&max98357a>;
                };
        };
    };

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the MT6572W functional spec: the MT6323 link isn't a board I2S bus - it's the AFE's output-only I2S (AFE_I2S_CON1) + ADDA downlink SRC out the fixed PMIC pins (AUD_*_MOSI/ADC_DAT_MISO), i.e. the exact equivalent of mt8183's "ADDA" back-end to mt6358.
So I'll match mt8183: AFE platform-only, a separate mt6572-mt6323 machine driver, the codec as a hardcoded ADDA-style back-end in C, and a minimal sound node

- mediatek,audio-codec
- iram

additionalProperties: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also unsquash. 6397 is one change, new binding is another

Comment thread sound/soc/codecs/mt6323.c Outdated
@@ -0,0 +1,336 @@
// SPDX-License-Identifier: GPL-2.0
//
// MediaTek MT6323 PMIC analog audio codec.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be multiline comment?

Comment thread README.md Outdated
| power key: mediatek,mt6323-keys | 🟢 OK | 🟢 OK | 🔴 TBD | 🟢 OK |
| haptics: regulator-haptic | 🟢 OK | 🔴 TBD | 🔴 TBD | 🟢 OK |
| charger | 🔴 DEAD | 🔴 DEAD | 🔴 DEAD | 🔴 DEAD |
| audio (playback + headphone jack) | 🔴 TBD | 🔴 TBD | 🔴 TBD | 🟡 initial: playback + headphone jack, no mic/earpiece |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partial.

DEAD means there's no such feature, TBD means it exists on other devices but not working yet. partial means something is working but not really usable (this one you want), OK means no major issues

Comment thread README.md Outdated
needs afe/i2s/etc drivers
| component | driver | status | note |
|--------------------|---------------------------|---------|--------------------------------------------------|
| AFE (DL1 playback) | mediatek,mt6572-audio | 🟢 OK | DL1 (loudspeaker) playback only; no earpiece/UL |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...but there's jack detection? or it doesn't support audio playback?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is supports both jack detection and jack audio playback. And also auto-switch between speakers and HP

Comment thread README.md Outdated
|--------------------|---------------------------|---------|--------------------------------------------------|
| AFE (DL1 playback) | mediatek,mt6572-audio | 🟢 OK | DL1 (loudspeaker) playback only; no earpiece/UL |
| analog codec | mediatek,mt6323-sound | 🟢 OK | MT6323 PMIC: DAC + headphone output + volume |
| speaker amp | simple-audio-amplifier | 🟢 OK | YDA145, gpio-enabled, fed from the headphone out |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

device specific

Comment thread README.md Outdated
| AFE (DL1 playback) | mediatek,mt6572-audio | 🟢 OK | DL1 (loudspeaker) playback only; no earpiece/UL |
| analog codec | mediatek,mt6323-sound | 🟢 OK | MT6323 PMIC: DAC + headphone output + volume |
| speaker amp | simple-audio-amplifier | 🟢 OK | YDA145, gpio-enabled, fed from the headphone out |
| headphone jack | hp-det-gpios/snd_soc_jack | 🟢 OK | EINT7 plug detect, auto-routes speaker <-> HP |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hp-det-gpios is not a driver

Comment thread README.md Outdated
| speaker amp | simple-audio-amplifier | 🟢 OK | YDA145, gpio-enabled, fed from the headphone out |
| headphone jack | hp-det-gpios/snd_soc_jack | 🟢 OK | EINT7 plug detect, auto-routes speaker <-> HP |
| capture (mic) | | 🔴 DEAD | uplink path not implemented yet |
| i2s | | 🔴 DEAD | not needed for the internal codec |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for notes if it's DEAD

@gabin8 gabin8 requested a review from rva3 June 3, 2026 20:57
@gabin8

gabin8 commented Jun 4, 2026

Copy link
Copy Markdown
Author

btw did you test on your devices?

@rva3 rva3 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all commits are missing signed-off-by. also i don't see changes to the drivers.

$ref: /schemas/iio/adc/mediatek,mt6359-auxadc.yaml#
unevaluatedProperties: false

audio-codec:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing signed-off-by in the commit message

@@ -0,0 +1,41 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing signed-off-by in the commit message

description:
The Audio Front-End (AFE) of the MediaTek MT6572 SoC. It provides the DL1
playback memif (a DMA engine streaming from the on-chip audio SRAM) and the
digital side of the serial audio link to the MT6323 PMIC analog codec.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this sounds generic... probably drop (like all other SoCs do for AFE)?

clocks:
maxItems: 1

clock-names:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clock-names is not needed if clocks maxItems = 1

@@ -0,0 +1,39 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing signed-off-by in the commit message


hp-det-gpios:
maxItems: 1
description: Optional headphone-jack plug-detect GPIO (high = inserted).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GPIO_ACTIVE_LOW can invert this. remove the (high = insert).

Comment thread sound/soc/codecs/mt6323.c Outdated
//
// mt6323.c -- MediaTek MT6323 PMIC analog audio codec
//
// The analog audio back-end (DAC, headphone driver, path to an external

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be multiline comment?

Comment thread sound/soc/codecs/mt6323.c
module_platform_driver(mt6323_codec_driver);

MODULE_DESCRIPTION("MediaTek MT6323 PMIC audio codec driver");
MODULE_LICENSE("GPL");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check comments about the driver from the previous review. i don't see them applied

Comment thread sound/soc/mediatek/mt6572/Makefile Outdated
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
# MediaTek MT6572 AFE platform + machine drivers

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop

Comment thread drivers/mfd/mt6397-core.c
.num_resources = ARRAY_SIZE(mt6323_pwrc_resources),
.resources = mt6323_pwrc_resources,
.of_compatible = "mediatek,mt6323-pwrc"
}, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing signed-off-by in the commit message

@rva3

rva3 commented Jun 4, 2026

Copy link
Copy Markdown

btw did you test on your devices?

no, i'll check later

@gabin8 gabin8 requested a review from rva3 June 8, 2026 22:17
@rva3

rva3 commented Jun 10, 2026

Copy link
Copy Markdown

on hold until i get it working on some of my devices i guess

gabin8 added 2 commits June 13, 2026 17:51
Document mediatek,mt6323-sound in the audio-codec node, alongside the existing MT6358/MT6397 codecs.

Signed-off-by: Custom Firmware <gabin278@gmail.com>
The MT6572 Audio Front-End: a DL1 playback memif streaming from the on-chip audio SRAM to the MT6323 PMIC codec.

Signed-off-by: Custom Firmware <gabin278@gmail.com>
@gabin8 gabin8 changed the title ASoC: mediatek: add initial MT6572 + MT6323 PMIC audio support ASoC: mediatek: add initial MT6572 + MT6323 PMIC audio (PAP5500 DUO + Lenovo A369i) Jun 14, 2026

@rva3 rva3 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can't verify this on my a369i, probably they wired audio differently in my revision. i'll ask someone to check with the other a369i though.

@@ -0,0 +1,41 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'the machine binding'? perhaps devicetree?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rephrased similar to other mtk socs

Comment thread sound/soc/codecs/mt6323.c Outdated
/*
* MediaTek MT6323 PMIC analog audio codec.
*
* The analog audio back-end (DAC, headphone driver, path to an external

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need these comments?

Comment thread sound/soc/codecs/mt6323.c Outdated
SNDRV_PCM_FMTBIT_S32_LE)

/*
* Audio registers in the PMIC 16-bit space: ABB_AFE<->PMIC bridge @ 0x4000,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same. do we need these comments?

Comment thread sound/soc/codecs/mt6323.c Outdated
#define PMIC_CKCON1_AUD_BITS GENMASK(13, 12)

/*
* Output gain lives in the ZCD (zero-cross-detect) block. Each register packs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same... do we need these comments?

Comment thread sound/soc/codecs/mt6323.c Outdated
/*
* Analog idle baseline from the stock power-on; the MT6323 audio fields are
* undocumented. Per the BSP: NEWIF_CFG0 = sample_rate << 12 | 0x330, and
* NEWIF_CFG2 = 0x302f selects the up8x receive-interface ADC voice mode.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Comment thread sound/soc/codecs/mt6323.c
};
module_platform_driver(mt6323_codec_driver);

MODULE_DESCRIPTION("MediaTek MT6323 PMIC audio codec driver");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also squash this into main codec commit

compatible = "mediatek,mt6572-mt6323-sound";
mediatek,platform = <&afe>;
audio-routing = "Speaker", "Speaker Driver";
/* Headphone-jack detect on GPIO136 (low = inserted). */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless comment

MTK_PIN(
136, "GPIO136",
MTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT),
MTK_EINT_FUNCTION(4, 2),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsquash. this should be separate commit so i can squash this with initial pinctrl commit

Comment thread README.md Outdated
| haptics: regulator-haptic | 🟢 OK | 🔴 TBD | 🔴 TBD | 🟢 OK |
| charger | 🔴 DEAD | 🔴 DEAD | 🔴 DEAD | 🔴 DEAD |
| audio (playback + headphone jack) | 🔴 TBD | 🔴 TBD | 🔴 TBD | 🟡 partial: playback + jack |
| audio (playback + headphone jack) | 🔴 TBD | 🟢 OK: playback + jack + speaker | 🔴 TBD | 🟢 OK: playback + jack + speaker |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it actually OK? i don't see the mic

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, no mic support.
downgraded to partial

Comment thread README.md Outdated
| haptics: regulator-haptic | 🟢 OK | 🔴 TBD | 🔴 TBD | 🟢 OK |
| charger | 🔴 DEAD | 🔴 DEAD | 🔴 DEAD | 🔴 DEAD |
| audio (playback + headphone jack) | 🔴 TBD | 🔴 TBD | 🔴 TBD | 🟡 partial: playback + jack |
| audio (playback + headphone jack) | 🔴 TBD | 🟢 OK: playback + jack + speaker | 🔴 TBD | 🟢 OK: playback + jack + speaker |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also squash with the other readme commit

gabin8 added 11 commits June 18, 2026 21:14
The machine binding tying the MT6572 AFE to the MT6323 PMIC codec, with standard aux-devs/audio-routing, optional headphone-jack detection and a speaker amplifier.

Signed-off-by: Custom Firmware <gabin278@gmail.com>
DAC, headphone output, internal class-D speaker and volume controls on
the MT6323 PMIC, reached over the parent MT6397 PMIC-wrapper regmap. The
analog register fields are undocumented; the init values come from the
stock power-on sequence.

Signed-off-by: Custom Firmware <gabin278@gmail.com>
AFE platform driver (DL1 playback memif + ADDA/PMIC link) plus the mt6572-mt6323 machine driver: a DL1 -> mt6323 dai-link, headphone-jack auto-routing between speaker and headphones, and an optional speaker amplifier via the standard aux-devs/audio-routing bindings. Earpiece and uplink/capture are not yet supported.

Signed-off-by: Custom Firmware <gabin278@gmail.com>
Add an mt6323-sound MFD cell so the MT6323 ASoC codec driver probes.

Signed-off-by: Custom Firmware <gabin278@gmail.com>
GPIO142 is the PAP5500 headphone-jack plug-detect line; give it its EINT7 mapping so gpiod_to_irq() works.

Signed-off-by: Custom Firmware <gabin278@gmail.com>
Sub-node of the audsys syscon for the DL1 playback front-end + the on-chip audio SRAM.

Signed-off-by: Custom Firmware <gabin278@gmail.com>
The MT6323 PMIC analog codec (mediatek,mt6323-sound).

Signed-off-by: Custom Firmware <gabin278@gmail.com>
The sound card (mediatek,mt6572-mt6323-sound) with the AFE platform, an external speaker amplifier (simple-audio-amplifier on GPIO139) and headphone-jack detect (GPIO142/EINT7).

Signed-off-by: Custom Firmware <gabin278@gmail.com>
Signed-off-by: Custom Firmware <gabin278@gmail.com>
GPIO136 is the Lenovo A369i headphone-jack plug-detect line; give it its EINT2 mapping so gpiod_to_irq() works.

Signed-off-by: Custom Firmware <gabin278@gmail.com>
Add the MT6572 AFE + MT6323 sound card with the internal class-D speaker and headphone-jack detection on GPIO136.

Signed-off-by: Custom Firmware <gabin278@gmail.com>
@gabin8 gabin8 requested a review from rva3 June 18, 2026 18:53

@rva3 rva3 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments

i'll check what's wrong with audio on my a369i today

Comment thread sound/soc/codecs/mt6323.c
@@ -0,0 +1,355 @@
// SPDX-License-Identifier: GPL-2.0
//
// mt6323.c -- MT6323 PMIC analog audio codec driver

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop filename. just MT6323 PMIC analog audio codec driver is fine

Comment thread sound/soc/codecs/mt6323.c
#define ABB_AFE_CON(n) (0x4000 + (n) * 2)
#define AUDTOP_CON(n) (0x0700 + (n) * 2)
#define SPK_CON(n) (0x0052 + (n) * 2)
/* Speaker clock gate lives in TOP_CKPDN1 (cleared to enable). */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

should we mention topckgen here? i guess devicetree should provide clocks? drop.

Comment thread sound/soc/codecs/mt6323.c
#define AUDTOP_CON(n) (0x0700 + (n) * 2)
#define SPK_CON(n) (0x0052 + (n) * 2)
/* Speaker clock gate lives in TOP_CKPDN1 (cleared to enable). */
#define PMIC_RG_AUD_SPK_PDN 0x000e

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also align regs with tabs (not sure if it's github issue or actually not aligned) like MT6323_TOP_CKPDN0_SET, MT6323_TOP_CKPDN0_CLR, ... are

Comment thread sound/soc/codecs/mt6323.c
#define MT6323_TOP_CKPDN0_SET 0x0104
#define MT6323_TOP_CKPDN0_CLR 0x0106
#define PMIC_RG_CLKSQ_EN_AUD BIT(0)
#define MT6323_TOP_CKPDN1_SET 0x010a

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space between field of the previous reg and new reg, e.g.

#define MT6323_TOP_CKPDN0_SET	0x0104
#define MT6323_TOP_CKPDN0_CLR	0x0106
#define PMIC_RG_CLKSQ_EN_AUD	BIT(0)

#define MT6323_TOP_CKPDN1_SET	0x010a

Comment thread sound/soc/codecs/mt6323.c

struct mt6323_codec_priv {
struct device *dev;
struct regmap *regmap; /* borrowed from the parent MT6323 MFD */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment should be on top, e.g.

/* borrowed from the parent MT6323 MFD */
struct regmap *regmap;

#define AFE_DAC_CON1_DL1_RATE GENMASK(3, 0)
#define AFE_DL1_BASE 0x0040
#define AFE_DL1_CUR 0x0044
#define AFE_DL1_END 0x0048 /* ring end, inclusive */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments on top

#define AFE_IRQ_MCU_STATUS_IRQ1 BIT(0)
#define AFE_IRQ_MCU_STATUS_MASK GENMASK(3, 0)
#define AFE_IRQ_MCU_CLR 0x03a8
/* IRQ fired with no status bit set (status == 0): clear-mask to ack and return. */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move into irq handler or drop

regmap_read(afe->regmap, AFE_IRQ_MCU_STATUS, &status);
status &= AFE_IRQ_MCU_STATUS_MASK;
if (!status) {
regmap_write(afe->regmap, AFE_IRQ_MCU_CLR, AFE_IRQ_MCU_CLR_NOSTATUS);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is write of the whole AFE_IRQ_MCU_CLR_NOSTATUS required here? can it be just regmap_write(afe->regmap, AFE_IRQ_MCU_CLR, status);?

@@ -0,0 +1,137 @@
// SPDX-License-Identifier: GPL-2.0
//
// mt6572-mt6323.c -- MediaTek MT6572 + MT6323 sound card

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop filename

static struct snd_soc_jack_gpio mt6572_mt6323_jack_gpio = {
.name = "hp-det",
.report = SND_JACK_HEADPHONE,
.debounce_time = 256, /* ms */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure... drop the comment i guess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants