← Back to Pull requests

drivers: opamp: mspm0: add GPAMP driver #127032

Open
unknown opened this pull request with 193 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 25, 2026 07:31 UTC
Author

Add a Zephyr opamp driver for the MSPM0 General Purpose Amplifier (GPAMP).

GPAMP has no dedicated register block — it's controlled by the PMUOPAMP register inside SYSCTL, so the device node is a child of the SYSCTL syscon node and is accessed via syscon_write_reg/syscon_read_reg rather than a mapped reg.

The amplifier has no internal gain stage; gain is set by the external feedback network. The driver only supports follower and standalone functional modes

  • follower: output fed back to the inverting input (gain fixed at x1). With ti,outpin-enable, output goes to the GPAMP_OUT pin (unity-gain buffer mode); without it, output stays internal (e.g. ADC input buffer).

  • standalone: inverting input on GPAMP_IN-, all feedback external. Requires ti,outpin-enable.
  • set_gain() follows the opamp_functional_mode contract: in follower mode it only accepts OPAMP_GAIN_1 (else -ENOTSUP); in standalone mode the call is a documented no-op and returns 0.

    Input routing (NSEL), chopping mode/frequency, and RRI input-stage selection are all devicetree-driven, derived from functional-mode and ti,* properties at build time via BUILD_ASSERT-checked macros.

  • Adds the ti,mspm0-gpamp binding, enables the gpamp node on G-series (g110x/g150x/g310x/g350x) and L-series (l110x/l13x3/l13x4) SoCs that have the peripheral per SDK headers
  • Testing:

  • tests/drivers/opamp/opamp_api on lp_mspm0g3507

  • -->
    <img width="737" height="317" alt="image" src="https://github.com/user-attachments/assets/61b62bda-4cf5-4ee0-b0b5-2d8c4a2d35ea" />

    Diff: 193 lines (+144 / -49) across 2 files Reviewer: KozhinovAlexander Review duration: 8762m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 193 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.315
    Real PR Conversation Timeline
    1 comments
    "Review active on #127032"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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.0% (MEDIUM) · Higher = larger blast radius
    36.0%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 19.2% · Safe to merge
    19.2%