From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f182.google.com (mail-yw1-f182.google.com [209.85.128.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4149532B9B5 for ; Mon, 13 Jul 2026 21:21:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783977713; cv=none; b=VDyitagcyOW5dHJU8x59+nXkvkPssLRgl8tUEpWVfrL2lb8kQcMxC788gHTnYsWc5RieUeDNd2FVNDaIA4bWm2ARcMKDWf4MFgJh8piOLbqVYcAn9BOpwbsg1nE74faStat2HRNaPrVXlqpCWrMaj8tPDWSLg6zASVo+0VboERc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783977713; c=relaxed/simple; bh=7uj7EbwyL2wBmOF1OYYDW4WfGY4SXoQRdpO12dF+O2Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=loRVUMNbC/LHCmLHKW8NK1v3BYGzK68NOY5i6S/t7aNLiq2xcK8OZGO+hVve5B6J0HvEWrmLRM6ELwQUMktTyRuzPfR4eyW1xedvdmnUcxEno13kqu454wdHAR1+m/zbKjWPcrgNnzNw/uaLyNYveqpoSRzJ+jlspAI6p1jInNc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=W3bbSXu5; arc=none smtp.client-ip=209.85.128.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="W3bbSXu5" Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-809b19a7f25so47494237b3.3 for ; Mon, 13 Jul 2026 14:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1783977711; x=1784582511; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=2Ss/hoKisOIZ0hdb5KRCghJHfPatt8rPwofgtoTmP3Y=; b=W3bbSXu55nR9FITDPPaJZFnOyKM7TvYkrk3C2S+I7jF60M/A/8Z2rFyOLBo8d+HBFY PPtDFRuYRoDqXsu8pm3zG2w4e7BheJ/0b/qbjbrpsZBwquuLFVfYZ3T6wXsexyJ0Rm1u 0RkhhTYh2Hjtr3YQddBlKnF1W8WxWUcIba+Zw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783977711; x=1784582511; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=2Ss/hoKisOIZ0hdb5KRCghJHfPatt8rPwofgtoTmP3Y=; b=BmI0ry4aEwME0nGbUKly0KEjRf4iKszSvk2UQc2ystRuzB+8XJq0/zb6Ko1ghFuil3 jlcFnrjJ8fJtihKCE3Cr7bZAxv+EdUG7bXeSiXcIZSVQEFCUvlf7Vzt+jwKksm3V5jDZ 2w+7ugKYYCYqhvX0YYlaqK3i0WUnxnIakiDDaw0NzUmvK83ZKW+J+trREmyCzrpJ3rhp Tvg2v+J9XUR9EfXCzxnBL3B03R5ozlvfB3HJizM6xjDyNvebQhNHWE/8QI3VVlBky4e2 rU06T0qowGTHWo536pOEeNCzNuccenXv/QVA1++yfB+nDPJzHLZU31bdkjjriiFTu26G pyQA== X-Forwarded-Encrypted: i=1; AHgh+RoepxsK4GNiLtin11vK7CxWluFueGnD2fpWjfSc1tyrxwbzjZUjAlRt+K6JTITqQUKKXgkw7k5WTUrXzQ4=@vger.kernel.org X-Gm-Message-State: AOJu0YwbOnkxHM2Licrjq95FcjUfUT/gGQ9ecOqZHz0UGi2NipRRYJtY ugvgYCtrDS3ygOGjzmLmOiAzvPZy7TiitrIl7SH1x9XkEcxNkVS4o/fKiCNweRkmUw== X-Gm-Gg: AfdE7ckfv1nHX4gzDWtihZlM0M4iCI2Bo5IpbB/RGilP0QxLH1UonkO2XillKOwGvvE G2y4u6v29AVadNOjVDqLRwYXI4C8kKyqyThyD5bQT4vxIpU2ezzcied6NicgaFVPZl8xBkcYQjR 311aeLSEAJnNMwOsM8JZcrs8oMyU1tQLK0LZ+AXWP2lWEGdUGJbMQI7S+D4MgNPGXMNQKdfqec5 WP/84nJ8UYzC6EiqZs4TfVrfzjJmqb7m3c0fZc15ziGWUeXMDiII3Rq+b7puKZLUNWl8uZvmQw7 yor0P3zt/+39rf+n5xXwRWz3fu1jie+i+nqfw8Gw/7UvWRYQu7cS3UjVmAP2erbVDE1GFM5rokk gGJ88NF6+MScPtRNWG0jF5bA7hhrqowdsFhby9puJXygxNK+JIcXkgnMdj/Ve1SSuudtnDxd3jB 3beJtt9F8Rcxg+Q8eGpV7+en3pRLhX2VwMZ0zRcOz3qIEpuRpCQE0Ydufkn1fD1dckSslhqgOjF UwtVIa7QQ== X-Received: by 2002:a05:690c:e685:b0:81e:ba51:909b with SMTP id 00721157ae682-81eba519148mr7629307b3.70.1783977711262; Mon, 13 Jul 2026 14:21:51 -0700 (PDT) Received: from ripwilburliny.c.googlers.com (188.63.48.34.bc.googleusercontent.com. [34.48.63.188]) by smtp.gmail.com with ESMTPSA id 00721157ae682-81e6bf82412sm126631447b3.21.2026.07.13.14.21.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 14:21:50 -0700 (PDT) From: Steven 'Steve' Kendall Date: Mon, 13 Jul 2026 21:21:41 +0000 Subject: [PATCH] ALSA: hda/cs8409: Fix for Dell Cirrus audio jack detect Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260713-fix-headphone-plug-cirrus-dell-v1-1-3c5157cd45cd@chromium.org> X-B4-Tracking: v=1; b=H4sIAORWVWoC/x2NwQqDMBAFf0X27EJMjaX9FekhNU+zEGLYYCmI/ 97Q4xxm5qQKFVR6dicpPlJlzw2GvqMl+ryBJTQma+xk7oPhVb4c4UOJewaXdGy8iOpROSAldri 9x0fwbnWWWqQomvEfzK/r+gG1mQ+wcAAAAA== X-Change-ID: 20260710-fix-headphone-plug-cirrus-dell-5e3b49da5f52 To: Jaroslav Kysela , Takashi Iwai Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Steven 'Steve' Kendall X-Mailer: b4 0.14.3 On some models like the Dell Inspiron 15 3520, jack detection does not work. This patch switches to polling and more regularly queries the lower values rather than cached values for the headphone and mic jacks. It also includes some logic to prevent the polling while headphones are already plugged so no audible "tick" can be heard. --- This patch switches to a polling method for a specific Dell machine (Inspiron 15 3520). This fixes jack detection for this model. It's possible the gate on manufacturer and model are unnecessary and this problem is common to a wider set of machines, but I've only tested on one machine thus far. I left the other logic ungated as it seemed likely the cache was not providing up-to-date information broadly. But I'm open to gating more or less of the content or changing the approach entirely. Signed-off-by: Steven 'Steve' Kendall --- sound/hda/codecs/cirrus/cs8409.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sound/hda/codecs/cirrus/cs8409.c b/sound/hda/codecs/cirrus/cs8409.c index c43ff3ef75b6e..733234844e7df 100644 --- a/sound/hda/codecs/cirrus/cs8409.c +++ b/sound/hda/codecs/cirrus/cs8409.c @@ -766,6 +766,9 @@ static int cs42l42_handle_tip_sense(struct sub_codec *cs42l42, unsigned int reg_ /* TIP_SENSE INSERT/REMOVE */ switch (reg_ts_status) { case CS42L42_TS_PLUG: + // if jack is already plugged, ignore plug event + if (cs42l42->hp_jack_in) + break; if (cs42l42->no_type_dect) { status_changed = 1; cs42l42->hp_jack_in = 1; @@ -776,6 +779,9 @@ static int cs42l42_handle_tip_sense(struct sub_codec *cs42l42, unsigned int reg_ break; case CS42L42_TS_UNPLUG: + // if jack is already unplugged, ignore unplug event + if (!cs42l42->hp_jack_in && !cs42l42->mic_jack_in) + break; status_changed = 1; cs42l42->hp_jack_in = 0; cs42l42->mic_jack_in = 0; @@ -1092,12 +1098,14 @@ static int cs8409_cs42l42_exec_verb(struct hdac_device *dev, unsigned int cmd, u switch (nid) { case CS8409_CS42L42_HP_PIN_NID: if (verb == AC_VERB_GET_PIN_SENSE) { + cs42l42_jack_unsol_event(cs42l42); *res = (cs42l42->hp_jack_in) ? AC_PINSENSE_PRESENCE : 0; return 0; } break; case CS8409_CS42L42_AMIC_PIN_NID: if (verb == AC_VERB_GET_PIN_SENSE) { + cs42l42_jack_unsol_event(cs42l42); *res = (cs42l42->mic_jack_in) ? AC_PINSENSE_PRESENCE : 0; return 0; } @@ -1157,6 +1165,11 @@ void cs8409_cs42l42_fixups(struct hda_codec *codec, const struct hda_fixup *fix, case CS8409_WARLOCK_MLK_DUAL_MIC: spec->scodecs[CS8409_CODEC0]->full_scale_vol = CS42L42_FULL_SCALE_VOL_0DB; spec->speaker_pdn_gpio = CS8409_WARLOCK_SPEAKER_PDN; + // if Dell Inspiron 15 3520, poll jack at 250ms + if (codec->bus->pci->subsystem_vendor == 0x1028 && + codec->bus->pci->subsystem_device == 0x0bb2) { + codec->jackpoll_interval = msecs_to_jiffies(250); + } break; default: spec->scodecs[CS8409_CODEC0]->full_scale_vol = @@ -1208,8 +1221,10 @@ void cs8409_cs42l42_fixups(struct hda_codec *codec, const struct hda_fixup *fix, * Run immediately after init. */ if (spec->init_done && spec->build_ctrl_done - && !spec->scodecs[CS8409_CODEC0]->hp_jack_in) + && !spec->scodecs[CS8409_CODEC0]->hp_jack_in) { cs42l42_run_jack_detect(spec->scodecs[CS8409_CODEC0]); + cs42l42_enable_jack_detect(spec->scodecs[CS8409_CODEC0]); + } break; default: break; --- base-commit: d96fcfe1b7f94ac742984ae7986b94a116abff1b change-id: 20260710-fix-headphone-plug-cirrus-dell-5e3b49da5f52 Best regards, -- Steven 'Steve' Kendall