From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32D21C433E6 for ; Fri, 12 Feb 2021 11:37:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03E3164E85 for ; Fri, 12 Feb 2021 11:37:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230270AbhBLLg6 (ORCPT ); Fri, 12 Feb 2021 06:36:58 -0500 Received: from www381.your-server.de ([78.46.137.84]:36544 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230242AbhBLLg3 (ORCPT ); Fri, 12 Feb 2021 06:36:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=LB8dl2RxIN//zhj+ja02xt445NXNMzDjJQYs9Xwtfa8=; b=e9IXiEEbfCytoXcIB16bx+BsX2 fAjG5vY/bS6142DoNUvUHl6fHqL7qlLIEvw4KhCcB+/sqMWwMWwKf0Krj+ZQTFs0SYbAsAWCVZRdB BQXfSWgJNf24IE9TcHUQ+1JdxHRur/HTjq1IG0XFmG67ihEe0n37BnH/1X89tsXdwmH4M7C3R7lo1 R7m03oyPPYdgws6DhQpiz6g95v5qeuGWO+t/Qs0aMiLRpNv+xIMIYGTxmEO5zJuSiQaO5m+1bLiIn iM7VclnBdVzpdwQZo/RVasz/2KyyHF6EmM5lIu4oyetGSo3yYA1X5ouWp1rYhsf15OrnRIYvgcmro omrqMG1Q==; Received: from sslproxy02.your-server.de ([78.47.166.47]) by www381.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lAWjY-00046S-9b; Fri, 12 Feb 2021 12:35:36 +0100 Received: from [62.216.202.92] (helo=[192.168.178.20]) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAWjY-000F1M-4X; Fri, 12 Feb 2021 12:35:36 +0100 Subject: Re: Adding custom functional callbacks to IIO driver To: Anand Ashok Dumbre , Jonathan Cameron , "knaack.h@gmx.de" , Peter Meerwald-Stadler , Michal Simek , "linux-iio@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" References: From: Lars-Peter Clausen Message-ID: Date: Fri, 12 Feb 2021 12:35:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.102.4/26077/Thu Feb 11 13:18:43 2021) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/12/21 12:07 PM, Anand Ashok Dumbre wrote: > Hello, > > I have an IIO adc driver that measures temperatures and voltages on the SOC. > There are other kernel modules interested in the temperature and voltage event information. > > Would using a custom callback registration mechanism be advisable? > Is there something similar done already in IIO that can be leveraged? Hi, Have a look at the IIO consumer API that allows other kernel modules to subscribe to the output of an IIO device. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/iio/consumer.h - Lars