From patchwork Mon Mar 18 20:39:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 10858545 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A7CA1575 for ; Mon, 18 Mar 2019 20:40:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3359C28769 for ; Mon, 18 Mar 2019 20:40:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 276BA2945E; Mon, 18 Mar 2019 20:40:08 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1771E29486 for ; Mon, 18 Mar 2019 20:40:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727799AbfCRUkB (ORCPT ); Mon, 18 Mar 2019 16:40:01 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.170]:28375 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727269AbfCRUjp (ORCPT ); Mon, 18 Mar 2019 16:39:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1552941583; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=PZ2Eo8d+YhwTy/BkqIPSZ4MMMCqG6vW1xSs6GtuCSkk=; b=Gi8/vuU6n3tAyPUtZgmwCP+KIESdyNN0NjHpeS/vn8fD+BPI/bfsrKXuf7T7IioOxb rTYmF40G8nPbsq6Iiyubzt/p95Ahzt3cQIfxViKVLz1mSRcNsVr43a5y7T6L5mrXJbx2 bFShR7qF+o7YSMQf1H/Eg+a52cSOZMZkOR8dluVthU/G9VvP+Qxh7fzb+qQGvH8j48c2 k6stOdCphG8pZHnFtgOsJqSXvtqPCWi3I2dhDAswLDTA7+WHcIiJ2v/TIthvoSJQPPse wmcbZCUekbtv0s2Wwz90M8WaGvmbCTXbJvHPUo1SiqujPyFo+XNN4itSCmkXd2aJAywp +1eg== X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o1OAA2UNf2M7O2CKNdGj" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 44.16 DYNA|AUTH) with ESMTPSA id h04075v2IKdZFym (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Mon, 18 Mar 2019 21:39:35 +0100 (CET) From: "H. Nikolaus Schaller" To: Jonathan Cameron Cc: letux-kernel@openphoenux.org, kernel@pyra-handheld.com, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, "H. Nikolaus Schaller" Subject: [RFC 4/4] iio: input-bridge: make the iio-input-bridge driver called by iio-core Date: Mon, 18 Mar 2019 21:39:34 +0100 Message-Id: X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds the iio-input-bridge to iio device (un)registering so that accelerometers are located and made present an input event device. Signed-off-by: H. Nikolaus Schaller --- drivers/iio/industrialio-core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 4700fd5d8c90..81f412b41a78 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -29,6 +29,7 @@ #include #include "iio_core.h" #include "iio_core_trigger.h" +#include "industrialio-inputbridge.h" #include #include #include @@ -1723,6 +1724,15 @@ int __iio_device_register(struct iio_dev *indio_dev, struct module *this_mod) if (ret < 0) goto error_unreg_eventset; + ret = iio_device_register_inputbridge(indio_dev); + if (ret) { + dev_err(indio_dev->dev.parent, + "Failed to register as input driver\n"); + device_del(&indio_dev->dev); + + return ret; + } + return 0; error_unreg_eventset: @@ -1745,6 +1755,8 @@ void iio_device_unregister(struct iio_dev *indio_dev) { mutex_lock(&indio_dev->info_exist_lock); + iio_device_unregister_inputbridge(indio_dev); + cdev_device_del(&indio_dev->chrdev, &indio_dev->dev); iio_device_unregister_debugfs(indio_dev);