Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2715204pxb; Thu, 3 Feb 2022 12:35:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSgTNK8MJWw6C3BqpRKXc6d0+UMXJbwxaG5FJq/xE+ZR3Wnv5LVRysNUwUAEbg4cw9qSQM X-Received: by 2002:a65:681a:: with SMTP id l26mr29387366pgt.365.1643920504944; Thu, 03 Feb 2022 12:35:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643920504; cv=none; d=google.com; s=arc-20160816; b=DWQYBpQR9alLCH1ZnESgnsXnyKQwp3SiBnEYUqlcNznYH/tfsPwTBXRA4Azmv8mS1Z +X81+elPAwMBVXw1nL+jTTH9Zba/ntkkOEePBQqbUmJlZ4OUmbvxOAFJ/HhkAbe+dVCQ rwuqiNKY7QW+3n6qkIyhVometK52bPft0aWYnbkxf3LtlWWxzGwYGSbhq5WdiplEqNSH YIhxMLDosfm062gpgGsxu1p2OiaYW19GCdAMp+GbKkObrS3YuZ4yRj/iVqodylSAXDMR rr7KHL2oS0yb5ctBkuv2J+T4sFj4IeDN+dwnl08fQfzghYz1hxJQSB4Ul2h7ECPz3l5F ZGGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=k50uuyFvzzRJev2cja55ejCxd5fDC4iujyK9kETMqOg=; b=RJPlFH/gw7VpoDoSrJVvu5fm3oB2zAjYJQoNhOUN4JHXodDdGTOYKlpHRukfwbzXcY Y29h/c4yD6fmQA+5sSB9xuMxjhaMlRkIkyDYlO5OdCFJfKJFBjQOq7e0kR0vFuJjVojM dsavrwr8L2lRXg3uSzapdoVK89D1QubTuQ3E4uWI94AucNynbLKf0RXyvfVAQxVc7sJK 9LfbcXzRzIOp0nLfSTohzREFnaabQwG0YfnctMrIggFDexp3+jrsvxnakTOJ6qNhu+6x /F8yFtlAMXGK1GQE4Jc7mvIMKxxEnuUjUxNFfLkklDDDQRR0/8svsNFbxLoQgv2quFox Mc9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u64si22703570pgd.742.2022.02.03.12.34.53; Thu, 03 Feb 2022 12:35:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350977AbiBCOGN (ORCPT + 99 others); Thu, 3 Feb 2022 09:06:13 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:43479 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235600AbiBCOGM (ORCPT ); Thu, 3 Feb 2022 09:06:12 -0500 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFcc5-00033s-10; Thu, 03 Feb 2022 14:57:29 +0100 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nFcc4-009xpX-Hv; Thu, 03 Feb 2022 14:57:28 +0100 From: Oleksij Rempel To: William Breathitt Gray Cc: Oleksij Rempel , linux-kernel@vger.kernel.org, Pengutronix Kernel Team , David Jander , Robin van der Gracht , linux-iio@vger.kernel.org, Jonathan Cameron Subject: [PATCH v2 2/2] counter: interrupt-cnt: add counter_push_event() Date: Thu, 3 Feb 2022 14:57:27 +0100 Message-Id: <20220203135727.2374052-3-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220203135727.2374052-1-o.rempel@pengutronix.de> References: <20220203135727.2374052-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add counter_push_event() to notify user space about new pulses Signed-off-by: Oleksij Rempel --- drivers/counter/interrupt-cnt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/counter/interrupt-cnt.c b/drivers/counter/interrupt-cnt.c index 9e99702470c2..3b13f56bbb11 100644 --- a/drivers/counter/interrupt-cnt.c +++ b/drivers/counter/interrupt-cnt.c @@ -26,10 +26,13 @@ struct interrupt_cnt_priv { static irqreturn_t interrupt_cnt_isr(int irq, void *dev_id) { - struct interrupt_cnt_priv *priv = dev_id; + struct counter_device *counter = dev_id; + struct interrupt_cnt_priv *priv = counter_priv(counter); atomic_inc(&priv->count); + counter_push_event(counter, COUNTER_EVENT_CHANGE_OF_STATE, 0); + return IRQ_HANDLED; } @@ -209,7 +212,7 @@ static int interrupt_cnt_probe(struct platform_device *pdev) irq_set_status_flags(priv->irq, IRQ_NOAUTOEN); ret = devm_request_irq(dev, priv->irq, interrupt_cnt_isr, IRQF_TRIGGER_RISING | IRQF_NO_THREAD, - dev_name(dev), priv); + dev_name(dev), counter); if (ret) return ret; -- 2.30.2