Received: by 10.223.185.116 with SMTP id b49csp8765938wrg; Fri, 2 Mar 2018 07:35:41 -0800 (PST) X-Google-Smtp-Source: AG47ELu7eVFMmUvpsJJNQzkGi/rWTPwL5z/EtdYoX6BfQs94CqSPj7SqXf2osf5A48Y7f+a3Rvcr X-Received: by 10.98.93.87 with SMTP id r84mr6055629pfb.131.1520004941868; Fri, 02 Mar 2018 07:35:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520004941; cv=none; d=google.com; s=arc-20160816; b=lj/oTWy+TcmVyQYQs5CYLh9YH8XAihkWaHxQ8AdPnoDG7Gkcpp3PQLp3mnY/ZxN1Q3 07Hq8hce6nXRg9HRzV6R3gvveGWfF5p23nfDEsywjhn7rjaE/7xOI+m/PvjQOAQvH6LM ZunPRU3jelgCj+64S0vrODdxw4GFcZSYAnIhyYgz7LapW/yIXnGBz9OkJUu3op/dabQ9 TN55yhC3ldIXrCRT/I2mySL/OV9IizfNC5d/+OJaCFHUbRjoQrJmWMP4bPi6peG+H61I IH+hu1EeEmRcbcJx+/3PbSVC7E+d1XhVw8jywtdw49IO9R/uDJVFD0lHSKCO6dojFAta eq2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=gBgNQFDpQokM0jL9i/ho9ogRF0C89TCo1ihWYjPAaOE=; b=BDCH0U1x414yNm3XEL+jT4z3LAauXBQYA2uWm8/1na8Db2gS7mfeVU250IfINjcRXK Oq73dEACKQBZdpF8sC210qJXriMgfQzIM/fW9ath0CH/GOBsaHsHWiJFP9NvS42+HAtJ RHArF+zvv71CYtuf/QeqS/spZODeOMQJNxYQeG8uOkPKLhqi7jHh/1exjGvFIdV3KxzU p0zLLJxwqY2TTPEtZOMFvwVChgLO6GuhjsguSVxWrFLN7XqL8nmvYcA+6s9J4PtNP0vQ zMVlWxAOn8fdGNjUvljb/Bo3zbo9yYhqgB3A+f2/Azwzxfb9RZRwq3Fhxh8r7a/0WVqJ lnwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nHn6sGTi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 73-v6si4894204ple.829.2018.03.02.07.35.20; Fri, 02 Mar 2018 07:35:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nHn6sGTi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1428165AbeCBN0F (ORCPT + 99 others); Fri, 2 Mar 2018 08:26:05 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:46660 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425249AbeCBN0B (ORCPT ); Fri, 2 Mar 2018 08:26:01 -0500 Received: by mail-pg0-f65.google.com with SMTP id r26so3774480pgv.13; Fri, 02 Mar 2018 05:26:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gBgNQFDpQokM0jL9i/ho9ogRF0C89TCo1ihWYjPAaOE=; b=nHn6sGTiirP6QUbPY4JDK8pJVO5YHcpR6BMUprAdW+lN4UHMk+Q9ApAeNYEXGCU/Q5 KnaP1v5jTSnnE8sKGuHc2WwwAbnlUsxQr6/zUo6sbVyx0birN7182Oxn/OSeF+CpTq3r +kchGEDvxrJSwE1CXLSZ3U9IiVs7hymCpJvHWGoPQPp7lGcKJ0f/RuojiDpUUoDM6Qnx N15RCKyNF0BWicbH9Q3oZhxN/5ysZf0F19qxFF8hNtNBGn4IRecBeocxSQ6q7cGzf/qy gZtvNgO5jqXBgckkrclXEqCCoTjLOjH4g8e66kUW+hEtxRuqoq6FOTRUCiS/HbGvQVsq lmtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gBgNQFDpQokM0jL9i/ho9ogRF0C89TCo1ihWYjPAaOE=; b=RuDlpSRxvlKjzE/GpS1Y/uOvP5llslP4hOOs7cWnuAsHMVR9arkP72SXIqjebL7xZf KcasSQUJhQn6oHbbD77zaO0BSk8bjzG3DhIfZQVh0RhB5vdzpElhT75tgm/spW3SNeCi wN5cOJuVCZ9FkZeF6q3MeNpd9jRkK3YhRIjUyn96ZJRBIaG1veVPzpp/+ZwWHfTTU/TE aBKx+ilvlYqP8W7gVhANUde9zU9K+tOwB8kWow0IPMNgh6wULOmpcHun3VVKPJfRDAze 3YxXPVFC744cy6VZlWSko0+JfeL6fBUh3gw3icV1KEfR4SeRAj69QkXa8JGnHvHj5VK/ 770Q== X-Gm-Message-State: APf1xPCAJdJJVInpP0AZC9gMN0V7IRXtIty+zF6U/g7RpJKJQKv96gq4 BtkuzTwt/dZa6MSSAZF4OH0= X-Received: by 10.101.97.139 with SMTP id c11mr4549722pgv.443.1519997161121; Fri, 02 Mar 2018 05:26:01 -0800 (PST) Received: from shreeya-VirtualBox ([103.212.140.150]) by smtp.gmail.com with ESMTPSA id j14sm11125739pfn.113.2018.03.02.05.25.59 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Mar 2018 05:26:00 -0800 (PST) From: Shreeya Patel To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, daniel.baluta@gmail.com Cc: Shreeya Patel Subject: [PATCH 3/6] Staging: iio: adis16209: Add _REG postfix for registers Date: Fri, 2 Mar 2018 18:55:56 +0530 Message-Id: <36a368e0dfc4ddbad460a4af117e088e80441a03.1519995673.git.shreeya.patel23498@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The defined names for registers does not make it very clear that they are registers and hence, add _REG postfix. This improves the readability of the code. Signed-off-by: Shreeya Patel --- drivers/staging/iio/accel/adis16209.c | 85 ++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/drivers/staging/iio/accel/adis16209.c b/drivers/staging/iio/accel/adis16209.c index 830c278..151120f 100644 --- a/drivers/staging/iio/accel/adis16209.c +++ b/drivers/staging/iio/accel/adis16209.c @@ -23,85 +23,85 @@ #define ADIS16209_STARTUP_DELAY_MS 220 /* Flash memory write count */ -#define ADIS16209_FLASH_CNT 0x00 +#define ADIS16209_FLASH_CNT_REG 0x00 /* Output, power supply */ -#define ADIS16209_SUPPLY_OUT 0x02 +#define ADIS16209_SUPPLY_OUT_REG 0x02 /* Output, x-axis accelerometer */ -#define ADIS16209_XACCL_OUT 0x04 +#define ADIS16209_XACCL_OUT_REG 0x04 /* Output, y-axis accelerometer */ -#define ADIS16209_YACCL_OUT 0x06 +#define ADIS16209_YACCL_OUT_REG 0x06 /* Output, auxiliary ADC input */ -#define ADIS16209_AUX_ADC 0x08 +#define ADIS16209_AUX_ADC_REG 0x08 /* Output, temperature */ -#define ADIS16209_TEMP_OUT 0x0A +#define ADIS16209_TEMP_OUT_REG 0x0A /* Output, x-axis inclination */ -#define ADIS16209_XINCL_OUT 0x0C +#define ADIS16209_XINCL_OUT_REG 0x0C /* Output, y-axis inclination */ -#define ADIS16209_YINCL_OUT 0x0E +#define ADIS16209_YINCL_OUT_REG 0x0E /* Output, +/-180 vertical rotational position */ -#define ADIS16209_ROT_OUT 0x10 +#define ADIS16209_ROT_OUT_REG 0x10 /* Calibration, x-axis acceleration offset null */ -#define ADIS16209_XACCL_NULL 0x12 +#define ADIS16209_XACCL_NULL_REG 0x12 /* Calibration, y-axis acceleration offset null */ -#define ADIS16209_YACCL_NULL 0x14 +#define ADIS16209_YACCL_NULL_REG 0x14 /* Calibration, x-axis inclination offset null */ -#define ADIS16209_XINCL_NULL 0x16 +#define ADIS16209_XINCL_NULL_REG 0x16 /* Calibration, y-axis inclination offset null */ -#define ADIS16209_YINCL_NULL 0x18 +#define ADIS16209_YINCL_NULL_REG 0x18 /* Calibration, vertical rotation offset null */ -#define ADIS16209_ROT_NULL 0x1A +#define ADIS16209_ROT_NULL_REG 0x1A /* Alarm 1 amplitude threshold */ -#define ADIS16209_ALM_MAG1 0x20 +#define ADIS16209_ALM_MAG1_REG 0x20 /* Alarm 2 amplitude threshold */ -#define ADIS16209_ALM_MAG2 0x22 +#define ADIS16209_ALM_MAG2_REG 0x22 /* Alarm 1, sample period */ -#define ADIS16209_ALM_SMPL1 0x24 +#define ADIS16209_ALM_SMPL1_REG 0x24 /* Alarm 2, sample period */ -#define ADIS16209_ALM_SMPL2 0x26 +#define ADIS16209_ALM_SMPL2_REG 0x26 /* Alarm control */ -#define ADIS16209_ALM_CTRL 0x28 +#define ADIS16209_ALM_CTRL_REG 0x28 /* Auxiliary DAC data */ -#define ADIS16209_AUX_DAC 0x30 +#define ADIS16209_AUX_DAC_REG 0x30 /* General-purpose digital input/output control */ -#define ADIS16209_GPIO_CTRL 0x32 +#define ADIS16209_GPIO_CTRL_REG 0x32 /* Miscellaneous control */ -#define ADIS16209_MSC_CTRL 0x34 +#define ADIS16209_MSC_CTRL_REG 0x34 /* Internal sample period (rate) control */ -#define ADIS16209_SMPL_PRD 0x36 +#define ADIS16209_SMPL_PRD_REG 0x36 /* Operation, filter configuration */ -#define ADIS16209_AVG_CNT 0x38 +#define ADIS16209_AVG_CNT_REG 0x38 /* Operation, sleep mode control */ -#define ADIS16209_SLP_CNT 0x3A +#define ADIS16209_SLP_CNT_REG 0x3A /* Diagnostics, system status register */ -#define ADIS16209_DIAG_STAT 0x3C +#define ADIS16209_DIAG_STAT_REG 0x3C /* Operation, system command register */ -#define ADIS16209_GLOB_CMD 0x3E +#define ADIS16209_GLOB_CMD_REG 0x3E /* MSC_CTRL */ @@ -165,10 +165,10 @@ enum adis16209_scan { static const u8 adis16209_addresses[8][1] = { [ADIS16209_SCAN_SUPPLY] = { }, [ADIS16209_SCAN_AUX_ADC] = { }, - [ADIS16209_SCAN_ACC_X] = { ADIS16209_XACCL_NULL }, - [ADIS16209_SCAN_ACC_Y] = { ADIS16209_YACCL_NULL }, - [ADIS16209_SCAN_INCLI_X] = { ADIS16209_XINCL_NULL }, - [ADIS16209_SCAN_INCLI_Y] = { ADIS16209_YINCL_NULL }, + [ADIS16209_SCAN_ACC_X] = { ADIS16209_XACCL_NULL_REG }, + [ADIS16209_SCAN_ACC_Y] = { ADIS16209_YACCL_NULL_REG }, + [ADIS16209_SCAN_INCLI_X] = { ADIS16209_XINCL_NULL_REG }, + [ADIS16209_SCAN_INCLI_Y] = { ADIS16209_YINCL_NULL_REG }, [ADIS16209_SCAN_ROT] = { }, [ADIS16209_SCAN_TEMP] = { }, }; @@ -266,18 +266,19 @@ static int adis16209_read_raw(struct iio_dev *indio_dev, } static const struct iio_chan_spec adis16209_channels[] = { - ADIS_SUPPLY_CHAN(ADIS16209_SUPPLY_OUT, ADIS16209_SCAN_SUPPLY, 0, 14), - ADIS_TEMP_CHAN(ADIS16209_TEMP_OUT, ADIS16209_SCAN_TEMP, 0, 12), - ADIS_ACCEL_CHAN(X, ADIS16209_XACCL_OUT, ADIS16209_SCAN_ACC_X, + ADIS_SUPPLY_CHAN(ADIS16209_SUPPLY_OUT_REG, ADIS16209_SCAN_SUPPLY, + 0, 14), + ADIS_TEMP_CHAN(ADIS16209_TEMP_OUT_REG, ADIS16209_SCAN_TEMP, 0, 12), + ADIS_ACCEL_CHAN(X, ADIS16209_XACCL_OUT_REG, ADIS16209_SCAN_ACC_X, BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 14), - ADIS_ACCEL_CHAN(Y, ADIS16209_YACCL_OUT, ADIS16209_SCAN_ACC_Y, + ADIS_ACCEL_CHAN(Y, ADIS16209_YACCL_OUT_REG, ADIS16209_SCAN_ACC_Y, BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 14), - ADIS_AUX_ADC_CHAN(ADIS16209_AUX_ADC, ADIS16209_SCAN_AUX_ADC, 0, 12), - ADIS_INCLI_CHAN(X, ADIS16209_XINCL_OUT, ADIS16209_SCAN_INCLI_X, + ADIS_AUX_ADC_CHAN(ADIS16209_AUX_ADC_REG, ADIS16209_SCAN_AUX_ADC, 0, 12), + ADIS_INCLI_CHAN(X, ADIS16209_XINCL_OUT_REG, ADIS16209_SCAN_INCLI_X, 0, 0, 14), - ADIS_INCLI_CHAN(Y, ADIS16209_YINCL_OUT, ADIS16209_SCAN_INCLI_Y, + ADIS_INCLI_CHAN(Y, ADIS16209_YINCL_OUT_REG, ADIS16209_SCAN_INCLI_Y, 0, 0, 14), - ADIS_ROT_CHAN(X, ADIS16209_ROT_OUT, ADIS16209_SCAN_ROT, 0, 0, 14), + ADIS_ROT_CHAN(X, ADIS16209_ROT_OUT_REG, ADIS16209_SCAN_ROT, 0, 0, 14), IIO_CHAN_SOFT_TIMESTAMP(8) }; @@ -297,9 +298,9 @@ static const char * const adis16209_status_error_msgs[] = { static const struct adis_data adis16209_data = { .read_delay = 30, - .msc_ctrl_reg = ADIS16209_MSC_CTRL, - .glob_cmd_reg = ADIS16209_GLOB_CMD, - .diag_stat_reg = ADIS16209_DIAG_STAT, + .msc_ctrl_reg = ADIS16209_MSC_CTRL_REG, + .glob_cmd_reg = ADIS16209_GLOB_CMD_REG, + .diag_stat_reg = ADIS16209_DIAG_STAT_REG, .self_test_mask = ADIS16209_MSC_CTRL_SELF_TEST_EN, .self_test_no_autoclear = true, -- 2.7.4