public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Jack Yu <jack.yu@realtek.com>, Mark Brown <broonie@kernel.org>,
	Sasha Levin <sashal@kernel.org>,
	oder_chiou@realtek.com, lgirdwood@gmail.com, perex@perex.cz,
	tiwai@suse.com, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH AUTOSEL 6.19-6.18] ASoC: rt721-sdca: Fix issue of fail to detect OMTP jack type
Date: Mon, 23 Feb 2026 07:37:07 -0500	[thread overview]
Message-ID: <20260223123738.1532940-2-sashal@kernel.org> (raw)
In-Reply-To: <20260223123738.1532940-1-sashal@kernel.org>

From: Jack Yu <jack.yu@realtek.com>

[ Upstream commit 5578da7d957fbaf91f6c39ba2363c2d2e4273183 ]

Add related HP-JD settings to fix issue of fail to detect
OMTP jack type.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://patch.msgid.link/20260210074335.2337830-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

## Analysis

### 1. Commit Message Analysis

The commit subject is explicitly a **fix**: "Fix issue of fail to detect
OMTP jack type." OMTP is a widely-used headphone jack standard (with
reversed mic/ground pins compared to CTIA). Failure to detect OMTP jacks
means users with OMTP headsets won't get proper microphone functionality
— the mic won't work or audio will be misrouted.

The author is **Jack Yu from Realtek** — the vendor engineer who wrote
the original driver. The commit was reviewed and merged by **Mark
Brown**, the ASoC subsystem maintainer.

### 2. Code Change Analysis

The fix modifies exactly **two register preset values** in
`rt721_sdca_jack_preset()`:

1. **Line 248**: `RT721_CBJ_A0_GAT_CTRL1` value changed from `0x2a02` to
   `0x2205` — This is a combo jack (CBJ) gate control register that
   governs jack type detection logic.
2. **Line 253**: Register `0x310400` value changed from `0x3023` to
   `0x3043` — This is an HP-JD (Headphone Jack Detect) setting register.

These are pure hardware register tuning changes — no control flow, no
new code paths, no new features. The function `rt721_sdca_jack_preset`
is a hardware initialization sequence that writes preset values to
configure the codec's jack detection circuitry.

### 3. Classification

This is a **hardware quirk/workaround** — correcting register values so
the codec properly detects a standard jack type. It falls squarely in
the "quirks and workarounds" exception category for stable. It's
analogous to audio codec quirks (`SND_PCI_QUIRK` entries) that are
routinely backported.

### 4. Scope and Risk Assessment

- **Extremely small change**: Only 2 register values modified (2 lines)
- **Zero structural change**: No new functions, no new control flow, no
  API changes
- **Confined scope**: Only affects rt721 SDCA codec users
- **Low regression risk**: These register values only affect the OMTP
  detection path; the worst case is that the values are still wrong (but
  CTIA detection should be unaffected since these are jack detect preset
  parameters set by the vendor)
- **Vendor-provided values**: Realtek knows their hardware — these
  register values come from the vendor's hardware team

### 5. User Impact

Users with RT721-SDCA codec (present in modern laptops using SoundWire)
who plug in OMTP headsets would find the microphone not working. This is
a real-world usability issue affecting actual hardware users.

### 6. Stable Tree Applicability

The rt721-sdca driver was introduced in commit `86ce355c1f9ab` which
first appeared in **v6.13-rc1**. This means the fix is applicable to
stable trees **6.13.y** and later (6.14.y, etc.). It would NOT apply to
6.12.y or earlier since the driver doesn't exist there.

### 7. Dependencies

The fix modifies only preset register values in an existing function. It
has **no dependencies** on other commits — it's a standalone two-line
value change.

### Verification

- **git log** confirmed `rt721-sdca.c` was introduced in commit
  `86ce355c1f9ab` (Oct 2024)
- **git tag --contains** confirmed the driver first appeared in
  v6.13-rc1
- **Read of the file** confirmed the function `rt721_sdca_jack_preset()`
  at lines 211-288 is a pure hardware register initialization sequence
- **Exploration** confirmed Jack Yu (jack.yu@realtek.com) from Realtek
  is the original author and continues to maintain the driver
- **Stable branches** confirmed `linux-6.13.y` exists as a target for
  backport
- The change is exactly 2 register values being modified, verified by
  reading the diff

### Conclusion

This is a small, surgical, vendor-provided hardware fix from the codec
manufacturer. It corrects register preset values to fix OMTP jack type
detection on RT721-SDCA codecs. The change is:
- Obviously correct (vendor-provided register values)
- Fixes a real bug (OMTP headsets don't work)
- Small and contained (2 register value changes)
- Does not introduce new features or APIs
- Has minimal regression risk

**YES**

 sound/soc/codecs/rt721-sdca.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt721-sdca.c b/sound/soc/codecs/rt721-sdca.c
index 8233532a1752a..35960c2252249 100644
--- a/sound/soc/codecs/rt721-sdca.c
+++ b/sound/soc/codecs/rt721-sdca.c
@@ -245,12 +245,12 @@ static void rt721_sdca_jack_preset(struct rt721_sdca_priv *rt721)
 	regmap_write(rt721->mbq_regmap, 0x5b10007, 0x2000);
 	regmap_write(rt721->mbq_regmap, 0x5B10017, 0x1b0f);
 	rt_sdca_index_write(rt721->mbq_regmap, RT721_CBJ_CTRL,
-		RT721_CBJ_A0_GAT_CTRL1, 0x2a02);
+		RT721_CBJ_A0_GAT_CTRL1, 0x2205);
 	rt_sdca_index_write(rt721->mbq_regmap, RT721_CAP_PORT_CTRL,
 		RT721_HP_AMP_2CH_CAL4, 0xa105);
 	rt_sdca_index_write(rt721->mbq_regmap, RT721_VENDOR_ANA_CTL,
 		RT721_UAJ_TOP_TCON14, 0x3b33);
-	regmap_write(rt721->mbq_regmap, 0x310400, 0x3023);
+	regmap_write(rt721->mbq_regmap, 0x310400, 0x3043);
 	rt_sdca_index_write(rt721->mbq_regmap, RT721_VENDOR_ANA_CTL,
 		RT721_UAJ_TOP_TCON14, 0x3f33);
 	rt_sdca_index_write(rt721->mbq_regmap, RT721_VENDOR_ANA_CTL,
-- 
2.51.0


  reply	other threads:[~2026-02-23 12:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 12:37 [PATCH AUTOSEL 6.19-6.1] drm/amd/display: Remove conditional for shaper 3DLUT power-on Sasha Levin
2026-02-23 12:37 ` Sasha Levin [this message]
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.18] ALSA: hda/tas2781: Ignore reset check for SPI device Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-5.15] btrfs: replace BUG() with error handling in __btrfs_balance() Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-5.15] ALSA: usb-audio: Add sanity check for OOB writes at silencing Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.12] drm/amd/display: Fix system resume lag issue Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.12] arm64: hugetlbpage: avoid unused-but-set-parameter warning (gcc-16) Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.12] drm/amd/display: Fix writeback on DCN 3.2+ Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.18] drm/amdgpu: Skip vcn poison irq release on VF Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.18] drm/amdgpu: return when ras table checksum is error Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.18] regulator: core: Remove regulator supply_name length limit Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-5.10] ARM: 9467/1: mm: Don't use %pK through printk Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-5.10] drm/radeon: Add HAINAN clock adjustment Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.18] drm/amdgpu: avoid sdma ring reset in sriov Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.12] spi: spidev: fix lock inversion between spi_lock and buf_lock Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-5.15] drm/amdgpu: Adjust usleep_range in fence wait Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19] mshv: Ignore second stats page map result failure Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19] btrfs: do not ASSERT() when the fs flips RO inside btrfs_repair_io_failure() Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.18] ALSA: hda/hdmi: Add quirk for TUXEDO IBS14G6 Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19] drm/amd/display: set enable_legacy_fast_update to false for DCN36 Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19] x86/hyperv: Move hv crash init after hypercall pg setup Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.18] mshv: clear eventfd counter on irqfd shutdown Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-5.10] drm/amd/display: Avoid updating surface with the same surface under MPO Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-5.15] ALSA: usb-audio: Update the number of packets properly at receiving Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.12] drm/amd/display: bypass post csc for additional color spaces in dal Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.18] ASoC: amd: amd_sdw: add machine driver quirk for Lenovo models Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-6.18] ALSA: hda/realtek: Fix headset mic on ASUS Zenbook 14 UX3405MA Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19] Drivers: hv: vmbus: Use kthread for vmbus interrupts on PREEMPT_RT Sasha Levin
2026-02-23 12:37 ` [PATCH AUTOSEL 6.19-5.10] drm/amdgpu: Add HAINAN clock adjustment Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260223123738.1532940-2-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=broonie@kernel.org \
    --cc=jack.yu@realtek.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=patches@lists.linux.dev \
    --cc=perex@perex.cz \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox