diff mbox

[v2,1/9] Staging: iio: accel: adis16201: Rename few macro definitions

Message ID 1521230786-18155-2-git-send-email-himanshujha199640@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Himanshu Jha March 16, 2018, 8:06 p.m. UTC
Rename the macro definitions with suitable names specifying their
purpose.

* ADIS16201_STARTUP_DELAY_MS: Remove the comment specifying the delay in
  microseconds and rename it with addtition of _MS suffix.

* ADIS16201_MSC_CTRL_ACTIVE_DATA_RDY_HIGH: Rename the macro to make it
  similar to other misc control registers which denotes the data ready
  polarity.

* ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT: Rename to denote it is a
  failure bit.

* ADIS16201_GLOB_CMD_FACTORY_RESET: Remove ambiguous _CAL suffix and add
  _RESET suffix instead to denote factory reset command.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
---
v2:
   -explained every change in the process of renaming macros. 

 drivers/staging/iio/accel/adis16201.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Jonathan Cameron March 18, 2018, 8:19 a.m. UTC | #1
On Sat, 17 Mar 2018 01:36:18 +0530
Himanshu Jha <himanshujha199640@gmail.com> wrote:

> Rename the macro definitions with suitable names specifying their
> purpose.
> 
> * ADIS16201_STARTUP_DELAY_MS: Remove the comment specifying the delay in
>   microseconds and rename it with addtition of _MS suffix.
> 
> * ADIS16201_MSC_CTRL_ACTIVE_DATA_RDY_HIGH: Rename the macro to make it
>   similar to other misc control registers which denotes the data ready
>   polarity.
> 
> * ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT: Rename to denote it is a
>   failure bit.
> 
> * ADIS16201_GLOB_CMD_FACTORY_RESET: Remove ambiguous _CAL suffix and add
>   _RESET suffix instead to denote factory reset command.
> 
> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Nicely described and well put together patch.

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan

> ---
> v2:
>    -explained every change in the process of renaming macros. 
> 
>  drivers/staging/iio/accel/adis16201.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel/adis16201.c
> index 0fae8aa..767ebf0 100644
> --- a/drivers/staging/iio/accel/adis16201.c
> +++ b/drivers/staging/iio/accel/adis16201.c
> @@ -20,7 +20,7 @@
>  #include <linux/iio/buffer.h>
>  #include <linux/iio/imu/adis.h>
>  
> -#define ADIS16201_STARTUP_DELAY	220 /* ms */
> +#define ADIS16201_STARTUP_DELAY_MS	220
>  
>  /* Flash memory write count */
>  #define ADIS16201_FLASH_CNT      0x00
> @@ -118,7 +118,7 @@
>  #define ADIS16201_MSC_CTRL_DATA_RDY_EN	        BIT(2)
>  
>  /* Data-ready polarity: 1 = active high, 0 = active low */
> -#define ADIS16201_MSC_CTRL_ACTIVE_HIGH	        BIT(1)
> +#define ADIS16201_MSC_CTRL_ACTIVE_DATA_RDY_HIGH	        BIT(1)
>  
>  /* Data-ready line selection: 1 = DIO1, 0 = DIO0 */
>  #define ADIS16201_MSC_CTRL_DATA_RDY_DIO1	BIT(0)
> @@ -135,7 +135,7 @@
>  #define ADIS16201_DIAG_STAT_SPI_FAIL_BIT   3
>  
>  /* Flash update failure */
> -#define ADIS16201_DIAG_STAT_FLASH_UPT_BIT  2
> +#define ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT  2
>  
>  /* Power supply above 3.625 V */
>  #define ADIS16201_DIAG_STAT_POWER_HIGH_BIT 1
> @@ -146,7 +146,7 @@
>  /* GLOB_CMD */
>  
>  #define ADIS16201_GLOB_CMD_SW_RESET	BIT(7)
> -#define ADIS16201_GLOB_CMD_FACTORY_CAL	BIT(1)
> +#define ADIS16201_GLOB_CMD_FACTORY_RESET	BIT(1)
>  
>  #define ADIS16201_ERROR_ACTIVE          BIT(14)
>  
> @@ -290,7 +290,7 @@ static const struct iio_info adis16201_info = {
>  
>  static const char * const adis16201_status_error_msgs[] = {
>  	[ADIS16201_DIAG_STAT_SPI_FAIL_BIT] = "SPI failure",
> -	[ADIS16201_DIAG_STAT_FLASH_UPT_BIT] = "Flash update failed",
> +	[ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT] = "Flash update failed",
>  	[ADIS16201_DIAG_STAT_POWER_HIGH_BIT] = "Power supply above 3.625V",
>  	[ADIS16201_DIAG_STAT_POWER_LOW_BIT] = "Power supply below 3.15V",
>  };
> @@ -303,11 +303,11 @@ static const struct adis_data adis16201_data = {
>  
>  	.self_test_mask = ADIS16201_MSC_CTRL_SELF_TEST_EN,
>  	.self_test_no_autoclear = true,
> -	.startup_delay = ADIS16201_STARTUP_DELAY,
> +	.startup_delay = ADIS16201_STARTUP_DELAY_MS,
>  
>  	.status_error_msgs = adis16201_status_error_msgs,
>  	.status_error_mask = BIT(ADIS16201_DIAG_STAT_SPI_FAIL_BIT) |
> -		BIT(ADIS16201_DIAG_STAT_FLASH_UPT_BIT) |
> +		BIT(ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT) |
>  		BIT(ADIS16201_DIAG_STAT_POWER_HIGH_BIT) |
>  		BIT(ADIS16201_DIAG_STAT_POWER_LOW_BIT),
>  };

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel/adis16201.c
index 0fae8aa..767ebf0 100644
--- a/drivers/staging/iio/accel/adis16201.c
+++ b/drivers/staging/iio/accel/adis16201.c
@@ -20,7 +20,7 @@ 
 #include <linux/iio/buffer.h>
 #include <linux/iio/imu/adis.h>
 
-#define ADIS16201_STARTUP_DELAY	220 /* ms */
+#define ADIS16201_STARTUP_DELAY_MS	220
 
 /* Flash memory write count */
 #define ADIS16201_FLASH_CNT      0x00
@@ -118,7 +118,7 @@ 
 #define ADIS16201_MSC_CTRL_DATA_RDY_EN	        BIT(2)
 
 /* Data-ready polarity: 1 = active high, 0 = active low */
-#define ADIS16201_MSC_CTRL_ACTIVE_HIGH	        BIT(1)
+#define ADIS16201_MSC_CTRL_ACTIVE_DATA_RDY_HIGH	        BIT(1)
 
 /* Data-ready line selection: 1 = DIO1, 0 = DIO0 */
 #define ADIS16201_MSC_CTRL_DATA_RDY_DIO1	BIT(0)
@@ -135,7 +135,7 @@ 
 #define ADIS16201_DIAG_STAT_SPI_FAIL_BIT   3
 
 /* Flash update failure */
-#define ADIS16201_DIAG_STAT_FLASH_UPT_BIT  2
+#define ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT  2
 
 /* Power supply above 3.625 V */
 #define ADIS16201_DIAG_STAT_POWER_HIGH_BIT 1
@@ -146,7 +146,7 @@ 
 /* GLOB_CMD */
 
 #define ADIS16201_GLOB_CMD_SW_RESET	BIT(7)
-#define ADIS16201_GLOB_CMD_FACTORY_CAL	BIT(1)
+#define ADIS16201_GLOB_CMD_FACTORY_RESET	BIT(1)
 
 #define ADIS16201_ERROR_ACTIVE          BIT(14)
 
@@ -290,7 +290,7 @@  static const struct iio_info adis16201_info = {
 
 static const char * const adis16201_status_error_msgs[] = {
 	[ADIS16201_DIAG_STAT_SPI_FAIL_BIT] = "SPI failure",
-	[ADIS16201_DIAG_STAT_FLASH_UPT_BIT] = "Flash update failed",
+	[ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT] = "Flash update failed",
 	[ADIS16201_DIAG_STAT_POWER_HIGH_BIT] = "Power supply above 3.625V",
 	[ADIS16201_DIAG_STAT_POWER_LOW_BIT] = "Power supply below 3.15V",
 };
@@ -303,11 +303,11 @@  static const struct adis_data adis16201_data = {
 
 	.self_test_mask = ADIS16201_MSC_CTRL_SELF_TEST_EN,
 	.self_test_no_autoclear = true,
-	.startup_delay = ADIS16201_STARTUP_DELAY,
+	.startup_delay = ADIS16201_STARTUP_DELAY_MS,
 
 	.status_error_msgs = adis16201_status_error_msgs,
 	.status_error_mask = BIT(ADIS16201_DIAG_STAT_SPI_FAIL_BIT) |
-		BIT(ADIS16201_DIAG_STAT_FLASH_UPT_BIT) |
+		BIT(ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT) |
 		BIT(ADIS16201_DIAG_STAT_POWER_HIGH_BIT) |
 		BIT(ADIS16201_DIAG_STAT_POWER_LOW_BIT),
 };