From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.127.231.26 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796358096; b=fx1/4FdADzLMkkDQkXfo71z0gPkGUUet4sLBdxz04OGzZm7QENEx/ieN4XTIQBWeYgf+ SLs7ihncQ7YvIw8adLvI4smwq0bhBEzU9eQkV6ZmXCyJEvknTVgAWI4f3M/PpO/hEhfBA B2uKjF11iKpULKByAmOGvgXMzgB7sJVdcluri6+VEsPEl3XcN4OTjGp8EdtNfmSTmeZ94 d46FOiFlftBQCK4PmMm4SxguIPKKRMiZwi/Bn0RjBIGbydLEKLdXTpdaZJm+9POSOm3uC gaDbXZFteLzFBhaNAP3Ti8VhOaNmuHm0sBFNaMTTyiRGrVD3LqSf9sSVaT3kmaW/0NQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796358096; h=DMARC-Filter:DKIM-Signature:Cc:Content-Transfer-Encoding:References: X-Mailer:Content-Type:To:Date:Received:In-Reply-To:X-Lms-Return-Path: Subject:Message-Id:X-Original-From:From:Mime-Version; bh=iTSyFJKj/fOI54sPQukvmFoSPwxbw9/2ia5FtsOkqAE=; b=2OrbUw2crV7OWVEO0nl8YKIvHSK7aFmffd1dUEPgGscLE8Fdc1xlfwKUKX/mvIJG9j8j 508Nm22A3GlsO4hF6fKj1AwQjIxpRC81nkRAzNwnPRVnvaN2MlMlkq++vjaC4tI5Uhs16 wTqUbVsw8GPkxYYRt2gxoZPXSbOlzin29hLLyEZXTkVhf+wv0GL4tzGAz4BVGIGRNa9VC PUS8AHfkpMDwGqewrYfoP6Hvpo8VdFGM1YSHJuo8e87AjmrgHacA2wvjjTWZNopqfzDOw 2VbAq9Vs4+RNnE/kfDU+1UA6RwMsu/7FgQU3FZ5s14kBwFsOwW+KYpXfMLQ7Lixie2A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=deepcomputing.io; spf=pass smtp.mailfrom=deepcomputing.io; dkim=pass header.d=deepcomputing-io.20200927.dkim.feishu.cn header.i=@deepcomputing-io.20200927.dkim.feishu.cn header.a=rsa-sha256 header.s=s1 header.b=bHXmG1Lu; arc=none smtp.remote-ip=209.127.231.26 Received: from va-2-26.ptr.blmpb.com (va-2-26.ptr.blmpb.com [209.127.231.26]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 123EB606A688 for ; Fri, 4 Dec 2026 04:21:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 123EB606A688 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=deepcomputing.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=deepcomputing.io Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=deepcomputing-io.20200927.dkim.feishu.cn header.i=@deepcomputing-io.20200927.dkim.feishu.cn header.a=rsa-sha256 header.s=s1 header.b=bHXmG1Lu DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=s1; d=deepcomputing-io.20200927.dkim.feishu.cn; t=1796358088; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=iTSyFJKj/fOI54sPQukvmFoSPwxbw9/2ia5FtsOkqAE=; b=bHXmG1LuTpdPVX1wyCIn2WT5RLU2kGH+musBM0EdOPATwHnGWyERuVFSPdXkdbughlEVmE 36SaaSXC0N+rWa3zCQbaaCW0xsa8s8v7SVFYQYRy6fjRdRWifi1sgQVx3SeZnRDIkDvtWt XPMiXScstSRLKaIemN5Q9UlpuzdxWl+oeqxB5JJfxJi/bKp8evXZA/41/BBXTQ60/YsULT tGm+AQzIz7tCP36ezzvm7/5+Y3MiSuSB6PuhCmz/xV0vrzp2J0KBA5D//q7pEeLiJOtGu5 UullSSCapJEtqNlhOhFaFBpuvs/w6iY+zAPHgJoT6dhKX2SXwYQrrT+3ss5XaA== Cc: "Benson Leung" , "Tzung-Bi Shih" , "Guenter Roeck" , Content-Transfer-Encoding: 7bit References: <20261204042112.2985112-1-yang.wang@deepcomputing.io> X-Mailer: git-send-email 2.43.0 Content-Type: text/plain; charset=UTF-8 To: Date: Fri, 4 Dec 2026 12:21:02 +0800 Received: from ubuntu.. ([183.23.101.24]) by smtp.feishu.cn with ESMTPS; Fri, 04 Dec 2026 12:21:26 +0800 In-Reply-To: <20261204042112.2985112-1-yang.wang@deepcomputing.io> X-Lms-Return-Path: Subject: [PATCH v2 04/13] platform/chrome: Allow transports to select EC IRQ flags Message-Id: <20261204042112.2985112-5-yang.wang@deepcomputing.io> X-Original-From: Wang Yang From: "Wang Yang" X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 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 --- 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