From: "Wang Yang" <yang.wang@deepcomputing.io>
To: <linux-kernel@vger.kernel.org>
Cc: "Benson Leung" <bleung@chromium.org>,
"Tzung-Bi Shih" <tzungbi@kernel.org>,
"Guenter Roeck" <groeck@chromium.org>,
<chrome-platform@lists.linux.dev>
Subject: [PATCH v2 04/13] platform/chrome: Allow transports to select EC IRQ flags
Date: Fri, 4 Dec 2026 12:21:02 +0800 [thread overview]
Message-ID: <20261204042112.2985112-5-yang.wang@deepcomputing.io> (raw)
In-Reply-To: <20261204042112.2985112-1-yang.wang@deepcomputing.io>
Initialize IRQ flags to IRQF_TRIGGER_LOW | IRQF_ONESHOT when the EC
device is allocated. Use these flags when registering the interrupt so
a transport can rely on the trigger type configured by its firmware.
Prepared with OpenAI Codex assistance.
Signed-off-by: Wang Yang <yang.wang@deepcomputing.io>
---
drivers/platform/chrome/cros_ec.c | 3 ++-
include/linux/platform_data/cros_ec_proto.h | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
index 81631b363402..5c2ce6b74975 100644
--- a/drivers/platform/chrome/cros_ec.c
+++ b/drivers/platform/chrome/cros_ec.c
@@ -63,6 +63,7 @@ struct cros_ec_device *cros_ec_device_alloc(struct device *dev)
return NULL;
ec_dev->dev = dev;
+ ec_dev->irqflags = IRQF_TRIGGER_LOW | IRQF_ONESHOT;
ec_dev->max_response = sizeof(struct ec_response_get_protocol_info);
ec_dev->max_request = sizeof(struct ec_params_rwsig_action);
ec_dev->suspend_timeout_ms = EC_HOST_SLEEP_TIMEOUT_DEFAULT;
@@ -247,7 +248,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
err = devm_request_threaded_irq(dev, ec_dev->irq,
cros_ec_irq_handler,
cros_ec_irq_thread,
- IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+ ec_dev->irqflags,
"chromeos-ec", ec_dev);
if (err)
goto exit;
diff --git a/include/linux/platform_data/cros_ec_proto.h b/include/linux/platform_data/cros_ec_proto.h
index a1ccecf5e1f8..6307f520db55 100644
--- a/include/linux/platform_data/cros_ec_proto.h
+++ b/include/linux/platform_data/cros_ec_proto.h
@@ -111,6 +111,7 @@ struct cros_ec_command {
* @proto_version: The protocol version used for this device.
* @priv: Private data.
* @irq: Interrupt to use.
+ * @irqflags: Interrupt request flags, defaulting to IRQF_TRIGGER_LOW | IRQF_ONESHOT.
* @id: Device id.
* @din: Input buffer (for data from EC). This buffer will always be
* dword-aligned and include enough space for up to 7 word-alignment
@@ -181,6 +182,7 @@ struct cros_ec_device {
u16 proto_version;
void *priv;
int irq;
+ unsigned long irqflags;
u8 *din;
u8 *dout;
int din_size;
--
2.43.0
next prev parent reply other threads:[~2026-12-04 4:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 4:20 [PATCH v2 00/13] Add SpacemiT K3 FML13V05 EC keyboard support Wang Yang
2026-12-04 4:20 ` [PATCH v2 01/13] platform/chrome: Correct LPC EC readmem bounds Wang Yang
2026-12-04 4:21 ` [PATCH v2 02/13] platform/chrome: Extract LPC-style EC protocol helpers Wang Yang
2026-12-04 4:21 ` [PATCH v2 03/13] platform/chrome: Allow transport-specific LPC response timeouts Wang Yang
2026-12-04 4:21 ` Wang Yang [this message]
2026-12-04 4:21 ` [PATCH v2 05/13] dt-bindings: embedded-controller: Add SpacemiT K3 EC window Wang Yang
2026-12-04 4:21 ` [PATCH v2 08/13] platform/chrome: Allow ChromeOS platform support on RISC-V Wang Yang
2026-12-04 4:21 ` [PATCH v2 09/13] platform/chrome: Add SpacemiT K3 eSPI EC transport Wang Yang
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=20261204042112.2985112-5-yang.wang@deepcomputing.io \
--to=yang.wang@deepcomputing.io \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=groeck@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tzungbi@kernel.org \
/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