← Back to Pull requests

feat(PeriphDrivers): Allow skipping GPIO and clock init in I2S drivers #1652

Closed
unknown closed this pull request without merging on Nov 23, 2026 12:38 UTC
View on GitHub
unknown unknown commented on Nov 20, 2026 11:01 UTC
Author

Description

MXC_I2S_Init() configures the I2S pins with MXC_GPIO_Config() and enables the I2S peripheral clock and its clock source. MXC_I2S_Shutdown() disables the peripheral clock. In Zephyr builds MSDK_NO_GPIO_CLK_INIT is defined: pinctrl owns the pins and the clock control driver owns the clocks. Each i2s_configure() call therefore overwrote the pinctrl settings (pull, VDDIOH), and shutdown turned off a clock Zephyr had enabled.

This PR skips the GPIO and clock handling when MSDK_NO_GPIO_CLK_INIT is defined, as the other drivers already do (UART, I2C, TRNG, ...). The I2S register reset in MXC_I2S_Shutdown() is kept, so MXC_I2S_Init() still starts from a clean state.

Drivers changed:

  • I2S/i2s_me17.c (MAX32655/56)

  • I2S/i2s_ai85.c (MAX78000), I2S/i2s_ai87.c (MAX78002)

  • I2S/i2s_me12.c (MAX32662), I2S/i2s_me15.c (MAX32670/75), I2S/i2s_me18.c (MAX32690), I2S/i2s_me20.c (MAX32680), I2S/i2s_me21.c (MAX32672), I2S/i2s_me16.c

  • SPIMSS/i2s_me10.c (MAX32650), SPIMSS/i2s_me11.c (MAX32660): MXC_I2S_Init() was already guarded; the clock disable in MXC_I2S_Shutdown() is now guarded too. On MAX32660 that clock is SPI1's, so I2S shutdown also stopped SPI1.
  • Without MSDK_NO_GPIO_CLK_INIT (normal MSDK builds), nothing changes.

    Testing

  • MAX32655 on Zephyr (MAX32655EVKIT, HW CI): the new drivers.i2s.max32.pinctrl test failed before this change (pin config reset after i2s_configure()) and passes with it.

  • All changed drivers compile with -Wall -Werror, both with and without MSDK_NO_GPIO_CLK_INIT.

  • clang-format clean.
  • Signed-off-by: Dimitrije Lilic <Dimitrije.Lilic@analog.com>

    Diff: 209 lines (+156 / -53) across 2 files Reviewer: ttmut Review duration: 4417m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 209 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.320
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1652"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.4% (MEDIUM) · Higher = larger blast radius
    36.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.4% · Safe to merge
    14.4%