Linux Sound subsystem development
 help / color / mirror / Atom feed
From: ArcticLampyrid <ArcticLampyrid@outlook.com>
To: sbinding@opensource.cirrus.com
Cc: david.rhodes@cirrus.com, james.schulman@cirrus.com,
	linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org,
	patches@opensource.cirrus.com, rf@opensource.cirrus.com,
	ArcticLampyrid <ArcticLampyrid@outlook.com>
Subject: [PATCH v3 1/2] ALSA: cs35l41: obey the trigger type from DSDT
Date: Thu, 18 Apr 2024 21:19:47 +0800	[thread overview]
Message-ID: <TYCP286MB253538FE76C93C032DB55212C40E2@TYCP286MB2535.JPNP286.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <TYCP286MB25357A4599E935F26A8AAB24C40E2@TYCP286MB2535.JPNP286.PROD.OUTLOOK.COM>

On some models, CSC3551's interrupt pin connected to
APIC. We need to obey the trigger type from DSDT in this case.

Signed-off-by: ArcticLampyrid <ArcticLampyrid@outlook.com>
---
 sound/pci/hda/cs35l41_hda.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
index d3fa6e136744..d9c7b4034684 100644
--- a/sound/pci/hda/cs35l41_hda.c
+++ b/sound/pci/hda/cs35l41_hda.c
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <sound/hda_codec.h>
+#include <linux/irq.h>
 #include <sound/soc.h>
 #include <linux/pm_runtime.h>
 #include <linux/spi/spi.h>
@@ -1511,6 +1512,14 @@ static int cs35l41_hda_apply_properties(struct cs35l41_hda *cs35l41)
 	irq_pol = cs35l41_gpio_config(cs35l41->regmap, hw_cfg);
 
 	if (cs35l41->irq && using_irq) {
+		struct irq_data *irq_data;
+
+		irq_data = irq_get_irq_data(cs35l41->irq);
+		if (irq_data && irqd_trigger_type_was_set(irq_data)) {
+			irq_pol = irqd_get_trigger_type(irq_data);
+			dev_info(cs35l41->dev, "Using configured IRQ Polarity: %d\n", irq_pol);
+		}
+
 		ret = devm_regmap_add_irq_chip(cs35l41->dev, cs35l41->regmap, cs35l41->irq,
 					       IRQF_ONESHOT | IRQF_SHARED | irq_pol,
 					       0, &cs35l41_regmap_irq_chip, &cs35l41->irq_data);
-- 
2.44.0


  reply	other threads:[~2024-04-18 13:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18 13:17 [PATCH v3 0/2] ALSA: hda/realtek: Fix internal speakers for Legion Y9000X 2022 IAH7 ArcticLampyrid
2024-04-18 13:19 ` ArcticLampyrid [this message]
2024-04-19 15:09   ` [PATCH v3 1/2] ALSA: cs35l41: obey the trigger type from DSDT Stefan Binding
2024-04-19 15:43     ` Qi Qi
2024-04-18 13:20 ` [PATCH v3 2/2] ALSA: hda/realtek: Fix internal speakers for Legion Y9000X 2022 IAH7 ArcticLampyrid
2024-04-18 13:59   ` Charles Keepax
2024-04-18 14:19     ` Qi Qi
2024-04-18 14:45       ` Greg KH
2024-04-19 15:40     ` Qi Qi

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=TYCP286MB253538FE76C93C032DB55212C40E2@TYCP286MB2535.JPNP286.PROD.OUTLOOK.COM \
    --to=arcticlampyrid@outlook.com \
    --cc=david.rhodes@cirrus.com \
    --cc=james.schulman@cirrus.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=rf@opensource.cirrus.com \
    --cc=sbinding@opensource.cirrus.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