Re: [PATCH v3 9/9] staging: iio: tsl2x7x/tsl2772: move out of staging

2018-05-12 Thread Brian Masney
On Sat, May 12, 2018 at 12:44:37PM +0100, Jonathan Cameron wrote: > On Thu, 10 May 2018 20:32:06 -0400 > Brian Masney <masn...@onstation.org> wrote: > > > On Thu, May 10, 2018 at 08:12:23PM -0400, Brian Masney wrote: > > > Move the tsl2772 driver out of staging and

Re: [PATCH v3 9/9] staging: iio: tsl2x7x/tsl2772: move out of staging

2018-05-10 Thread Brian Masney
On Thu, May 10, 2018 at 08:12:23PM -0400, Brian Masney wrote: > Move the tsl2772 driver out of staging and into mainline. Hey Jonathan, Here is the .c and .h file to make your review easier. Thanks for all your feedback on all of these changes to this driver plus the other 3 that I've alre

[PATCH v3 4/9] staging: iio: tsl2x7x: use macro to populate tsl2X7X_device_info

2018-05-10 Thread Brian Masney
This patch creates a macro that populates the tsl2X7X_device_info structure to reduce duplicated code in the driver. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 61 ++--- 1 file changed, 16 insertions(

[PATCH v3 8/9] staging: iio: tsl2x7x: rename driver to tsl2772

2018-05-10 Thread Brian Masney
. This patch also adds Brian Masney's copyright to tsl2772.h for all of the work that has been done to move this driver out of staging. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/Kconfig | 2 +- drivers/staging/iio/light/Ma

[PATCH v3 9/9] staging: iio: tsl2x7x/tsl2772: move out of staging

2018-05-10 Thread Brian Masney
Move the tsl2772 driver out of staging and into mainline. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/iio/light/Kconfig | 8 drivers/iio/light/Makefile | 1 + drivers/{staging => }/iio/light/

[PATCH v3 2/9] staging: iio: tsl2x7x: use direct returns

2018-05-10 Thread Brian Masney
This patch changes the functions tsl2x7x_read_event_value() and tsl2x7x_read_raw() to use direct returns to simplify the code. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 49 - 1 file changed, 16 inse

[PATCH v3 6/9] staging: iio: tsl2x7x: correct IIO_EV_INFO_PERIOD values

2018-05-10 Thread Brian Masney
went above 3. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 44 + drivers/staging/iio/light/tsl2x7x.h | 1 - 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7

[PATCH v3 3/9] staging: iio: tsl2x7x: turn chip off if IIO device registration fails

2018-05-10 Thread Brian Masney
-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c index c1e726fc87b7..f5ca5ada0358 100644 --- a/drivers/stagi

[PATCH v3 7/9] staging: iio: tsl2x7x: add range checking to tsl2x7x_write_raw

2018-05-10 Thread Brian Masney
The CALIBBIAS and INT_TIME masks in tsl2x7x_write_raw did not have any range checking in place so this patch adds the appropriate range checking. The defines TSL2X7X_ALS_GAIN_TRIM_{MIN,MAX} are also introduced by this patch. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/s

[PATCH v3 5/9] staging: iio: tsl2x7x: convert to use read_avail

2018-05-10 Thread Brian Masney
supported devices use 2.73 ms - 699 ms. This patch adds support for the multiple ranges. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 93 ++--- 1 file changed, 76 insertions(+), 17 deletions(-) diff --git a/d

[PATCH v3 0/9] staging: iio: tsl2x7x: move out of staging

2018-05-10 Thread Brian Masney
.pdf - https://ams.com/eng/content/download/250283/976077/file/TMD2771_DS000177_2-00.pdf - https://ams.com/eng/content/download/365023/1210677/file/TMD2772-E.pdf Brian Masney (9): staging: iio: tsl2x7x: remove unnecessary whitespace staging: iio: tsl2x7x: use direct returns staging: iio

[PATCH v3 1/9] staging: iio: tsl2x7x: remove unnecessary whitespace

2018-05-10 Thread Brian Masney
This patch removes unnecessary whitespace in preparation for moving this driver out of staging. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 22 +++--- drivers/staging/iio/light/tsl2x7x.h | 1 - 2 files changed, 11 inse

Re: [PATCH v2 11/11] staging: iio: tsl2x7x/tsl2772: move out of staging

2018-05-03 Thread Brian Masney
intensity in (lux) and proximity * detection (prox) for the TAOS TSL2571, TSL2671, TMD2671, TSL2771, TMD2771, * TSL2572, TSL2672, TMD2672, TSL2772, and TMD2772 devices. * * Copyright (c) 2012, TAOS Corporation. * Copyright (c) 2017-2018 Brian Masney <masn...@onstation.org> */ #include #i

[PATCH v2 08/11] staging: iio: tsl2x7x: add device ids for code readability

2018-05-03 Thread Brian Masney
This patch adds the device IDs to the device_channel_config array to improve code readability. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/s

[PATCH v2 09/11] staging: iio: tsl2x7x: correct IIO_EV_INFO_PERIOD values

2018-05-03 Thread Brian Masney
went above 3. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 44 + drivers/staging/iio/light/tsl2x7x.h | 1 - 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7

[PATCH v2 06/11] staging: iio: tsl2x7x: correct integration time and lux equation

2018-05-03 Thread Brian Masney
https://en.wikipedia.org/wiki/Lux. The driver was primarily tested using a TSL2772, however some quick tests were also ran against the devices TSL2771, TSL2572, and TMD2772. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl

[PATCH v2 10/11] staging: iio: tsl2x7x: rename driver to tsl2772

2018-05-03 Thread Brian Masney
. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/Kconfig | 2 +- drivers/staging/iio/light/Makefile | 2 +- drivers/staging/iio/light/{tsl2x7x.c => tsl2772.c} | 691 +++-- drivers/staging/iio/light/{

[PATCH v2 11/11] staging: iio: tsl2x7x/tsl2772: move out of staging

2018-05-03 Thread Brian Masney
Move the tsl2772 driver out of staging and into mainline. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/iio/light/Kconfig | 8 drivers/iio/light/Makefile | 1 + drivers/{staging => }/iio/light/

[PATCH v2 07/11] staging: iio: tsl2x7x: support 2.72 and 2.73 ALS increments

2018-05-03 Thread Brian Masney
The driver assumed that the ALS increment was 2.72 ms, and the upper range was 696 ms. Some other supported devices use 2.73 ms - 699 ms. This patch adds support for the multiple ranges. Signed-off-by: Brian Masney <masn...@onstation.org> --- I debated whether or not this change shoul

[PATCH v2 04/11] staging: iio: tsl2x7x: move calibscale_available attribute to IIO_INTENSITY channel

2018-05-03 Thread Brian Masney
. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c index 7e8db5178a2c..9aee04fb4168

[PATCH v2 02/11] staging: iio: tsl2x7x: add range checking to three sysfs attributes

2018-05-03 Thread Brian Masney
The sysfs attributes in_illuminance0_target_input, in_illuminance0_calibrate, and in_proximity0_calibrate did not have proper range checking in place so this patch adds the correct range checks. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.

[PATCH v2 00/11] staging: iio: tsl2x7x: move out of staging

2018-05-03 Thread Brian Masney
- https://ams.com/eng/content/download/250283/976077/file/TMD2771_DS000177_2-00.pdf - https://ams.com/eng/content/download/365023/1210677/file/TMD2772-E.pdf Brian Masney (11): staging: iio: tsl2x7x: use GPL-2.0+ SPDX license identifier staging: iio: tsl2x7x: add range checking to three sysfs

[PATCH v2 05/11] staging: iio: tsl2x7x: use IIO_CONST_ATTR for calibscale_available

2018-05-03 Thread Brian Masney
IIO_CONST_ATTR. The following device datasheets were checked: tsl2571, tsl2771, tmd2771, tsl2572, tsl2772, tmd2772. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 46 - 1 file changed, 4 insertions(+), 42 del

[PATCH v2 03/11] staging: iio: tsl2x7x: don't setup event handlers if interrupts are not configured

2018-05-03 Thread Brian Masney
and info structure members. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 130 +++- 1 file changed, 112 insertions(+), 18 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl

[PATCH v2 01/11] staging: iio: tsl2x7x: use GPL-2.0+ SPDX license identifier

2018-05-03 Thread Brian Masney
The summary text for the GPL is not needed since the SPDX identifier is a legally binding shorthand that can be used instead. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 11 +-- drivers/staging/iio/light/tsl2x7x.h | 15 +---

Re: [PATCH 02/13] staging: iio: tsl2x7x: use GPL-2.0+ SPDX license identifier

2018-04-21 Thread Brian Masney
On Sat, Apr 21, 2018 at 05:16:38PM +0100, Jonathan Cameron wrote: > On Fri, 20 Apr 2018 20:41:42 -0400 > Brian Masney <masn...@onstation.org> wrote: > > > The summary text for the GPL is not needed since the SPDX identifier > > is a legally binding shortha

[PATCH 10/13] staging: iio: tsl2x7x: rename prx to prox for consistency

2018-04-20 Thread Brian Masney
is corrected to prox_gain so that it matches what is actually in the structure. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 12 ++-- drivers/staging/iio/light/tsl2x7x.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff

[PATCH 13/13] staging: iio: tsl2x7x: rename prox_config to als_prox_config

2018-04-20 Thread Brian Masney
to als_prox_config since ALS settings can be stored here as well. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 7 --- drivers/staging/iio/light/tsl2x7x.h | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/stagi

[PATCH 05/13] staging: iio: tsl2x7x: remove unnecessary chip status checks in suspend/resume

2018-04-20 Thread Brian Masney
tsl2x7x_suspend() and tsl2x7x_resume() both check to see what the current chip status is. These checks are not necessary so this patch removes those checks. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 16 ++-- 1 file chan

[PATCH 04/13] staging: iio: tsl2x7x: simplify tsl2x7x_clear_interrupts function

2018-04-20 Thread Brian Masney
. This patch removes the tsl2x7x_clear_interrupts() function and replaces the two callers with the i2c_smbus_write_byte() call instead. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 32 +++- 1 file changed, 15 inse

[PATCH 08/13] staging: iio: tsl2x7x: add range checking to three sysfs attributes

2018-04-20 Thread Brian Masney
The sysfs attributes in_illuminance0_target_input, in_illuminance0_calibrate, and in_proximity0_calibrate did not have proper range checking in place so this patch adds the correct range checks. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.

[PATCH 12/13] staging: iio: tsl2x7x: various comment cleanups

2018-04-20 Thread Brian Masney
for some existing structure members. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 59 + drivers/staging/iio/light/tsl2x7x.h | 48 +++--- 2 files changed, 51 insertions(+), 56 del

[PATCH 01/13] staging: iio: tsl2x7x: move integration_time* attributes to IIO_INTENSITY channel

2018-04-20 Thread Brian Masney
in_proximity0_calibscale_available in_proximity0_raw name of_node power subsystem uevent Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7

[PATCH 07/13] staging: iio: tsl2x7x: simplify device id verification

2018-04-20 Thread Brian Masney
This patch renames tsl2x7x_device_id() to tsl2x7x_device_id_verif(), removes the unnecessary pointer on the id parameter, and only calls the verification function once. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 11 +-- 1 file chan

[PATCH 11/13] staging: iio: tsl2x7x: use device defaults for als_time, prox_time and wait_time

2018-04-20 Thread Brian Masney
This patch changes the defaults of the als_time, prox_time and wait_time to match the defaults according to the TSL2772 datasheet. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH 09/13] staging: iio: tsl2x7x: move power and diode settings into header file

2018-04-20 Thread Brian Masney
The power and diode defines are needed for the platform data so this patch moves the defines out of the .c file and into the header file. A comment for the diode is also cleaned up while this code is touched. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio

[PATCH 00/13] iio: tsl2x7x: staging cleanups

2018-04-20 Thread Brian Masney
time to wrap this up next week. Brian Masney (13): staging: iio: tsl2x7x: move integration_time* attributes to IIO_INTENSITY channel staging: iio: tsl2x7x: use GPL-2.0+ SPDX license identifier staging: iio: tsl2x7x: don't return error in IRQ handler staging: iio: tsl2x7x: simplify

[PATCH 06/13] staging: iio: tsl2x7x: simplify tsl2x7x_write_interrupt_config return

2018-04-20 Thread Brian Masney
tsl2x7x_write_interrupt_config() has an unnecessary return value check at the end of the function. This patch changes the function to just return the value from the call to tsl2x7x_invoke_change(). Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x

[PATCH 03/13] staging: iio: tsl2x7x: don't return error in IRQ handler

2018-04-20 Thread Brian Masney
tsl2x7x_event_handler() could return an error and this could cause the interrupt to remain masked. We shouldn't return an error in the interrupt handler so this patch always returns IRQ_HANDLED. An error will be logged if one occurs. Signed-off-by: Brian Masney <masn...@onstation.

[PATCH 02/13] staging: iio: tsl2x7x: use GPL-2.0+ SPDX license identifier

2018-04-20 Thread Brian Masney
The summary text for the GPL is not needed since the SPDX identifier is a legally binding shorthand that can be used instead. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 10 +- drivers/staging/iio/light/tsl2x7x.h | 14 +--

[PATCH 3/4] staging: iio: tsl2x7x: use either direction for IIO_EV_INFO_{ENABLE, PERIOD}

2018-03-24 Thread Brian Masney
: in_intensity0_thresh_either_en in_intensity0_thresh_either_period in_intensity0_thresh_falling_value in_intensity0_thresh_rising_value in_proximity0_thresh_either_en in_proximity0_thresh_either_period in_proximity0_thresh_falling_value in_proximity0_thresh_rising_value Signed-off-by: Brian Masney

[PATCH 1/4] staging: iio: tsl2x7x: use auto increment I2C protocol

2018-03-24 Thread Brian Masney
be found at https://www.i2c-bus.org/auto-increment/. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 100 1 file changed, 67 insertions(+), 33 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7

[PATCH 2/4] staging: iio: tsl2x7x: move IIO_CHAN_INFO_CALIB{SCALE, BIAS} to IIO_LIGHT channel

2018-03-24 Thread Brian Masney
in_intensity0_raw in_intensity1_raw in_proximity0_calibrate in_proximity0_calibscale in_proximity0_calibscale_available in_proximity0_raw name of_node power subsystem uevent Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 24 1 file c

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

2018-03-24 Thread Brian Masney
Move the tsl2x7x driver out of staging and into mainline. Signed-off-by: Brian Masney <masn...@onstation.org> --- Note: I intentionally ran git format-patch with --no-renames since Jonathan likes to see the whole files in the email body for staging graduation patches. The #include &quo

[PATCH 0/4] staging: iio: tsl2x7x: move out of staging

2018-03-24 Thread Brian Masney
Here is a patch series to move the tsl2x7x driver out of staging and into mainline. Driver was tested using various TSL2X7X devices on a Raspberry Pi 2. Datasheet for the TSl2772: https://ams.com/eng/content/download/291503/1066377/file/TSL2772_DS000181_2-00.pdf Brian Masney (4): staging: iio

[PATCH 09/11] staging: iio: tsl2x7x: remove ch0 and ch1 variables from tsl2x7x_get_lux()

2018-03-21 Thread Brian Masney
Remove the ch0 and ch1 variables from tsl2x7x_get_lux() and write those values directly into the chip->als_cur_info.als_ch0 and chip->als_cur_info.als_ch01 variables. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 21 ++---

[PATCH 08/11] staging: iio: tsl2x7x: remove unused variables from tsl2x7x_get_lux()

2018-03-21 Thread Brian Masney
tsl2x7x_get_lux() has a ch0lux and ch1lux variables that are not used so this patch removes them. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7

[PATCH 11/11] staging: iio: tsl2x7x: add copyright

2018-03-21 Thread Brian Masney
Add Brian Masney's copyright and to the list of module authors for all of the staging cleanups. This patch also update's Jon Brenner's current work email address since AMS now owns TAOS. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 4 +++-

[PATCH 04/11] staging: iio: tsl2x7x: simplify tsl2x7x_prox_cal()

2018-03-21 Thread Brian Masney
routine. - Run iio_event_monitor. - Verify that a proximity event is triggered when my hand comes anywhere between the sensor and where I performed the calibration routine. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c

[PATCH 06/11] staging: iio: tsl2x7x: make logging consistent and correct newlines

2018-03-21 Thread Brian Masney
This patch updates all of the logging commands so that they are consistent with the other messages, includes __func__ in the message, and all of the messages include newlines. This patch also removes some debug log messages. Signed-off-by: Brian Masney <masn...@onstation.org> --- Changes si

[PATCH 10/11] staging: iio: tsl2x7x: put local variables in reverse Christmas tree order

2018-03-21 Thread Brian Masney
This patch ensures that all of the local variable declarations are in reverse Christmas tree order where possible to increase code readability. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 21 - 1 file changed, 8 inse

[PATCH 05/11] staging: iio: tsl2x7x: split out als and prox interrupt settings

2018-03-21 Thread Brian Masney
. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 64 - drivers/staging/iio/light/tsl2x7x.h | 7 ++-- 2 files changed, 24 insertions(+), 47 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/d

[PATCH 00/11] staging: iio: tsl2x7x: staging cleanups

2018-03-21 Thread Brian Masney
alling_value in_intensity0_thresh_rising_en in_intensity0_thresh_rising_value in_proximity0_thresh_either_period in_proximity0_thresh_falling_en in_proximity0_thresh_falling_value in_proximity0_thresh_rising_en in_proximity0_thresh_rising_value Brian Masney (11): staging: iio: tsl2x7x: remove unnecessary code

[PATCH 01/11] staging: iio: tsl2x7x: remove unnecessary code

2018-03-21 Thread Brian Masney
ex_trylock(), but that is no longer the case. This patch also removes a comment that is no longer relevant about returning the last sample. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/s

[PATCH 03/11] staging: iio: tsl2x7x: no need to clear interrupt flag when getting lux

2018-03-21 Thread Brian Masney
tsl2x7x_get_lux() does not need to clear the interrupt flag when querying the ALS. The interrupt flag is cleared in tsl2x7x_event_handler(). This patches removes the unnecessary code. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 4

[PATCH 02/11] staging: iio: tsl2x7x: correct interrupt handler trigger

2018-03-21 Thread Brian Masney
tion: either ... Event: time: 1478193463020270185, type: illuminance, channel: 0, evtype: thresh, direction: either ... Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/ligh

[PATCH 07/11] staging: iio: tsl2x7x: split out als and prox persistence settings

2018-03-21 Thread Brian Masney
-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 24 +++- drivers/staging/iio/light/tsl2x7x.h | 9 ++--- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio

[PATCH 00/12] staging cleanups

2018-03-03 Thread Brian Masney
of the supported devices. The rest of the patches are not that interesting and either reduce duplicate code, add error handling, or other minor cosmetic changes. Brian Masney (12): staging: iio: tsl2x7x: remove power functions from tsl2X7X_platform_data staging: iio: tsl2x7x: add common function

[PATCH 10/12] staging: iio: tsl2x7x: make logging consistent and correct newlines

2018-03-03 Thread Brian Masney
This patch updates all of the logging commands so that they are consistent with the other messages, includes __func__ in the message, and all of the messages include newlines. This patch also removes some debug log messages from tsl2x7x_prox_cal(). Signed-off-by: Brian Masney <m

[PATCH 08/12] staging: iio: tsl2x7x: add error handling to tsl2x7x_prox_cal()

2018-03-03 Thread Brian Masney
tsl2x7x_prox_cal() did not have any error checks. This patch adds the missing error handling and ensures that any errors are reported to user space via in_proximity0_calibrate_store(). Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.

[PATCH 03/12] staging: iio: tsl2x7x: add common function for reading chip status

2018-03-03 Thread Brian Masney
-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 40 ++--- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c index c02db03ef369..6bb622

[PATCH 09/12] staging: iio: tsl2x7x: add missing error checks

2018-03-03 Thread Brian Masney
The functions in_illuminance0_calibrate_store() and in_illuminance0_lux_table_store() did not have complete error handling in place. This patch adds the missing error handling. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 14 ++

[PATCH 12/12] staging: iio: tsl2x7x: make proximity sensor function correctly

2018-03-03 Thread Brian Masney
0 into those bits. Verified that the proximity sensor now works correctly on a TSL2771 hooked up to a Raspberry Pi 2. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 25 ++--- drivers/staging/iio/light/tsl2x7x.h | 2 ++ 2

[PATCH 02/12] staging: iio: tsl2x7x: add common function for clearing interrupts

2018-03-03 Thread Brian Masney
There were three places where the same chunk of code was used to clear interrupts. This patch creates a common function tsl2x7x_clear_interrupts() to reduce duplicate code. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.

[PATCH 05/12] staging: iio: tsl2x7x: convert mutex_trylock() to mutex_lock()

2018-03-03 Thread Brian Masney
The driver uses mutex_lock() and mutex_trylock() in several places. Convert the mutex_trylock() to mutex_lock() for consistency with other IIO light drivers in mainline. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 9 ++--- 1 file chan

[PATCH 07/12] staging: iio: tsl2x7x: correct 'Avoid CamelCase' warning from checkpatch

2018-03-03 Thread Brian Masney
The statP and calP variables triggered an 'Avoid CamelCase' warning from checkpatch.pl. This patch renames these variables to stat and cal to fix this warning. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 26 +-

[PATCH 04/12] staging: iio: tsl2x7x: add common function for writing to the control register

2018-03-03 Thread Brian Masney
. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 54 + 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c index 6bb622

[PATCH 06/12] staging: iio: tsl2x7x: correctly return errors in tsl2x7x_get_prox()

2018-03-03 Thread Brian Masney
. The -EINVAL error code is for an unexpected value in the register. This patch also corrects an unnecessary word wrap in the call to le16_to_cpup() while changes are being made to this code. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.

[PATCH 11/12] staging: iio: tsl2x7x: remove unnecessary sysfs attribute

2018-03-03 Thread Brian Masney
-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c index fb91c46c8747..8c29a52153c1 100644 --- a/drivers/staging/iio/light/tsl2x7x.c

[PATCH 01/12] staging: iio: tsl2x7x: remove power functions from tsl2X7X_platform_data

2018-03-03 Thread Brian Masney
in the mainline kernel. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 18 -- drivers/staging/iio/light/tsl2x7x.h | 4 2 files changed, 22 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio

[PATCH 00/13] staging: iio: tsl2x7x: staging cleanups

2017-10-19 Thread Brian Masney
code cleanups to improve code readability that will be required for a staging graduation: - Convert in_proximity0_calibscale_available to IIO_CONST_ATTR - Remove unused structures - Sort #includes - Remove unnecessary parentheses - Code alignment cleanups Brian Masney (13): staging: iio: tsl2x7x

[PATCH 10/13] staging: iio: tsl2x7x: rename power defines to improve code readability

2017-10-19 Thread Brian Masney
The LED power defines are named like TSL2X7X_mAXXX. Rename these values to TSL2X7X_XXX_mA to improve code readability. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff

[PATCH 09/13] staging: iio: tsl2x7x: correct alignment of parenthesis

2017-10-19 Thread Brian Masney
of that sysfs attribute. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c

[PATCH 03/13] staging: iio: tsl2x7x: sort #includes

2017-10-19 Thread Brian Masney
Sort the #include statements for increased code readability. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio

[PATCH 05/13] staging: iio: tsl2x7x: changed #defines to be aligned on the same column

2017-10-19 Thread Brian Masney
on the same column to increase code readability. This patch also removes the unnecessary parentheses around the value of TSL2X7X_MAX_TIMER_CNT. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 132 ++-- 1 file chang

[PATCH 04/13] staging: iio: tsl2x7x: remove unnecessary struct iio_dev definition

2017-10-19 Thread Brian Masney
tsl2x7x.h has a blank definition for 'struct iio_dev' that is not needed. This patch removes that definition. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7

[PATCH 11/13] staging: iio: tsl2x7x: fix alignment of break statements

2017-10-19 Thread Brian Masney
Correct the alignment of the break statements to match the alignment of the rest of the code within the case statements. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d

[PATCH 01/13] staging: iio: tsl2x7x: migrate *_thresh_period sysfs attributes to iio_event_spec

2017-10-19 Thread Brian Masney
The sysfs attributes in_intensity0_thresh_period and in_proximity0_thresh_period are currently directly created by the driver. This patch migrates the creation of these sysfs attributes from the driver to using the IIO core via iio_event_spec. Signed-off-by: Brian Masney <masn...@onstation.

[PATCH 08/13] staging: iio: tsl2x7x: correct alignment of parenthesis

2017-10-19 Thread Brian Masney
variables in order to get the line short enough. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl

[PATCH 07/13] staging: iio: tsl2x7x: remove unnecessary parentheses

2017-10-19 Thread Brian Masney
This patch fixes the error 'Unnecessary parentheses around 'XXX' from checkpatch.pl. It also fixes several other places with unnecessary parentheses that checkpatch.pl did not detect. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.

[PATCH 06/13] staging: iio: tsl2x7x: convert in_proximity0_calibscale_available to use IIO_CONST_ATTR

2017-10-19 Thread Brian Masney
The sysfs attribute in_proximity0_calibscale_available is currently created by using DEVICE_ATTR_RO(). Convert this over to use IIO_CONST_ATTR(). Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 15 --- 1 file changed, 4 insertions(

[PATCH 13/13] staging: iio: tsl2x7x: add goto for TSL2X7X_LUX_CALC_OVER_FLOW

2017-10-19 Thread Brian Masney
This patch adds a return_max label for the two cases that need to set the lux to TSL2X7X_LUX_CALC_OVER_FLOW and return. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/d

[PATCH 12/13] staging: iio: tsl2x7x: put function definitions on a single line

2017-10-19 Thread Brian Masney
The functions tsl2x7x_invoke_change() and tsl2x7x_prox_calculate() are short enough that the return value and static declaration can be moved onto the same line with the function name. This patch makes that change to increase code readability. Signed-off-by: Brian Masney <masn...@onstation.

[PATCH 02/13] staging: iio: tsl2x7x: remove unused tsl2x7x_parse_result structure

2017-10-19 Thread Brian Masney
The structure tsl2x7x_parse_result is not used so this patch removes its definition. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/stagi

Re: [PATCH 3/3] staging: iio: tsl2x7x: migrate *_thresh_period sysfs attributes to iio_event_spec

2017-10-01 Thread Brian Masney
On Sun, Oct 01, 2017 at 11:14:46AM +0100, Jonathan Cameron wrote: > On Fri, 29 Sep 2017 21:09:21 -0400 > Brian Masney <masn...@onstation.org> wrote: > > > The sysfs attributes in_intensity0_thresh_period and > > in_proximity0_thresh_period are currently dir

[PATCH 3/3] staging: iio: tsl2x7x: migrate *_thresh_period sysfs attributes to iio_event_spec

2017-09-29 Thread Brian Masney
The sysfs attributes in_intensity0_thresh_period and in_proximity0_thresh_period are currently directly created by the driver. This patch migrates the creation of these sysfs attributes from the driver to using the IIO core via iio_event_spec. Signed-off-by: Brian Masney <masn...@onstation.

[PATCH 0/3] staging: iio: tsl2x7x: staging cleanups

2017-09-29 Thread Brian Masney
./in_intensity0_raw ./in_intensity1_raw ./in_proximity0_calibrate ./in_proximity0_raw ./name ./power/autosuspend_delay_ms ./power/control ./power/runtime_active_time ./power/runtime_status ./power/runtime_suspended_time ./uevent Brian Masney (3): staging: iio: tsl2x7x: rename tsl2x7x_settings variable

[PATCH 2/3] staging: iio: tsl2x7x: migrate in_illuminance0_integration_time sysfs attribute to iio_chan_spec

2017-09-29 Thread Brian Masney
The driver explicitly creates the in_illuminance0_integration_time sysfs attribute outside the IIO core. This attribute is available in the IIO core so this patches migrates the attribute to be created by the iio_chan_spec. Signed-off-by: Brian Masney <masn...@onstation.org> --- Changes si

[PATCH 1/3] staging: iio: tsl2x7x: rename tsl2x7x_settings variable to settings

2017-09-29 Thread Brian Masney
-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 183 +--- 1 file changed, 85 insertions(+), 98 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c index d9defc

Re: [PATCH v2] staging: iio: tsl2x7x: clean up limit checks

2017-09-15 Thread Brian Masney
LUX_TABLE_SZ define instead of using > the magic number 3. I declared the default tables using that define > to hopefully signal to future programmers that if they want to use a > different size they have to update all the related code. > >

Re: [PATCH] iio staging: tsl2x7x: clean up limit checks

2017-09-05 Thread Brian Masney
On Tue, Sep 05, 2017 at 05:02:55PM -0400, Brian Masney wrote: > On Tue, Sep 05, 2017 at 05:58:54PM +0300, Dan Carpenter wrote: > > On Sun, Sep 03, 2017 at 10:12:46PM -0400, Brian Masney wrote: > > > On Sun, Sep 03, 2017 at 12:35:05PM +0100, Jonathan Cameron wrote: > > >

Re: [PATCH] iio staging: tsl2x7x: clean up limit checks

2017-09-05 Thread Brian Masney
On Tue, Sep 05, 2017 at 05:58:54PM +0300, Dan Carpenter wrote: > On Sun, Sep 03, 2017 at 10:12:46PM -0400, Brian Masney wrote: > > On Sun, Sep 03, 2017 at 12:35:05PM +0100, Jonathan Cameron wrote: > > > On Mon, 21 Aug 2017 13:11:03 +0300 > > > Dan Carpenter <d

Re: [PATCH] iio staging: tsl2x7x: clean up limit checks

2017-09-03 Thread Brian Masney
On Sun, Sep 03, 2017 at 12:35:05PM +0100, Jonathan Cameron wrote: > On Mon, 21 Aug 2017 13:11:03 +0300 > Dan Carpenter wrote: > > > The second part of this patch is probably the most interesting. We > > use "TSL2X7X_MAX_LUX_TABLE_SIZE * 3" as the limit instead of just

[PATCH v2 9/9] staging: iio: tsl2x7x: check return value from tsl2x7x_invoke_change()

2017-07-06 Thread Brian Masney
would attempt to turn the chip off and incorrectly return success. The code to power off the chip is removed by this patch since we should fail fast. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 55 +

[PATCH v2 6/9] staging: iio: tsl2x7x: refactor {read, write}_event_value to allow handling multiple iio_event_infos

2017-07-06 Thread Brian Masney
by iio_event_spec. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 157 +--- 1 file changed, 90 insertions(+), 67 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c index 5

[PATCH v2 8/9] staging: iio: tsl2x7x: migrate in_illuminance0_integration_time sysfs attribute to iio_chan_spec

2017-07-06 Thread Brian Masney
The driver explicitly creates the in_illuminance0_integration_time sysfs attribute outside the IIO core. This attribute is available in the IIO core so this patches migrates the attribute to be created by the iio_chan_spec. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/s

[PATCH v2 4/9] staging: iio: tsl2x7x: remove tsl2x7x_i2c_read()

2017-07-06 Thread Brian Masney
(). Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 71 - 1 file changed, 22 insertions(+), 49 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c index 95ed7cc6..6

[PATCH v2 5/9] staging: iio: tsl2x7x: cleaned up i2c calls in tsl2x7x_als_calibrate()

2017-07-06 Thread Brian Masney
returned -1 if the ADC was not enabled and this patch changes that return value to -EINVAL. Signed-off-by: Brian Masney <masn...@onstation.org> --- drivers/staging/iio/light/tsl2x7x.c | 34 -- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/d

[PATCH v2 7/9] staging: iio: tsl2x7x: use usleep_range() instead of mdelay()

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

[PATCH v2 2/9] staging: iio: tsl2x7x: add device tree documentation

2017-07-06 Thread Brian Masney
Add device tree documentation for the tsl2x7x IIO driver. Signed-off-by: Brian Masney <masn...@onstation.org> CC: Rob Herring <robh...@kernel.org> CC: Mark Rutland <mark.rutl...@arm.com> CC: devicet...@vger.kernel.org --- Documentation/devicetree/bindings/trivial-devices.txt

  1   2   3   4   >