From patchwork Fri Dec 22 15:07:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 10130779 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 53FF46038F for ; Fri, 22 Dec 2017 15:29:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 416232A074 for ; Fri, 22 Dec 2017 15:29:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3535A2A078; Fri, 22 Dec 2017 15:29:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DF6622A074 for ; Fri, 22 Dec 2017 15:29:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IUExn0ivGdMCUWCiPvYXHGmnrZaMIfO4DkARVka4WS4=; b=bleSvKDj+kcTLH jAlI1kn5yUJjYOzVE7QqzAGZfeae7uSxesZE12e1P9GWi69zJik0+PwPT06ZJJCmpHESbkeR97nZ1 mCRTiZsqOIYlrjcYzhLRKOVqP9jEe8DVpTKYZ4+y571cLzhp0JAJK/FIaMXz+DA1kNAtBEJPgSRsE ItgPpIk+wmww8Ql8tYjXTax6P+HxkXaiJG7piR6ZPQGE5IpZVQ2nt3Mb+GPTKqdH+QiTALJ3J1pQC s19vJNS8dnSxklS3vuvck+owjRmsrH1ruJOPR3zIHxqZNPyVb+g2xhTS4HWZtLkYgBXty8Bk0JWuG dnnPJPFDJ3b2Cda882zA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eSPGl-0005YS-JV; Fri, 22 Dec 2017 15:29:55 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eSOxg-0006IC-2i for linux-arm-kernel@lists.infradead.org; Fri, 22 Dec 2017 15:10:17 +0000 X-IronPort-AV: E=Sophos;i="5.45,441,1508828400"; d="scan'208";a="10402494" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Dec 2017 08:10:11 -0700 Received: from eh-station.mchp-main.com (10.10.76.4) by chn-sv-exch07.mchp-main.com (10.10.76.108) with Microsoft SMTP Server id 14.3.352.0; Fri, 22 Dec 2017 08:10:10 -0700 From: Eugen Hristev To: , , , , , , , , , Subject: [PATCH 08/14] iio: triggers: add private data to pollfuncs Date: Fri, 22 Dec 2017 17:07:15 +0200 Message-ID: <1513955241-10985-9-git-send-email-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513955241-10985-1-git-send-email-eugen.hristev@microchip.com> References: <1513955241-10985-1-git-send-email-eugen.hristev@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171222_071012_767330_DA88549A X-CRM114-Status: UNSURE ( 7.24 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eugen Hristev Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add a private data pointer field to pollfunc struct. This is useful in the trigger handler to get specific data for the driver registering the pollfunc. Signed-off-by: Eugen Hristev --- include/linux/iio/trigger_consumer.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/iio/trigger_consumer.h b/include/linux/iio/trigger_consumer.h index 36e2a02..13be595 100644 --- a/include/linux/iio/trigger_consumer.h +++ b/include/linux/iio/trigger_consumer.h @@ -29,6 +29,7 @@ struct iio_trigger; * @timestamp: some devices need a timestamp grabbed as soon * as possible after the trigger - hence handler * passes it via here. + * @p: private data for the poll func owner. **/ struct iio_poll_func { struct iio_dev *indio_dev; @@ -38,6 +39,7 @@ struct iio_poll_func { char *name; int irq; s64 timestamp; + void *p; }; @@ -49,6 +51,13 @@ struct iio_poll_func const char *fmt, ...); void iio_dealloc_pollfunc(struct iio_poll_func *pf); + +static inline void +iio_pollfunc_set_private_data(struct iio_poll_func *pf, void *p) +{ + pf->p = p; +} + irqreturn_t iio_pollfunc_store_time(int irq, void *p); void iio_trigger_notify_done(struct iio_trigger *trig);