[RFC v2] regmap: Add regmap_pipe_read API

2016-07-20 Thread Crestez Dan Leonard
g> Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- Changes since V1: * Improve comments. I think "pipe" is the correct word here. * Rely on void* pointer arithmetic instead of casting to u8* The SPMI implementations of regmap_bus have read functions

[RFC v2] regmap: Add regmap_pipe_read API

2016-07-20 Thread Crestez Dan Leonard
s intended. This breaks if caching is enabled and reg+1 happens to be a cacheable register. Without regmap support refactoring a driver to enable regmap caching requires separate i2c and spi paths. This is exactly what regmap is supposed to help avoid. Suggested-by: Jonathan Cameron Signed-off-by: C

Re: [PATCH v2 3/3] acpi spi: Initialize modalias from of_compatible

2016-07-20 Thread Crestez Dan Leonard
On 07/19/2016 01:22 PM, Mark Brown wrote: > On Wed, Jul 13, 2016 at 02:53:42PM +0300, Crestez Dan Leonard wrote: >> When using devicetree spi_device.modalias is set to the compatible >> string with the vendor prefix removed. For SPI devices described via >> ACPI the i2c_b

Re: [PATCH v2 3/3] acpi spi: Initialize modalias from of_compatible

2016-07-20 Thread Crestez Dan Leonard
On 07/19/2016 01:22 PM, Mark Brown wrote: > On Wed, Jul 13, 2016 at 02:53:42PM +0300, Crestez Dan Leonard wrote: >> When using devicetree spi_device.modalias is set to the compatible >> string with the vendor prefix removed. For SPI devices described via >> ACPI the i2c_b

[PATCH v2 2/3] acpi i2c: Initialize info.type from of_compatible

2016-07-13 Thread Crestez Dan Leonard
01:00". If the of_compatible property is present try to use that instead. This makes it easier to instantiate i2c drivers through ACPI with DT ids. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- drivers/i2c/i2c-core.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff

[PATCH v2 0/3] Init device ids from ACPI of_compatible

2016-07-13 Thread Crestez Dan Leonard
rlays got it. * Change acpi_of_modalias outlen param to size_t * Use {} after else Crestez Dan Leonard (3): acpi: Export acpi_of_modalias equiv of of_modalias_node acpi i2c: Initialize info.type from of_compatible acpi spi: Initialize modalias from of_compatible drivers/acpi/bus.c |

[PATCH v2 1/3] acpi: Export acpi_of_modalias equiv of of_modalias_node

2016-07-13 Thread Crestez Dan Leonard
When using devicetree stuff like i2c_client.name or spi_device.modalias is initialized to the first DT compatible id with the vendor prefix stripped. Since some drivers rely on this try to replicate it when using ACPI with DT ids. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.

[PATCH v2 1/3] acpi: Export acpi_of_modalias equiv of of_modalias_node

2016-07-13 Thread Crestez Dan Leonard
When using devicetree stuff like i2c_client.name or spi_device.modalias is initialized to the first DT compatible id with the vendor prefix stripped. Since some drivers rely on this try to replicate it when using ACPI with DT ids. Signed-off-by: Crestez Dan Leonard --- drivers/acpi/bus.c

[PATCH v2 2/3] acpi i2c: Initialize info.type from of_compatible

2016-07-13 Thread Crestez Dan Leonard
01:00". If the of_compatible property is present try to use that instead. This makes it easier to instantiate i2c drivers through ACPI with DT ids. Signed-off-by: Crestez Dan Leonard --- drivers/i2c/i2c-core.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/i2c-core.c b/d

[PATCH v2 0/3] Init device ids from ACPI of_compatible

2016-07-13 Thread Crestez Dan Leonard
rlays got it. * Change acpi_of_modalias outlen param to size_t * Use {} after else Crestez Dan Leonard (3): acpi: Export acpi_of_modalias equiv of of_modalias_node acpi i2c: Initialize info.type from of_compatible acpi spi: Initialize modalias from of_compatible drivers/acpi/bus.c |

[PATCH v2 3/3] acpi spi: Initialize modalias from of_compatible

2016-07-13 Thread Crestez Dan Leonard
;. Change acpi_register_spi_device to use the of_compatible property if present. This makes it easier to instantiate spi drivers through ACPI with DT ids. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- drivers/spi/spi.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletio

[PATCH v2 3/3] acpi spi: Initialize modalias from of_compatible

2016-07-13 Thread Crestez Dan Leonard
;. Change acpi_register_spi_device to use the of_compatible property if present. This makes it easier to instantiate spi drivers through ACPI with DT ids. Signed-off-by: Crestez Dan Leonard --- drivers/spi/spi.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/s

[PATCH] iio: Fix missing unlock on duplicate trigger

2016-06-28 Thread Crestez Dan Leonard
Since duplicate trigger names are supposed to cause errors at probe time anyway this issue is unlikely to affect anyone. Fixes commit 2e2b6a13f5f5119c36551c1ab99b85e0ad1a2105: iio: Refuse to register triggers with duplicate names Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.

[PATCH] iio: Fix missing unlock on duplicate trigger

2016-06-28 Thread Crestez Dan Leonard
Since duplicate trigger names are supposed to cause errors at probe time anyway this issue is unlikely to affect anyone. Fixes commit 2e2b6a13f5f5119c36551c1ab99b85e0ad1a2105: iio: Refuse to register triggers with duplicate names Signed-off-by: Crestez Dan Leonard --- drivers/iio/industrialio

Re: [RFC] regmap: Add regmap_pipe_read API

2016-06-22 Thread Crestez Dan Leonard
On 06/21/2016 09:42 PM, Mark Brown wrote: > On Thu, Jun 16, 2016 at 06:24:36PM +0300, Crestez Dan Leonard wrote: > >> +val = ((u8*)val) + read_len; > > This cast looks broken, you should be able to do pointer arithmetic on > void pointers as though they we

Re: [RFC] regmap: Add regmap_pipe_read API

2016-06-22 Thread Crestez Dan Leonard
On 06/21/2016 09:42 PM, Mark Brown wrote: > On Thu, Jun 16, 2016 at 06:24:36PM +0300, Crestez Dan Leonard wrote: > >> +val = ((u8*)val) + read_len; > > This cast looks broken, you should be able to do pointer arithmetic on > void pointers as though they we

Re: [PATCH v3] iio: Add driver for Silabs si1132, si1141/2/3 and si1145/6/7 ambient light, uv index and proximity sensors

2016-06-21 Thread Crestez Dan Leonard
On 06/19/2016 02:57 PM, Jonathan Cameron wrote: > On 17/06/16 12:10, Crestez Dan Leonard wrote: >> From: Peter Meerwald <pme...@pmeerw.net> >> >> The si114x supports x=1,2,3 IR LEDs for proximity sensing together with >> visible and IR ambient light sensing (ALS).

Re: [PATCH v3] iio: Add driver for Silabs si1132, si1141/2/3 and si1145/6/7 ambient light, uv index and proximity sensors

2016-06-21 Thread Crestez Dan Leonard
On 06/19/2016 02:57 PM, Jonathan Cameron wrote: > On 17/06/16 12:10, Crestez Dan Leonard wrote: >> From: Peter Meerwald >> >> The si114x supports x=1,2,3 IR LEDs for proximity sensing together with >> visible and IR ambient light sensing (ALS). >> >> Newer

Re: [PATCH 2/3] acpi i2c: Initialize info.type from of_compatible

2016-06-17 Thread Crestez Dan Leonard
On 06/16/2016 11:11 AM, Mika Westerberg wrote: > On Wed, Jun 15, 2016 at 09:30:28PM +0300, Crestez Dan Leonard wrote: >> When using devicetree i2c_board_info.type is set to the compatible >> string with the vendor prefix removed. For I2C devices described via >> ACPI the i2c_b

Re: [PATCH 2/3] acpi i2c: Initialize info.type from of_compatible

2016-06-17 Thread Crestez Dan Leonard
On 06/16/2016 11:11 AM, Mika Westerberg wrote: > On Wed, Jun 15, 2016 at 09:30:28PM +0300, Crestez Dan Leonard wrote: >> When using devicetree i2c_board_info.type is set to the compatible >> string with the vendor prefix removed. For I2C devices described via >> ACPI the i2c_b

[PATCH v3] iio: Add driver for Silabs si1132, si1141/2/3 and si1145/6/7 ambient light, uv index and proximity sensors

2016-06-17 Thread Crestez Dan Leonard
asheet lists register 0x1a as 'reserved'. It might make sense to just return a constant on these models. This was tested on si1143 and si1145 Link to v2: https://www.spinics.net/lists/linux-iio/msg25055.html Signed-off-by: Peter Meerwald <pme...@pmeerw.net> Signed-off-by: Crestez Dan Leonard &

[PATCH v3] iio: Add driver for Silabs si1132, si1141/2/3 and si1145/6/7 ambient light, uv index and proximity sensors

2016-06-17 Thread Crestez Dan Leonard
as 'reserved'. It might make sense to just return a constant on these models. This was tested on si1143 and si1145 Link to v2: https://www.spinics.net/lists/linux-iio/msg25055.html Signed-off-by: Peter Meerwald Signed-off-by: Crestez Dan Leonard --- drivers/iio/light/Kconfig | 13 + drivers

Re: [RFC] regmap: Add regmap_pipe_read API

2016-06-17 Thread Crestez Dan Leonard
On 06/16/2016 06:43 PM, Geert Uytterhoeven wrote: > Hi Leonard, > > On Thu, Jun 16, 2016 at 5:24 PM, Crestez Dan Leonard > <leonard.cres...@intel.com> wrote: >> The regmap API usually assumes that bulk read operations will read a >> range of registers but som

Re: [RFC] regmap: Add regmap_pipe_read API

2016-06-17 Thread Crestez Dan Leonard
On 06/16/2016 06:43 PM, Geert Uytterhoeven wrote: > Hi Leonard, > > On Thu, Jun 16, 2016 at 5:24 PM, Crestez Dan Leonard > wrote: >> The regmap API usually assumes that bulk read operations will read a >> range of registers but some I2C/SPI devices have certai

[RFC] regmap: Add regmap_pipe_read API

2016-06-16 Thread Crestez Dan Leonard
happens to be a cacheable register. Without regmap support refactoring a driver to enable regmap caching requires separate I2C and SPI paths. This is exactly what regmap is supposed to help avoid. Suggested-by: Jonathan Cameron <ji...@kernel.org> Signed-off-by: Crestez Dan Leonard <leo

[RFC] regmap: Add regmap_pipe_read API

2016-06-16 Thread Crestez Dan Leonard
happens to be a cacheable register. Without regmap support refactoring a driver to enable regmap caching requires separate I2C and SPI paths. This is exactly what regmap is supposed to help avoid. Suggested-by: Jonathan Cameron Signed-off-by: Crestez Dan Leonard --- This works as expected for mpu6050

[PATCH 3/3] acpi spi: Initialize modalias from of_compatible

2016-06-15 Thread Crestez Dan Leonard
;. Change acpi_register_spi_device to use the of_compatible property if present. This makes it easier to instantiate spi drivers through ACPI with DT ids. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- drivers/spi/spi.c | 10 +- 1 file changed, 9 insertions(+), 1 deletio

[PATCH 3/3] acpi spi: Initialize modalias from of_compatible

2016-06-15 Thread Crestez Dan Leonard
;. Change acpi_register_spi_device to use the of_compatible property if present. This makes it easier to instantiate spi drivers through ACPI with DT ids. Signed-off-by: Crestez Dan Leonard --- drivers/spi/spi.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi.c

[PATCH 2/3] acpi i2c: Initialize info.type from of_compatible

2016-06-15 Thread Crestez Dan Leonard
01:00". If the of_compatible property is present try to use that instead. This makes it easier to instantiate i2c drivers through ACPI with DT ids. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- drivers/i2c/i2c-core.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff

[PATCH 1/3] acpi: Export acpi_of_modalias equiv of of_modalias_node

2016-06-15 Thread Crestez Dan Leonard
When using devicetree stuff like i2c_client.name or spi_device.modalias is initialized to the first DT compatible id with the vendor prefix stripped. Since some drivers rely on this try to replicate it when using ACPI with DT ids. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.

[PATCH 0/3] Init device ids from ACPI of_compatible

2016-06-15 Thread Crestez Dan Leonard
le", "st,lis3dh"}, } }) } The driver for that device supports tens of models is not aware of ACPI. Like to prev thread: https://www.spinics.net/lists/linux-acpi/msg66469.html Like to acpi overlays: https://www.spinics.net/lists/linux-acpi/msg66638.html Crestez Dan L

[PATCH 2/3] acpi i2c: Initialize info.type from of_compatible

2016-06-15 Thread Crestez Dan Leonard
01:00". If the of_compatible property is present try to use that instead. This makes it easier to instantiate i2c drivers through ACPI with DT ids. Signed-off-by: Crestez Dan Leonard --- drivers/i2c/i2c-core.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/i2c-core.c b/d

[PATCH 1/3] acpi: Export acpi_of_modalias equiv of of_modalias_node

2016-06-15 Thread Crestez Dan Leonard
When using devicetree stuff like i2c_client.name or spi_device.modalias is initialized to the first DT compatible id with the vendor prefix stripped. Since some drivers rely on this try to replicate it when using ACPI with DT ids. Signed-off-by: Crestez Dan Leonard --- drivers/acpi/bus.c

[PATCH 0/3] Init device ids from ACPI of_compatible

2016-06-15 Thread Crestez Dan Leonard
le", "st,lis3dh"}, } }) } The driver for that device supports tens of models is not aware of ACPI. Like to prev thread: https://www.spinics.net/lists/linux-acpi/msg66469.html Like to acpi overlays: https://www.spinics.net/lists/linux-acpi/msg66638.html Crestez Dan L

Re: [RFC v2 2/2] i2c: Pass i2c_device_id to probe func when using DT ids through ACPI

2016-06-10 Thread Crestez Dan Leonard
On 06/10/2016 09:32 AM, Mika Westerberg wrote: > On Thu, Jun 09, 2016 at 04:06:03PM +0300, Crestez Dan Leonard wrote: >> When devices are instatiated through devicetree the i2c_client->name is >> set to the compatible string with company name stripped out. This

Re: [RFC v2 2/2] i2c: Pass i2c_device_id to probe func when using DT ids through ACPI

2016-06-10 Thread Crestez Dan Leonard
On 06/10/2016 09:32 AM, Mika Westerberg wrote: > On Thu, Jun 09, 2016 at 04:06:03PM +0300, Crestez Dan Leonard wrote: >> When devices are instatiated through devicetree the i2c_client->name is >> set to the compatible string with company name stripped out. This

Re: [RFC v2 2/2] i2c: Pass i2c_device_id to probe func when using DT ids through ACPI

2016-06-10 Thread Crestez Dan Leonard
On 06/10/2016 10:04 AM, Wolfram Sang wrote: > On Thu, Jun 09, 2016 at 04:06:03PM +0300, Crestez Dan Leonard wrote: >> When devices are instatiated through devicetree the i2c_client->name is >> set to the compatible string with company name stripped out. This is >> then matc

Re: [RFC v2 2/2] i2c: Pass i2c_device_id to probe func when using DT ids through ACPI

2016-06-10 Thread Crestez Dan Leonard
On 06/10/2016 10:04 AM, Wolfram Sang wrote: > On Thu, Jun 09, 2016 at 04:06:03PM +0300, Crestez Dan Leonard wrote: >> When devices are instatiated through devicetree the i2c_client->name is >> set to the compatible string with company name stripped out. This is >> then matc

[RFC v2 2/2] i2c: Pass i2c_device_id to probe func when using DT ids through ACPI

2016-06-09 Thread Crestez Dan Leonard
ate between model numbers. When using ACPI this id parameter is NULL and the driver usually needs to do ACPI-specific differentiation. This patch attempts to find a valid i2c_device_id when using ACPI with DT-like compatible strings. Signed-off-by: Crestez Dan Leonard <leonard.cres...@int

[RFC v2 1/2] acpi: Expose acpi_of_match_device

2016-06-09 Thread Crestez Dan Leonard
This can be used by device drivers as the equivalent of of_match_device when they are instantiated through ACPI using devicetree IDs. This is described in Documentation/acpi/enumeration.txt Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- drivers/acpi/bus.c

[RFC v2 0/2] Match i2c_device_id when using DT ids through ACPI

2016-06-09 Thread Crestez Dan Leonard
vice will have the same signature as of_match_device. The purpose of these changes would be to make more drivers easier to instantiate through ACPI firmware. v2 fixes the code to actually work correctly. Hopefully the patches will also be sent to the correct addresses this time. Crestez Dan Leon

[RFC v2 2/2] i2c: Pass i2c_device_id to probe func when using DT ids through ACPI

2016-06-09 Thread Crestez Dan Leonard
ate between model numbers. When using ACPI this id parameter is NULL and the driver usually needs to do ACPI-specific differentiation. This patch attempts to find a valid i2c_device_id when using ACPI with DT-like compatible strings. Signed-off-by: Crestez Dan Leonard --- drivers/i2c/i2c-core.c |

[RFC v2 1/2] acpi: Expose acpi_of_match_device

2016-06-09 Thread Crestez Dan Leonard
This can be used by device drivers as the equivalent of of_match_device when they are instantiated through ACPI using devicetree IDs. This is described in Documentation/acpi/enumeration.txt Signed-off-by: Crestez Dan Leonard --- drivers/acpi/bus.c | 13 +++-- include/linux/acpi.h | 8

[RFC v2 0/2] Match i2c_device_id when using DT ids through ACPI

2016-06-09 Thread Crestez Dan Leonard
vice will have the same signature as of_match_device. The purpose of these changes would be to make more drivers easier to instantiate through ACPI firmware. v2 fixes the code to actually work correctly. Hopefully the patches will also be sent to the correct addresses this time. Crestez Dan Leon

[RFC 0/2] Match i2c_device_id when using DT ids through ACPI

2016-06-06 Thread Crestez Dan Leonard
vice will have the same signature as of_match_device. The purpose of these changes would be to make more drivers easier to instantiate through ACPI firmware. It's possible that I misunderstood and this problem already has a different solution. Crestez Dan Leonard (2): acpi: Expose acpi_of_m

[RFC 0/2] Match i2c_device_id when using DT ids through ACPI

2016-06-06 Thread Crestez Dan Leonard
vice will have the same signature as of_match_device. The purpose of these changes would be to make more drivers easier to instantiate through ACPI firmware. It's possible that I misunderstood and this problem already has a different solution. Crestez Dan Leonard (2): acpi: Expose acpi_of_m

[RFC 2/2] i2c: Pass i2c_device_id to probe func when using DT ids through ACPI

2016-06-06 Thread Crestez Dan Leonard
ate between model numbers. When using ACPI this id parameter is NULL and the driver usually needs to do ACPI-specific differentiation. This patch attempts to find a valid i2c_device_id when using ACPI with DT-like compatible strings. Signed-off-by: Crestez Dan Leonard <leonard.cres...@int

[RFC 1/2] acpi: Expose acpi_of_match_device

2016-06-06 Thread Crestez Dan Leonard
This can be used by device drivers as the equivalent of of_match_device when they are instantiated through ACPI using devicetree IDs. This is described in Documentation/acpi/enumeration.txt Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- drivers/acpi/bus.c

[RFC 1/2] acpi: Expose acpi_of_match_device

2016-06-06 Thread Crestez Dan Leonard
This can be used by device drivers as the equivalent of of_match_device when they are instantiated through ACPI using devicetree IDs. This is described in Documentation/acpi/enumeration.txt Signed-off-by: Crestez Dan Leonard --- drivers/acpi/bus.c | 13 +++-- include/linux/acpi.h | 8

[RFC 2/2] i2c: Pass i2c_device_id to probe func when using DT ids through ACPI

2016-06-06 Thread Crestez Dan Leonard
ate between model numbers. When using ACPI this id parameter is NULL and the driver usually needs to do ACPI-specific differentiation. This patch attempts to find a valid i2c_device_id when using ACPI with DT-like compatible strings. Signed-off-by: Crestez Dan Leonard --- drivers/i2c/i2c-core.c |

[PATCH] iio: generic_buffer: Fix --trigger-num option

2016-06-03 Thread Crestez Dan Leonard
Initialize trig_num to -1 and handle trig_num=0 as a valid id. Fixes: 7c7e9dad (iio: iio_generic_buffer: Add --trigger-num option) Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- tools/iio/iio_generic_buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH] iio: generic_buffer: Fix --trigger-num option

2016-06-03 Thread Crestez Dan Leonard
Initialize trig_num to -1 and handle trig_num=0 as a valid id. Fixes: 7c7e9dad (iio: iio_generic_buffer: Add --trigger-num option) Signed-off-by: Crestez Dan Leonard --- tools/iio/iio_generic_buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/iio

Re: [PATCH v4 0/3] iio: generic_buffer: Select device/trigger by number

2016-06-03 Thread Crestez Dan Leonard
On 05/30/2016 06:19 PM, Crestez Dan Leonard wrote: > This patch series adds support for selecting iio devices/triggers by numeric > id > rather than just name. This is useful because the names are not actually > guaranteed to be unique. > > Changes since v3: > * Rebase o

Re: [PATCH v4 0/3] iio: generic_buffer: Select device/trigger by number

2016-06-03 Thread Crestez Dan Leonard
On 05/30/2016 06:19 PM, Crestez Dan Leonard wrote: > This patch series adds support for selecting iio devices/triggers by numeric > id > rather than just name. This is useful because the names are not actually > guaranteed to be unique. > > Changes since v3: > * Rebase o

[PATCH] iio: inv_mpu6050: Fix use-after-free in ACPI code

2016-06-03 Thread Crestez Dan Leonard
In some cases this can result in incorrectly returning a negative value from asus_acpi_get_sensor_info and the AK8963 magnetometer failing to show up. Cc: Srinivas Pandruvada <srinivas.pandruv...@linux.intel.com> Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- dri

[PATCH] iio: inv_mpu6050: Fix use-after-free in ACPI code

2016-06-03 Thread Crestez Dan Leonard
In some cases this can result in incorrectly returning a negative value from asus_acpi_get_sensor_info and the AK8963 magnetometer failing to show up. Cc: Srinivas Pandruvada Signed-off-by: Crestez Dan Leonard --- drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 5 +++-- 1 file changed, 3

Re: [PATCH v2 6/7] iio: inv_mpu6050: Reformat sample for active scan mask

2016-05-31 Thread Crestez Dan Leonard
On 05/31/2016 12:42 AM, Jonathan Cameron wrote: > On 30 May 2016 14:44:41 BST, Crestez Dan Leonard <leonard.cres...@intel.com> > wrote: >> On 05/29/2016 06:47 PM, Jonathan Cameron wrote: >>> On 18/05/16 16:00, Crestez Dan Leonard wrote: >>>> Right now it is

Re: [PATCH v2 6/7] iio: inv_mpu6050: Reformat sample for active scan mask

2016-05-31 Thread Crestez Dan Leonard
On 05/31/2016 12:42 AM, Jonathan Cameron wrote: > On 30 May 2016 14:44:41 BST, Crestez Dan Leonard > wrote: >> On 05/29/2016 06:47 PM, Jonathan Cameron wrote: >>> On 18/05/16 16:00, Crestez Dan Leonard wrote: >>>> Right now it is possible to only

[PATCH v2] iio: Add driver for Silabs si1132, si1141/2/3 and si1145/6/7 ambient light, uv index and proximity sensors

2016-05-30 Thread Crestez Dan Leonard
; Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- Changes since Peter's v1: * Fix set_chlist returning positive value on success * Do not assume channel addresses are in order of scan index * Take lock in buffer_preenable * Print part/rev/seq id at probe time * Cleanup

[PATCH v2] iio: Add driver for Silabs si1132, si1141/2/3 and si1145/6/7 ambient light, uv index and proximity sensors

2016-05-30 Thread Crestez Dan Leonard
From: Peter Meerwald The si114x supports x=1,2,3 IR LEDs for proximity sensing together with visible and IR ambient light sensing (ALS). Newer parts (si1132, si1145/6/7) can measure UV light and compute an UV index Signed-off-by: Peter Meerwald Signed-off-by: Crestez Dan Leonard --- Changes

[PATCH v4 1/3] iio: generic_buffer: Cleanup when receiving signals

2016-05-30 Thread Crestez Dan Leonard
can all be done under a single error label. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- tools/iio/iio_generic_buffer.c | 172 ++--- 1 file changed, 108 insertions(+), 64 deletions(-) diff --git a/tools/iio/iio_generic_buffer.c b/

[PATCH v4 1/3] iio: generic_buffer: Cleanup when receiving signals

2016-05-30 Thread Crestez Dan Leonard
can all be done under a single error label. Signed-off-by: Crestez Dan Leonard --- tools/iio/iio_generic_buffer.c | 172 ++--- 1 file changed, 108 insertions(+), 64 deletions(-) diff --git a/tools/iio/iio_generic_buffer.c b/tools/iio/iio_generic_buffer.c in

[PATCH v4 2/3] iio: generic_buffer: Add --device-num option

2016-05-30 Thread Crestez Dan Leonard
This makes it possible to distinguish between iio devices with the same name. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- tools/iio/iio_generic_buffer.c | 69 +++--- 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a

[PATCH v4 2/3] iio: generic_buffer: Add --device-num option

2016-05-30 Thread Crestez Dan Leonard
This makes it possible to distinguish between iio devices with the same name. Signed-off-by: Crestez Dan Leonard --- tools/iio/iio_generic_buffer.c | 69 +++--- 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a/tools/iio/iio_generic_buffer.c b

[PATCH v4 3/3] iio: generic_buffer: Add --trigger-num option

2016-05-30 Thread Crestez Dan Leonard
Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- tools/iio/iio_generic_buffer.c | 36 ++-- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/tools/iio/iio_generic_buffer.c b/tools/iio/iio_generic_buffer.c index 3f16e9f..0e8a1f7

[PATCH v4 3/3] iio: generic_buffer: Add --trigger-num option

2016-05-30 Thread Crestez Dan Leonard
Signed-off-by: Crestez Dan Leonard --- tools/iio/iio_generic_buffer.c | 36 ++-- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/tools/iio/iio_generic_buffer.c b/tools/iio/iio_generic_buffer.c index 3f16e9f..0e8a1f7 100644 --- a/tools/iio

[PATCH v4 0/3] iio: generic_buffer: Select device/trigger by number

2016-05-30 Thread Crestez Dan Leonard
and check if >= 0 for valid id. Jonathan: you replied to v3 saying that they were applied but I don't see those patches on any branch from your repo: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git Crestez Dan Leonard (3): iio: generic_buffer: Cleanup when receiving sign

[PATCH v4 0/3] iio: generic_buffer: Select device/trigger by number

2016-05-30 Thread Crestez Dan Leonard
and check if >= 0 for valid id. Jonathan: you replied to v3 saying that they were applied but I don't see those patches on any branch from your repo: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git Crestez Dan Leonard (3): iio: generic_buffer: Cleanup when receiving sign

Re: [PATCH v2 6/7] iio: inv_mpu6050: Reformat sample for active scan mask

2016-05-30 Thread Crestez Dan Leonard
On 05/29/2016 06:47 PM, Jonathan Cameron wrote: > On 18/05/16 16:00, Crestez Dan Leonard wrote: >> Right now it is possible to only enable some of the x/y/z channels, for >> example you can enable accel_z without x or y but if you actually do >> that what you get is actual

Re: [PATCH v2 6/7] iio: inv_mpu6050: Reformat sample for active scan mask

2016-05-30 Thread Crestez Dan Leonard
On 05/29/2016 06:47 PM, Jonathan Cameron wrote: > On 18/05/16 16:00, Crestez Dan Leonard wrote: >> Right now it is possible to only enable some of the x/y/z channels, for >> example you can enable accel_z without x or y but if you actually do >> that what you get is actual

Re: [RFC 6/7] iio: Refuse to register triggers with duplicate names

2016-05-30 Thread Crestez Dan Leonard
On 05/29/2016 10:48 PM, Jonathan Cameron wrote: > On 23/05/16 19:40, Crestez Dan Leonard wrote: >> The trigger name is documented as unique but drivers are currently >> allowed to register triggers with duplicate names. This should be >> considered a bug since it makes

Re: [RFC 6/7] iio: Refuse to register triggers with duplicate names

2016-05-30 Thread Crestez Dan Leonard
On 05/29/2016 10:48 PM, Jonathan Cameron wrote: > On 23/05/16 19:40, Crestez Dan Leonard wrote: >> The trigger name is documented as unique but drivers are currently >> allowed to register triggers with duplicate names. This should be >> considered a bug since it makes

Re: [RFC] iio: Add driver for Silabs si1132, si1141/2/3 and si1145/6/7 ambient light, uv index and proximity sensors

2016-05-24 Thread Crestez Dan Leonard
.silabs.com/products/sensors/Pages/HID-USB-to-IR-Reference-Design.aspx > > Signed-off-by: Peter Meerwald <pme...@pmeerw.net> > --- > This is the code I am currently working on, partly tested. I've stripped some > features from earlier versions and added support for newer c

Re: [RFC] iio: Add driver for Silabs si1132, si1141/2/3 and si1145/6/7 ambient light, uv index and proximity sensors

2016-05-24 Thread Crestez Dan Leonard
ensors/Pages/HID-USB-to-IR-Reference-Design.aspx > > Signed-off-by: Peter Meerwald > --- > This is the code I am currently working on, partly tested. I've stripped some > features from earlier versions and added support for newer chips. > I hope this is useful to Crestez Dan Leonar

Re: [PATCH 3/3] iio: st_sensors: Use level interrupts

2016-05-24 Thread Crestez Dan Leonard
On 05/24/2016 02:40 PM, Linus Walleij wrote: > On Fri, May 13, 2016 at 8:43 PM, Crestez Dan Leonard > <leonard.cres...@intel.com> wrote: > >> As far as I can tell DRDY for ST sensors behaves as a level rather than >> edge interrupt. Registering for

Re: [PATCH 3/3] iio: st_sensors: Use level interrupts

2016-05-24 Thread Crestez Dan Leonard
On 05/24/2016 02:40 PM, Linus Walleij wrote: > On Fri, May 13, 2016 at 8:43 PM, Crestez Dan Leonard > wrote: > >> As far as I can tell DRDY for ST sensors behaves as a level rather than >> edge interrupt. Registering for IRQF_TRIGGER_RISING instead of >> IRQF_TRIGG

Re: [PATCH 1/3] iio: st_sensors: Init trigger before irq request

2016-05-24 Thread Crestez Dan Leonard
On 05/24/2016 02:27 PM, Linus Walleij wrote: > On Fri, May 13, 2016 at 8:43 PM, Crestez Dan Leonard > <leonard.cres...@intel.com> wrote: > >> This fixes a possible race where an interrupt arrives before complete >> initialization and crashes because iio_trigger_get_drv

Re: [PATCH 1/3] iio: st_sensors: Init trigger before irq request

2016-05-24 Thread Crestez Dan Leonard
On 05/24/2016 02:27 PM, Linus Walleij wrote: > On Fri, May 13, 2016 at 8:43 PM, Crestez Dan Leonard > wrote: > >> This fixes a possible race where an interrupt arrives before complete >> initialization and crashes because iio_trigger_get_drvdata returns NULL. >>

[RFC 4/7] iio: Add current_trigger_id alternative

2016-05-23 Thread Crestez Dan Leonard
This allows controlling the current trigger by numeric ID rather than name. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- Documentation/ABI/testing/sysfs-bus-iio | 9 +++ Documentation/DocBook/iio.tmpl | 4 +- drivers/iio/industrialio-trigger.c

[RFC 6/7] iio: Refuse to register triggers with duplicate names

2016-05-23 Thread Crestez Dan Leonard
The trigger name is documented as unique but drivers are currently allowed to register triggers with duplicate names. This should be considered a bug since it makes the 'current_trigger' interface unusable. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- drive

[RFC 4/7] iio: Add current_trigger_id alternative

2016-05-23 Thread Crestez Dan Leonard
This allows controlling the current trigger by numeric ID rather than name. Signed-off-by: Crestez Dan Leonard --- Documentation/ABI/testing/sysfs-bus-iio | 9 +++ Documentation/DocBook/iio.tmpl | 4 +- drivers/iio/industrialio-trigger.c | 115

[RFC 6/7] iio: Refuse to register triggers with duplicate names

2016-05-23 Thread Crestez Dan Leonard
The trigger name is documented as unique but drivers are currently allowed to register triggers with duplicate names. This should be considered a bug since it makes the 'current_trigger' interface unusable. Signed-off-by: Crestez Dan Leonard --- drivers/iio/industrialio-trigger.c | 21

[PATCHv3 3/7] iio: generic_buffer: Add --trigger-num option

2016-05-23 Thread Crestez Dan Leonard
Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- tools/iio/generic_buffer.c | 34 +- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c index 3f16e9f..e8c3052 100644 --- a

[RFC 0/7] Deal with iio trigger names

2016-05-23 Thread Crestez Dan Leonard
osted earlier: https://www.spinics.net/lists/linux-iio/msg24867.html Crestez Dan Leonard (7): iio: generic_buffer: Cleanup when receiving signals iio: generic_buffer: Add --device-num option iio: generic_buffer: Add --trigger-num option iio: Add current_trigger_id alternative iio: generi

[PATCHv3 3/7] iio: generic_buffer: Add --trigger-num option

2016-05-23 Thread Crestez Dan Leonard
Signed-off-by: Crestez Dan Leonard --- tools/iio/generic_buffer.c | 34 +- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c index 3f16e9f..e8c3052 100644 --- a/tools/iio/generic_buffer.c +++ b

[RFC 0/7] Deal with iio trigger names

2016-05-23 Thread Crestez Dan Leonard
osted earlier: https://www.spinics.net/lists/linux-iio/msg24867.html Crestez Dan Leonard (7): iio: generic_buffer: Cleanup when receiving signals iio: generic_buffer: Add --device-num option iio: generic_buffer: Add --trigger-num option iio: Add current_trigger_id alternative iio: generi

[RFC 7/7] iio: Make trigger names unique

2016-05-23 Thread Crestez Dan Leonard
This changes the format of trigger names for some drivers so that the result always includes indio_dev->id and is thus unique. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- drivers/iio/adc/max1027.c | 4 ++-- drivers/iio/common/s

[PATCHv3 1/7] iio: generic_buffer: Cleanup when receiving signals

2016-05-23 Thread Crestez Dan Leonard
can all be done under a single error label. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- Changes since v2: Initialize data to NULL to prevent crash on free. tools/iio/generic_buffer.c | 172 - 1 file changed, 108 insertio

[PATCHv3 2/7] iio: generic_buffer: Add --device-num option

2016-05-23 Thread Crestez Dan Leonard
This makes it possible to distinguish between iio devices with the same name. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- tools/iio/generic_buffer.c | 69 ++ 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a

[RFC 5/7] iio: generic_buffer: Use current_trigger_id

2016-05-23 Thread Crestez Dan Leonard
This is a preferred alternative to 'current_trigger'. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- tools/iio/generic_buffer.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c index e

[RFC 7/7] iio: Make trigger names unique

2016-05-23 Thread Crestez Dan Leonard
This changes the format of trigger names for some drivers so that the result always includes indio_dev->id and is thus unique. Signed-off-by: Crestez Dan Leonard --- drivers/iio/adc/max1027.c | 4 ++-- drivers/iio/common/st_sensors/st_sensors_trigger.c | 2 +- driv

[PATCHv3 1/7] iio: generic_buffer: Cleanup when receiving signals

2016-05-23 Thread Crestez Dan Leonard
can all be done under a single error label. Signed-off-by: Crestez Dan Leonard --- Changes since v2: Initialize data to NULL to prevent crash on free. tools/iio/generic_buffer.c | 172 - 1 file changed, 108 insertions(+), 64 deletions(-) diff --git a/to

[PATCHv3 2/7] iio: generic_buffer: Add --device-num option

2016-05-23 Thread Crestez Dan Leonard
This makes it possible to distinguish between iio devices with the same name. Signed-off-by: Crestez Dan Leonard --- tools/iio/generic_buffer.c | 69 ++ 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a/tools/iio/generic_buffer.c b/tools

[RFC 5/7] iio: generic_buffer: Use current_trigger_id

2016-05-23 Thread Crestez Dan Leonard
This is a preferred alternative to 'current_trigger'. Signed-off-by: Crestez Dan Leonard --- tools/iio/generic_buffer.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c index e8c3052..b23371a 100644 --- a/tools

Re: [PATCH 1/2] iio: generic_buffer: Cleanup when receiving signals

2016-05-23 Thread Crestez Dan Leonard
On 05/21/2016 07:28 PM, Jonathan Cameron wrote: > On 20/05/16 16:55, Peter Meerwald-Stadler wrote: >> >>> This also drops all the code freeing string buffers at the end of main. >>> Memory is freed when the process exits anyway so there's no point in >>> cluttering the code with all those gotos.

Re: [PATCH 1/2] iio: generic_buffer: Cleanup when receiving signals

2016-05-23 Thread Crestez Dan Leonard
On 05/21/2016 07:28 PM, Jonathan Cameron wrote: > On 20/05/16 16:55, Peter Meerwald-Stadler wrote: >> >>> This also drops all the code freeing string buffers at the end of main. >>> Memory is freed when the process exits anyway so there's no point in >>> cluttering the code with all those gotos.

[PATCH v2 2/2] iio: generic_buffer: Add --device-num option

2016-05-23 Thread Crestez Dan Leonard
This makes it possible to distinguish between iio devices with the same name. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- tools/iio/generic_buffer.c | 69 ++ 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a

[PATCH v2 1/2] iio: generic_buffer: Cleanup when receiving signals

2016-05-23 Thread Crestez Dan Leonard
can all be done under a single error label. Signed-off-by: Crestez Dan Leonard <leonard.cres...@intel.com> --- tools/iio/generic_buffer.c | 170 - 1 file changed, 107 insertions(+), 63 deletions(-) diff --git a/tools/iio/generic_buffer.c b/

[PATCH v2 2/2] iio: generic_buffer: Add --device-num option

2016-05-23 Thread Crestez Dan Leonard
This makes it possible to distinguish between iio devices with the same name. Signed-off-by: Crestez Dan Leonard --- tools/iio/generic_buffer.c | 69 ++ 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a/tools/iio/generic_buffer.c b/tools

[PATCH v2 1/2] iio: generic_buffer: Cleanup when receiving signals

2016-05-23 Thread Crestez Dan Leonard
can all be done under a single error label. Signed-off-by: Crestez Dan Leonard --- tools/iio/generic_buffer.c | 170 - 1 file changed, 107 insertions(+), 63 deletions(-) diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c index 2429

  1   2   3   >