linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] Staging: iio: adis16209: Change some macro names
@ 2018-03-08 18:16 Shreeya Patel
  2018-03-08 19:11 ` Himanshu Jha
  0 siblings, 1 reply; 3+ messages in thread
From: Shreeya Patel @ 2018-03-08 18:16 UTC (permalink / raw)
  To: lars, Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh,
	linux-iio, devel, linux-kernel, daniel.baluta
  Cc: Shreeya Patel

Make some of the macro names according to the names
given in the datasheet of the adis16209 driver and
have slight indentation in field definitions to make
them clearly different from the register addresses.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
---

Changes in v4
  -Have slight indentation in field definitions.

 drivers/staging/iio/accel/adis16209.c | 48 +++++++++++++++++------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/iio/accel/adis16209.c b/drivers/staging/iio/accel/adis16209.c
index eb5c878..19636e2 100644
--- a/drivers/staging/iio/accel/adis16209.c
+++ b/drivers/staging/iio/accel/adis16209.c
@@ -68,21 +68,21 @@
 #define  ADIS16209_MSC_CTRL_ACTIVE_HIGH		BIT(1)
 #define  ADIS16209_MSC_CTRL_DATA_RDY_DIO2	BIT(0)
 
-#define ADIS16209_STAT_REG			0x3C
-#define  ADIS16209_STAT_ALARM2			BIT(9)
-#define  ADIS16209_STAT_ALARM1			BIT(8)
-#define ADIS16209_STAT_SELFTEST_FAIL_BIT	5
-#define ADIS16209_STAT_SPI_FAIL_BIT		3
-#define ADIS16209_STAT_FLASH_UPT_FAIL_BIT	2
+#define ADIS16209_DIAG_STAT_REG			0x3C
+#define  ADIS16209_DIAG_STAT_ALARM2		BIT(9)
+#define  ADIS16209_DIAG_STAT_ALARM1		BIT(8)
+#define  ADIS16209_DIAG_STAT_SELFTEST_FAIL_BIT	5
+#define  ADIS16209_DIAG_STAT_SPI_FAIL_BIT	3
+#define  ADIS16209_DIAG_STAT_FLASH_UPT_BIT	2
 /* Power supply above 3.625 V */
-#define ADIS16209_STAT_POWER_HIGH_BIT		1
+#define  ADIS16209_DIAG_STAT_POWER_HIGH_BIT	1
 /* Power supply below 3.15 V */
-#define ADIS16209_STAT_POWER_LOW_BIT		0
+#define  ADIS16209_DIAG_STAT_POWER_LOW_BIT	0
 
-#define ADIS16209_CMD_REG			0x3E
-#define  ADIS16209_CMD_SW_RESET			BIT(7)
-#define  ADIS16209_CMD_CLEAR_STAT		BIT(4)
-#define  ADIS16209_CMD_FACTORY_CAL		BIT(1)
+#define ADIS16209_GLOB_CMD_REG			0x3E
+#define  ADIS16209_GLOB_CMD_SW_RESET		BIT(7)
+#define  ADIS16209_GLOB_CMD_CLEAR_STAT		BIT(4)
+#define  ADIS16209_GLOB_CMD_FACTORY_CAL		BIT(1)
 
 #define ADIS16209_ERROR_ACTIVE			BIT(14)
 
@@ -238,29 +238,29 @@ static const struct iio_info adis16209_info = {
 };
 
 static const char * const adis16209_status_error_msgs[] = {
-	[ADIS16209_STAT_SELFTEST_FAIL_BIT] = "Self test failure",
-	[ADIS16209_STAT_SPI_FAIL_BIT] = "SPI failure",
-	[ADIS16209_STAT_FLASH_UPT_FAIL_BIT] = "Flash update failed",
-	[ADIS16209_STAT_POWER_HIGH_BIT] = "Power supply above 3.625V",
-	[ADIS16209_STAT_POWER_LOW_BIT] = "Power supply below 3.15V",
+	[ADIS16209_DIAG_STAT_SELFTEST_FAIL_BIT] = "Self test failure",
+	[ADIS16209_DIAG_STAT_SPI_FAIL_BIT] = "SPI failure",
+	[ADIS16209_DIAG_STAT_FLASH_UPT_BIT] = "Flash update failed",
+	[ADIS16209_DIAG_STAT_POWER_HIGH_BIT] = "Power supply above 3.625V",
+	[ADIS16209_DIAG_STAT_POWER_LOW_BIT] = "Power supply below 3.15V",
 };
 
 static const struct adis_data adis16209_data = {
 	.read_delay = 30,
 	.msc_ctrl_reg = ADIS16209_MSC_CTRL_REG,
-	.glob_cmd_reg = ADIS16209_CMD_REG,
-	.diag_stat_reg = ADIS16209_STAT_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,
 	.startup_delay = ADIS16209_STARTUP_DELAY_MS,
 
 	.status_error_msgs = adis16209_status_error_msgs,
-	.status_error_mask = BIT(ADIS16209_STAT_SELFTEST_FAIL_BIT) |
-		BIT(ADIS16209_STAT_SPI_FAIL_BIT) |
-		BIT(ADIS16209_STAT_FLASH_UPT_FAIL_BIT) |
-		BIT(ADIS16209_STAT_POWER_HIGH_BIT) |
-		BIT(ADIS16209_STAT_POWER_LOW_BIT),
+	.status_error_mask = BIT(ADIS16209_DIAG_STAT_SELFTEST_FAIL_BIT) |
+		BIT(ADIS16209_DIAG_STAT_SPI_FAIL_BIT) |
+		BIT(ADIS16209_DIAG_STAT_FLASH_UPT_BIT) |
+		BIT(ADIS16209_DIAG_STAT_POWER_HIGH_BIT) |
+		BIT(ADIS16209_DIAG_STAT_POWER_LOW_BIT),
 };
 
 static int adis16209_probe(struct spi_device *spi)
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] Staging: iio: adis16209: Change some macro names
  2018-03-08 18:16 [PATCH v4] Staging: iio: adis16209: Change some macro names Shreeya Patel
@ 2018-03-08 19:11 ` Himanshu Jha
  2018-03-08 19:27   ` Shreeya Patel
  0 siblings, 1 reply; 3+ messages in thread
From: Himanshu Jha @ 2018-03-08 19:11 UTC (permalink / raw)
  To: Shreeya Patel
  Cc: devel, daniel.baluta, lars, Michael.Hennerich, linux-iio, gregkh,
	linux-kernel, pmeerw, knaack.h, jic23

On Thu, Mar 08, 2018 at 11:46:17PM +0530, Shreeya Patel wrote:
> Make some of the macro names according to the names
> given in the datasheet of the adis16209 driver and
> have slight indentation in field definitions to make
> them clearly different from the register addresses.
> 
> Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
> ---
> 
> Changes in v4
>   -Have slight indentation in field definitions.
> 
>  drivers/staging/iio/accel/adis16209.c | 48 +++++++++++++++++------------------
>  1 file changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/staging/iio/accel/adis16209.c b/drivers/staging/iio/accel/adis16209.c
> index eb5c878..19636e2 100644
> --- a/drivers/staging/iio/accel/adis16209.c
> +++ b/drivers/staging/iio/accel/adis16209.c
> @@ -68,21 +68,21 @@
>  #define  ADIS16209_MSC_CTRL_ACTIVE_HIGH		BIT(1)
>  #define  ADIS16209_MSC_CTRL_DATA_RDY_DIO2	BIT(0)
>  
> -#define ADIS16209_STAT_REG			0x3C
> -#define  ADIS16209_STAT_ALARM2			BIT(9)
> -#define  ADIS16209_STAT_ALARM1			BIT(8)
> -#define ADIS16209_STAT_SELFTEST_FAIL_BIT	5
> -#define ADIS16209_STAT_SPI_FAIL_BIT		3
> -#define ADIS16209_STAT_FLASH_UPT_FAIL_BIT	2
> +#define ADIS16209_DIAG_STAT_REG			0x3C
> +#define  ADIS16209_DIAG_STAT_ALARM2		BIT(9)
> +#define  ADIS16209_DIAG_STAT_ALARM1		BIT(8)
> +#define  ADIS16209_DIAG_STAT_SELFTEST_FAIL_BIT	5
> +#define  ADIS16209_DIAG_STAT_SPI_FAIL_BIT	3
> +#define  ADIS16209_DIAG_STAT_FLASH_UPT_BIT	2

#define ADIS16209_STAT_FLASH_UPT_FAIL_BIT    2
?
It represents flash update fail bit!

-- 
Thanks
Himanshu Jha
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] Staging: iio: adis16209: Change some macro names
  2018-03-08 19:11 ` Himanshu Jha
@ 2018-03-08 19:27   ` Shreeya Patel
  0 siblings, 0 replies; 3+ messages in thread
From: Shreeya Patel @ 2018-03-08 19:27 UTC (permalink / raw)
  To: Himanshu Jha
  Cc: devel, daniel.baluta, lars, Michael.Hennerich, linux-iio, gregkh,
	linux-kernel, pmeerw, knaack.h, jic23



On 9 March 2018 00:41:12 GMT+05:30, Himanshu Jha <himanshujha199640@gmail.com> wrote:
>On Thu, Mar 08, 2018 at 11:46:17PM +0530, Shreeya Patel wrote:
>> Make some of the macro names according to the names
>> given in the datasheet of the adis16209 driver and
>> have slight indentation in field definitions to make
>> them clearly different from the register addresses.
>> 
>> Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
>> ---
>> 
>> Changes in v4
>>   -Have slight indentation in field definitions.
>> 
>>  drivers/staging/iio/accel/adis16209.c | 48
>+++++++++++++++++------------------
>>  1 file changed, 24 insertions(+), 24 deletions(-)
>> 
>> diff --git a/drivers/staging/iio/accel/adis16209.c
>b/drivers/staging/iio/accel/adis16209.c
>> index eb5c878..19636e2 100644
>> --- a/drivers/staging/iio/accel/adis16209.c
>> +++ b/drivers/staging/iio/accel/adis16209.c
>> @@ -68,21 +68,21 @@
>>  #define  ADIS16209_MSC_CTRL_ACTIVE_HIGH		BIT(1)
>>  #define  ADIS16209_MSC_CTRL_DATA_RDY_DIO2	BIT(0)
>>  
>> -#define ADIS16209_STAT_REG			0x3C
>> -#define  ADIS16209_STAT_ALARM2			BIT(9)
>> -#define  ADIS16209_STAT_ALARM1			BIT(8)
>> -#define ADIS16209_STAT_SELFTEST_FAIL_BIT	5
>> -#define ADIS16209_STAT_SPI_FAIL_BIT		3
>> -#define ADIS16209_STAT_FLASH_UPT_FAIL_BIT	2
>> +#define ADIS16209_DIAG_STAT_REG			0x3C
>> +#define  ADIS16209_DIAG_STAT_ALARM2		BIT(9)
>> +#define  ADIS16209_DIAG_STAT_ALARM1		BIT(8)
>> +#define  ADIS16209_DIAG_STAT_SELFTEST_FAIL_BIT	5
>> +#define  ADIS16209_DIAG_STAT_SPI_FAIL_BIT	3
>> +#define  ADIS16209_DIAG_STAT_FLASH_UPT_BIT	2
>
>#define ADIS16209_STAT_FLASH_UPT_FAIL_BIT    2
>?
>It represents flash update fail bit! 

I think so that I have sent the wrong patch :(

This is totally the reverse of the change that I wanted to have. 
Maybe I messed up with this patch. 

Jonathan, please avoid this patch. 
I'll send the corrected one soon. 

Thanks 

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-08 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-08 18:16 [PATCH v4] Staging: iio: adis16209: Change some macro names Shreeya Patel
2018-03-08 19:11 ` Himanshu Jha
2018-03-08 19:27   ` Shreeya Patel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).