From patchwork Wed Nov 29 22:31:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Cline X-Patchwork-Id: 10083763 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 3E97760234 for ; Wed, 29 Nov 2017 22:32:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2954929CD4 for ; Wed, 29 Nov 2017 22:32:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D8B329CD6; Wed, 29 Nov 2017 22:32:22 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 9C4B629CD4 for ; Wed, 29 Nov 2017 22:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752496AbdK2WcI (ORCPT ); Wed, 29 Nov 2017 17:32:08 -0500 Received: from a8-242.smtp-out.amazonses.com ([54.240.8.242]:41646 "EHLO a8-242.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752349AbdK2WbN (ORCPT ); Wed, 29 Nov 2017 17:31:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=rdybrs3533vx7mghocfwl3vdwgpl2v5u; d=jcline.org; t=1511994672; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; bh=FggrGXmm5nt4IFbBE3e934Gfe6Lh7b5smUzq98m0wfA=; b=X8so3MC6edbR9d4FDtrsLBasdc2sGNjaCML5PMsoL7kh+FoBGvy0zSIkyrYfJYlR Mnb/+d7WWCCzbzcCUDjfPUQYU3ujre1RlSM4roOoJSGZyInQpb1TmAnQTyYIst0OCHO 6Km+3oMqx90lcVkZdYe4UX2ws8LurPkZ3ii8UrwI= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1511994672; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:Feedback-ID; bh=FggrGXmm5nt4IFbBE3e934Gfe6Lh7b5smUzq98m0wfA=; b=gs+lmZ1Lg1d7lUfybb8iWqDB/hVWUKv6xduJoRi/93nKRcAG17a4sTFnzA1M0hkd 3ueUUclHGhtWrtvw1Ok2eBzlcYFz8zg8YgHYlehmkCv5kZo7sk4zAz7eUnI8AMji3aK m/y6rDX5bE8M5RdOUQQ1NGUkfYWnbQzHj4sx+eG4= X-Virus-Scanned: amavisd-new at jcline.org From: Jeremy Cline To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Cc: Hans de Goede , Lars Kellogg-Stedman , Steven Presser , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Jeremy Cline Subject: [PATCH 1/2] iio: accel: bmc150: Move struct definitions into the header Date: Wed, 29 Nov 2017 22:31:12 +0000 Message-ID: <0100016009e7c593-065f58b2-ae0f-4d6d-a1ff-769e86d992d8-000000@email.amazonses.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171129223016.17848-1-jeremy@jcline.org> References: <20171129223016.17848-1-jeremy@jcline.org> X-SES-Outgoing: 2017.11.29-54.240.8.242 Feedback-ID: 1.us-east-1.z18Isoc/FaoPOvCyJyi1mnTt8STwoRuibXVNoUcvG6g=:AmazonSES 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 The I2C driver needs to access the bmc150_accel_data struct defined in bcm150-accel-core.c, so move it and the structs it requires into the header file. Signed-off-by: Jeremy Cline --- drivers/iio/accel/bmc150-accel-core.c | 43 -------------------------------- drivers/iio/accel/bmc150-accel.h | 47 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 43 deletions(-) diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index 870f92ef61c2..340914677322 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -163,49 +163,6 @@ struct bmc150_accel_chip_info { const struct bmc150_scale_info scale_table[4]; }; -struct bmc150_accel_interrupt { - const struct bmc150_accel_interrupt_info *info; - atomic_t users; -}; - -struct bmc150_accel_trigger { - struct bmc150_accel_data *data; - struct iio_trigger *indio_trig; - int (*setup)(struct bmc150_accel_trigger *t, bool state); - int intr; - bool enabled; -}; - -enum bmc150_accel_interrupt_id { - BMC150_ACCEL_INT_DATA_READY, - BMC150_ACCEL_INT_ANY_MOTION, - BMC150_ACCEL_INT_WATERMARK, - BMC150_ACCEL_INTERRUPTS, -}; - -enum bmc150_accel_trigger_id { - BMC150_ACCEL_TRIGGER_DATA_READY, - BMC150_ACCEL_TRIGGER_ANY_MOTION, - BMC150_ACCEL_TRIGGERS, -}; - -struct bmc150_accel_data { - struct regmap *regmap; - int irq; - struct bmc150_accel_interrupt interrupts[BMC150_ACCEL_INTERRUPTS]; - struct bmc150_accel_trigger triggers[BMC150_ACCEL_TRIGGERS]; - struct mutex mutex; - u8 fifo_mode, watermark; - s16 buffer[8]; - u8 bw_bits; - u32 slope_dur; - u32 slope_thres; - u32 range; - int ev_enable_state; - int64_t timestamp, old_timestamp; /* Only used in hw fifo mode. */ - const struct bmc150_accel_chip_info *chip_info; -}; - static const struct { int val; int val2; diff --git a/drivers/iio/accel/bmc150-accel.h b/drivers/iio/accel/bmc150-accel.h index ae6118ae11b1..c38754452883 100644 --- a/drivers/iio/accel/bmc150-accel.h +++ b/drivers/iio/accel/bmc150-accel.h @@ -2,6 +2,53 @@ #ifndef _BMC150_ACCEL_H_ #define _BMC150_ACCEL_H_ +struct bmc150_accel_chip_info; +struct bmc150_accel_data; +struct bmc150_accel_interrupt_info; + +struct bmc150_accel_interrupt { + const struct bmc150_accel_interrupt_info *info; + atomic_t users; +}; + +struct bmc150_accel_trigger { + struct bmc150_accel_data *data; + struct iio_trigger *indio_trig; + int (*setup)(struct bmc150_accel_trigger *t, bool state); + int intr; + bool enabled; +}; + +enum bmc150_accel_interrupt_id { + BMC150_ACCEL_INT_DATA_READY, + BMC150_ACCEL_INT_ANY_MOTION, + BMC150_ACCEL_INT_WATERMARK, + BMC150_ACCEL_INTERRUPTS, +}; + +enum bmc150_accel_trigger_id { + BMC150_ACCEL_TRIGGER_DATA_READY, + BMC150_ACCEL_TRIGGER_ANY_MOTION, + BMC150_ACCEL_TRIGGERS, +}; + +struct bmc150_accel_data { + struct regmap *regmap; + int irq; + struct bmc150_accel_interrupt interrupts[BMC150_ACCEL_INTERRUPTS]; + struct bmc150_accel_trigger triggers[BMC150_ACCEL_TRIGGERS]; + struct mutex mutex; + u8 fifo_mode, watermark; + s16 buffer[8]; + u8 bw_bits; + u32 slope_dur; + u32 slope_thres; + u32 range; + int ev_enable_state; + int64_t timestamp, old_timestamp; /* Only used in hw fifo mode. */ + const struct bmc150_accel_chip_info *chip_info; +}; + struct regmap; enum {