From patchwork Mon Jan 23 21:17:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 645711 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 62463C61D9D for ; Mon, 23 Jan 2023 21:04:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232427AbjAWVE1 (ORCPT ); Mon, 23 Jan 2023 16:04:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232888AbjAWVE0 (ORCPT ); Mon, 23 Jan 2023 16:04:26 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BCB130B10; Mon, 23 Jan 2023 13:04:25 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AE5876104A; Mon, 23 Jan 2023 21:04:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80B80C433EF; Mon, 23 Jan 2023 21:04:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674507864; bh=48D1qji7MQQv0UQXB018g3Ske4Yx09paEJnj8pvmczs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DwXPKOQkhmry9nwtI/DNz93nrhgCbj64gR7CFIYUc0QO6UCyOeR2nD7349ozTwG/p n9cZ3ZH6IaK7az7Zdd7QhzjVxStfwoR8uZvMG+xsWVCGkvWOjiEfVWxzi7ouEAOzPk o0ozEl61ceFvnALdx9hhtN1xoiZax/PCU0oRnlWG+WFUYjqDj+WfPu9pvUtxdU9WCZ xt+RX+kHtVoP4kS3YJMq22zD1pXH4s/R9Y9k0q658eiF9zTfYmW4v5nfhgVx3grzCP vt1hUVmqmgRcAsbl0Zi1C65zfadERK3cXkplkeOC7gCJ7xZAP0GbVRVgKlpmwc/cSF 6a8FhO6EHrvtQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Barry Song Subject: [PATCH 01/12] staging: iio: accel: adis16203: More conventional header ordering Date: Mon, 23 Jan 2023 21:17:47 +0000 Message-Id: <20230123211758.563383-2-jic23@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123211758.563383-1-jic23@kernel.org> References: <20230123211758.563383-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron A common practice in IIO drivers it to have the headers in alphabetical order with the exception of the more specific IIO headers which come in their own block at the end. Signed-off-by: Jonathan Cameron --- drivers/staging/iio/accel/adis16203.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c index c0e4c9266b5f..dd02ceb00d40 100644 --- a/drivers/staging/iio/accel/adis16203.c +++ b/drivers/staging/iio/accel/adis16203.c @@ -6,14 +6,13 @@ */ #include - -#include -#include - #include #include #include +#include +#include + #define ADIS16203_STARTUP_DELAY 220 /* ms */ /* Flash memory write count */ From patchwork Mon Jan 23 21:17:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 646229 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 1EDEAC38142 for ; Mon, 23 Jan 2023 21:04:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232846AbjAWVEc (ORCPT ); Mon, 23 Jan 2023 16:04:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232699AbjAWVEb (ORCPT ); Mon, 23 Jan 2023 16:04:31 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C70EA32503; Mon, 23 Jan 2023 13:04:28 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 68C5DB80E90; Mon, 23 Jan 2023 21:04:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85A1FC4339E; Mon, 23 Jan 2023 21:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674507866; bh=7EqEpNgTP+wTWSd+Y/4V+uBfgtR9/+Icmx3ms+nJliM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CQzvqg6v30OgSPBDPlqCoA80Nya6IcISO/HjpnG+G2iOreAzG9genqmERaRX8CFAo mytqKzEDsAGxISpc8aafbgDIdwR9YL0z8VTLz8FaK7nFeQ0VohkwGB6DHh+ccwpCZP krL5EvOn8rtFau+7sER+Ls6w4ouLNzHR71DIOvrGTujzLFAwPVZg24yYGNluHQ7gi+ wVOSQvw8g70sA3ExKAAfNjjgQP4cvVnE2Zi/AInoDWV2p2kSBYzsQYXULVLob/t0I3 /c2ULZ5zKkmrQp6u2LfLL1BV3hpBcDX9izrWknjTwtWvhMT3BR941Edwyn4lJQbc34 eAb6njzXcqb5Q== From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Barry Song Subject: [PATCH 02/12] staging: iio: accel: adis16203: Drop excessive register comments Date: Mon, 23 Jan 2023 21:17:48 +0000 Message-Id: <20230123211758.563383-3-jic23@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123211758.563383-1-jic23@kernel.org> References: <20230123211758.563383-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron A lot of these comments added very little that was not obvious from the register/field name. In one case the polarity was the opposite of what would be expected so rename that field (currently unused in the driver) Signed-off-by: Jonathan Cameron --- drivers/staging/iio/accel/adis16203.c | 71 +-------------------------- 1 file changed, 1 insertion(+), 70 deletions(-) diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c index dd02ceb00d40..60117aaf56d4 100644 --- a/drivers/staging/iio/accel/adis16203.c +++ b/drivers/staging/iio/accel/adis16203.c @@ -15,111 +15,42 @@ #define ADIS16203_STARTUP_DELAY 220 /* ms */ -/* Flash memory write count */ #define ADIS16203_FLASH_CNT 0x00 - -/* Output, power supply */ #define ADIS16203_SUPPLY_OUT 0x02 - -/* Output, auxiliary ADC input */ #define ADIS16203_AUX_ADC 0x08 - -/* Output, temperature */ #define ADIS16203_TEMP_OUT 0x0A - -/* Output, x-axis inclination */ #define ADIS16203_XINCL_OUT 0x0C - -/* Output, y-axis inclination */ #define ADIS16203_YINCL_OUT 0x0E - -/* Incline null calibration */ #define ADIS16203_INCL_NULL 0x18 - -/* Alarm 1 amplitude threshold */ #define ADIS16203_ALM_MAG1 0x20 - -/* Alarm 2 amplitude threshold */ #define ADIS16203_ALM_MAG2 0x22 - -/* Alarm 1, sample period */ #define ADIS16203_ALM_SMPL1 0x24 - -/* Alarm 2, sample period */ #define ADIS16203_ALM_SMPL2 0x26 - -/* Alarm control */ #define ADIS16203_ALM_CTRL 0x28 - -/* Auxiliary DAC data */ #define ADIS16203_AUX_DAC 0x30 - -/* General-purpose digital input/output control */ #define ADIS16203_GPIO_CTRL 0x32 - -/* Miscellaneous control */ #define ADIS16203_MSC_CTRL 0x34 - -/* Internal sample period (rate) control */ #define ADIS16203_SMPL_PRD 0x36 - -/* Operation, filter configuration */ #define ADIS16203_AVG_CNT 0x38 - -/* Operation, sleep mode control */ #define ADIS16203_SLP_CNT 0x3A - -/* Diagnostics, system status register */ #define ADIS16203_DIAG_STAT 0x3C - -/* Operation, system command register */ #define ADIS16203_GLOB_CMD 0x3E -/* MSC_CTRL */ - -/* Self-test at power-on: 1 = disabled, 0 = enabled */ -#define ADIS16203_MSC_CTRL_PWRUP_SELF_TEST BIT(10) - -/* Reverses rotation of both inclination outputs */ +#define ADIS16203_MSC_CTRL_PWRUP_SELF_TEST_DIS BIT(10) #define ADIS16203_MSC_CTRL_REVERSE_ROT_EN BIT(9) - -/* Self-test enable */ #define ADIS16203_MSC_CTRL_SELF_TEST_EN BIT(8) - -/* Data-ready enable: 1 = enabled, 0 = disabled */ #define ADIS16203_MSC_CTRL_DATA_RDY_EN BIT(2) - -/* Data-ready polarity: 1 = active high, 0 = active low */ #define ADIS16203_MSC_CTRL_ACTIVE_HIGH BIT(1) - -/* Data-ready line selection: 1 = DIO1, 0 = DIO0 */ #define ADIS16203_MSC_CTRL_DATA_RDY_DIO1 BIT(0) -/* DIAG_STAT */ - -/* Alarm 2 status: 1 = alarm active, 0 = alarm inactive */ #define ADIS16203_DIAG_STAT_ALARM2 BIT(9) - -/* Alarm 1 status: 1 = alarm active, 0 = alarm inactive */ #define ADIS16203_DIAG_STAT_ALARM1 BIT(8) - -/* Self-test diagnostic error flag */ #define ADIS16203_DIAG_STAT_SELFTEST_FAIL_BIT 5 - -/* SPI communications failure */ #define ADIS16203_DIAG_STAT_SPI_FAIL_BIT 3 - -/* Flash update failure */ #define ADIS16203_DIAG_STAT_FLASH_UPT_BIT 2 - -/* Power supply above 3.625 V */ #define ADIS16203_DIAG_STAT_POWER_HIGH_BIT 1 - -/* Power supply below 2.975 V */ #define ADIS16203_DIAG_STAT_POWER_LOW_BIT 0 -/* GLOB_CMD */ - #define ADIS16203_GLOB_CMD_SW_RESET BIT(7) #define ADIS16203_GLOB_CMD_CLEAR_STAT BIT(4) #define ADIS16203_GLOB_CMD_FACTORY_CAL BIT(1) From patchwork Mon Jan 23 21:17:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 645710 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 04B66C25B50 for ; Mon, 23 Jan 2023 21:04:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232864AbjAWVEd (ORCPT ); Mon, 23 Jan 2023 16:04:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232564AbjAWVEb (ORCPT ); Mon, 23 Jan 2023 16:04:31 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E34838653; Mon, 23 Jan 2023 13:04:29 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BD0C9610A2; Mon, 23 Jan 2023 21:04:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C3C0C4339C; Mon, 23 Jan 2023 21:04:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674507868; bh=LbJlhf7egiClJvLuB5vqS0R+pxqtjvxQgKBOfISnhYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uitf8mPQ+K4JCogfdxzmGEwlBMft1Zp3tO3jCoVFu9grMReohLIqdz9YcjYz3FEPZ GyephBOyIhDGzZgCkcyuLgIjeuhfLkvtuMrTtxdx/zzWkDZ61bSfHnD7kV1etwFYSJ s2I3kM+JKK4ANNLZeFJyY0Q3arknEZYVsff3PcUQvxhblqPubVea1VsZMt9fHKlPap y+j4VS5IMT7YrciCppM0rhX2QDcoP1wx8xZ7bjIcXIBNlvsIGouHhtpoS88W6zH4B+ rfv2Jv3mtOm0n1L6rWtifncZY5nLbrGNX1yLCX/PPMeUV4+29BWPS3qocX4aOh8JR5 hJu29kurY0arA== From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Barry Song Subject: [PATCH 03/12] staging: iio: accel: adis16203: Rename incli channel registers Date: Mon, 23 Jan 2023 21:17:49 +0000 Message-Id: <20230123211758.563383-4-jic23@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123211758.563383-1-jic23@kernel.org> References: <20230123211758.563383-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron This device has two such channels that are effectively reading the same thing, just with a 180 degree offset. First rename them (later we will drop one of them as it is easier to apply an offset in software). Signed-off-by: Jonathan Cameron --- drivers/staging/iio/accel/adis16203.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c index 60117aaf56d4..8e5d1d2ea8e9 100644 --- a/drivers/staging/iio/accel/adis16203.c +++ b/drivers/staging/iio/accel/adis16203.c @@ -19,8 +19,8 @@ #define ADIS16203_SUPPLY_OUT 0x02 #define ADIS16203_AUX_ADC 0x08 #define ADIS16203_TEMP_OUT 0x0A -#define ADIS16203_XINCL_OUT 0x0C -#define ADIS16203_YINCL_OUT 0x0E +#define ADIS16203_INCL_OUT 0x0C +#define ADIS16203_INCL_OUT_180 0x0E #define ADIS16203_INCL_NULL 0x18 #define ADIS16203_ALM_MAG1 0x20 #define ADIS16203_ALM_MAG2 0x22 @@ -138,10 +138,10 @@ static int adis16203_read_raw(struct iio_dev *indio_dev, static const struct iio_chan_spec adis16203_channels[] = { ADIS_SUPPLY_CHAN(ADIS16203_SUPPLY_OUT, ADIS16203_SCAN_SUPPLY, 0, 12), ADIS_AUX_ADC_CHAN(ADIS16203_AUX_ADC, ADIS16203_SCAN_AUX_ADC, 0, 12), - ADIS_INCLI_CHAN(X, ADIS16203_XINCL_OUT, ADIS16203_SCAN_INCLI_X, + ADIS_INCLI_CHAN(X, ADIS16203_INCL_OUT, ADIS16203_SCAN_INCLI_X, BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 14), /* Fixme: Not what it appears to be - see data sheet */ - ADIS_INCLI_CHAN(Y, ADIS16203_YINCL_OUT, ADIS16203_SCAN_INCLI_Y, + ADIS_INCLI_CHAN(Y, ADIS16203_INCL_OUT_180, ADIS16203_SCAN_INCLI_Y, 0, 0, 14), ADIS_TEMP_CHAN(ADIS16203_TEMP_OUT, ADIS16203_SCAN_TEMP, 0, 12), IIO_CHAN_SOFT_TIMESTAMP(5), From patchwork Mon Jan 23 21:17:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 646228 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 56BD2C05027 for ; Mon, 23 Jan 2023 21:04:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232564AbjAWVEi (ORCPT ); Mon, 23 Jan 2023 16:04:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232888AbjAWVEe (ORCPT ); Mon, 23 Jan 2023 16:04:34 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4099737F3E; Mon, 23 Jan 2023 13:04:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C03FA6109A; Mon, 23 Jan 2023 21:04:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92E1FC4339E; Mon, 23 Jan 2023 21:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674507870; bh=SwYXs9I2ta5OOSwgF/OPkPmKgovgrvcG9ebNwU0ipZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fWaSQD9ikHr0APAlpezk0/E8nTE6nDYbWuaX2PdMSDmVKIFGB3VAl8GN9Uwxdzups oPmW5jVILTvftCVoUXTugx3PFjaJPjKnPjKGH6rirxNdwFDNBFG+xY4FcujQ4xRq24 FjYGbpgz2wyc/fmFtZJFOlcf3yXKvzmVpWqPAT9otPuov3IVru9jUNou2hGjqj/fD/ IBp5AAeZg+M8KoRcJ1+GdrMizx3ijCUW82AHgoHTWo5GvEo97lRFfeaFjM47HVhdCv Md4r7ee6unrAIdmeKPuqY+vo/eVMWWcPTi9BJKtf4S70s1FFasyb/2e/cnk2oKq33W aTjlfYxgxMwAA== From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Barry Song Subject: [PATCH 04/12] staging: iio: accel: adis16203: Drop the 180 degree offset channel Date: Mon, 23 Jan 2023 21:17:50 +0000 Message-Id: <20230123211758.563383-5-jic23@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123211758.563383-1-jic23@kernel.org> References: <20230123211758.563383-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron There is no standard ABI suitable for this channel, which is blocking the graduation of this driver from staging. It provides no obvious benefit over applying a -180 degree offset in software. So drop the channel. Signed-off-by: Jonathan Cameron --- drivers/staging/iio/accel/adis16203.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c index 8e5d1d2ea8e9..b59a003f3e26 100644 --- a/drivers/staging/iio/accel/adis16203.c +++ b/drivers/staging/iio/accel/adis16203.c @@ -59,7 +59,6 @@ enum adis16203_scan { ADIS16203_SCAN_INCLI_X, - ADIS16203_SCAN_INCLI_Y, ADIS16203_SCAN_SUPPLY, ADIS16203_SCAN_AUX_ADC, ADIS16203_SCAN_TEMP, @@ -140,11 +139,8 @@ static const struct iio_chan_spec adis16203_channels[] = { ADIS_AUX_ADC_CHAN(ADIS16203_AUX_ADC, ADIS16203_SCAN_AUX_ADC, 0, 12), ADIS_INCLI_CHAN(X, ADIS16203_INCL_OUT, ADIS16203_SCAN_INCLI_X, BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 14), - /* Fixme: Not what it appears to be - see data sheet */ - ADIS_INCLI_CHAN(Y, ADIS16203_INCL_OUT_180, ADIS16203_SCAN_INCLI_Y, - 0, 0, 14), ADIS_TEMP_CHAN(ADIS16203_TEMP_OUT, ADIS16203_SCAN_TEMP, 0, 12), - IIO_CHAN_SOFT_TIMESTAMP(5), + IIO_CHAN_SOFT_TIMESTAMP(4), }; static const struct iio_info adis16203_info = { From patchwork Mon Jan 23 21:17:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 645709 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 AA841C38142 for ; Mon, 23 Jan 2023 21:04:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232786AbjAWVEi (ORCPT ); Mon, 23 Jan 2023 16:04:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232441AbjAWVEf (ORCPT ); Mon, 23 Jan 2023 16:04:35 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 761F132E70; Mon, 23 Jan 2023 13:04:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CED08610A3; Mon, 23 Jan 2023 21:04:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AE24C433EF; Mon, 23 Jan 2023 21:04:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674507872; bh=O29dY269yId+Tk5piMwcX/yhYJ65tW/QMiVRDIvTutI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lJvFIqPNFqKBIfKeKMLkT6bZeHVK9Lfp/wIAS2W1kyXnV9A96jHpePcLXTcV1rUMT Gdz4VJsX0PppqP4NVxQhIS1auSfJizGBMs/SfSB2TEsGXXxw6ghgsiAAyzZPxQANn9 3vAlw0j1zU1mR6+vmPK50+vg3evbsH0Q7YHMlruZnFTGTVD2oXWMZ9LAkHZhboTuZJ 4b8QN6hJ6CRHVCmKAdeuu0b5GfFXtRDodX8Mqnh5vocPpuirThgAuoGjvPVTxwNOeC jOFGiNbVLuRMzGFpUWJcvPTNKl/MzAcT7ssj2qHd0VmW9wlE/IMzNkqgrLinJLs1Xy 5Ys3FL6WAATvA== From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Barry Song Subject: [PATCH 05/12] staging: iio: accel: adis16203: Simplify handling of calibbias Date: Mon, 23 Jan 2023 21:17:51 +0000 Message-Id: <20230123211758.563383-6-jic23@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123211758.563383-1-jic23@kernel.org> References: <20230123211758.563383-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron Dropping the indirection on address lookup as there was only one address enables several other minor cleanups. Signed-off-by: Jonathan Cameron --- drivers/staging/iio/accel/adis16203.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c index b59a003f3e26..67c0340d7097 100644 --- a/drivers/staging/iio/accel/adis16203.c +++ b/drivers/staging/iio/accel/adis16203.c @@ -5,6 +5,7 @@ * Copyright 2010 Analog Devices Inc. */ +#include #include #include #include @@ -57,6 +58,8 @@ #define ADIS16203_ERROR_ACTIVE BIT(14) +#define ADIS16203_INCLI_NULL_MSK GENMASK(13, 0) + enum adis16203_scan { ADIS16203_SCAN_INCLI_X, ADIS16203_SCAN_SUPPLY, @@ -66,10 +69,6 @@ enum adis16203_scan { #define DRIVER_NAME "adis16203" -static const u8 adis16203_addresses[] = { - [ADIS16203_SCAN_INCLI_X] = ADIS16203_INCL_NULL, -}; - static int adis16203_write_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int val, @@ -77,10 +76,12 @@ static int adis16203_write_raw(struct iio_dev *indio_dev, long mask) { struct adis *st = iio_priv(indio_dev); - /* currently only one writable parameter which keeps this simple */ - u8 addr = adis16203_addresses[chan->scan_index]; - return adis_write_reg_16(st, addr, val & 0x3FFF); + if (mask != IIO_CHAN_INFO_CALIBBIAS) + return -EINVAL; + + return adis_write_reg_16(st, ADIS16203_INCL_NULL, + FIELD_PREP(ADIS16203_INCLI_NULL_MSK, val)); } static int adis16203_read_raw(struct iio_dev *indio_dev, @@ -90,7 +91,7 @@ static int adis16203_read_raw(struct iio_dev *indio_dev, { struct adis *st = iio_priv(indio_dev); int ret; - u8 addr; + s16 val16; switch (mask) { @@ -123,8 +124,7 @@ static int adis16203_read_raw(struct iio_dev *indio_dev, *val = 25000 / -470 - 1278; /* 25 C = 1278 */ return IIO_VAL_INT; case IIO_CHAN_INFO_CALIBBIAS: - addr = adis16203_addresses[chan->scan_index]; - ret = adis_read_reg_16(st, addr, &val16); + ret = adis_read_reg_16(st, ADIS16203_INCL_NULL, &val16); if (ret) return ret; *val = sign_extend32(val16, 13); From patchwork Mon Jan 23 21:17:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 646227 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 1666CC54EAA for ; Mon, 23 Jan 2023 21:04:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231501AbjAWVEj (ORCPT ); Mon, 23 Jan 2023 16:04:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232852AbjAWVEj (ORCPT ); Mon, 23 Jan 2023 16:04:39 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D46FD24488; Mon, 23 Jan 2023 13:04:36 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8B2CBB80E96; Mon, 23 Jan 2023 21:04:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1F75C4339B; Mon, 23 Jan 2023 21:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674507874; bh=KwirpNA3y6XauK8S7usKhZVnThfvTfYC6YOhW8SKf60=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i+jA0BYYFZyKNfUtq94ha6fduVxGqGl/I1w6itk0X7B08PdSksSRtoPam8SE5jn4u N5dts7UHIbfBG/+M7etiq6Z0T7EDjFKHavpywCfyIf0rIzuf3ClGNNb3y1viNFOeZK 0eNcyyYPK+2GBrBMjkpkkXJe1SrYeEtY1MJwZhClmTGwpflFhy1f4yquUp09wyysHT DXpdowIrC+LMZ/tmXqL/jgiar248NYgEo1SKUscudELYC2xPYNO20fOeoyrTfXNckD q1w/NUkeuFlizh4skjX9RWjqfhY9L8DdwOtHhExnNJDxPp3ZtMaSD+SbFsAeQIti7x YQQTQxfQhu9RA== From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Barry Song Subject: [PATCH 06/12] staging: iio: accel: adis16203: Drop driver name define Date: Mon, 23 Jan 2023 21:17:52 +0000 Message-Id: <20230123211758.563383-7-jic23@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123211758.563383-1-jic23@kernel.org> References: <20230123211758.563383-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron These defines just make it harder to see what strings are set for which driver structure fields. Much better to just have the string inline. In this case it wasn't even used. Signed-off-by: Jonathan Cameron --- drivers/staging/iio/accel/adis16203.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c index 67c0340d7097..25342717539b 100644 --- a/drivers/staging/iio/accel/adis16203.c +++ b/drivers/staging/iio/accel/adis16203.c @@ -67,8 +67,6 @@ enum adis16203_scan { ADIS16203_SCAN_TEMP, }; -#define DRIVER_NAME "adis16203" - static int adis16203_write_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int val, @@ -196,7 +194,7 @@ static int adis16203_probe(struct spi_device *spi) /* this is only used for removal purposes */ spi_set_drvdata(spi, indio_dev); - indio_dev->name = spi->dev.driver->name; + indio_dev->name = "adis16203"; indio_dev->channels = adis16203_channels; indio_dev->num_channels = ARRAY_SIZE(adis16203_channels); indio_dev->info = &adis16203_info; From patchwork Mon Jan 23 21:17:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 646226 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 ADA56C54EED for ; Mon, 23 Jan 2023 21:04:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230267AbjAWVEo (ORCPT ); Mon, 23 Jan 2023 16:04:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231663AbjAWVEn (ORCPT ); Mon, 23 Jan 2023 16:04:43 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0710332503; Mon, 23 Jan 2023 13:04:39 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 2F99ACE176D; Mon, 23 Jan 2023 21:04:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A882AC433D2; Mon, 23 Jan 2023 21:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674507876; bh=xNFqaSt6sAiqcpyDJBbIK/2JCT49tj09BjUpYSsTMco=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NWHPzLzKzR/gbiCyBGwy/87ylpO1apM55QPY0eu+GRp/DJlYqJ7l2hy1U1cG16zl2 +uH3OUf6SLb9ax4qEv1CKTQBlkc6TMJ2c3xPg1xt9RiUNc0SOWj4bk3DPgGUX6R6Fu 2/T6l+coyDojymRfr83ixk/7sJd3Jsim7mETYrhVk95Kstj/B+1SWYh7ngUJgjiiNr NGsWusC3986I4l6pCcsqXmJ1A3RlaUAbM9xbDGr9x5m3ERqdJb7WXUse/qPHcvopRW kXkFpVrKjuNN1Hw7dc69QATNKIOUcPp5FNoFdvO7RWdrm1dmyapIz7nvoL+8rS6qLV 0aAAVKfhhVWBg== From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Barry Song Subject: [PATCH 07/12] staging: iio: accel: adis16203: Make units explicit in name of delay define Date: Mon, 23 Jan 2023 21:17:53 +0000 Message-Id: <20230123211758.563383-8-jic23@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123211758.563383-1-jic23@kernel.org> References: <20230123211758.563383-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron A postfix of _MS avoids the need for a comment that might bit rot. Signed-off-by: Jonathan Cameron --- drivers/staging/iio/accel/adis16203.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c index 25342717539b..271e560c41c0 100644 --- a/drivers/staging/iio/accel/adis16203.c +++ b/drivers/staging/iio/accel/adis16203.c @@ -14,7 +14,7 @@ #include #include -#define ADIS16203_STARTUP_DELAY 220 /* ms */ +#define ADIS16203_STARTUP_DELAY_MS 220 #define ADIS16203_FLASH_CNT 0x00 #define ADIS16203_SUPPLY_OUT 0x02 @@ -156,9 +156,9 @@ static const char * const adis16203_status_error_msgs[] = { }; static const struct adis_timeout adis16203_timeouts = { - .reset_ms = ADIS16203_STARTUP_DELAY, - .sw_reset_ms = ADIS16203_STARTUP_DELAY, - .self_test_ms = ADIS16203_STARTUP_DELAY + .reset_ms = ADIS16203_STARTUP_DELAY_MS, + .sw_reset_ms = ADIS16203_STARTUP_DELAY_MS, + .self_test_ms = ADIS16203_STARTUP_DELAY_MS }; static const struct adis_data adis16203_data = { From patchwork Mon Jan 23 21:17:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 645708 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 41010C38142 for ; Mon, 23 Jan 2023 21:04:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231480AbjAWVEn (ORCPT ); Mon, 23 Jan 2023 16:04:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbjAWVEm (ORCPT ); Mon, 23 Jan 2023 16:04:42 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 645CF38026; Mon, 23 Jan 2023 13:04:39 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EF93D61092; Mon, 23 Jan 2023 21:04:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABF52C433A0; Mon, 23 Jan 2023 21:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674507878; bh=VnHxjBNrUG6CY7s6ScRwsoldize5YgLyA6igzmAEr7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Insh2jMuVk52Nlgs/dW1MFru6Ss0tplO925D2SaV1GPkPNH/5p/On4alhYPtBabPS S3Qttn1CPowls7FEmyDBFOlEFUDNo3ERTprGnCzRvpx44npXsSEHbVNFkVtAfpR03w GTxutgywKXvUj2zIET1GkeU0FNJAbgNsWLJqvt2pWV3aXBGjS1hPwmVN0udm1TmlMT P3FqghLfATSkiQZo7HAAFF4/14lDbyZpRHJVusTxQ6JJKMYRPblej++fLUag6SjP6s xWvUbydOSfNavqfqEWK6FKIcmcs4iog1CZXDCZ1uo9iZLHZ+8IQtgirFG3/ivIc+FO N2Q/AVY9m+tbQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Barry Song Subject: [PATCH 08/12] staging: iio: accel: adis16203: Trivial whitespace cleanup Date: Mon, 23 Jan 2023 21:17:54 +0000 Message-Id: <20230123211758.563383-9-jic23@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123211758.563383-1-jic23@kernel.org> References: <20230123211758.563383-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron Identation etc in this driver was inconsistent. Fix that. Signed-off-by: Jonathan Cameron --- drivers/staging/iio/accel/adis16203.c | 97 +++++++++++++-------------- 1 file changed, 46 insertions(+), 51 deletions(-) diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c index 271e560c41c0..20e9c9eb9436 100644 --- a/drivers/staging/iio/accel/adis16203.c +++ b/drivers/staging/iio/accel/adis16203.c @@ -16,49 +16,49 @@ #define ADIS16203_STARTUP_DELAY_MS 220 -#define ADIS16203_FLASH_CNT 0x00 -#define ADIS16203_SUPPLY_OUT 0x02 -#define ADIS16203_AUX_ADC 0x08 -#define ADIS16203_TEMP_OUT 0x0A -#define ADIS16203_INCL_OUT 0x0C -#define ADIS16203_INCL_OUT_180 0x0E -#define ADIS16203_INCL_NULL 0x18 -#define ADIS16203_ALM_MAG1 0x20 -#define ADIS16203_ALM_MAG2 0x22 -#define ADIS16203_ALM_SMPL1 0x24 -#define ADIS16203_ALM_SMPL2 0x26 -#define ADIS16203_ALM_CTRL 0x28 -#define ADIS16203_AUX_DAC 0x30 -#define ADIS16203_GPIO_CTRL 0x32 -#define ADIS16203_MSC_CTRL 0x34 -#define ADIS16203_SMPL_PRD 0x36 -#define ADIS16203_AVG_CNT 0x38 -#define ADIS16203_SLP_CNT 0x3A -#define ADIS16203_DIAG_STAT 0x3C -#define ADIS16203_GLOB_CMD 0x3E - -#define ADIS16203_MSC_CTRL_PWRUP_SELF_TEST_DIS BIT(10) -#define ADIS16203_MSC_CTRL_REVERSE_ROT_EN BIT(9) -#define ADIS16203_MSC_CTRL_SELF_TEST_EN BIT(8) -#define ADIS16203_MSC_CTRL_DATA_RDY_EN BIT(2) -#define ADIS16203_MSC_CTRL_ACTIVE_HIGH BIT(1) -#define ADIS16203_MSC_CTRL_DATA_RDY_DIO1 BIT(0) - -#define ADIS16203_DIAG_STAT_ALARM2 BIT(9) -#define ADIS16203_DIAG_STAT_ALARM1 BIT(8) -#define ADIS16203_DIAG_STAT_SELFTEST_FAIL_BIT 5 -#define ADIS16203_DIAG_STAT_SPI_FAIL_BIT 3 -#define ADIS16203_DIAG_STAT_FLASH_UPT_BIT 2 -#define ADIS16203_DIAG_STAT_POWER_HIGH_BIT 1 -#define ADIS16203_DIAG_STAT_POWER_LOW_BIT 0 - -#define ADIS16203_GLOB_CMD_SW_RESET BIT(7) -#define ADIS16203_GLOB_CMD_CLEAR_STAT BIT(4) -#define ADIS16203_GLOB_CMD_FACTORY_CAL BIT(1) - -#define ADIS16203_ERROR_ACTIVE BIT(14) - -#define ADIS16203_INCLI_NULL_MSK GENMASK(13, 0) +#define ADIS16203_FLASH_CNT 0x00 +#define ADIS16203_SUPPLY_OUT 0x02 +#define ADIS16203_AUX_ADC 0x08 +#define ADIS16203_TEMP_OUT 0x0A +#define ADIS16203_INCL_OUT 0x0C +#define ADIS16203_INCL_OUT_180 0x0E +#define ADIS16203_INCL_NULL 0x18 +#define ADIS16203_ALM_MAG1 0x20 +#define ADIS16203_ALM_MAG2 0x22 +#define ADIS16203_ALM_SMPL1 0x24 +#define ADIS16203_ALM_SMPL2 0x26 +#define ADIS16203_ALM_CTRL 0x28 +#define ADIS16203_AUX_DAC 0x30 +#define ADIS16203_GPIO_CTRL 0x32 +#define ADIS16203_MSC_CTRL 0x34 +#define ADIS16203_SMPL_PRD 0x36 +#define ADIS16203_AVG_CNT 0x38 +#define ADIS16203_SLP_CNT 0x3A +#define ADIS16203_DIAG_STAT 0x3C +#define ADIS16203_GLOB_CMD 0x3E + +#define ADIS16203_MSC_CTRL_PWRUP_SELF_TEST_DIS BIT(10) +#define ADIS16203_MSC_CTRL_REVERSE_ROT_EN BIT(9) +#define ADIS16203_MSC_CTRL_SELF_TEST_EN BIT(8) +#define ADIS16203_MSC_CTRL_DATA_RDY_EN BIT(2) +#define ADIS16203_MSC_CTRL_ACTIVE_HIGH BIT(1) +#define ADIS16203_MSC_CTRL_DATA_RDY_DIO1 BIT(0) + +#define ADIS16203_DIAG_STAT_ALARM2 BIT(9) +#define ADIS16203_DIAG_STAT_ALARM1 BIT(8) +#define ADIS16203_DIAG_STAT_SELFTEST_FAIL_BIT 5 +#define ADIS16203_DIAG_STAT_SPI_FAIL_BIT 3 +#define ADIS16203_DIAG_STAT_FLASH_UPT_BIT 2 +#define ADIS16203_DIAG_STAT_POWER_HIGH_BIT 1 +#define ADIS16203_DIAG_STAT_POWER_LOW_BIT 0 + +#define ADIS16203_GLOB_CMD_SW_RESET BIT(7) +#define ADIS16203_GLOB_CMD_CLEAR_STAT BIT(4) +#define ADIS16203_GLOB_CMD_FACTORY_CAL BIT(1) + +#define ADIS16203_ERROR_ACTIVE BIT(14) + +#define ADIS16203_INCLI_NULL_MSK GENMASK(13, 0) enum adis16203_scan { ADIS16203_SCAN_INCLI_X, @@ -69,9 +69,7 @@ enum adis16203_scan { static int adis16203_write_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, - int val, - int val2, - long mask) + int val, int val2, long mask) { struct adis *st = iio_priv(indio_dev); @@ -84,18 +82,16 @@ static int adis16203_write_raw(struct iio_dev *indio_dev, static int adis16203_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, - int *val, int *val2, - long mask) + int *val, int *val2, long mask) { struct adis *st = iio_priv(indio_dev); int ret; - s16 val16; switch (mask) { case IIO_CHAN_INFO_RAW: return adis_single_conversion(indio_dev, chan, - ADIS16203_ERROR_ACTIVE, val); + ADIS16203_ERROR_ACTIVE, val); case IIO_CHAN_INFO_SCALE: switch (chan->type) { case IIO_VOLTAGE: @@ -220,7 +216,6 @@ static const struct of_device_id adis16203_of_match[] = { { .compatible = "adi,adis16203" }, { }, }; - MODULE_DEVICE_TABLE(of, adis16203_of_match); static struct spi_driver adis16203_driver = { From patchwork Mon Jan 23 21:17:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 645707 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 3F367C38142 for ; Mon, 23 Jan 2023 21:04:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231981AbjAWVEt (ORCPT ); Mon, 23 Jan 2023 16:04:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231663AbjAWVEs (ORCPT ); Mon, 23 Jan 2023 16:04:48 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39A7838038; Mon, 23 Jan 2023 13:04:43 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ADEB8B80E3F; Mon, 23 Jan 2023 21:04:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC590C4339B; Mon, 23 Jan 2023 21:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674507880; bh=B+qp4Bg0ckQ1EeHpNrnKDGWpfd3LdqaTfOttRJJrPgs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IpA+rARNa9lf8MdJYKMFMJIMjUd7MANNfz2AKQUNB76zH4l+ZyPYqrE+UgyuElwNk dfSnj5oPAD3v1BKLkOiwdZ88TMpbk4l2RTMLxWlRFlZ4ctGL+0SqvGPcRzVWmhs/SK 0H9l9jqGJDjmiAAkvbBgwJM04YlYkwG5beQW3Touyuxdqz25ZsTNc/kUio6HvVe3Of esrJ+JpCWmKVOihuZDnQjeN1Vw1E19jDQzGQV/bV0gJQWOZrbgUQrxSqpimSPBvWji UYfGeHUPs7QHTepukFxTPpHQFS98bq6y21V7qOnVxYJMrEH4BT4tEWikrTpNg68jPZ 1/c5vbonQ+ixw== From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Barry Song Subject: [PATCH 09/12] staging: iio: accel: adis16203: Drop setting drvdata as nothing gets it Date: Mon, 23 Jan 2023 21:17:55 +0000 Message-Id: <20230123211758.563383-10-jic23@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123211758.563383-1-jic23@kernel.org> References: <20230123211758.563383-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron As commented, it is only useful for .remove() which doesn't exist, so drop setting it and the comment. Signed-off-by: Jonathan Cameron --- drivers/staging/iio/accel/adis16203.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c index 20e9c9eb9436..9915b73454d2 100644 --- a/drivers/staging/iio/accel/adis16203.c +++ b/drivers/staging/iio/accel/adis16203.c @@ -187,8 +187,6 @@ static int adis16203_probe(struct spi_device *spi) if (!indio_dev) return -ENOMEM; st = iio_priv(indio_dev); - /* this is only used for removal purposes */ - spi_set_drvdata(spi, indio_dev); indio_dev->name = "adis16203"; indio_dev->channels = adis16203_channels; From patchwork Mon Jan 23 21:17:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 646225 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 BC821C54EAA for ; Mon, 23 Jan 2023 21:04:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232079AbjAWVEu (ORCPT ); Mon, 23 Jan 2023 16:04:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232878AbjAWVEt (ORCPT ); Mon, 23 Jan 2023 16:04:49 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ED2738665; Mon, 23 Jan 2023 13:04:43 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EEC8D61093; Mon, 23 Jan 2023 21:04:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C37D1C433EF; Mon, 23 Jan 2023 21:04:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674507882; bh=z7t1uWckaiUEht/osE1ffup1zeOOHYuYzMqKoLJ3WvU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=igQHficwaZPNJyhi1nqIPK2ZdLCTTia+x99Up4FhgRftc3Q2e0cRLxrgOJb4yrWSB hrBxNcHTUeL5+GICkjXoz/HkbZzsaH0MqNxChaA5acAM2o1H2Jx2NlKtOyww1XkSnR TfGzD5x+qXa825FCNW+87aB08G+8VLQSuYgvDXy2N/JSt5W12DU9cpUeYIVbV0lMmf UoAbDqL6lAQ78Mv2TVOZooFUuCmUyGXfkjX73fboGo7yBJuN9WZomDVrAfG38UaWsY o9WgutoAj3DSLm9PClCjJXYomdbNkA4CPHKt8tbeMYqYH0XXtJIBfPNaKKljKW+Mxp EMR67wNwLpzjQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Barry Song Subject: [PATCH 10/12] staging: iio: accel: adis16203: Trivial style cleanup Date: Mon, 23 Jan 2023 21:17:56 +0000 Message-Id: <20230123211758.563383-11-jic23@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123211758.563383-1-jic23@kernel.org> References: <20230123211758.563383-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron Drop a training comma after a null terminator and a comment that says nothing beyond the obvious. Signed-off-by: Jonathan Cameron --- drivers/staging/iio/accel/adis16203.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c index 9915b73454d2..1aaf9815aa66 100644 --- a/drivers/staging/iio/accel/adis16203.c +++ b/drivers/staging/iio/accel/adis16203.c @@ -182,7 +182,6 @@ static int adis16203_probe(struct spi_device *spi) struct iio_dev *indio_dev; struct adis *st; - /* setup the industrialio driver allocated elements */ indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); if (!indio_dev) return -ENOMEM; @@ -212,7 +211,7 @@ static int adis16203_probe(struct spi_device *spi) static const struct of_device_id adis16203_of_match[] = { { .compatible = "adi,adis16203" }, - { }, + { } }; MODULE_DEVICE_TABLE(of, adis16203_of_match); From patchwork Mon Jan 23 21:17:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 646224 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 83B66C54EAA for ; Mon, 23 Jan 2023 21:05:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231663AbjAWVFN (ORCPT ); Mon, 23 Jan 2023 16:05:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233065AbjAWVFA (ORCPT ); Mon, 23 Jan 2023 16:05:00 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E7C836093; Mon, 23 Jan 2023 13:04:48 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 3FFBBCE177D; Mon, 23 Jan 2023 21:04:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF14EC4339E; Mon, 23 Jan 2023 21:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674507884; bh=5f/C5c9JIAXP9r2odmuD9frv/a6t3JXMKM+BDL0WCQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HDKMkyjl9muAGLuIgDylGmpiRaWSqDwtjliBAKrhlqHcgYc+wCNtdBFqE+qKwobmJ OQ7ZVAF/gv6XnBN1io1JPDQz2RCY2wXgTyiT8WGoB7XJilVYU8/SwVqt0aNQorBnpF liB3/M7H4JllPYiR1FEaBAtUIoQM3Z13mHNK/PGNK/j06ruDZz9lMHBw6DzrqTUpoP mZij+fqZAUVOpo0nt6Nbg+46GngKJOTA5vI/jCHV0TcCUK26yvU5oIqmp+XlWJHd8t SLA6tI+MB6TNGXBKB8YcqCafTm5W0bIfqnSpiP2jpCV3vTSv4qNr/zzGkKhXrJf6oh 0kXj5ES/ILj2w== From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Barry Song Subject: [PATCH 11/12] staging: iio: accel: adis16203: Move out of staging Date: Mon, 23 Jan 2023 21:17:57 +0000 Message-Id: <20230123211758.563383-12-jic23@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123211758.563383-1-jic23@kernel.org> References: <20230123211758.563383-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron The main blocker of this driver moving previously was non standard ABI for the 180 degree offset channel. Now support for that channel has been dropped, this simple driver can move out of staging. Signed-off-by: Jonathan Cameron --- drivers/iio/accel/Kconfig | 12 ++++++++++++ drivers/iio/accel/Makefile | 1 + drivers/{staging => }/iio/accel/adis16203.c | 0 drivers/staging/iio/accel/Kconfig | 12 ------------ drivers/staging/iio/accel/Makefile | 1 - 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig index b6b45d359f28..88d4b18bd5e8 100644 --- a/drivers/iio/accel/Kconfig +++ b/drivers/iio/accel/Kconfig @@ -18,6 +18,18 @@ config ADIS16201 To compile this driver as a module, say M here: the module will be called adis16201. +config ADIS16203 + tristate "Analog Devices ADIS16203 Programmable 360 Degrees Inclinometer" + depends on SPI + select IIO_ADIS_LIB + select IIO_ADIS_LIB_BUFFER if IIO_BUFFER + help + Say Y here to build support for Analog Devices adis16203 Programmable + 360 Degrees Inclinometer. + + To compile this driver as a module, say M here: the module will be + called adis16203. + config ADIS16209 tristate "Analog Devices ADIS16209 Dual-Axis Digital Inclinometer and Accelerometer" depends on SPI diff --git a/drivers/iio/accel/Makefile b/drivers/iio/accel/Makefile index 311ead9c3ef1..b6f0cee52659 100644 --- a/drivers/iio/accel/Makefile +++ b/drivers/iio/accel/Makefile @@ -5,6 +5,7 @@ # When adding new entries keep the list in alphabetical order obj-$(CONFIG_ADIS16201) += adis16201.o +obj-$(CONFIG_ADIS16203) += adis16203.o obj-$(CONFIG_ADIS16209) += adis16209.o obj-$(CONFIG_ADXL313) += adxl313_core.o obj-$(CONFIG_ADXL313_I2C) += adxl313_i2c.o diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/iio/accel/adis16203.c similarity index 100% rename from drivers/staging/iio/accel/adis16203.c rename to drivers/iio/accel/adis16203.c diff --git a/drivers/staging/iio/accel/Kconfig b/drivers/staging/iio/accel/Kconfig index 3318997a7009..3769af8719f3 100644 --- a/drivers/staging/iio/accel/Kconfig +++ b/drivers/staging/iio/accel/Kconfig @@ -4,18 +4,6 @@ # menu "Accelerometers" -config ADIS16203 - tristate "Analog Devices ADIS16203 Programmable 360 Degrees Inclinometer" - depends on SPI - select IIO_ADIS_LIB - select IIO_ADIS_LIB_BUFFER if IIO_BUFFER - help - Say Y here to build support for Analog Devices adis16203 Programmable - 360 Degrees Inclinometer. - - To compile this driver as a module, say M here: the module will be - called adis16203. - config ADIS16240 tristate "Analog Devices ADIS16240 Programmable Impact Sensor and Recorder" depends on SPI diff --git a/drivers/staging/iio/accel/Makefile b/drivers/staging/iio/accel/Makefile index 094cc9be35bd..b0beec471814 100644 --- a/drivers/staging/iio/accel/Makefile +++ b/drivers/staging/iio/accel/Makefile @@ -3,5 +3,4 @@ # Makefile for industrial I/O accelerometer drivers # -obj-$(CONFIG_ADIS16203) += adis16203.o obj-$(CONFIG_ADIS16240) += adis16240.o From patchwork Mon Jan 23 21:17:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 645706 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 94A8BC05027 for ; Mon, 23 Jan 2023 21:05:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233200AbjAWVFM (ORCPT ); Mon, 23 Jan 2023 16:05:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233086AbjAWVFC (ORCPT ); Mon, 23 Jan 2023 16:05:02 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BEE738661; Mon, 23 Jan 2023 13:04:49 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B8B67B80EA4; Mon, 23 Jan 2023 21:04:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8E06C433EF; Mon, 23 Jan 2023 21:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674507886; bh=JfdSnP/IqcEU/RUpwi8uEy+ZYVr2XcnzyLksuNk/4MU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YNRo016XnjSx+2eUjgQivHPW6qu9wGLJEfSclufrG+a7FCGG7CLXpMnTOeMRusC5g 2qGeqOcz9IFBj3uIJhkn6he4GU2IiZSb2eLlW/geh3Ahmvcw47x5hbTILYI08UN0SJ QoJRUQ0g3PsYFMRTMmJ0tRsff+VJ63rICoKEuxEZry5IgyUpOKrBnUPSZ/mrPUpa/G yV0lTP99JC1s/Q8fWtqc94/a/Diok3RT26pMgM4of7m3nDVQIqdNZ77z1f1L3m9WVZ vKZm37Wuig7NywbFgDX+BjreTJmC7u73FX+Mw+IWUezQzjqGSIzDGVb0Q4rH8SQXbo rV8q90XoX8DsQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Barry Song Subject: [PATCH 12/12] dt-bindings: iio: accel: Add ADIS16203 Inclinometer Date: Mon, 23 Jan 2023 21:17:58 +0000 Message-Id: <20230123211758.563383-13-jic23@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123211758.563383-1-jic23@kernel.org> References: <20230123211758.563383-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron There has been a driver in staging for quite a while. Given we are now moving it to the main tree, time to make sure it has binding documentation. Signed-off-by: Jonathan Cameron --- .../bindings/iio/accel/adi,adis16203.yaml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adis16203.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adis16203.yaml new file mode 100644 index 000000000000..05c095247e10 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/accel/adi,adis16203.yaml @@ -0,0 +1,59 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/accel/adi,adis16203.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ADIS16203 Programmable 360 degree inclinometer + +maintainers: + - Jonathan Cameron + +properties: + compatible: + const: adi,adis16203 + + reg: + maxItems: 1 + + interrupts: + maxItems: 2 + + interrupt-names: + description: + Device has two configurable outputs, both of which may be used + as interrupt sources. + enum: + - dio0 + - dio1 + + reset-gpios: true + + vdd-supply: true + +required: + - compatible + - reg + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml# + +unevaluatedProperties: false + +examples: + - | + #include + spi { + #address-cells = <1>; + #size-cells = <0>; + accelerometer@0 { + compatible = "adi,adis16201"; + reg = <0>; + spi-max-frequency = <2500000>; + interrupt-parent = <&gpio0>; + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "dio0"; + }; + }; +... +