[RESEND PATCH v3 1/3] iio: gyro: adxrs290: Add triggered buffer support

2020-09-10 Thread Nishant Malpani
triggers (sysfs-trig & hrtimer). Reviewed-by: Andy Shevchenko Signed-off-by: Nishant Malpani --- Changes in v3: - issue a separate precursor patch for the devm resource unwinding hook - rename labels in the error-path - use dev_err_probe() (which handles deferred probing) only for c

[RESEND PATCH v3 3/3] iio: gyro: adxrs290: Add debugfs register access support

2020-09-10 Thread Nishant Malpani
Extend support to read/write byte data from/to the device using debugfs iio interface. Reviewed-by: Andy Shevchenko Signed-off-by: Nishant Malpani --- Changes in v3: - refactor code based on Andy's suggestions No changes in v2 --- drivers/iio/gyro/adxrs290.c

[RESEND PATCH v3 2/3] dt-bindings: iio: gyro: adxrs290: Add interrupts support

2020-09-10 Thread Nishant Malpani
Include 'interrupts' property and provide a suitable example for using a GPIO interrupt line. Signed-off-by: Nishant Malpani --- Changes in v3: - remove gpio.h header since unused Changes in v2: - remove 'interrupts' property from the required properties list - re

[RESEND PATCH v3 0/3] iio: gyro: adxrs290: Add triggered buffer & debugfs support

2020-09-10 Thread Nishant Malpani
. Nishant Malpani (3): iio: gyro: adxrs290: Add triggered buffer support dt-bindings: iio: gyro: adxrs290: Add interrupts support iio: gyro: adxrs290: Add debugfs register access support .../bindings/iio/gyroscope/adi,adxrs290.yaml | 6 + drivers/iio/gyro/Kconfig | 2

[PATCH v3 2/3] dt-bindings: iio: gyro: adxrs290: Add interrupts support

2020-09-10 Thread Nishant Malpani
Include 'interrupts' property and provide a suitable example for using a GPIO interrupt line. Signed-off-by: Nishant Malpani --- Changes in v3: - remove gpio.h header since unused Changes in v2: - remove 'interrupts' property from the required properties list - re

[PATCH v3 1/3] iio: gyro: adxrs290: Add triggered buffer support

2020-09-10 Thread Nishant Malpani
triggers (sysfs-trig & hrtimer). Signed-off-by: Nishant Malpani --- Changes in v3: - issue a separate precursor patch for the devm resource unwinding hook - rename labels in the error-path - use dev_err_probe() (which handles deferred probing) only for calls which request h/w resou

[PATCH v3 3/3] iio: gyro: adxrs290: Add debugfs register access support

2020-09-10 Thread Nishant Malpani
Extend support to read/write byte data from/to the device using debugfs iio interface. Signed-off-by: Nishant Malpani --- Changes in v3: - refactor code based on Andy's suggestions No changes in v2 --- drivers/iio/gyro/adxrs290.c | 26 ++ 1 file change

[PATCH v3 0/3] iio: gyro: adxrs290: Add triggered buffer & debugfs support

2020-09-10 Thread Nishant Malpani
. Nishant Malpani (3): iio: gyro: adxrs290: Add triggered buffer support dt-bindings: iio: gyro: adxrs290: Add interrupts support iio: gyro: adxrs290: Add debugfs register access support .../bindings/iio/gyroscope/adi,adxrs290.yaml | 6 + drivers/iio/gyro/Kconfig | 2

[PATCH] iio: gyro: adxrs290: use hook for devm resource unwinding

2020-09-10 Thread Nishant Malpani
Make use of devm_add_action_or_reset() hook to switch device into STANDBY mode during standard resource unwinding. The patch includes a helper function, in the form of adxrs290_set_mode(), to realise driving the device into STANDBY mode. Signed-off-by: Nishant Malpani --- drivers/iio/gyro

[PATCH v2 2/3] dt-bindings: iio: gyro: adxrs290: Add interrupts support

2020-09-03 Thread Nishant Malpani
Include 'interrupts' property and provide a suitable example for using a GPIO interrupt line. Signed-off-by: Nishant Malpani --- Changes in v2: - remove 'interrupts' property from the required properties list - rewrite commit message --- .../devicetree/bindings/iio/gy

Re: [PATCH v2 1/3] iio: gyro: adxrs290: Add triggered buffer support

2020-09-03 Thread Nishant Malpani
Hello, Thanks for the review, Andy. ... On Thu, Sep 3, 2020 at 6:50 PM Andy Shevchenko wrote: > > On Thu, Sep 3, 2020 at 4:10 PM Nishant Malpani > wrote: > > > > Provide a way for continuous data capture by setting up buffer support. The > > data ready signal exp

[PATCH v2 3/3] iio: gyro: adxrs290: Add debugfs register access support

2020-09-03 Thread Nishant Malpani
Extend support to read/write byte data from/to the device using debugfs iio interface. Signed-off-by: Nishant Malpani --- No changes in v2 --- drivers/iio/gyro/adxrs290.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/iio/gyro/adxrs290.c b/drivers/iio/gyro

[PATCH v2 0/3] iio: gyro: adxrs290: Add triggered buffer & debugfs support

2020-09-03 Thread Nishant Malpani
. Nishant Malpani (3): iio: gyro: adxrs290: Add triggered buffer support dt-bindings: iio: gyro: adxrs290: Add interrupts support iio: gyro: adxrs290: Add debugfs register access support .../bindings/iio/gyroscope/adi,adxrs290.yaml | 7 + drivers/iio/gyro/Kconfig | 2

Re: [PATCH v2 3/3] iio: gyro: adxrs290: Add debugfs register access support

2020-09-03 Thread Nishant Malpani
Hello, On Thu, Sep 3, 2020 at 6:55 PM Andy Shevchenko wrote: > > On Thu, Sep 3, 2020 at 4:10 PM Nishant Malpani > wrote: > > > > Extend support to read/write byte data from/to the device using > > debugfs iio interface. > > ... > > > +static int adx

[PATCH v2 1/3] iio: gyro: adxrs290: Add triggered buffer support

2020-09-03 Thread Nishant Malpani
triggers (sysfs-trig & hrtimer). Signed-off-by: Nishant Malpani --- Changes in v2: - In adxrs290_set_mode(), move 'if' block outside the locked section - use break statement for error handling instead of goto labels in switch-case blocks - remove outer parentheses when condi

Re: [PATCH 2/3] dt-bindings: iio: gyro: adxrs290: Add required interrupts property

2020-09-03 Thread Nishant Malpani
Hello, On Sat, Aug 29, 2020 at 10:18 PM Jonathan Cameron wrote: > > On Tue, 25 Aug 2020 18:17:10 +0530 > Nishant Malpani wrote: > > > Append 'interrupts' as a required property and provide a suitable example > > for using a GPIO interrupt line. > >

Re: [PATCH 1/3] iio: gyro: adxrs290: Add triggered buffer support

2020-09-03 Thread Nishant Malpani
Hello, Thanks for the review, Jonathan. Comments inline... On Sat, Aug 29, 2020 at 10:16 PM Jonathan Cameron wrote: > > On Tue, 25 Aug 2020 18:17:09 +0530 > Nishant Malpani wrote: > > > Provide a way for continuous data capture by setting up buffer support. The > > data

Re: [PATCH 1/3] iio: gyro: adxrs290: Add triggered buffer support

2020-09-02 Thread Nishant Malpani
Hello, Thanks for the review, Andy. Comments inline... On 26/08/20 9:40 pm, Andy Shevchenko wrote: On Tue, Aug 25, 2020 at 4:11 PM Nishant Malpani wrote: Provide a way for continuous data capture by setting up buffer support. The data ready signal exposed at the SYNC pin of the ADXRS290 is

[PATCH 2/3] dt-bindings: iio: gyro: adxrs290: Add required interrupts property

2020-08-25 Thread Nishant Malpani
Append 'interrupts' as a required property and provide a suitable example for using a GPIO interrupt line. Signed-off-by: Nishant Malpani --- .../devicetree/bindings/iio/gyroscope/adi,adxrs290.yaml | 8 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetre

[PATCH 3/3] iio: gyro: adxrs290: Add debugfs register access support

2020-08-25 Thread Nishant Malpani
Extend support to read/write byte data from/to the device using debugfs iio interface. Signed-off-by: Nishant Malpani --- drivers/iio/gyro/adxrs290.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/iio/gyro/adxrs290.c b/drivers/iio/gyro/adxrs290.c index

[PATCH 0/3] iio: gyro: adxrs290: Add triggered buffer & debugfs support

2020-08-25 Thread Nishant Malpani
. Nishant Malpani (3): iio: gyro: adxrs290: Add triggered buffer support dt-bindings: iio: gyro: adxrs290: Add required interrupts property iio: gyro: adxrs290: Add debugfs register access support .../bindings/iio/gyroscope/adi,adxrs290.yaml | 8 + drivers/iio/gyro/Kconfig

[PATCH 1/3] iio: gyro: adxrs290: Add triggered buffer support

2020-08-25 Thread Nishant Malpani
triggers (sysfs-trig & hrtimer). Signed-off-by: Nishant Malpani --- drivers/iio/gyro/Kconfig| 2 + drivers/iio/gyro/adxrs290.c | 272 ++-- 2 files changed, 260 insertions(+), 14 deletions(-) diff --git a/drivers/iio/gyro/Kconfig b/drivers/iio/gyro/Kconfig i

[PATCH 1/1] iio: gyro: adxrs290: Insert missing mutex initialization call

2020-08-25 Thread Nishant Malpani
Insert a missing mutex_init() call during the probe that initializes the driver's local lock to unlocked state. Fixes: 2c8920fff145 ("iio: gyro: Add driver support for ADXRS290") Signed-off-by: Nishant Malpani --- drivers/iio/gyro/adxrs290.c | 2 ++ 1 file changed, 2 insertions(+

[v4 2/2] dt-bindings: iio: gyro: Add DT binding doc for ADXRS290

2020-07-26 Thread Nishant Malpani
Add devicetree binding document for ADXRS290, a dual-axis MEMS gyroscope. Reviewed-by: Rob Herring Signed-off-by: Nishant Malpani --- No changes in v4. No changes in v3. Changes in v2: - use 'const' instead of 'enum' while setting the compatible string since o

[v4 1/2] iio: gyro: Add driver support for ADXRS290

2020-07-26 Thread Nishant Malpani
for now. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADXRS290.pdf Reviewed-by: Andy Shevchenko Signed-off-by: Nishant Malpani --- Changes in v4: - reorder header includes lexicographically - add prefix 'ADXRS290_MODE_' to enum 'adxrs290

Re: [v3 1/2] iio: gyro: Add driver support for ADXRS290

2020-07-26 Thread Nishant Malpani
On 26/07/20 5:45 pm, Jonathan Cameron wrote: On Fri, 24 Jul 2020 16:31:59 +0530 Nishant Malpani wrote: ADXRS290 is a high performance MEMS pitch and roll (dual-axis in-plane) angular rate sensor (gyroscope) designed for use in stabilization applications. It also features an internal

Re: [v3 1/2] iio: gyro: Add driver support for ADXRS290

2020-07-26 Thread Nishant Malpani
On 26/07/20 1:33 pm, Andy Shevchenko wrote: On Fri, Jul 24, 2020 at 2:02 PM Nishant Malpani wrote: ADXRS290 is a high performance MEMS pitch and roll (dual-axis in-plane) angular rate sensor (gyroscope) designed for use in stabilization applications. It also features an internal temperature

[v3 2/2] dt-bindings: iio: gyro: Add DT binding doc for ADXRS290

2020-07-24 Thread Nishant Malpani
Add devicetree binding document for ADXRS290, a dual-axis MEMS gyroscope. Reviewed-by: Rob Herring Signed-off-by: Nishant Malpani --- No changes in v3. Changes in v2: - use 'const' instead of 'enum' while setting the compatible string since only a single item

[v3 1/2] iio: gyro: Add driver support for ADXRS290

2020-07-24 Thread Nishant Malpani
for now. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADXRS290.pdf Signed-off-by: Nishant Malpani --- Changes in v3: - drop "Link" tag & extra line in commit message - rename cut-off frequencies tables to 'adxrs290_{lpf, hpf}_3db_freq_h

Re: [PATCH v2 1/2] iio: gyro: Add driver support for ADXRS290

2020-07-22 Thread Nishant Malpani
On 22/07/20 3:53 pm, Andy Shevchenko wrote: On Wed, Jul 22, 2020 at 12:40 PM Nishant Malpani wrote: On 22/07/20 3:08 am, Andy Shevchenko wrote: On Tue, Jul 21, 2020 at 11:35 PM Nishant Malpani wrote: On 22/07/20 1:16 am, Andy Shevchenko wrote: ... Can't you declare table as cons

Re: [PATCH v2 1/2] iio: gyro: Add driver support for ADXRS290

2020-07-22 Thread Nishant Malpani
On 22/07/20 3:08 am, Andy Shevchenko wrote: On Tue, Jul 21, 2020 at 11:35 PM Nishant Malpani wrote: On 22/07/20 1:16 am, Andy Shevchenko wrote: On Tue, Jul 21, 2020 at 9:20 PM Nishant Malpani wrote: ... + *vals = (const int *)adxrs290_lpf_3db_freq_tbl; Why casting

Re: [PATCH v2 1/2] iio: gyro: Add driver support for ADXRS290

2020-07-21 Thread Nishant Malpani
On 22/07/20 2:05 am, Nishant Malpani wrote: [...] +   return IIO_VAL_INT; +   default: +   return -EINVAL; +   } ... +   *vals = (const int *)adxrs290_lpf_3db_freq_tbl; Why casting? adxrs290_lpf_3db_freq_tbl

Re: [PATCH v2 1/2] iio: gyro: Add driver support for ADXRS290

2020-07-21 Thread Nishant Malpani
Hello Andy, Thanks for the review. Comments inline... On 22/07/20 1:16 am, Andy Shevchenko wrote: On Tue, Jul 21, 2020 at 9:20 PM Nishant Malpani wrote: ADXRS290 is a high performance MEMS pitch and roll (dual-axis in-plane) angular rate sensor (gyroscope) designed for use in stabilization

Re: [PATCH 2/2] dt-bindings: iio: gyro: Add DT binding doc for ADXRS290

2020-07-21 Thread Nishant Malpani
Hello Jonathon & Rob, Thanks for the review. Comments inline... On 21/07/20 8:11 am, Rob Herring wrote: On Mon, Jul 20, 2020 at 12:16:33PM +0100, Jonathan Cameron wrote: On Wed, 15 Jul 2020 14:58:21 +0530 Nishant Malpani wrote: Add devicetree binding document for ADXRS290, a dual-axis

Re: [PATCH 1/2] iio: gyro: Add driver support for ADXRS290

2020-07-21 Thread Nishant Malpani
Hello Jonathan, Thanks a lot for the detailed review. Comments inline... On 20/07/20 4:43 pm, Jonathan Cameron wrote: On Wed, 15 Jul 2020 15:20:35 +0530 Nishant Malpani wrote: Hello, On 15/07/20 2:57 pm, Nishant Malpani wrote: ADXRS290 is a high performance MEMS pitch and roll (dual-axis

[PATCH v2 2/2] dt-bindings: iio: gyro: Add DT binding doc for ADXRS290

2020-07-21 Thread Nishant Malpani
Add devicetree binding document for ADXRS290, a dual-axis MEMS gyroscope. Signed-off-by: Nishant Malpani --- Changes in v2: - use 'const' instead of 'enum' while setting the compatible string since only a single item is expected - add 'additionalProperties: fal

[PATCH v2 1/2] iio: gyro: Add driver support for ADXRS290

2020-07-21 Thread Nishant Malpani
for now. Datasheet: Link: https://www.analog.com/media/en/technical-documentation/data-sheets/ADXRS290.pdf Signed-off-by: Nishant Malpani --- Changes in v2: - append copyright tag with author's info - remove asm/unaligned.h header - remove unnecessary comments about the regi

Re: [PATCH 1/2] iio: gyro: Add driver support for ADXRS290

2020-07-15 Thread Nishant Malpani
Hello, On 15/07/20 2:57 pm, Nishant Malpani wrote: ADXRS290 is a high performance MEMS pitch and roll (dual-axis in-plane) angular rate sensor (gyroscope) designed for use in stabilization applications. It also features an internal temperature sensor and programmable high-pass and low-pass

[PATCH 1/2] iio: gyro: Add driver support for ADXRS290

2020-07-15 Thread Nishant Malpani
for now. Datasheet: Link: https://www.analog.com/media/en/technical-documentation/data-sheets/ADXRS290.pdf Signed-off-by: Nishant Malpani --- MAINTAINERS | 6 + drivers/iio/gyro/Kconfig| 10 + drivers/iio/gyro/Makefile | 1 + drivers/iio/gyro/adxrs290.c | 490

[PATCH 2/2] dt-bindings: iio: gyro: Add DT binding doc for ADXRS290

2020-07-15 Thread Nishant Malpani
Add devicetree binding document for ADXRS290, a dual-axis MEMS gyroscope. Signed-off-by: Nishant Malpani --- .../bindings/iio/gyroscope/adi,adxrs290.yaml | 52 +++ MAINTAINERS | 1 + 2 files changed, 53 insertions(+) create mode 100644