Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp962141pxp; Wed, 16 Mar 2022 22:45:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeGaf12972zE/P+1WaFxQaAcwA69uF+frOWR0ELlI9za9iBkWo6TRXcAHEm+wP2m0MaOf4 X-Received: by 2002:a63:6c8a:0:b0:37c:62da:a647 with SMTP id h132-20020a636c8a000000b0037c62daa647mr2345668pgc.423.1647495932278; Wed, 16 Mar 2022 22:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647495932; cv=none; d=google.com; s=arc-20160816; b=odQSLrhePUxaGHpecSYG0Fprsmz/5v/1NOFbyTJ7fCQfV9U4hK+LhKcXMyUCImfrUi obW1ozVJ5A6lqQb7zNSzacuPHO12WlEyrDoK3PPiQqCXMs+9FV6coM1ErMq+0pwJwmKN cR8nrkfE8lnVqMq+LFL/x7HxCC/CrldPutn5PhI1KGhJvm6E2wj/mXf/R+k/bVHDbbzM Lb5KhZ/AcJeIT5SONq0bXEaW0rVAWQ8EAUi7xjF/9rYQiIQSBDmslJfuGlyavM2md/wZ 4UPut0/l/l8yOOoMI9oDVXjkxKZNurkG0OuYZ7d9AtdjgNe0T+InewhuRPTP7+3iIZVw 1clA== 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 :dkim-signature; bh=jFCbz7FlNevBgSrjKRG8KK3STwFo/kY9uOkLzfQEECQ=; b=SHg2T/y/HfgvvqYtG25nKAPqcFgUaEu6/yPYWbYyUWrQBdWx1H5Z++9Y5NmeYRQBNM lKQULV7owI+ggxdLmzisw9236yZnxSCVsR/GIzfK4t7f0+NhB226mxMO/9u4C292h5gP 9g8aSxYxPirHvTYLFt0nT3nBaO8KFZGcOmaFAw5xYOwuCN1uzLfo56ZmA5DHebZpUYaR uyHIwb8Mj0La8vsYxGEknWfUbxEC6sryAhsp9vueecFyx0r9T+N0MnuKC6XoTFbI909u hn5epZWFw+zUXCzS2475hXNLxKEB9iFbKp+iuEsi/Z1QXykaytDj04HYdiYuaCow5EKi CkEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oW4TE3zB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m5-20020a654c85000000b003816043ef61si1092448pgt.342.2022.03.16.22.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:45:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oW4TE3zB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0E07011D7B1; Wed, 16 Mar 2022 21:39:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351438AbiCOTk3 (ORCPT + 99 others); Tue, 15 Mar 2022 15:40:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351419AbiCOTkW (ORCPT ); Tue, 15 Mar 2022 15:40:22 -0400 Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06F4729C8A; Tue, 15 Mar 2022 12:39:10 -0700 (PDT) Received: by mail-qt1-x830.google.com with SMTP id v14so136274qta.2; Tue, 15 Mar 2022 12:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jFCbz7FlNevBgSrjKRG8KK3STwFo/kY9uOkLzfQEECQ=; b=oW4TE3zBivfIf/rWyWV8dLljW5PGeKY76PqSqjJiNAM3CajLiZ5vEx8pWh+NFpmtEl gMZHNxC8UOpIJiwQvQh3cseTr0O39uVt0swketNuRfVskzmMJRhOHtl/qIUUF26+FpM3 zmEcIS1+/Rriyec863ewEAW0XBrYWsaj1LJ1geXR15Mf/0EN87/v7Fs8lt76dLsfXBbR rxq4ujQllBp1qJGCeChXsW8RQcxankSFkOdjXU5G7Tv4THEFOX01ix7WmiebHasyq5dI XStWD98s+AdqrtXJc9KnSU7LfVlgWiA8QPwXY8ShotK5sq/x1CDMlpfZjp3d6JOtB3HG r0fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jFCbz7FlNevBgSrjKRG8KK3STwFo/kY9uOkLzfQEECQ=; b=C0BKRYPCssrvdFfIjgusOMc9wfxldgBuBo54aY6XveGPNjE9sb89aYloc2ZW7z6aSj z6oAIO6+03JPCUFXqTZh4G4Gsd39f+WwiioEL2tFGVI02yOLMjdtm3RcmOvK6oVOp1Yu 61P3gma5SDJB2x3ogTMeEbE79Er3j98atINNLy5XPSRBsQaanoJxh5vJ+wvGUw5V56iL dTkOJzQny4xhjvCjXtuKC/C8lyXn7fZUjA8JlrbppVbcDD0y2KPODCNOyyUuOExFtXT4 /7jmDJXjjxElajtRi6A8w+jz5eacViTHq0UzeKfQ4ge3jVg8pJ+r9hU4sm3Sd4Tx89zD whUw== X-Gm-Message-State: AOAM532eDQ5QK+NHmG6rymrhDGDJaJaw+7Jbfv0/8kLyxOqkWNTmzRYO jFpZ8Xb2CxpLSmp0+jh8t6w= X-Received: by 2002:a05:622a:588:b0:2de:9242:8788 with SMTP id c8-20020a05622a058800b002de92428788mr24208093qtb.76.1647373149187; Tue, 15 Mar 2022 12:39:09 -0700 (PDT) Received: from ishi.. (072-189-064-222.res.spectrum.com. [72.189.64.222]) by smtp.gmail.com with ESMTPSA id o4-20020a05620a22c400b0067e02a697e0sm1440798qki.33.2022.03.15.12.39.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 12:39:08 -0700 (PDT) From: William Breathitt Gray To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Oleksij Rempel , William Breathitt Gray Subject: [RESEND PATCH 4/6] counter: interrupt-cnt: add counter_push_event() Date: Tue, 15 Mar 2022 15:38:55 -0400 Message-Id: <9da3460113b5092e8658e12f23578567aab7cc5f.1647373009.git.vilhelm.gray@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oleksij Rempel Add counter_push_event() to notify user space about new pulses Signed-off-by: Oleksij Rempel Link: https://lore.kernel.org/r/20220203135727.2374052-3-o.rempel@pengutronix.de Signed-off-by: William Breathitt Gray --- 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.35.1