[PATCH 4/7] staging: iio: isl29028: use the runtime power management for system sleep

2017-02-08 Thread Brian Masney
and resume to go through the runtime power management. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.

[PATCH 3/7] staging: iio: isl29028: fix incorrect sampling frequency value

2017-02-08 Thread Brian Masney
instead of the expected 400ms value. This patch changes the 3 supported sampling frequency to 2 so that the proximity sleep time of 400ms can be used. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH 2/7] staging: iio: isl29028: fix incorrect sleep time when taking initial proximity reading

2017-02-08 Thread Brian Masney
When proximity is enabled in isl29028_enable_proximity(), the function msleep() is called with the sampling frequency, which is not correct. This patch changes the code to sleep the specified amount of time listed in the datasheet instead. Signed-off-by: Brian Masney <masn...@onstation.

[PATCH 1/7] staging: iio: isl29028: change mdelay() to msleep()

2017-02-08 Thread Brian Masney
This driver in some cases can busy wait for upwards of 100 ms. Since the kernel at this point is not running in atomic context, and is running in process context, we can safely use msleep() instead. This patch changes the two occurrences of mdelay() to msleep(). Signed-off-by: Brian Masney <m

[PATCH 0/7] iio: isl29028: move out of staging

2017-02-08 Thread Brian Masney
that the IR LED turns on for two seconds when the proximity sensing feature is enabled. Brian Masney (7): staging: iio: isl29028: change mdelay() to msleep() staging: iio: isl29028: fix incorrect sleep time when taking proximity reading staging: iio: isl29028: fix incorrect sampling

[PATCH 7/7] staging: iio: isl29028: move out of staging

2017-02-08 Thread Brian Masney
Move ISL29028 ALS / Proximity Sensor out of staging and into mainline. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/iio/light/Kconfig | 10 ++ drivers/iio/light/Makefile | 1 + drivers/{staging => }/iio/light/isl29028.c | 0

[PATCH 5/7] staging: iio: isl29028: add copyright

2017-02-08 Thread Brian Masney
Add Brian Masney's copyright to the header for the several rounds of staging cleanups that has been done to this driver. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/iio

[PATCH 6/7] iio: Documentation: add ABI documentation for in_proximity_sampling_frequency_available

2017-02-08 Thread Brian Masney
Add entry for the in_proximity_sampling_frequency_available sysfs entry to the existing sampling_frequency_available ABI documentation. Signed-off-by: Brian Masney <masn...@onstation.org> --- Documentation/ABI/testing/sysfs-bus-iio | 1 + 1 file changed, 1 insertion(+) diff

Re: [PATCH v2 15/15] staging: iio: isl29028: add runtime power management support

2017-01-21 Thread Brian Masney
On Sat, Jan 21, 2017 at 02:58:12PM +, Jonathan Cameron wrote: > On 17/01/17 09:25, Brian Masney wrote: > > This patch adds runtime power management support to the isl29028 driver. > > It defaults to powering off the device after two second

[PATCH v2 2/2] staging: iio: isl29028: move out of staging

2017-02-12 Thread Brian Masney
Move ISL29028 ALS / Proximity Sensor out of staging and into mainline. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/iio/light/Kconfig | 10 ++ drivers/iio/light/Makefile | 1 + drivers/{staging => }/iio/light/isl29028.c | 0

[PATCH v2 0/2] staging: iio: isl29028: move out of staging

2017-02-12 Thread Brian Masney
This is hopefully the last of the changes that are needed to move this driver out of staging. Datasheet: http://www.intersil.com/content/dam/Intersil/documents/isl2/isl29028.pdf Changes since v1: - in_proximity_sampling_frequency_available sysfs attribute now shows decimals. Brian Masney (2

[PATCH v2 1/2] staging: iio: isl29028: change sampling frequencies available to use decimals

2017-02-12 Thread Brian Masney
will still be selected. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c index 5375e7a..c1d6540

Re: [PATCH v2 2/2] staging: iio: isl29028: move out of staging

2017-02-12 Thread Brian Masney
On Sun, Feb 12, 2017 at 05:55:34AM -0500, Brian Masney wrote: > Move ISL29028 ALS / Proximity Sensor out of staging and into mainline. > > Signed-off-by: Brian Masney <masn...@onstation.org> Sorry, Jonathan, I forgot to run git format-patch with --no-renames and didn't realize u

[PATCH v2 14/15] staging: iio: isl29028: only set ALS scale when ALS/IR sensing is enabled

2017-01-17 Thread Brian Masney
the stage for faster resume times from runtime power management if the user is only querying the proximity sensor. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/stagi

[PATCH v2 15/15] staging: iio: isl29028: add runtime power management support

2017-01-17 Thread Brian Masney
renames that function to isl29028_clear_configure_reg() since it is now used in several places. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 118 --- 1 file changed, 110 insertions(+), 8 deletions(-) diff --git a/d

[PATCH v2 13/15] staging: iio: isl29028: only set proximity sampling rate when proximity is enabled

2017-01-17 Thread Brian Masney
the stage for faster resume times from the runtime power management if the user is only querying the ALS/IR sensor. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/stagi

[PATCH v2 10/15] staging: iio: isl29028: remove out of memory log message

2017-01-17 Thread Brian Masney
. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c index be1fc4a..e93077b 100644 --- a/drivers/staging/iio

[PATCH v2 04/15] staging: iio: isl29028: change newlines to improve readability

2017-01-17 Thread Brian Masney
Add and remove newlines to improve code readability in preparation for moving the driver out of staging. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 33 - 1 file changed, 24 insertions(+), 9 deletions(-)

[PATCH v2 00/15] staging cleanups

2017-01-17 Thread Brian Masney
flag from isl29028_enable_proximity(). I think that we can apply that patch now that the driver has runtime power management support. - Suggestions from Dan Carpenter - Dropped v1 patch #12 (fix comparison between signed and unsigned integers) Brian Masney (15): staging: iio: isl29028

[PATCH v2 02/15] staging: iio: isl29028: fix alignment of function arguments

2017-01-17 Thread Brian Masney
Two separate calls to regmap_update_bits() in isl29028_set_als_scale() and isl29028_set_als_ir_mode() did not have their function arguments on the next line aligned correctly to the open parenthesis. This patch corrects the alignment. Signed-off-by: Brian Masney <masn...@onstation.

[PATCH v2 09/15] staging: iio: isl29028: remove unnecessary error logging in isl29028_chip_init_and_power_on()

2017-01-17 Thread Brian Masney
If the call to isl29028_chip_init_and_power_on() in isl29028_probe() fails, then isl29028_probe() will log an error message. All of the error paths in that call path already have error logging in place. This patch removes the unnecessary logging. Signed-off-by: Brian Masney <masn...@onstation.

[PATCH v2 12/15] staging: iio: isl29028: remove enable flag from isl29028_enable_proximity()

2017-01-17 Thread Brian Masney
isl29028_enable_proximity() has a boolean argument named enable. This function is only called once and the enable flag is set to true in that call. This patch removes the enable parameter from that function. Signed-off-by: Brian Masney <masn...@onstation.org> --- The device gets runtime

[PATCH v2 08/15] staging: iio: isl29028: made error messages consistent

2017-01-17 Thread Brian Masney
The wording and style of the different error messages was not consistent. This patch makes the wording and style consistent throughout the driver. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 56

[PATCH v2 06/15] staging: iio: isl29028: move failure logging into isl29028_set_proxim_sampling()

2017-01-17 Thread Brian Masney
When isl29028_set_proxim_sampling() fails, it was up to both callers to log the failure message. This patch moves the logging into isl29028_set_proxim_sampling() to reduce the overall amount of code in the driver. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio

[PATCH v2 01/15] staging: iio: isl29028: made alignment of variables in struct isl29028_chip consistent

2017-01-17 Thread Brian Masney
The alignment of the variables in the struct isl29028_chip is not consistent. This changes all of the variables to use consistent alignment to improve the code readability. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 10 +-

[PATCH v2 11/15] staging: iio: isl29028: remove unnecessary parenthesis

2017-01-17 Thread Brian Masney
isl29028_write_raw() contains unnecessary parenthesis when checking to see if the passed in lux scale is valid. This patch removes the unnecessary parenthesis. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 2 +- 1 file changed, 1 insertion

[PATCH v2 05/15] staging: iio: isl29028: remove unused define ISL29028_DEV_ATTR

2017-01-17 Thread Brian Masney
The #define ISL29028_DEV_ATTR was not used so this patch removes the unnecessary code. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio

[PATCH v2 07/15] staging: iio: isl29028: move failure logging into isl29028_set_als_scale()

2017-01-17 Thread Brian Masney
When isl29028_set_als_scale() fails, it was up to both callers to log the failure message. This patch moves the logging into isl29028_set_als_scale() to reduce the overall amount of code in the driver. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl2

[PATCH v2 03/15] staging: iio: isl29028: combine isl29028_proxim_get() and isl29028_read_proxim()

2017-01-17 Thread Brian Masney
-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29028.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c index 74eb736..a13c8db 100644 --- a/d

[PATCH v2 2/2] staging: iio: isl29018: use IIO_DEVICE_ATTR_{RO, RW} macros

2016-09-25 Thread Brian Masney
Use the IIO_DEVICE_ATTR_RO and IIO_DEVICE_ATTR_RW macros to create the device attributes. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29018.c | 33 +++-- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/d

[PATCH v2 1/2] include: linux: iio: add IIO_ATTR_{RO, WO, RW} and IIO_DEVICE_ATTR_{RO, WO, RW} macros

2016-09-25 Thread Brian Masney
and include/linux/sysfs.h. Signed-off-by: Brian Masney <masn...@onstation.org> --- include/linux/iio/sysfs.h | 24 1 file changed, 24 insertions(+) diff --git a/include/linux/iio/sysfs.h b/include/linux/iio/sysfs.h index 9cd8f74..ce9426c 100644 --- a/include/linux/iio/sysfs.h

[PATCH 4/4] staging: iio: isl29018: move out of staging

2016-10-06 Thread Brian Masney
Move ISL29018/ISL29023/ISL29035 driver out of staging into mainline. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/iio/light/Kconfig| 12 + drivers/iio/light/Makefile | 1 + drivers/iio/light/isl29018.c

[PATCH 1/4] staging: iio: isl29018: add documentation about the infrared suppression

2016-10-06 Thread Brian Masney
Add documentation from the ISL29018 Data Sheet (FN6619.4, Oct 8, 2012) about the infrared suppression that can be controlled with the proximity_on_chip_ambient_infrared_suppression sysfs attribute. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29018.

[PATCH 3/4] staging: iio: isl29018: rename Kconfig variable to match existing light drivers in mainline.

2016-10-06 Thread Brian Masney
Rename CONFIG_SENSORS_ISL29018 to CONFIG_ISL29018 for consistency with the other light drivers in mainline. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/Kconfig | 2 +- drivers/staging/iio/light/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 del

[PATCH 2/4] staging: iio: isl29018: document device tree bindings

2016-10-06 Thread Brian Masney
RNING: DT compatible string "isil,isl29035" appears un-documented -- check ./Documentation/devicetree/bindings/ Signed-off-by: Brian Masney <masn...@onstation.org> --- .../devicetree/bindings/iio/light/isl29018.txt | 28 ++ 1 file changed, 28 insertions(

Re: [PATCH 4/4] staging: iio: isl29018: move out of staging

2016-10-09 Thread Brian Masney
On Sun, Oct 09, 2016 at 10:45:12AM +0100, Jonathan Cameron wrote: > On 07/10/16 01:48, Brian Masney wrote: > > Move ISL29018/ISL29023/ISL29035 driver out of staging into mainline. > > > > Signed-off-by: Brian Masney <masn...@onstation.org> > Time for a nitpick ta

[PATCH 2/2] staging: iio: isl29018: fix alignment of function arguments

2016-09-20 Thread Brian Masney
Address warning from checkpatch: CHECK: Alignment should match open parenthesis Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29018.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/light/isl29018.c b/d

[PATCH 1/2] staging: iio: isl29018: remove the FSF's mailing address

2016-09-20 Thread Brian Masney
Address warning from checkpatch: CHECK: Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. Linux already includes a copy of the GPL. Signed-off-by: Brian Masney

[PATCH 1/3] staging: iio: isl29018: remove unused variable and defines

2016-09-25 Thread Brian Masney
Removes unused variable and associated #defines that was found using make W=1. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29018.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/stagi

[PATCH 3/3] staging: iio: isl29018: fix comparison between signed and unsigned integers

2016-09-25 Thread Brian Masney
Fixes warning found by make W=2: warning: comparison between signed and unsigned integer expressions Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29018.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/stagi

[PATCH 2/3] staging: iio: isl29018: made error handling consistent

2016-09-25 Thread Brian Masney
function. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29018.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c index ad282f1..0a35588 100644 --- a/d

[PATCH 2/2] staging: iio: isl29018: use IIO_DEVICE_ATTR_{RO, RW} macros

2016-09-25 Thread Brian Masney
Use the IIO_DEVICE_ATTR_RO and IIO_DEVICE_ATTR_RW macros to create the device attributes. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29018.c | 33 +++-- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/d

[PATCH 1/2] include: linux: iio: add IIO_DEVICE_ATTR_{RO, WO, RW} macros

2016-09-25 Thread Brian Masney
-by: Brian Masney <masn...@onstation.org> --- include/linux/iio/sysfs.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/linux/iio/sysfs.h b/include/linux/iio/sysfs.h index 9cd8f74..f7c6431 100644 --- a/include/linux/iio/sysfs.h +++ b/include/linux/iio/sysfs.h @@ -59,6

[PATCH v3 5/5] staging: iio: isl29018: check if the chip is in a suspended state

2016-09-26 Thread Brian Masney
Add a check to isl29018_write_raw() to ensure that the chip is not in a suspended state. This makes the code consistent with what is present in isl29018_read_raw(). Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29018.c | 7 ++- 1 file chan

[PATCH v3 2/5] staging: iio: isl29018: use IIO_DEVICE_ATTR_{RO, RW} macros

2016-09-26 Thread Brian Masney
Use the IIO_DEVICE_ATTR_RO and IIO_DEVICE_ATTR_RW macros to create the device attributes. Signed-off-by: Brian Masney <masn...@onstation.org> --- This version of the patch now applies cleanly to the iio.git/testing branch. drivers/staging/iio/light/isl29018.

[PATCH v3 3/5] staging: iio: isl29018: fixed race condition in in_illuminance_scale_available_show()

2016-09-26 Thread Brian Masney
raw() locks a mutex specific to this driver when the integration time variable is updated. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29018.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/

[PATCH v3 4/5] staging: iio: isl29018: change isl29018_read_raw() to only have one exit point

2016-09-26 Thread Brian Masney
When the chip is in a suspended state, isl29018_read_raw() will return -EBUSY. Change the function so that it only has a single exit point. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/isl29018.c | 6 -- 1 file changed, 4 insertions(+), 2 del

[PATCH v3 1/5] include: linux: iio: add IIO_ATTR_{RO, WO, RW} and IIO_DEVICE_ATTR_{RO, WO, RW} macros

2016-09-26 Thread Brian Masney
and include/linux/sysfs.h. Signed-off-by: Brian Masney <masn...@onstation.org> --- This is the same version of this patch that I sent out on Sunday. I am resending the patch set since my the second patch in that series would not apply cleanly to iio.git/testing. include/linux/iio/sysfs.

Re: [PATCH v3 5/5] staging: iio: isl29018: check if the chip is in a suspended state

2016-10-01 Thread Brian Masney
On Sat, Oct 01, 2016 at 02:59:49PM +0100, Jonathan Cameron wrote: > On 27/09/16 01:20, Brian Masney wrote: > > Add a check to isl29018_write_raw() to ensure that the chip is not in a > > suspended state. This makes the code consistent with what is present > >

Re: [PATCH v2 09/23] staging: iio: tsl2583: cleaned up logging

2016-11-08 Thread Brian Masney
On Tue, Nov 08, 2016 at 02:29:20AM -0800, Joe Perches wrote: > On Tue, 2016-11-08 at 05:16 -0500, Brian Masney wrote: > > There are several places in the code where the function name is > > hardcoded in the log message. Use the __func__ constant string to build > > the l

Re: [PATCH 7/9] staging: iio: tsl2583: fix issue with changes to calibscale and int_time not being set on the chip

2016-11-06 Thread Brian Masney
On Sun, Nov 06, 2016 at 12:03:53PM +, Jonathan Cameron wrote: > On 03/11/16 12:56, Brian Masney wrote: > > When updating the in_illuminance_calibscale and > > in_illuminance_integration_time sysfs attributes, these values were not > > actually written to the chip. Th

[PATCH v2 18/23] staging: iio: tsl2583: change tsl2583_als_calibrate() to return 0 on success

2016-11-08 Thread Brian Masney
tsl2583_als_calibrate() to return 0 on success. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index 5cdfe06..f1c9bb9

[PATCH v2 17/23] staging: iio: tsl2583: moved code block inside else statement

2016-11-08 Thread Brian Masney
The check for ch1lux > ch0lux inside tsl2583_get_lux is only valid if the ratio is not equal to zero. Move the code block inside the else statement. This does away with the need to initialize the variables to zero. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/

[PATCH v2 06/23] staging: iio: tsl2583: change current chip state from a tristate to a bool

2016-11-08 Thread Brian Masney
The current chip state is represented as a tristate (working, suspended, and unknown). The unknown state was not used. This patch changes the chip state so that it is now represented as a single boolean value (suspended). Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/s

[PATCH v2 19/23] staging: iio: tsl2583: remove unnecessary parentheses

2016-11-08 Thread Brian Masney
in_illuminance_lux_table_store() contains some unnecessary parentheses. This patch removes them since they provide no value. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d

[PATCH v2 23/23] staging: iio: tsl2583: move out of staging

2016-11-08 Thread Brian Masney
Move tsl2580, tsl2581, tsl2583 driver out of staging into mainline. Signed-off-by: Brian Masney <masn...@onstation.org> --- .../ABI/testing/sysfs-bus-iio-light-tsl2583| 20 + drivers/iio/light/Kconfig | 7 + drivers/iio/light/Ma

[PATCH v2 21/23] staging: iio: tsl2583: move from a global to a per device lux table

2016-11-08 Thread Brian Masney
. When updating the lux table via sysfs, only 9 entries, plus the terminator, could be added. This changes the code to allow for the 10 entries, plus the terminator. Signed-off-by: Brian Masney <masn...@onstation.org> --- I also included the change for the lux table size since

[PATCH v2 16/23] staging: iio: tsl2583: updated code comment to match what the code does

2016-11-08 Thread Brian Masney
If channel 0 does not have any data, then the code sets the lux to zero. The corresponding comment says that the last value is returned. This updates the comment to correctly reflect what the code does. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl

[PATCH v2 22/23] staging: iio: tsl2583: updated copyright and MODULE_AUTHOR

2016-11-08 Thread Brian Masney
Added Brian Masney's copyright to the header and to the MODULE_AUTHOR for all of the staging cleanups that has been done to this driver. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCH v2 20/23] staging: iio: tsl2583: don't assume an unsigned int is 32 bits

2016-11-08 Thread Brian Masney
in_illuminance_lux_table_store assumes that an unsigned int is 32 bits. Replace this with sizeof(unsigned int). Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/stagi

[PATCH v2 14/23] staging: iio: tsl2583: combine sysfs documentation

2016-11-08 Thread Brian Masney
There are two separate files describing the tsl2583 sysfs attributes. Combine the two files into one. Updated the name of the sysfs attributes to match the current ABI. Signed-off-by: Brian Masney <masn...@onstation.org> Suggested-by: Peter Meerwald-Stadler <pme...@p

[PATCH v2 10/23] staging: iio: tsl2583: unify function and variable prefix to tsl2583_

2016-11-08 Thread Brian Masney
Some functions and variables were prefixed with either taos, tsl258x or tsl2583. Change everything to use the tsl2583 prefix since that is the name of the .c file. The taos_settings member inside the taos_settings struct was renamed to als_settings. Signed-off-by: Brian Masney <m

[PATCH v2 15/23] staging: iio: tsl2583: fix multiline comment syntax

2016-11-08 Thread Brian Masney
The definition of the tsl2583_device_lux struct has a series of single line comments. There are two other cases where the multiline comments did not have an initial blank line. Change these comments to use the proper multiline syntax. Signed-off-by: Brian Masney <masn...@onstation.

[PATCH v2 05/23] staging: iio: tsl2583: remove unnecessary chip status checks in suspend/resume

2016-11-08 Thread Brian Masney
if it is already powered on. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index 2a3db3f..3be2213

[PATCH v2 12/23] staging: iio: tsl2583: fix comparison between signed and unsigned integers

2016-11-08 Thread Brian Masney
Fixed warning found by make W=2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/d

[PATCH v2 01/23] staging: iio: tsl2583: split out functionality of taos_chip_on()

2016-11-08 Thread Brian Masney
of a larger refactor that was split up to make the code review easier. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 122 +--- 1 file changed, 58 insertions(+), 64 deletions(-) diff --git a/drivers/staging/iio

[PATCH v2 13/23] staging: iio: tsl2583: change newlines to improve readability

2016-11-08 Thread Brian Masney
Add and remove newlines to improve code readability in preparation for moving the driver out of staging. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/s

[PATCH v2 11/23] staging: iio: tsl2583: fix alignment of #define values

2016-11-08 Thread Brian Masney
Most of the values in the #defines have their values aligned on a single column, but some do not. This changes the remaining defines to use consistent alignment with the majority to improve code readability. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio

[PATCH v2 02/23] staging: iio: tsl2583: fix issue with changes to calibscale and int_time not being set on the chip

2016-11-08 Thread Brian Masney
when these sysfs attributes are updated. The chip initialization also calls these these new functions. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 85 +++-- 1 file changed, 52 insertions(+), 33 deletions(-) diff

[PATCH v2 00/23] staging: iio: tsl2583: move out of staging

2016-11-08 Thread Brian Masney
to a per device lux table. - Combined redundant sysfs ABI documentation - Made log messages clearer - Code style and formatting cleanups - Staging graduation I verified that the driver functions correctly using a TSL2581 hooked up to a Raspberry Pi 2. Brian Masney (23): staging: iio: tsl2583

[PATCH v2 07/23] staging: iio: tsl2583: remove redundant write to the control register in taos_probe()

2016-11-08 Thread Brian Masney
. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index 9880e41..0f5f544 100644 --- a/drivers/staging/iio/light/tsl

[PATCH v2 08/23] staging: iio: tsl2583: remove the FSF's mailing address

2016-11-08 Thread Brian Masney
Address warning from checkpatch: CHECK: Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. Linux already includes a copy of the GPL. Signed-off-by: Brian Masney

[PATCH v2 04/23] staging: iio: tsl2583: remove unnecessary chip status check in taos_get_lux

2016-11-08 Thread Brian Masney
taos_get_lux checks to see if the chip is in a working state. This check is not necessary since it is only called from tsl2583_read_raw and in_illuminance_calibrate_store (via taos_als_calibrate). The chip state is already checked by these functions. Signed-off-by: Brian Masney <m

[PATCH v2 03/23] staging: iio: tsl2583: check if chip is suspended in in_illuminance_calibrate_store

2016-11-08 Thread Brian Masney
in_illuminance_calibrate_store() did not check to see if the chip is suspended. This patch adds the proper check. The return value from taos_als_calibrate() was also not checked in this function, so the proper check was also added while changes are being made here. Signed-off-by: Brian Masney

[PATCH v2 09/23] staging: iio: tsl2583: cleaned up logging

2016-11-08 Thread Brian Masney
changed. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 51 ++--- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index a

[PATCH v3 28/28] staging: iio: tsl2583: move out of staging

2016-11-10 Thread Brian Masney
Move tsl2580, tsl2581, tsl2583 driver out of staging into mainline. Signed-off-by: Brian Masney <masn...@onstation.org> --- .../ABI/testing/sysfs-bus-iio-light-tsl2583| 20 + drivers/iio/light/Kconfig | 7 + drivers/iio/light/Ma

[PATCH v3 27/28] staging: iio: tsl2583: add copyright and MODULE_AUTHOR

2016-11-10 Thread Brian Masney
Add Brian Masney's copyright to the header and to the MODULE_AUTHOR for all of the staging cleanups that has been done to this driver. The original MODULE_AUTHOR() did not have a space between his name and email address. This patch also adds the missing space. Signed-off-by: Brian Masney <m

[PATCH v3 01/28] staging: iio: tsl2583: split out functionality of taos_chip_on()

2016-11-10 Thread Brian Masney
of a larger refactor that was split up to make the code review easier. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 122 +--- 1 file changed, 58 insertions(+), 64 deletions(-) diff --git a/drivers/staging/iio

[PATCH v3 10/28] staging: iio: tsl2583: unify function and variable prefix to tsl2583_

2016-11-10 Thread Brian Masney
Some functions and variables were prefixed with either taos, tsl258x, taos2583, or tsl2583. Change everything to use the tsl2583 prefix since that is the name of the .c file. The taos_settings member inside the taos_settings struct was renamed to als_settings. Signed-off-by: Brian Masney <m

[PATCH v3 04/28] staging: iio: tsl2583: remove unnecessary chip status check in taos_get_lux

2016-11-10 Thread Brian Masney
taos_get_lux checks to see if the chip is in a working state. This check is not necessary since it is only called from tsl2583_read_raw and in_illuminance_calibrate_store (via taos_als_calibrate). The chip state is already checked by these functions. Signed-off-by: Brian Masney <m

[PATCH v3 02/28] staging: iio: tsl2583: fix issue with changes to calibscale and int_time not being set on the chip

2016-11-10 Thread Brian Masney
when these sysfs attributes are updated. The chip initialization also calls these these new functions. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 85 +++-- 1 file changed, 52 insertions(+), 33 deletions(-) diff

[PATCH v3 07/28] staging: iio: tsl2583: remove redundant write to the control register in taos_probe()

2016-11-10 Thread Brian Masney
. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index 5a32102..449506b 100644 --- a/drivers/staging/iio/light/tsl

[PATCH v3 12/28] staging: iio: tsl2583: fix comparison between signed and unsigned integers

2016-11-10 Thread Brian Masney
Fixed warning found by make W=2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/d

[PATCH v3 00/28] staging: iio: tsl2583: move out of staging

2016-11-10 Thread Brian Masney
is that the patches are split up further to make the code review easier. Brian Masney (28): staging: iio: tsl2583: split out functionality of taos_chip_on() staging: iio: tsl2583: fix issue with changes to calibscale and int_time not being set on the chip staging: iio: tsl2583: check

[PATCH v3 08/28] staging: iio: tsl2583: remove the FSF's mailing address

2016-11-10 Thread Brian Masney
Address warning from checkpatch: CHECK: Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. Linux already includes a copy of the GPL. Signed-off-by: Brian Masney

[PATCH v3 16/28] staging: iio: tsl2583: updated code comment to match what the code does

2016-11-10 Thread Brian Masney
If channel 0 does not have any data, then the code sets the lux to zero. The corresponding comment says that the last value is returned. This updates the comment to correctly reflect what the code does. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl

[PATCH v3 11/28] staging: iio: tsl2583: fix alignment of #define values

2016-11-10 Thread Brian Masney
Most of the values in the #defines have their values aligned on a single column, but some do not. This changes the remaining defines to use consistent alignment with the majority to improve code readability. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio

[PATCH v3 13/28] staging: iio: tsl2583: change newlines to improve readability

2016-11-10 Thread Brian Masney
Add and remove newlines to improve code readability in preparation for moving the driver out of staging. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/s

[PATCH v3 14/28] staging: iio: tsl2583: combine sysfs documentation

2016-11-10 Thread Brian Masney
There are two separate files describing the tsl2583 sysfs attributes. Combine the two files into one. Updated the name of the sysfs attributes to match the current ABI. Signed-off-by: Brian Masney <masn...@onstation.org> Suggested-by: Peter Meerwald-Stadler <pme...@p

[PATCH v3 20/28] staging: iio: tsl2583: don't assume an unsigned int is 32 bits

2016-11-10 Thread Brian Masney
in_illuminance_lux_table_store assumes that an unsigned int is 32 bits. Replace this with sizeof(unsigned int). Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/stagi

[PATCH v3 17/28] staging: iio: tsl2583: moved code block inside else statement

2016-11-10 Thread Brian Masney
The check for ch1lux > ch0lux inside tsl2583_get_lux is only valid if the ratio is not equal to zero. Move the code block inside the else statement. This does away with the need to initialize the variables to zero. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/

[PATCH v3 15/28] staging: iio: tsl2583: fix multiline comment syntax

2016-11-10 Thread Brian Masney
The definition of the tsl2583_device_lux struct has a series of single line comments. There are two other cases where the multiline comments did not have an initial blank line. Change these comments to use the proper multiline syntax. Signed-off-by: Brian Masney <masn...@onstation.

[PATCH v3 09/28] staging: iio: tsl2583: cleaned up logging

2016-11-10 Thread Brian Masney
changed. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 73 ++--- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index 5

[PATCH v3 03/28] staging: iio: tsl2583: check if chip is suspended in in_illuminance_calibrate_store

2016-11-10 Thread Brian Masney
in_illuminance_calibrate_store() did not check to see if the chip is suspended. This patch adds the proper check. The return value from taos_als_calibrate() was also not checked in this function, so the proper check was also added while changes are being made here. Signed-off-by: Brian Masney

[PATCH v3 05/28] staging: iio: tsl2583: remove unnecessary chip status checks in suspend/resume

2016-11-10 Thread Brian Masney
if it is already powered on. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index 170b8e9..29dd072

[PATCH v3 06/28] staging: iio: tsl2583: change current chip state from a tristate to a bool

2016-11-10 Thread Brian Masney
The current chip state is represented as a tristate (working, suspended, and unknown). The unknown state was not used. This patch changes the chip state so that it is now represented as a single boolean value (suspended). Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/s

[PATCH v3 23/28] staging: iio: tsl2583: clarified comment about clearing interrupts

2016-11-10 Thread Brian Masney
The comment that describes the code that clears the interrupt bit was vague and didn't provide much value. This patch adds more detail about why that bit needs to be cleared. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 5 +++-- 1 file chan

[PATCH v3 19/28] staging: iio: tsl2583: remove unnecessary parentheses

2016-11-10 Thread Brian Masney
in_illuminance_lux_table_store() contains some unnecessary parentheses. This patch removes them since they provide no value. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d

[PATCH v3 26/28] staging: iio: tsl2583: remove unnecessary variable initialization

2016-11-10 Thread Brian Masney
The ret variable in tsl2583_suspend() and tsl2583_resume() was initialized to 0. This is not necessary so this patch removes the initialization. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 4 ++-- 1 file changed, 2 insertions(+), 2 del

[PATCH v3 24/28] staging: iio: tsl2583: remove comment for tsl2583_probe()

2016-11-10 Thread Brian Masney
The comment for tsl2583_probe() does not provide any useful value. This patch removes the comment. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2583.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/iio/light/tsl2583.c b/d

  1   2   3   4   >