From patchwork Tue Mar 15 19:38:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: William Breathitt Gray X-Patchwork-Id: 12781789 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB7C7C433EF for ; Tue, 15 Mar 2022 19:39:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351405AbiCOTkU (ORCPT ); Tue, 15 Mar 2022 15:40:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351387AbiCOTkT (ORCPT ); Tue, 15 Mar 2022 15:40:19 -0400 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE72D27B03; Tue, 15 Mar 2022 12:39:06 -0700 (PDT) Received: by mail-qv1-xf35.google.com with SMTP id eq14so321945qvb.3; Tue, 15 Mar 2022 12:39:06 -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=KBxpEzoITwpU6kRtLWtpxV0a9ktQzPhWaCO/U0K4p2c=; b=XdzVQlWtFuwhv2KKVJvudG1KFS1VEslxYAFcjhLcAc061BST9gME1NKzu4mGfSvDuW 8n1l1sWbJhRlhZRZ8A/QebvedXpumD81wGEc+gSr5yL4Qw1QGJYeuVaCsaEBNQyD+mtq iGAbsZ5gGGosDXD+76Y5tIl45WE8faqRL1R8lOEIFyi5OWociN4w4ejp54ph1Ir6YS2L oeGNRbGhv9TgkEOOc++cSuh5y0vffeszOwnkMTAIrIZou59eOhAqaWK9gbHwlLBnKaA6 1aU89b8tYDIrEFQUfitkeCVkr+xlQqv7nMkzG4g+3vHps7O6db44L1go5LfJVSzPKWGg ClZQ== 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=KBxpEzoITwpU6kRtLWtpxV0a9ktQzPhWaCO/U0K4p2c=; b=xTPNrssimuo0T+qxkIS9bRhK1q5QEZhMzefSplJ+dS3Sdd2mhv+F/g6eN2fY1wCO6j RtOC1QT50HV7187kkw6O9+f1wbAUTLJdWTWPjtJxwl9b/q6cypCVBpd8eGqqu/e8bo4T Y6suaC7VMyt5gfSYSMSLed3r1NwWnRPOe6QOYNPs+fRssYcTfIjSX0X8+8ZpisxuGE1A 7xVJWVna2k6naXJ5UkqV0lr+j+kmYu2OZKOIMiQ9OGL1rfNqeTm3EZc1m3Vho45qM8v8 U7Cbc1il1uxc50R9uEyZ8hYFvwkM8hSgr6laADN+SCYS63rIYbdCfaVskM62H7KPW0oD hP9w== X-Gm-Message-State: AOAM533heXpahWJdYrDtTbXmDxBmV/mD3i6+HjgaMXt1wAvH/pqtmjet 2QiP7P+p6VEccFpuEMPzoY4= X-Google-Smtp-Source: ABdhPJz8vcAdgiHLoJc84Zb8vEocnkd+b3eDP5CmaX3KcjgI26RtA+QjPQhFt+uMPD3IzwC1FqbDhQ== X-Received: by 2002:a0c:be89:0:b0:42c:4194:6adb with SMTP id n9-20020a0cbe89000000b0042c41946adbmr22624611qvi.6.1647373145823; Tue, 15 Mar 2022 12:39:05 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 12:39:05 -0700 (PDT) From: William Breathitt Gray To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, William Breathitt Gray , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Syed Nayyar Waris Subject: [RESEND PATCH 1/6] counter: 104-quad-8: Add COMPILE_TEST depends Date: Tue, 15 Mar 2022 15:38:52 -0400 Message-Id: <3917721e792d362ee108b2f12cd2223675449d05.1647373009.git.vilhelm.gray@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 104_QUAD_8 depends on X86, but compiles fine on ARCH=arm. This patch adds support for COMPILE_TEST which is useful for compile testing code changes to the driver and Counter subsystem. Suggested-by: Uwe Kleine-König Cc: Syed Nayyar Waris Acked-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220105094137.259111-1-vilhelm.gray@gmail.com Signed-off-by: William Breathitt Gray Acked-by: Syed Nayyar Waris --- drivers/counter/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/counter/Kconfig b/drivers/counter/Kconfig index 3dcdb681c4e4..5edd155f1911 100644 --- a/drivers/counter/Kconfig +++ b/drivers/counter/Kconfig @@ -14,7 +14,7 @@ if COUNTER config 104_QUAD_8 tristate "ACCES 104-QUAD-8 driver" - depends on PC104 && X86 + depends on (PC104 && X86) || COMPILE_TEST select ISA_BUS_API help Say yes here to build support for the ACCES 104-QUAD-8 quadrature From patchwork Tue Mar 15 19:38:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: William Breathitt Gray X-Patchwork-Id: 12781790 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0D54C433FE for ; Tue, 15 Mar 2022 19:39:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351411AbiCOTkV (ORCPT ); Tue, 15 Mar 2022 15:40:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351407AbiCOTkU (ORCPT ); Tue, 15 Mar 2022 15:40:20 -0400 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECEC727FF6; Tue, 15 Mar 2022 12:39:07 -0700 (PDT) Received: by mail-qv1-xf30.google.com with SMTP id 13so299447qvq.8; Tue, 15 Mar 2022 12:39:07 -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=6n/GEXN5lDYLZ4JxfAxl/V57o/OOb9d29VzaUpcLpQA=; b=AechcBsRHkC9FhFZuNbA/sO4Tuy863lBtYizhPTaLsA7vMEys8NaWH7RHaAH3i3YnX z3YhRd53z1vErumO0rFGcBwk78KLYV7YtNI6nMwaVnmYrFcrtswMV0nYhLIPNqOPChDi 6Xv2tf2Xav5AECI4FcXDALrtvTN9/Npk6HtPTHJcuXvzQ9/6bN2Gjs2rBOCBIq4KjPl0 YxgZ7JjtvcM+yAz/Bbb1O4LzrIicf5iaXsx7pA6h4ibw/5LmXcrYPEy1WHVU90xFI0Nt vxnkIaX8vDe+JW7zE5bKqTvWYHAhjWFFx6HgY8mIUTGGxmScIWjVW4YbvOCUQDjvGPTx lzpw== 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=6n/GEXN5lDYLZ4JxfAxl/V57o/OOb9d29VzaUpcLpQA=; b=KGi/sVyk/C9jiJhIN7guqfk7Dgv21Z3Nh50gu+/MrCsNdXTdU8RXVmmNVnemxe51j/ 1v/7FMk5qKapeVzQVGaATA9e3P8fF7bPh6vGN8/f51FjCzoh6cag0HA4YrNYhXVAvyNs e8lVe66IiW9sZy/488x78y1HR1DN5Un/wpZtM86udWBXj/SN4gMA1b/9UFkb+Mn+XncX QBVngN9xrt1ehsaip4Pr/wjBqz9+rZV1LQKsyquUuvuQvcfhf7Jn3OMqUHoR8fRHdwqP 4gxTso+5O6LfkYxVK3RmeiJ8De8NL4xi3wG8dBnbQhshzGS1px6vaCV8MAz25QAEsQYg 47gg== X-Gm-Message-State: AOAM532//Pfn5SR0ZYh9iEaVgCnLWcist+c9/Q5GxNDLCGYrq3KSWfsR dizdBF9ZyhU5JCEsYDGQucQ= X-Google-Smtp-Source: ABdhPJw7whkPdA/y1cLsh5cBY3dhhlYpNL/ZKq60sS4Ygc2RxvxnjPZp9tBKybKPBT9qXoeIjIHCtA== X-Received: by 2002:ad4:594c:0:b0:435:6a5e:ebeb with SMTP id eo12-20020ad4594c000000b004356a5eebebmr22645843qvb.96.1647373146965; Tue, 15 Mar 2022 12:39:06 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 12:39:06 -0700 (PDT) From: William Breathitt Gray To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, William Breathitt Gray , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= Subject: [RESEND PATCH 2/6] counter: Set counter device name Date: Tue, 15 Mar 2022 15:38:53 -0400 Message-Id: <87cc8eb4c84f49f89290577dc9231b2e4d7d3e8c.1647373009.git.vilhelm.gray@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Naming the counter device provides a convenient way to identify it in devres_log events and similar situations. This patch names the counter device by combining the prefix "counter" with the counter device's unique ID. Acked-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220204084551.16397-1-vilhelm.gray@gmail.com Signed-off-by: William Breathitt Gray --- drivers/counter/counter-core.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/counter/counter-core.c b/drivers/counter/counter-core.c index 869894b74741..938651f9e9e0 100644 --- a/drivers/counter/counter-core.c +++ b/drivers/counter/counter-core.c @@ -22,6 +22,8 @@ #include "counter-chrdev.h" #include "counter-sysfs.h" +#define COUNTER_NAME "counter" + /* Provides a unique ID for each counter device */ static DEFINE_IDA(counter_ida); @@ -113,8 +115,15 @@ struct counter_device *counter_alloc(size_t sizeof_priv) device_initialize(dev); + err = dev_set_name(dev, COUNTER_NAME "%d", dev->id); + if (err) + goto err_dev_set_name; + return counter; +err_dev_set_name: + + counter_chrdev_remove(counter); err_chrdev_add: ida_free(&counter_ida, dev->id); @@ -247,7 +256,8 @@ static int __init counter_init(void) if (err < 0) return err; - err = alloc_chrdev_region(&counter_devt, 0, COUNTER_DEV_MAX, "counter"); + err = alloc_chrdev_region(&counter_devt, 0, COUNTER_DEV_MAX, + COUNTER_NAME); if (err < 0) goto err_unregister_bus; From patchwork Tue Mar 15 19:38:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Breathitt Gray X-Patchwork-Id: 12781792 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C694C4332F for ; Tue, 15 Mar 2022 19:39:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351425AbiCOTkX (ORCPT ); Tue, 15 Mar 2022 15:40:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351414AbiCOTkV (ORCPT ); Tue, 15 Mar 2022 15:40:21 -0400 Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07516289BC; Tue, 15 Mar 2022 12:39:09 -0700 (PDT) Received: by mail-qv1-xf31.google.com with SMTP id 13so299490qvq.8; Tue, 15 Mar 2022 12:39:08 -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=2R5wH7aZWLbq7NU5C7S2zfPJjL0MgrTHEo9aJHUkpcs=; b=YP7xzPGpoR3yYsKXNbyMstcMwSpyG4B7mE6pdO47Xfl8t7snvSVN9KfHhMAAWnXocB cFZbRaH4YDmVRBHMtsDoG75yQfun3oFcj8CeMqJ8weq1v2IzuyDt4/iV/ygtUhoJ/ZYL Uw84z/r8xgLOA4XIIq3M0K84C86uLEYcQvBc6POH9LsqHfq5p4fxxwoG2PpwrrwT6mcj zEJ5Ibt12Cxc0KccNsyGxRDIkmb8cyY06jYGL0XhBxDSPylPNKGadh/q5wOSOYQ2fkdC HpR4ECQi5Yyt2EaetRbhvWL+1wizjiBs9eQWuK1xEtgNNaW3BDHSo1jdHsvMBEa2ioEE BrcQ== 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=2R5wH7aZWLbq7NU5C7S2zfPJjL0MgrTHEo9aJHUkpcs=; b=HRJInyi1mSK2gf6IZcVFZvqOHAQ1x32/rZsDws+j5KrEQKlmSF5vDc3ok8eir/+L4g XGWfwguYfmUkkOPFf0AxFTdKOUsnV34YeXVdc99SvR3VfJtEh/ntMuyGFIzNLA8LUiUB 3akuOmWV+dxcARaQ3aZyKPiMpEXUbw7ehW/Owv6F4W+6oSkoF1mESwNCASXZGNzrLIYx JgquHfs3IUjOHmdyzuZls8xRPxMfh6/sKFY3xI/QfZegY0j25fnfhyG5HemIeRbCdjNq IMsHB+PNIQWVx438vBJAxVHldxUsPb1bX/L+KH8TcqnZ9p45M5/Pm/xfqt7DA5bSB3xc trrQ== X-Gm-Message-State: AOAM5307JJlmAOBEiYyzZmGs9P4K3C2CkrpS24DcS8nnBTOYFMjupU1J BmrEZ4j5ykNfxvnbJd2TIwc= X-Google-Smtp-Source: ABdhPJxZptkq4Q7hj6GPgtj6YgLyWYFQk1gsN6Ggq2WaLBy0Kip0IE6VKtsIUwAI4HJpkf4o7QwQdw== X-Received: by 2002:a05:6214:5297:b0:435:aa83:d639 with SMTP id kj23-20020a056214529700b00435aa83d639mr22908168qvb.107.1647373148181; Tue, 15 Mar 2022 12:39:08 -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.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 12:39:07 -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 3/6] counter: add new COUNTER_EVENT_CHANGE_OF_STATE Date: Tue, 15 Mar 2022 15:38:54 -0400 Message-Id: <486a5de67414470449efb84d06a2f2214f4bb31d.1647373009.git.vilhelm.gray@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Oleksij Rempel Add new counter event to notify user space about every new counter pulse. Signed-off-by: Oleksij Rempel Link: https://lore.kernel.org/r/20220203135727.2374052-2-o.rempel@pengutronix.de Signed-off-by: William Breathitt Gray --- include/uapi/linux/counter.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/counter.h b/include/uapi/linux/counter.h index d0aa95aeff7b..96c5ffd368ad 100644 --- a/include/uapi/linux/counter.h +++ b/include/uapi/linux/counter.h @@ -61,6 +61,8 @@ enum counter_event_type { COUNTER_EVENT_THRESHOLD, /* Index signal detected */ COUNTER_EVENT_INDEX, + /* State of counter is changed */ + COUNTER_EVENT_CHANGE_OF_STATE, }; /** From patchwork Tue Mar 15 19:38:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Breathitt Gray X-Patchwork-Id: 12781791 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 656BBC433EF for ; Tue, 15 Mar 2022 19:39:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351418AbiCOTkX (ORCPT ); Tue, 15 Mar 2022 15:40:23 -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-Google-Smtp-Source: ABdhPJytPJG7ZHJs6/c0xg+icxv/Chr0DUw2L6C5hu9ZQVP/ms5bX/yUfn6s6oNE+y+ptKiKv+fi0Q== 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 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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; From patchwork Tue Mar 15 19:38:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Breathitt Gray X-Patchwork-Id: 12781793 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2650C433F5 for ; Tue, 15 Mar 2022 19:39:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351430AbiCOTkZ (ORCPT ); Tue, 15 Mar 2022 15:40:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351422AbiCOTkX (ORCPT ); Tue, 15 Mar 2022 15:40:23 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3AAA2A254; Tue, 15 Mar 2022 12:39:10 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id s11so131419qtc.3; Tue, 15 Mar 2022 12:39:10 -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=y2zVgXnlF97kfQZU4hBwzTBXD9p1KQnPsEAJ23W9Aok=; b=nk8cRuI60pQJMdDFYScVdGyJhYGw3hyQEwlLkjLcK1rqyLbjSb41CodrEz7M91a/86 viGjTEkHnjKF3djf7ieqbT/3sEhDFJm0139+x41ruH3IyyBYoOdl5knGUHiD4pt/F6mz bMREAkcW209ChB+fwye7FistKPobJkOmBSWYK0/nJWuyz/fs0YTnJtdX7eGc2JIZAGaH cw2XJ/8JZu4A+M72bW9ufmC9TCTl2AugQOVMO7N258yynpuoHXFIAVxjXTyG2d2V+92g a4B27660vAIWA9EkPWnLrYr4skqhp1ReM0kyo3r0LnA/+XBG93odDRxpWTghGoFyrf+f 4r2A== 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=y2zVgXnlF97kfQZU4hBwzTBXD9p1KQnPsEAJ23W9Aok=; b=y/tO2pN5L2PqcPB0LJEmk9KTZ9am99HpNL21he1mny1Gpm0cFKYWdeWf3hbeeQOGfV iR8vVYu1dZYeLZ2qgz0Mxn3sPm20IeDiHHW5hVE+k5tGr1UzPbZfVeJWXs6g3QJTlNMX l5+K0TImi/txVBAe8hWioshlITJ/+cAleupBrkG9I4Qc+tq6HUAadakNX40N8k52fkfL N5spKXo6ffRRXEvFAGz5YrQgYk7KjFKdyYnK6OE1nE9kp0viQe0AZsSp3WFi4IpOplT/ 7YyLTrgAhkPVtacRfh6LDP3jDm5gVEn1NlBwookV7jDqqvPUMTY27XGdzSNvcE1DSCae y+Gg== X-Gm-Message-State: AOAM532qf1D4wSa9Wfp8p1Jp+N30JzyP9ClyHIGuy05iRI6eXrmLzICR eSd3HHXSJOZBWdnQYPpi3No= X-Google-Smtp-Source: ABdhPJzRFXiGL4qJknqCgskM7Cd5tXnRJZPk8pOuyRG9nhU+lbPKvIIjh2AYUnUMMdZvOJv7jT7svQ== X-Received: by 2002:a05:622a:189e:b0:2e1:dcd4:d01c with SMTP id v30-20020a05622a189e00b002e1dcd4d01cmr5781103qtc.1.1647373150034; Tue, 15 Mar 2022 12:39:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 12:39:09 -0700 (PDT) From: William Breathitt Gray To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, William Breathitt Gray Subject: [RESEND PATCH 5/6] MAINTAINERS: Add Counter subsystem git tree Date: Tue, 15 Mar 2022 15:38:56 -0400 Message-Id: <41db1ea7bd9384da99fb332019ddc03067fe5311.1647373009.git.vilhelm.gray@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The Counter subsystem tree is now separate from the IIO tree. Signed-off-by: William Breathitt Gray --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 1ba1e4af2cbc..f4875a9faa2d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4951,6 +4951,7 @@ COUNTER SUBSYSTEM M: William Breathitt Gray L: linux-iio@vger.kernel.org S: Maintained +T: git git@gitlab.com:vilhelmgray/counter.git F: Documentation/ABI/testing/sysfs-bus-counter F: Documentation/driver-api/generic-counter.rst F: drivers/counter/ From patchwork Tue Mar 15 19:38:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Breathitt Gray X-Patchwork-Id: 12781794 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 419EDC433EF for ; Tue, 15 Mar 2022 19:39:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351440AbiCOTke (ORCPT ); Tue, 15 Mar 2022 15:40:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351443AbiCOTka (ORCPT ); Tue, 15 Mar 2022 15:40:30 -0400 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43F6A2B1AD; Tue, 15 Mar 2022 12:39:12 -0700 (PDT) Received: by mail-qv1-xf2d.google.com with SMTP id 13so299637qvq.8; Tue, 15 Mar 2022 12:39:12 -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=vtpi8KqEblfOcUZ0Pw5p0t2W/KlA+6v+4V+RQUI8IgQ=; b=ANAUT6DcYlkHmQleHKtW+nR4/iCBpy7Rfe7yv/ZfiacbzPp9P1eGNXLYpYzX2rA0tc V7FwAuUBRLttYV4TTs33laSYXdtzLtzAFBejd755ZYZVbGH75mIVidrx+VCIm3XZq1qk T9Gu58gVqDWjtcAuZgIHsqtPrYsBck4P5ENUf75dxOXMuGbuDWh2wpeZtlYEJlWM7aVp 4F1Bju+Dke/itdxE07b/GiW1v4EIVZrHkqqdlThItvpMD9TzkgU/6VOnLt0+/A5wol16 X7QqKH3kop0RiHxN5abv3o7NTVqk0HmCFPey0vIXCXjKr9XLvDTcYyF8dRyRVGZ5Cczr cMHg== 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=vtpi8KqEblfOcUZ0Pw5p0t2W/KlA+6v+4V+RQUI8IgQ=; b=w3dNkNqiHq4bE7jMprtjng1dRCPJwabYPuRLFy+fjVEWegjPi7PGPCQe3xakkTRIQg t2wO0aCwVtN2LN735gu5L+bpLZTZNeqJYRyKNxT7untI2/JG1ueb4OWyC2WS9Qw8x3OL 5IEYobikBSRIVDkQlDE/mgcM/tiO74sOmkhSlAIdl29e48NVBeRylIVRjrxAfWdLx38S wut3VE8UVyOOF/5ZSMif9JTVm3HRZo4Wz/SeFY+6m638n6hU/R3rE+bideEc1J3MzmP9 M1ygNQgbVfDwga2TaHnBxxiQOqmy99KDL09JzG9fjN+ItTmPiD4KNQFQpXQOOnDJqPvd y/uw== X-Gm-Message-State: AOAM533dHF6TX6vHjgeWWRve7yGOLH1t8DU0ao25lK7Q0H/d4CijuPe8 4GhES3rGtb7JtFASEGXXJLo= X-Google-Smtp-Source: ABdhPJw3c0Gc+qsu1VcCFc5QY6piefkAaumx9XPYdozaQ4sDIixhK9+tK9nKpu6duS8AbGUkbfknFQ== X-Received: by 2002:ad4:5d4c:0:b0:435:41df:faa2 with SMTP id jk12-20020ad45d4c000000b0043541dffaa2mr22679848qvb.73.1647373151431; Tue, 15 Mar 2022 12:39:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 12:39:11 -0700 (PDT) From: William Breathitt Gray To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Tom Rix , Jonathan Cameron , William Breathitt Gray Subject: [RESEND PATCH 6/6] counter: add defaults to switch-statements Date: Tue, 15 Mar 2022 15:38:57 -0400 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Tom Rix Clang static analysis reports this representative problem counter-chrdev.c:482:3: warning: Undefined or garbage value returned to caller return ret; ^~~~~~~~~~ counter_get_data() has a multilevel switches, some without defaults, so ret is sometimes not set. Add returning -EINVAL similar to other defaults. Signed-off-by: Tom Rix Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20220227161746.82776-1-trix@redhat.com Signed-off-by: William Breathitt Gray Acked-by: Syed Nayyar Waris --- drivers/counter/counter-chrdev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/counter/counter-chrdev.c b/drivers/counter/counter-chrdev.c index b7c62f957a6a..69d340be9c93 100644 --- a/drivers/counter/counter-chrdev.c +++ b/drivers/counter/counter-chrdev.c @@ -477,6 +477,8 @@ static int counter_get_data(struct counter_device *const counter, case COUNTER_SCOPE_COUNT: ret = comp->count_u8_read(counter, parent, &value_u8); break; + default: + return -EINVAL; } *value = value_u8; return ret; @@ -496,6 +498,8 @@ static int counter_get_data(struct counter_device *const counter, case COUNTER_SCOPE_COUNT: ret = comp->count_u32_read(counter, parent, &value_u32); break; + default: + return -EINVAL; } *value = value_u32; return ret;