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

2017-09-15 Thread Brian Masney
he TSL2X7X_DEF_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. > > Signed-off-by: Dan Carpente

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

2017-09-29 Thread Brian Masney
rove code readability. Signed-off-by: Brian Masney --- 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 d9defc8ece83..e34

[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 --- drivers/staging/iio

[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 to

[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 --- Changes since v1 (Jul 9 2017): - Use

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 wrote: > > > The sysfs attributes in_intensity0_thresh_period and > > in_proximity0_thresh_period are currently directly created by the driver. > &

[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 --- drivers/staging/iio/light/tsl2x7x.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c index

[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 --- drivers/staging/iio/light/tsl2x7x.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff

[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 --- drivers/staging/iio/light/tsl2x7x.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/iio/light

[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 --- drivers/staging/iio

[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 --- 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/tsl2x7x.c index 6cc89cd6505e

[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 --- drivers/staging/iio/light/tsl2x7x.c | 16 1

[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 --- drivers/staging/iio/light/tsl2x7x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/light

[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 --- drivers/staging/iio/light/tsl2x7x.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.h b/drivers/staging

[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 --- Changes since v1

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

2017-10-19 Thread Brian Masney
n 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 --- drivers/staging/iio/light/tsl2x7x.c | 132 ++-- 1 file changed, 66 insertions(+), 66 dele

[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 --- drivers/staging/iio/light/tsl2x7x.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/iio/light

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

2017-10-19 Thread Brian Masney
length of that sysfs attribute. Signed-off-by: Brian Masney --- 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 index 88

[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 --- 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/light/tsl2x7x.c index

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

2018-04-20 Thread Brian Masney
Hopefully I'll have 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 s

[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 --- drivers/staging/iio/light/tsl2x7x.c | 7 +-- 1 file changed

[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 --- drivers/staging/iio/

[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 --- drivers/staging/iio/light/tsl2x7x.c | 10 +- drivers/staging/iio/light/tsl2x7x.h | 14 +- 2 files changed, 2

[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 --- drivers/staging/iio/light/tsl2x7x.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light

[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 --- drivers/staging/iio/light/tsl2x7x.c | 11 +-- 1 file changed, 5 insertions(+), 6

[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 --- drivers/staging/iio/light/tsl2x7x.c | 12

[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 --- drivers/staging/iio/light/tsl2x7x.c | 59 + drivers/staging/iio/light/tsl2x7x.h | 48 +++--- 2 files changed, 51 insertions(+), 56 deletions(-) diff --git a/drivers

[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 --- drivers/staging/iio/light/tsl2x7x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/iio

[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 --- drivers/staging/iio/light/tsl2x7x.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions

[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 --- drivers/staging/iio/light/tsl2x7x.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff

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

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

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

2018-04-20 Thread Brian Masney
als_prox_config since ALS settings can be stored here as well. Signed-off-by: Brian Masney --- 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/staging/iio/light/tsl2x7x.c b

[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 --- drivers/staging/iio/light/tsl2x7x.c | 25

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 wrote: > > > The summary text for the GPL is not needed since the SPDX identifier > > is a legally binding shorthand that can be used instead. > >

[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 --- drivers/staging/iio/light/tsl2x7x.c | 11 +-- drivers/staging/iio/light/tsl2x7x.h | 15 +-- 2 files changed, 2

[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 --- drivers/staging/iio/light/tsl2x7x.c | 46 - 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/drivers

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

2018-05-03 Thread Brian Masney
info structure members. Signed-off-by: Brian Masney --- 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/tsl2x7x.c index b4d77f65ca12

[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 --- 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 100644 --- a/drivers/staging/iio

[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 --- drivers/staging/iio/light/tsl2x7x.c | 28

[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 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 --- I debated whether or not this change should even be included. I feel pretty

[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 --- drivers/iio/light/Kconfig | 8 drivers/iio/light/Makefile | 1 + drivers/{staging => }/iio/light/tsl2772.c |

[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 --- drivers/staging/iio/light/tsl2x7x.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b

[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 --- 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/tsl2x7x.c b/drivers/staging/iio

[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 --- drivers/staging/iio/light/tsl2x7x.c | 174 drivers/stagi

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

2018-05-03 Thread Brian Masney
. Signed-off-by: Brian Masney --- 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/{tsl2x7x.h => tsl2772.h} | 48

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

2018-05-03 Thread Brian Masney
light 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 */ #include #include #include #in

[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 --- drivers/staging/iio/light/tsl2x7x.c | 93 ++--- 1 file changed, 76 insertions(+), 17 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c

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

2018-05-10 Thread Brian Masney
_3-00.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

[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 --- drivers/staging/iio/light/tsl2x7x.c | 22 +++--- drivers/staging/iio/light/tsl2x7x.h | 1 - 2 files changed, 11 insertions(+), 12 deletions(-) diff

[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 --- drivers/staging/iio/light/tsl2x7x.c

[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 --- 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/staging/iio/light/tsl2x7x.c +++ b

[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 --- drivers/staging/iio/light/tsl2x7x.c | 49 - 1 file changed, 16 insertions(+), 33 deletions(-) diff

[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 --- 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/tsl2x7x.c b/drivers/staging/iio

[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 --- drivers/staging/iio/light/tsl2x7x.c | 61 ++--- 1 file changed, 16 insertions(+), 45 deletions(-) diff --git a

[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 --- drivers/staging/iio/light/Kconfig | 2 +- drivers/staging/iio/light/Makefile | 2 +- dr

[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 --- drivers/iio/light/Kconfig | 8 drivers/iio/light/Makefile | 1 + drivers/{staging => }/iio/light/tsl2772.c |

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

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 wrote: > > > On Thu, May 10, 2018 at 08:12:23PM -0400, Brian Masney wrote: > > > Move the tsl2772 driver out of staging and into mainline. > > &

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

2017-04-24 Thread Brian Masney
to you on this driver. I got side tracked with other projects. Brian Masney (2): staging: iio: isl29028: correct proximity sleep times staging: iio: isl29028: move out of staging drivers/iio/light/Kconfig| 10 + drivers/iio/light/Makefile | 1 + drivers/iio/light

[PATCH v3 1/2] staging: iio: isl29028: correct proximity sleep times

2017-04-24 Thread Brian Masney
the _available sysfs attribute. The original code showed the value 83 that corresponds to the sleep time 12 ms. The data sheet actually lists 12.5 ms as the sleep time, so the proximity frequency was updated to 80. Signed-off-by: Brian Masney --- drivers/staging/iio/light/isl29028.c | 70

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

2017-04-24 Thread Brian Masney
Move ISL29028 ALS / Proximity Sensor out of staging and into mainline. Signed-off-by: Brian Masney --- drivers/iio/light/Kconfig| 10 + drivers/iio/light/Makefile | 1 + drivers/iio/light/isl29028.c | 723 +++ drivers/staging/iio

Re: [PATCH] staging: iio: isl29028: add isl29030 support

2017-04-28 Thread Brian Masney
On Fri, Apr 28, 2017 at 05:55:58PM +0200, Sebastian Reichel wrote: > isl29030 is basically the same chip. The only difference > is the chip's first pin. For isl29028 its named ADDR0 and > can be used to change the chip's i2c address. For isl29030 > on the other hand that pin is named Ials and is an

[PATCH 1/2] staging: iio: tsl2x7x: rename driver for consistency with other IIO light drivers

2017-05-04 Thread Brian Masney
This patch renames the tsl2x7x_core.c file to tsl2x7x.c so that the naming convention is consistent with other IIO light drivers outside of staging. Signed-off-by: Brian Masney --- drivers/staging/iio/light/Makefile | 2 +- drivers/staging/iio/light/{tsl2x7x_core.c

[PATCH 2/2] staging: iio: tsl2x7x: remove header file

2017-05-04 Thread Brian Masney
There is a tsl2x7x.h header that is only used by tsl2x7x.c. This patch moves the contents of the header file into the C code with the driver. Signed-off-by: Brian Masney --- drivers/staging/iio/light/tsl2x7x.c | 76 ++- drivers/staging/iio/light/tsl2x7x.h | 100

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

2017-05-04 Thread Brian Masney
The two patches in this series begin my work to move this driver out of staging. Before I start working on the meat of the changes that are necessary for a staging graduation, I want to get these two trivial patches out and merged first in case there are any concerns with these changes. Brian

Re: [PATCH v3] staging: iio: light: Replace symbolic permissions as per coding style

2017-05-20 Thread Brian Masney
On Sat, May 20, 2017 at 06:55:02PM +0100, Jonathan Cameron wrote: > On 19/05/17 10:37, surenderpols...@gmail.com wrote: > >From: Surender Polsani > > > >Fixed the following checkpatch.pl warnings: > >octal permissions are more preferable than symbolic permissions > > > >Replaced DEVICE_ATTR family

Re: ks7010 firmware upload fail

2017-06-05 Thread Brian Masney
On Mon, Jun 05, 2017 at 08:24:44PM +1000, Tobin C. Harding wrote: > On Mon, Jun 05, 2017 at 09:22:12AM +0200, Wolfram Sang wrote: > > Tobin, > > > > > My question is should I be digging further into the MMC code or be doing > > > something else with the driver code? > > > > So, you haven't found

[PATCH 01/19] staging: iio: isl29028: remove nested if statements

2016-12-03 Thread Brian Masney
: Brian Masney --- drivers/staging/iio/light/isl29028.c | 30 ++ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c index aa413e5..4e35d00 100644 --- a/drivers/staging/iio/light

[PATCH 02/19] staging: iio: isl29028: remove enable flag from isl29028_enable_proximity()

2016-12-03 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 --- drivers/staging/iio/light/isl29028.c | 10 -- 1

[PATCH 05/19] staging: iio: isl29028: made alignment of #defines consistent

2016-12-03 Thread Brian Masney
The alignment of the #defines at the top of the file is not consistent. This changes all of the defines to use consistent alignment to improve the code readability. Signed-off-by: Brian Masney --- drivers/staging/iio/light/isl29028.c | 42 ++-- 1 file changed, 21

[PATCH 04/19] staging: iio: isl29028: add power management support

2016-12-03 Thread Brian Masney
This patch adds power management support to the isl29028 driver. Signed-off-by: Brian Masney --- drivers/staging/iio/light/isl29028.c | 59 1 file changed, 59 insertions(+) diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light

[PATCH 00/19] staging: iio: isl29028: staging cleanups

2016-12-03 Thread Brian Masney
g. Looking through the data sheet, and the git commits since the driver was first introduced into staging, everything in the driver looks correct so I think this is operator error on my part. Brian Masney (19): staging: iio: isl29028: remove nested if statements staging: iio: isl29028: remove enable

[PATCH 06/19] staging: iio: isl29028: made alignment of variables in struct isl29028_chip consistent

2016-12-03 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 --- drivers/staging/iio/light/isl29028.c | 10 +- 1 file changed, 5 insertions(+), 5

[PATCH 03/19] staging: iio: isl29028: remove chip test and defaults from isl29028_chip_init()

2016-12-03 Thread Brian Masney
isl29028_chip_init_and_power_on(). Signed-off-by: Brian Masney --- drivers/staging/iio/light/isl29028.c | 42 +++- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c index c8e234d

[PATCH 13/19] staging: iio: isl29028: move failure logging into isl29028_set_proxim_sampling()

2016-12-03 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 --- drivers/staging/iio/light/isl29028.c | 28

[PATCH 07/19] staging: iio: isl29028: fix alignment of function arguments

2016-12-03 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 --- drivers/staging/iio/light

[PATCH 17/19] staging: iio: isl29028: remove out of memory log message

2016-12-03 Thread Brian Masney
ssary. Signed-off-by: Brian Masney --- 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 3f01ad1..bda5183 100644 --- a/drivers/staging/iio/light/isl29028.c +++ b/dr

[PATCH 19/19] staging: iio: isl29028: remove legacy device tree binding

2016-12-03 Thread Brian Masney
pport this binding indefinitely. Signed-off-by: Brian Masney Cc: devicet...@vger.kernel.org Cc: Rob Herring Cc: Mark Rutland --- 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/light/isl29028.c ind

[PATCH 12/19] staging: iio: isl29028: fix comparison between signed and unsigned integers

2016-12-03 Thread Brian Masney
Fixed warning found by make W=2 to reduce the amount of build noise: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Brian Masney --- drivers/staging/iio/light/isl29028.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH 14/19] staging: iio: isl29028: move failure logging into isl29028_set_als_scale()

2016-12-03 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 --- drivers/staging/iio/light/isl29028.c | 23

[PATCH 10/19] staging: iio: isl29028: remove unused define ISL29028_DEV_ATTR

2016-12-03 Thread Brian Masney
The #define ISL29028_DEV_ATTR was not used so this patch removes the unnecessary code. Signed-off-by: Brian Masney --- 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/light/isl29028.c index

[PATCH 09/19] staging: iio: isl29028: change newlines to improve readability

2016-12-03 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 --- drivers/staging/iio/light/isl29028.c | 31 ++- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/drivers/staging/iio

[PATCH 16/19] staging: iio: isl29028: remove unnecessary error logging in isl29028_chip_init_and_power_on()

2016-12-03 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 --- drivers/staging

[PATCH 08/19] staging: iio: isl29028: combine isl29028_proxim_get() and isl29028_read_proxim()

2016-12-03 Thread Brian Masney
-off-by: Brian Masney --- 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 38027ee..fa2b283 100644 --- a/drivers/staging/iio/light

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

2016-12-03 Thread Brian Masney
The wording and style of the different error messages was not consistent. This patches makes the wording and style consistent throughout the driver. Signed-off-by: Brian Masney --- drivers/staging/iio/light/isl29028.c | 56 1 file changed, 32 insertions

[PATCH 18/19] staging: iio: isl29028: remove unnecessary parenthesis

2016-12-03 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 --- drivers/staging/iio/light/isl29028.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 11/19] staging: iio: isl29028: made column alignment in isl29028_channels consistent

2016-12-03 Thread Brian Masney
-off-by: Brian Masney --- drivers/staging/iio/light/isl29028.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c index 0e727ba..218d165 100644 --- a/drivers/staging/iio/light/isl29028.c +++ b

Re: [PATCH 12/19] staging: iio: isl29028: fix comparison between signed and unsigned integers

2016-12-05 Thread Brian Masney
On Mon, Dec 05, 2016 at 11:53:39PM +0300, Dan Carpenter wrote: > On Sat, Dec 03, 2016 at 09:19:36PM -0500, Brian Masney wrote: > > Fixed warning found by make W=2 to reduce the amount of build noise: > > > > warning: comparison between signed and unsigned integer expression

Re: [PATCH 02/19] staging: iio: isl29028: remove enable flag from isl29028_enable_proximity()

2017-01-14 Thread Brian Masney
On Sun, Dec 04, 2016 at 11:16:04AM +, Jonathan Cameron wrote: > On 04/12/16 02:19, Brian Masney wrote: > > 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 pat

[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 --- drivers/staging/iio/light/isl29028.c | 27

[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 --- 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/drivers/staging/iio/light

[PATCH v2 00/15] staging cleanups

2017-01-17 Thread Brian Masney
nable 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: isl

[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 --- drivers/staging/iio/light

[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 --- drivers/staging

[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 --- The device gets runtime power management support in the

[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 --- drivers/staging/iio/light/isl29028.c | 56 1 file changed, 32 insertions(+), 24

[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 --- drivers/staging/iio/light/isl29028.c | 31

[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 --- drivers/staging/iio/light/isl29028.c | 10 +- 1 file changed, 5 insertions(+), 5

  1   2   3   4   >