[PATCH v4 12/12] staging: iio: ad2s1200: Move driver out of staging

2018-05-18 Thread David Veenstra
Move the iio driver for the ad2s1200 and ad2s1205 resolver-to-digital converter out of staging, into mainline iio subsystems. Signed-off-by: David Veenstra --- drivers/iio/Kconfig | 1 + drivers/iio/Makefile| 1 + drivers/iio/resolver/Kconfig

[PATCH v4 09/12] staging: iio: ad2s1200: Add scaling factor for angular velocity channel

2018-05-18 Thread David Veenstra
The sysfs iio ABI states radians per second is expected as the unit for angular velocity, but the 12-bit angular velocity register has revolution per seconds as its unit. So a scaling factor of approximately 2 * Pi is added to the angular velocity channel. Signed-off-by: David Veenstra

[PATCH v4 10/12] staging: iio: ad2s1200: Add scaling factor for angle channel

2018-05-18 Thread David Veenstra
A scaling factor of approximately 2 * Pi / (2^12 -1) is added, to scale the 12-bits angular position to radians. A return type of IIO_VAL_INT_PLUS_NANO is used, so that the scale of both the angle channel and angular velocity channel has 7 significant digits. Signed-off-by: David Veenstra

[PATCH v4 11/12] staging: iio: ad2s1200: Add copyright

2018-05-18 Thread David Veenstra
Add David Veenstra as a copyright holders and as an author, for all of the staging clean ups of the ad2s1200 driver. Signed-off-by: David Veenstra --- Changes in v4: - Introduced in this version. drivers/staging/iio/resolver/ad2s1200.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a

[PATCH v4 08/12] dt-bindings: iio: resolver: Document AD2S1200 bindings

2018-05-18 Thread David Veenstra
Add documentation for the device tree bindings of the AD2S1200 resolver. Signed-off-by: David Veenstra --- Changes in v4: - Added vendor prefix to gpio function name. - Added unit address. - Changed commit subject to be more inline with other dt-bindings commit . .../bindings/iio

[PATCH v4 07/12] staging: iio: ad2s1200: Add dt table

2018-05-18 Thread David Veenstra
Add device tree table for matching with the vendor ID. Signed-off-by: David Veenstra --- Changes in v4: - Introduced in this version. drivers/staging/iio/resolver/ad2s1200.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging

[PATCH v4 06/12] staging: iio: ad2s1200: Replace platform data with dt bindings

2018-05-18 Thread David Veenstra
Remove usage of platform data, and replace it with device tree facilities. Signed-off-by: David Veenstra --- Changes in v4: - Added vendor prefix to gpio function names. drivers/staging/iio/resolver/ad2s1200.c | 32 - 1 file changed, 15 insertions(+), 17 deletions

[PATCH v4 05/12] staging: iio: ad2s1200: Replace legacy gpio API with modern API

2018-05-18 Thread David Veenstra
The legacy, integer based gpio API is replaced with the modern descriptor based API. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers

[PATCH v4 00/12] iio: ad2s1200: Driver clean up

2018-05-18 Thread David Veenstra
documentation for device tree binding 6. Move driver to main line. Changes in v4: - Some new minor code style fix ups. - Move spi setup to before iio device registration. - Add vendor prefix to gpios function name, and dt docs. - Add device tree table - Add copyright. Best regards, David Veenstra

[PATCH v4 04/12] staging: iio: ad2s1200: Setup spi before iio device register

2018-05-18 Thread David Veenstra
The spi should be set up before the device is registered as an iio device. This patch moves the setup to before the device registration. Signed-off-by: David Veenstra --- Changes in v4: - Introduced in this version. drivers/staging/iio/resolver/ad2s1200.c | 13 +++-- 1 file changed

[PATCH v4 02/12] staging: iio: ad2s1200: Remove unneeded initializations

2018-05-18 Thread David Veenstra
Remove 2 initializations which are unneeded, because the initialized values are never used. Signed-off-by: David Veenstra --- Changes in v4: - Introduced in this version. drivers/staging/iio/resolver/ad2s1200.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v4 03/12] staging: iio: ad2s1200: Add kernel docs to driver state

2018-05-18 Thread David Veenstra
Add missing kernel docs to the ad2s1200 driver state. Signed-off-by: David Veenstra --- Changes in v4: - Simplified explanation of lock. drivers/staging/iio/resolver/ad2s1200.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers

[PATCH v4 01/12] staging: iio: ad2s1200: Remove unneeded newline in license

2018-05-18 Thread David Veenstra
Remove unneeded newline in license, as it does not improve readability. Signed-off-by: David Veenstra --- Changes in v4: - Introduced in this version. drivers/staging/iio/resolver/ad2s1200.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers

[PATCH v3 9/9] staging: iio: ad2s1200: Move driver out of staging

2018-04-22 Thread David Veenstra
Move the iio driver for the ad2s1200 and ad2s1205 resolver-to-digital converter out of staging, into mainline iio subsystems. Signed-off-by: David Veenstra --- Changes in v3: - Add mention of ad2s1205 in commit message. drivers/iio/Kconfig | 1 + drivers/iio/Makefile

[PATCH v3 8/9] staging: iio: ad2s1200: Add scaling factor for angle channel

2018-04-22 Thread David Veenstra
A scaling factor of approximately 2 * Pi / (2^12 -1) is added, to scale the 12-bits angular position to radians. A return type of IIO_VAL_INT_PLUS_NANO is used, so that the scale of both the angle channel and angular velocity channel has 7 significant digits. Signed-off-by: David Veenstra

[PATCH v3 5/9] staging: iio: ad2s1200: Add documentation for device tree binding

2018-04-22 Thread David Veenstra
Add documentation for the added device tree bindings. Signed-off-by: David Veenstra --- Changes in v3: - Documentation is added to Documentation/devicetree/bindings/iio/resolver instead of staging directory. - Add mention to ad2s1205 device. .../devicetree/bindings/iio/resolver/ad2s1200

[PATCH v3 7/9] staging: iio: Documentation: Add missing sysfs docs for angle channel

2018-04-22 Thread David Veenstra
d-off-by: David Veenstra --- Changes in v3: - Remove axis modifier on in_angle. Documentation/ABI/testing/sysfs-bus-iio | 9 + 1 file changed, 9 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 6a5f34b4d5b9..240287e2343

[PATCH v3 3/9] staging: iio: ad2s1200: Replace legacy gpio API with modern API

2018-04-22 Thread David Veenstra
The legacy, integer based gpio API is replaced with the modern descriptor based API. Signed-off-by: David Veenstra --- Changes in v3: - This patch no longer deals with dt bindings. See the next patch. drivers/staging/iio/resolver/ad2s1200.c | 15 --- 1 file changed, 8

[PATCH v3 4/9] staging: iio: ad2s1200: Replace platform data with dt bindings

2018-04-22 Thread David Veenstra
Remove usage of platform data, and replace it with device tree facilities. Signed-off-by: David Veenstra --- Changes in v3: - Introduced in this version. drivers/staging/iio/resolver/ad2s1200.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff

[PATCH v3 6/9] staging: iio: ad2s1200: Add scaling factor for angular velocity channel

2018-04-22 Thread David Veenstra
The sysfs iio ABI states radians per second is expected as the unit for angular velocity, but the 12-bit angular velocity register has rps as its unit. So a scaling factor of approximately 2 * Pi is added to the angular velocity channel. Signed-off-by: David Veenstra --- Changes in v3: - A

[PATCH v3 1/9] staging: iio: ad2s1200: Add kernel docs to driver state

2018-04-22 Thread David Veenstra
Add missing kernel docs to the ad2s1200 driver state. Signed-off-by: David Veenstra --- Changes in v3: - Added more explanation to mutex lock. drivers/staging/iio/resolver/ad2s1200.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b

[PATCH v3 2/9] staging: iio: ad2s1200: Improve readability with be16_to_cpup

2018-04-22 Thread David Veenstra
expressions that use be16_to_cpup. Signed-off-by: David Veenstra --- Changes in v3: - change type of rx to __be16. - remove unneeded variable vel. - remove unneeded type cast to s16 (patch line 79). drivers/staging/iio/resolver/ad2s1200.c | 11 --- 1 file changed, 4 insertions(+), 7

[PATCH v3 0/9] staging: iio: ad2s1200: Driver clean up

2018-04-22 Thread David Veenstra
folder. - Change return type of scale for angle and angular velocity channel. - Remove axis modifier from documentation of angle channel. - Add missing references to ad2s1205. Best regards, David Veenstra [1] https://marc.info/?l=linux-iio&m=152137920426820&w=2 [2] https://marc.info/?l=lin

[PATCH v2 12/13] staging: iio: ad2s1200: Add scaling factor for angle channel

2018-04-20 Thread David Veenstra
A fractional scaling factor of approximately 2 * Pi / (2^12 -1) is added, to scale the 12-bits angular position to radians. Signed-off-by: David Veenstra --- Changes in v2: - This patch replaces the patch that changed the the channel for angular position to inclination channel

[PATCH v2 13/13] staging: iio: ad2s1200: Move driver out of staging

2018-04-20 Thread David Veenstra
Move the iio driver for the ad2s1200 resolver-to-digital converter out of staging, into mainline iio subsystems. Signed-off-by: David Veenstra --- Changes in v2: - Added commit message. - Also move device tree binding documentation out of staging. - Disabled move detection

[PATCH v2 08/13] staging: iio: ad2s1200: Replace legacy gpio API with modern API

2018-04-20 Thread David Veenstra
The legacy, integer based gpio API is replaced with the descriptor based API. For compatibility, it is first tried to use the platform data to request the gpio's. Otherwise, it looks for the "sample" and "rdvel" gpio function. Signed-off-by: David Veenstra --- dri

[PATCH v2 11/13] staging: iio: Documentation: Add missing sysfs docs for angle channel

2018-04-20 Thread David Veenstra
d-off-by: David Veenstra --- Change in v2: - Introduces in this version. Documentation/ABI/testing/sysfs-bus-iio | 11 +++ 1 file changed, 11 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 6a5f34b4d5b9..8ad0e55f99e

[PATCH v2 09/13] staging: iio: ad2s1200: Add documentation for device tree binding

2018-04-20 Thread David Veenstra
Add documentation for the added device tree bindings. Signed-off-by: David Veenstra --- Changes in v2: - Introduced in this version. .../bindings/staging/iio/resolver/ad2s1200.txt | 16 1 file changed, 16 insertions(+) create mode 100644 Documentation/devicetree

[PATCH v2 07/13] staging: iio: ad2s1200: Improve readability with be16_to_cpup

2018-04-20 Thread David Veenstra
expressions that use be16_to_cpup. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200.c index 0a5fc9917e32..11ed9c7332e6

[PATCH v2 10/13] staging: iio: ad2s1200: Add scaling factor for angular velocity channel

2018-04-20 Thread David Veenstra
scaling factor of the angle channel. Signed-off-by: David Veenstra --- Changes in v2: - Move explanation of Pi approximation to top of switch statement, as this will also be relevant to angle channel. - Replaced 33102 / 2 with 16551 on line 84. drivers/staging/iio/resolver/ad2s1200.c

[PATCH v2 06/13] staging: iio: ad2s1200: Introduce variable for repeated value

2018-04-20 Thread David Veenstra
Add variable to hold &spi->dev in ad2s1200_probe. This value is repeatedly used in ad2s1200_probe. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2

[PATCH v2 05/13] staging: iio: ad2s1200: Add kernel docs to driver state

2018-04-20 Thread David Veenstra
Add missing kernel docs to the ad2s1200 driver state. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200.c index 357fe3c382b3

[PATCH v2 04/13] staging: iio: ad2s1200: Add blank lines

2018-04-20 Thread David Veenstra
Add blank lines to improve readability. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200.c index b6c3a3c8f7fe..357fe3c382b3 100644

[PATCH v2 03/13] staging: iio: ad2s1200: Reverse Christmas tree ordering

2018-04-20 Thread David Veenstra
Reorders the variable declarations to prefer a reverse Christmas tree order to improve readability. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b

[PATCH v2 01/13] staging: iio: ad2s1200: Remove unneeded include

2018-04-20 Thread David Veenstra
This patches removes unneeded slab.h header. Signed-off-by: David Veenstra --- Changes in v2: - Introduced in this version. drivers/staging/iio/resolver/ad2s1200.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver

[PATCH v2 02/13] staging: iio: ad2s1200: Sort includes alphabetically

2018-04-20 Thread David Veenstra
This patches sorts all the includes in alphabetic order. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200.c

[PATCH v2 00/13] staging: iio: ad2s1200: Driver clean up

2018-04-20 Thread David Veenstra
Hennerich opinion. Since Michael didn't weigh in, I have left this how it was. Best regards, David Veenstra [1] https://marc.info/?l=linux-iio&m=152137920426820&w=2 [2] https://marc.info/?l=linux-iio&m=152181140619243&w=2 David Veenstra (13): staging: iio: ad2s1200: Remove unnee

[PATCH 11/11] Move resolver ad2c1200 driver out of staging to mainline iio

2018-03-18 Thread David Veenstra
Signed-off-by: David Veenstra --- drivers/iio/Kconfig | 1 + drivers/iio/Makefile | 1 + drivers/iio/resolver/Kconfig | 17 + drivers/iio/resolver/Makefile | 5 + drivers/{staging => }/

[PATCH 09/11] staging: iio: ad2s1200: Add scaling factor for IIO_ANGL_VEL channel

2018-03-18 Thread David Veenstra
The sysfs iio ABI states that a unit of radians per second is expected, but the 12-bit angular velocity register has rps as its unit. So a fractional scaling factor of approximately 2 * Pi is added to the angular velocity channel. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver

[PATCH 10/11] staging: iio: ad2s1200: Replace angle channel with inclination channel

2018-03-18 Thread David Veenstra
the ABI. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200.c index 4b97a106012c..937676bcc0d4 100644 --- a/drivers

[PATCH 08/11] staging: iio: ad2s1200: Replace legacy gpio ABI with modern ABI

2018-03-18 Thread David Veenstra
The legacy, integer based gpio ABI is replaced with the descriptor based ABI. For compatibility, it is first tried to use the platform data to request the gpio's. Otherwise, it looks for the "sample" and "rdvel" gpio function. Signed-off-by: David Veenstra --- dri

[PATCH 07/11] staging: iio: ad2s1200: Ensure udelay(1) in all necessary code paths

2018-03-18 Thread David Veenstra
After a successful spi transaction, a udelay(1) is needed. This doesn't happen for the default case of the switch statement in ad2s1200_read_raw. This patch makes sure that it does. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 8 +--- 1 file chang

[PATCH 06/11] staging: iio: ad2s1200: Improve readability with be16_to_cpup

2018-03-18 Thread David Veenstra
expressions that use be16_to_cpup. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200.c index eceb86e952de..e0e7c88368ed

[PATCH 04/11] staging: iio: ad2s1200: Add kernel docs to driver state

2018-03-18 Thread David Veenstra
Add missing kernel docs to the ad2s1200 driver state. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200.c index 20df16b7852b

[PATCH 05/11] staging: iio: ad2s1200: Introduce variable for repeated value

2018-03-18 Thread David Veenstra
Add variable to hold &spi->dev in ad2s1200_probe. This value is repeatedly used in ad2s1200_probe. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2

[PATCH 03/11] staging: iio: ad2s1200: Add blank lines

2018-03-18 Thread David Veenstra
Add blank lines to improve readability. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200.c index 94d0a66532fd..20df16b7852b 100644

[PATCH 02/11] staging: iio: ad2s1200: Reverse Christmas tree order

2018-03-18 Thread David Veenstra
Reorders the variable declarations to prefer a reverse Christmas tree order to improve readability. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b

[PATCH 01/11] staging: iio: ad2s1200: Sort includes alphabetically

2018-03-18 Thread David Veenstra
This patches sorts all the includes in alphabetic order. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200

[PATCH 00/11] staging: iio: ad2s1200: Driver clean up

2018-03-18 Thread David Veenstra
conveniant format and has semantics similar to that of angular position. David Veenstra (11): staging: iio: ad2s1200: Sort includes alphabetically staging: iio: ad2s1200: Reverse Christmas tree order staging: iio: ad2s1200: Add blank lines staging: iio: ad2s1200: Add kernel docs to driver state

[PATCH 02/11] staging: iio: ad2s1200: Reverse Christmas tree order

2018-03-18 Thread David Veenstra
Reorders the variable declarations to prefer a reverse Christmas tree order to improve readability. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b

[PATCH 01/11] staging: iio: ad2s1200: Sort includes alphabetically

2018-03-18 Thread David Veenstra
This patches sorts all the includes in alphabetic order. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200

[PATCH 00/11] staging: iio: ad2s1200: Driver clean up

2018-03-18 Thread David Veenstra
likely to be a cubersome format for users of the ABI interface. Finally, there is in_incli which seems to be meant for any kind of inclination, given in degrees. In my opinion in_incli is the best choice, as it has a conveniant format and has semantics similar to that of angular position. David