From patchwork Thu Apr 18 13:19:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ArcticLampyrid X-Patchwork-Id: 13634719 Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01olkn2023.outbound.protection.outlook.com [40.92.99.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65E731E4AD; Thu, 18 Apr 2024 13:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.99.23 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713446404; cv=fail; b=Fq16Mdro9sKi4un3MZJU79MeNgA3LNcNCTG0h2Zslzsp7pP3fXQFZJ6maite+CJoGvoYWp91pV/iaiapoU4hXq0MVPEF8p8V2TY2YH8JWftvP9ff5WBgcqzD0UVDef5+IjLL1+MgJRrWRVZidvrR1Ey+f/SiXPeLljeDUDAsSsQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713446404; c=relaxed/simple; bh=RXaVx98+HAPoB1YxNP+snq4RK/xKaTCR02jC/cZDWrA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=KAQ6b1nf4OZ6lJyIEU7wZX2rMjGcdNL1TeAyiTfNLecL1snNGZITmHFmB1Fr5WCEHfBjUwxrLj2zyV3/Qob/BAUWn8Jf31XyPJsbhrohIbc/0571ofuC5HYPigo3Mx1jdAzLdafDGblvZ+KPBqfyr1uwSBiYFXBG9MT06vOucBs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=OA5GoChd; arc=fail smtp.client-ip=40.92.99.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="OA5GoChd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lEuiW0x8jq9IVwkFYJH8QjTe5OTQL7tgW3G92D6QjBkoxecgWj/Cr8FZc/kIKg2iZQ0vgy/Cryw1pFZ/sXqMeJpZ8pHy4NaI8NWE1dPlYCAIU7YXiUFJroqazOP0g7JjcGKar93Uwz7Q4uL//PF/QbalWoc85Hc5W9BoGZhJ8Cc+jPz1wkna2HJ7vhiF/YR23qQqWxAQzmzShJHW5OPzIl2g9UIeJgxfSan05bdgAqjjGHMtg3ZNFZXT/Hmg15lECC4fNnhEsAvBxHOrAbXgp5+01svulnyoGF6lH5fzbXNu4PV7la/oIQQsu8ZQ1ARz6s1GDfDGMFyCfTk17mch5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=e+/Hy7KFGw3BwOLFALtMC4ALkZp5ybscPilbgxF1hAE=; b=Xdd1cDP3QaDVFNGOeEs0B/EeHAxv3x0eHEMRhqSJf6rMTPElj/VZ1VdKlDcdF8yHyG7VOq2ANoneW4L2lmiW+WucMB845ZjVRPeY/EU1pU5Zl3CeaTLj8mWdgy8gcBAWaCk9qasBndQBRmKIHvhqWbtD8Wn25plBqxauLN3T3n3Q6hEw0pbNCPUQLtsgF4zWVX1gxsZtz5aqWHKbKia/rLPRK43kq5GXzf8PNhvOnoUPgkX5oqoqeBdNjayeRWA0fA7d2wvftpsSfZLE604CBC6XMYYUv2juH16o1j4YveOKux9hCpzdlXpyyfd0KnragC+TRNcm8P4INJ07YoaiyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e+/Hy7KFGw3BwOLFALtMC4ALkZp5ybscPilbgxF1hAE=; b=OA5GoChdbLpaggEegZHq1OxrARqRuRPrKB7K5Ya+Wnhx9yeNCHS0QymdNKzY2Ru/wTNYKZLczvv1k4YvSv2XwYrx19qnLzWW5CICH32oCNUh6v5dcmVh5pK1JZG/jDwbt+hAYuJOINXQcJpou9a6Q3WK9pk2xhKf1TD7fccO39yt3mUBEvtgsQvSlOXQGQsUsj4iM9wZhRV4/mm9LDbDwsG0RuiVvfnhWSei4fsxxLxD1VWDQAsHSy4u9pDrpJl/GY5hsiY1+SzmBGAmZRW3FIH3ilEWOJrBTWvJHaleN/sUXce2u/n0ASH+pbq7E9gsErt7b1uohjcCZfhm0hwp+g== Received: from TYCP286MB2535.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:209::11) by TYWP286MB2794.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:23d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.39; Thu, 18 Apr 2024 13:19:59 +0000 Received: from TYCP286MB2535.JPNP286.PROD.OUTLOOK.COM ([fe80::f2c3:e53f:2ea9:55c8]) by TYCP286MB2535.JPNP286.PROD.OUTLOOK.COM ([fe80::f2c3:e53f:2ea9:55c8%4]) with mapi id 15.20.7472.037; Thu, 18 Apr 2024 13:19:59 +0000 From: ArcticLampyrid 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 Subject: [PATCH v3 1/2] ALSA: cs35l41: obey the trigger type from DSDT Date: Thu, 18 Apr 2024 21:19:47 +0800 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: X-TMN: [AYL1dpxLI1H90hbDQE2RRI/AwlK1vwxQkVy/njQxZnbIV1rQvPBbqA==] X-ClientProxiedBy: TYCP286CA0071.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31a::15) To TYCP286MB2535.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:209::11) X-Microsoft-Original-Message-ID: <20240418131947.31747-1-ArcticLampyrid@outlook.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCP286MB2535:EE_|TYWP286MB2794:EE_ X-MS-Office365-Filtering-Correlation-Id: 61a1b809-1019-4536-8682-08dc5faa3f6b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mee11nwGd6fX41BSepF9BJfr3qutTkb0J4bymvn0EGRnbtWTAd/txNOhciwjh4Vk6GIfyUQzITZSs8tqy7KUTbn0ISsBeslaYq8+yePSmaHANpRH0rC/vQx9TytA7HeIg0T/6lirh36+sy4Y6oiRf//UkRyB9V0dBtByDmw3mekH6l8BpbxW6q/9MOmbqIk/qvfM22vA9L0GpFkWZ8defoGGMtBW0swTzYt97b1Gw+EPsEtqT9j69XvMJwRsFGLmVYIGvQQhPshyE2w4Z7t780RdrXDzd8jQTDGC9Osm8t/uatnRPwRieoChnoFgdp0X6dYc3BjJ3jp7XA/Rv2nx9rjMb83YAHaaS9x59ZR3Lm0LlB7fFfes2Fqdp8nLPcPNUQxK69qH68l+/eSlr8nDFJgIqJt2zCSbLkwWHidcK6FGcORC2+6Ud2h4k/Uqvvs3ht0XZGSyWX1nhQY4SXvCgXuRePDPYAR6H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VBvGw52Y55i8eWeCStwgsYztvIuWAQJ9nInAT0hpXHc5OxoW4ivSvgbA1sPg77Mel8nWDNAaBrCfuJSeYof7V8e1YYCdOEmiw+5OkhnB9vadmQYMzNuBNVr2Y9+eK1IAkkqcJdqMEPFznV17WX7TaXbYMZ3ao/Me2/heLcO7AE9vVc3XQEXhEZnymI15byjUHvMn77WesGP1YaUCsV82yVV4aCgluMcHpELOBRqD+Ererpg8J0VZoMzvhcoYj1nGjh1NnQH7mCjb5QtJljgFTt+GZemOFqclARhj4YElmdWQwzMdhIPBtohzSkuhhGauvFhw/whubkJkkEE579Ei1xd4VSqxMkPe6rAf92WeAWYy4oRRuIqH99Zcbe2xddQXJmqnnuPnrBU7bvFXep2iAA6wY7KgEsgAopUh+Pvt7CBWYzWBcaxFjK46KqxxKyrBzMkJyI+WzK75oF7Q== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61a1b809-1019-4536-8682-08dc5faa3f6b X-MS-Exchange-CrossTenant-AuthSource: TYCP286MB2535.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2024 13:19:59.5797 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWP286MB2794 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 --- 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 #include #include +#include #include #include #include @@ -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);