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

2016-10-09 Thread Jonathan Cameron
On 07/10/16 01:48, Brian Masney wrote: > 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 > --- > drivers/stagi

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

2016-10-09 Thread Jonathan Cameron
On 07/10/16 01:48, Brian Masney wrote: > Fix the following warnings from checkpatch: > > WARNING: DT compatible string "isil,isl29018" appears un-documented -- > check ./Documentation/devicetree/bindings/ > WARNING: DT compatible string "isil,isl29023" appears un-documented -- > check ./Documentat

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

2016-10-09 Thread Jonathan Cameron
On 09/10/16 09:43, Jonathan Cameron wrote: > On 07/10/16 01:48, Brian Masney wrote: >> 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_suppre

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

2016-10-09 Thread Jonathan Cameron
On 07/10/16 01:48, Brian Masney wrote: > Move ISL29018/ISL29023/ISL29035 driver out of staging into mainline. > > Signed-off-by: Brian Masney Time for a nitpick tastic review ;) The nature of a move out of staging patch is that we'll go over it with the level of fine toothed comb we apply to a n

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

2016-10-09 Thread Jonathan Cameron
On 07/10/16 01:48, Brian Masney wrote: > Rename CONFIG_SENSORS_ISL29018 to CONFIG_ISL29018 for consistency with > the other light drivers in mainline. > > Signed-off-by: Brian Masney I'm always a bit split on these. It would be lovely to tidy it up, but it may cause unnecessary breakage to peopl

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

2016-10-09 Thread Jonathan Cameron
On 09/10/16 11:35, Brian Masney wrote: > 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

Re: [PATCH v2 1/8] staging: iio: isl29018: add newlines to improve readability

2016-10-10 Thread Jonathan Cameron
On 10/10/16 08:19, Brian Masney wrote: > Add newlines to improve code readability in preparation for moving the > driver out of staging. > > Signed-off-by: Brian Masney Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > ---

Re: [PATCH v2 2/8] staging: iio: isl29018: fix poorly named function

2016-10-10 Thread Jonathan Cameron
On 10/10/16 08:19, Brian Masney wrote: > isl29035_detect() did not do chip detection. Move functionality directly > into isl29018_chip_init() to avoid naming confusion. It kind of does do detection (or at least verification). Key point is that it does other things as well. I added the word 'just'

Re: [PATCH v2 3/8] staging: iio: isl29018: fix multiline comment syntax

2016-10-10 Thread Jonathan Cameron
On 10/10/16 08:19, Brian Masney wrote: > Change multiline comments from: > > /* line1 > * line2 > * ... > */ > > to > > /* > * line1 > * line2 > * ... > */ > > Signed-off-by: Brian Masney Applied to the togreg branch of iio.git and pushed out as testing. Thanks, Jonathan > --- > driv

Re: [PATCH v2 4/8] staging: iio: isl29018: combine two return statements into one

2016-10-10 Thread Jonathan Cameron
On 10/10/16 08:19, Brian Masney wrote: > Use the return value from isl29018_set_integration_time() as the return > value for isl29018_chip_init() since this is the last piece of work > inside that function. > > Signed-off-by: Brian Masney Applied to the togreg branch of iio.git and pushed out as

Re: [PATCH v2 6/8] staging: iio: isl29018: rename description in Kconfig for consistency

2016-10-10 Thread Jonathan Cameron
On 10/10/16 08:20, Brian Masney wrote: > Rename description from "ISL 29018" to "Intersil 29018" in Kconfig for > consistency with other drivers in mainline. > > Signed-off-by: Brian Masney Applied. > --- > drivers/staging/iio/light/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH v2 5/8] staging: iio: isl29018: remove blank line for consistency

2016-10-10 Thread Jonathan Cameron
On 10/10/16 08:19, Brian Masney wrote: > Remove blank line between MODULE_DEVICE_TABLE() and its corresponding > structure for consistency with the other device table entries. > > Signed-off-by: Brian Masney Applied. Thanks, Jonathan > --- > drivers/staging/iio/light/isl29018.c | 1 - > 1 file

Re: [PATCH v2 7/8] staging: iio: isl29018: add ABI documentation for infrared suppression

2016-10-10 Thread Jonathan Cameron
On 10/10/16 08:20, Brian Masney wrote: > Add ABI 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 I'm going to let t

Re: [PATCH] Staging: iio: fix a MAINTAINERS entry

2016-10-11 Thread Jonathan Cameron
On 11/10/16 12:12, Dan Carpenter wrote: > The "drivers/" part of the path name was missing. > > Signed-off-by: Dan Carpenter Applied - thanks. Jonathan > > diff --git a/MAINTAINERS b/MAINTAINERS > index 0c7d973..63f15c9 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -779,7 +779,7 @@ S:

Re: [PATCH v2 7/8] staging: iio: isl29018: add ABI documentation for infrared suppression

2016-10-15 Thread Jonathan Cameron
On 10/10/16 21:57, Jonathan Cameron wrote: > On 10/10/16 08:20, Brian Masney wrote: >> Add ABI 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_suppre

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

2016-10-15 Thread Jonathan Cameron
On 10/10/16 08:20, Brian Masney wrote: > Move ISL29018/ISL29023/ISL29035 driver out of staging into mainline. > > Signed-off-by: Brian Masney Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks Brian for taking this one on and your hard

Re: [PATCH 3/7] iio: light: tsl2583: use DEVICE_ATTR_{RO, RW, WO} macros

2016-10-19 Thread Jonathan Cameron
On 19 October 2016 11:32:06 BST, Brian Masney wrote: >Use the DEVICE_ATTR_RO, IIO_DEVICE_ATTR_RW, and IIO_DEVICE_ATTR_WO >macros to create the device attributes. > >Signed-off-by: Brian Masney Hi Brian, One very quick comment. Driver should be using an iio_chan_spec array and relevant inf

Re: [PATCH 6/7] iio: light: tsl2583: add locking to sysfs *_store() functions

2016-10-22 Thread Jonathan Cameron
On 19/10/16 12:37, Dan Carpenter wrote: > I appologize for laughing, but I am still secretly amused in my heart. > > regards, > dan carpenter > Fewer beers or less caffeine for Dan! Key take away here is keep things simple. The gotos in my mind would actually have made sense, but I wouldn't do

Re: [PATCH 7/7] iio: light: tsl2583: fix concurrency issue in taos_get_lux()

2016-10-22 Thread Jonathan Cameron
On 19/10/16 11:32, Brian Masney wrote: > taos_get_lux() calls mutex_trylock(). If the lock could not be acquired, > then chip->als_cur_info.lux is returned. The issue is that this value > is updated while the mutex is held and could cause a half written value > to be returned to the caller. This pa

Re: [PATCH 3/7] iio: light: tsl2583: use DEVICE_ATTR_{RO, RW, WO} macros

2016-10-22 Thread Jonathan Cameron
On 19/10/16 14:11, Dan Carpenter wrote: > On Wed, Oct 19, 2016 at 09:08:30AM -0400, Brian Masney wrote: >> On Wed, Oct 19, 2016 at 02:26:27PM +0300, Dan Carpenter wrote: >>> What does illuminance0_ mean? Can we remove that? >> >> I left the names of the existing sysfs attributes intact to not brea

Re: [PATCH 1/7] iio: light: tsl2583: return proper error code

2016-10-22 Thread Jonathan Cameron
On 19/10/16 11:32, Brian Masney wrote: > taos_gain_store() and taos_als_calibrate() both have a code path where > -1 was returned. This patch changes the code so that a proper error code > is returned to make the code consistent with the error paths that are > present within those same functions. >

Re: [PATCH 14/28] iio: accel: sca3000_core: avoid potentially uninitialized variable

2016-10-23 Thread Jonathan Cameron
ed register values, > to ensure this cannot happen. > > Fixes: e0f3fc9b47e6 ("iio: accel: sca3000_core: implemented > IIO_CHAN_INFO_SAMP_FREQ") > Signed-off-by: Arnd Bergmann > Cc: Ico Doornekamp > Cc: Jonathan Cameron > --- > I submitted this on Sept 22, and Jonat

Re: [PATCH] staging: iio: cdc/ad7746: fix missing return value

2016-10-25 Thread Jonathan Cameron
On 25/10/16 16:56, Arnd Bergmann wrote: > As found by "gcc -Wmaybe-uninitialized", the latest change to the > driver lacked an initalization for the return code in one of the > added cases: > > drivers/staging/iio/cdc/ad7746.c: In function ‘ad7746_read_raw’: > drivers/staging/iio/cdc/ad7746.c:655:

Re: [PATCH] [v2] staging: iio: ad5933: avoid uninitialized variable in error case

2016-10-25 Thread Jonathan Cameron
On 24/10/16 16:22, Arnd Bergmann wrote: > The ad5933_i2c_read function returns an error code to indicate > whether it could read data or not. However ad5933_work() ignores > this return code and just accesses the data unconditionally, > which gets detected by gcc as a possible bug: > > drivers/sta

Re: [PATCH] [v2] staging: iio: ad5933: avoid uninitialized variable in error case

2016-10-25 Thread Jonathan Cameron
On 25/10/16 18:00, Lars-Peter Clausen wrote: > On 10/25/2016 06:57 PM, Jonathan Cameron wrote: >> On 24/10/16 16:22, Arnd Bergmann wrote: >>> The ad5933_i2c_read function returns an error code to indicate >>> whether it could read data or not. However ad5933_work() ignor

Re: [PATCH v3] staging: iio: cdc: ad7746: add additional config defines

2016-10-30 Thread Jonathan Cameron
On 28/10/16 09:26, Eva Rachel Retuya wrote: > Introduce defines for shifting and mask under the config register for > better readability. Also, introduce helper variables for index > calculation. > > Signed-off-by: Eva Rachel Retuya Looks good to me. Lars could you sanity check this one as well?

Re: [PATCH 01/10] staging: iio: tsl2583: add of_match table for device tree support

2016-10-30 Thread Jonathan Cameron
On 28/10/16 11:00, Brian Masney wrote: > Add device tree support for the tsl2583 IIO driver with no custom > properties. > > Signed-off-by: Brian Masney Trivial enough that I feel I can take this without an explicit devicetree ack. Of course one is always welcome if anyone gets a chance to look

Re: [PATCH 01/10] staging: iio: tsl2583: add of_match table for device tree support

2016-10-30 Thread Jonathan Cameron
On 30/10/16 17:43, Jonathan Cameron wrote: > On 28/10/16 11:00, Brian Masney wrote: >> Add device tree support for the tsl2583 IIO driver with no custom >> properties. >> >> Signed-off-by: Brian Masney > Trivial enough that I feel I can take this without an explici

Re: [PATCH 02/10] staging: iio: tsl2583: check for error code from i2c_smbus_read_byte()

2016-10-30 Thread Jonathan Cameron
On 28/10/16 11:00, Brian Masney wrote: > taos_i2c_read() and taos_als_calibrate() does not check to see if the > value returned by i2c_smbus_read_byte() was an error code. This patch > adds the appropriate error handling. > > Signed-off-by: Brian Masney Applied to the togreg branch of iio.git and

Re: [PATCH 03/10] staging: iio: tsl2583: return proper error code instead of -1

2016-10-30 Thread Jonathan Cameron
On 28/10/16 11:00, Brian Masney wrote: > taos_als_calibrate() has a code path where -1 is returned. This patch > changes the code so that a proper error code is returned. > > Signed-off-by: Brian Masney Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play

Re: [PATCH 04/10] staging: iio: tsl2583: remove redundant power_state sysfs attribute

2016-10-30 Thread Jonathan Cameron
On 28/10/16 11:00, Brian Masney wrote: > IIO devices have a /sys/bus/iio/devices/iio:deviceX/power/ directory > that allows viewing and controling various power parameters. The tsl2583 > driver also has an additional custom sysfs attribute named power_state > that is not needed. This patch removes

Re: [PATCH 05/10] staging: iio: tsl2583: check return values from taos_chip_{on,off}

2016-10-30 Thread Jonathan Cameron
On 28/10/16 11:00, Brian Masney wrote: > The return value from taos_chip_on() and taos_chip_off() was not > checked in taos_luxtable_store() and taos_probe(). This patch adds > proper error checking to these function calls. > > Signed-off-by: Brian Masney This does raise the question of whether w

Re: [PATCH 06/10] staging: iio: tsl2583: convert to use iio_chan_spec and {read,write}_raw

2016-10-30 Thread Jonathan Cameron
On 28/10/16 11:00, Brian Masney wrote: > The tsl2583 driver directly creates sysfs attributes that should instead > be created by the IIO core on behalf of the driver. This patch adds the > iio_chan_spec array, the relevant info_mask elements and the read_raw() > and write_raw() functions to take a

Re: [PATCH 07/10] staging: iio: tsl2583: convert illuminance0_calibscale sysfs attr to use iio_chan_spec

2016-10-30 Thread Jonathan Cameron
On 28/10/16 11:00, Brian Masney wrote: > The illuminance0_calibscale sysfs attribute is not currently created by > the IIO core. This patch adds the appropriate mask to iio_chan_spec, > along with the appropriate data handling in the read_raw() and > write_raw() functions, so that the sysfs attribu

Re: [PATCH 08/10] staging: iio: tsl2583: use IIO_*_ATTR* macros to create sysfs entries

2016-10-30 Thread Jonathan Cameron
On 28/10/16 11:00, Brian Masney wrote: > Use the IIO_CONST_ATTR, IIO_DEVICE_ATTR_RW, and IIO_DEVICE_ATTR_WO > macros for creating the in_illuminance_calibscale_available, > in_illuminance_integration_time_available, in_illuminance_input_target, > in_illuminance_calibrate, and in_illuminance_lux_tab

Re: [PATCH 09/10] staging: iio: tsl2583: add error code to sysfs store functions

2016-10-30 Thread Jonathan Cameron
On 28/10/16 11:00, Brian Masney wrote: > in_illuminance_input_target_store() and in_illuminance_calibrate_store() > validated the data from userspace, however it would not return an > error code to userspace if an invalid value was passed in. This patch > changes these functions so that they return

Re: [PATCH 10/10] staging: iio: tsl2583: add locking to sysfs attributes

2016-10-30 Thread Jonathan Cameron
On 28/10/16 11:00, Brian Masney wrote: > in_illuminance_input_target_show(), in_illuminance_input_target_store(), > in_illuminance_calibrate_store(), and in_illuminance_lux_table_store() > accesses data from the tsl2583_chip struct. Some of these fields can be > modified by other parts of the drive

Re: [PATCH v3] staging: iio: cdc: ad7746: add additional config defines

2016-10-30 Thread Jonathan Cameron
On 30/10/16 17:46, Lars-Peter Clausen wrote: > On 10/30/2016 06:41 PM, Jonathan Cameron wrote: >> On 28/10/16 09:26, Eva Rachel Retuya wrote: >>> Introduce defines for shifting and mask under the config register for >>> better readability. Also, introduce helper variable

Re: [PATCH 07/10] staging: iio: tsl2583: convert illuminance0_calibscale sysfs attr to use iio_chan_spec

2016-10-30 Thread Jonathan Cameron
On 30 October 2016 20:04:09 GMT+00:00, Brian Masney wrote: >On Sun, Oct 30, 2016 at 06:37:40PM +0000, Jonathan Cameron wrote: >> On 28/10/16 11:00, Brian Masney wrote: >> > The illuminance0_calibscale sysfs attribute is not currently >created by >> > the

Re: [PATCH v3] staging: iio: cdc: ad7746: add additional config defines

2016-11-01 Thread Jonathan Cameron
On 31/10/16 08:05, Eva Rachel Retuya wrote: > On Mon, Oct 31, 2016 at 03:49:01PM +0800, Eva Rachel Retuya wrote: >> On Sun, Oct 30, 2016 at 06:49:00PM +, Jonathan Cameron wrote: >>> On 30/10/16 17:46, Lars-Peter Clausen wrote: >>>> On 10/30/2016 06:41 PM, Jonathan

Re: [PATCH 1/6] staging: iio: set proper supply name to devm_regulator_get()

2016-11-05 Thread Jonathan Cameron
On 01/11/16 19:58, Lars-Peter Clausen wrote: > On 11/01/2016 05:03 AM, Matt Ranostay wrote: >> On Mon, Oct 31, 2016 at 10:04 AM, Eva Rachel Retuya >> wrote: >>> The name passed to devm_regulator_get() should match the name of the >>> supply as specified in the device datasheet. This makes it clea

Re: [PATCH 1/6] staging: iio: set proper supply name to devm_regulator_get()

2016-11-05 Thread Jonathan Cameron
On 05/11/16 12:58, Jonathan Cameron wrote: > On 01/11/16 19:58, Lars-Peter Clausen wrote: >> On 11/01/2016 05:03 AM, Matt Ranostay wrote: >>> On Mon, Oct 31, 2016 at 10:04 AM, Eva Rachel Retuya >>> wrote: >>>> The name passed to devm_regulator_get() shou

Re: [PATCH 1/6] staging: iio: set proper supply name to devm_regulator_get()

2016-11-05 Thread Jonathan Cameron
On 31/10/16 17:04, Eva Rachel Retuya wrote: > The name passed to devm_regulator_get() should match the name of the > supply as specified in the device datasheet. This makes it clear what > power supply is being referred to in case of presence of other > regulators. > > Currently, the supply name s

Re: [PATCH 2/6] staging: iio: rework regulator handling

2016-11-05 Thread Jonathan Cameron
On 31/10/16 17:04, Eva Rachel Retuya wrote: > Currently, the affected drivers ignore all errors from regulator_get(). > The way it is now, it also breaks probe deferral (EPROBE_DEFER). The > correct behavior is to propagate the error to the upper layers so they > can handle it accordingly. > > Rew

Re: [PATCH 3/6] staging: iio: ad7192: add DVdd regulator

2016-11-05 Thread Jonathan Cameron
On 31/10/16 17:04, Eva Rachel Retuya wrote: > The AD7190/AD7192/AD7193/AD7195 is supplied with two power sources: > AVdd as analog supply voltage and DVdd as digital supply voltage. > > Attempt to fetch and enable the regulator 'dvdd'. Bail out if any error > occurs. > > Suggested-by: Lars-Peter

Re: [PATCH 4/6] staging: iio: ad7192: rename regulator 'reg' to 'avdd'

2016-11-05 Thread Jonathan Cameron
On 31/10/16 17:04, Eva Rachel Retuya wrote: > Rename regulator 'reg' to 'avdd' so as to be clear what regulator it > stands for specifically. Also, update the goto label accordingly. > > Signed-off-by: Eva Rachel Retuya Applied. Thanks, Jonathan > --- > drivers/staging/iio/adc/ad7192.c | 22 ++

Re: [PATCH 5/6] staging: iio: ad9832: add DVDD regulator

2016-11-05 Thread Jonathan Cameron
On 31/10/16 17:04, Eva Rachel Retuya wrote: > The AD9832/AD9835 is supplied with two power sources: AVDD as analog > supply voltage and DVDD as digital supply voltage. > > Attempt to fetch and enable the regulator 'dvdd'. Bail out if any error > occurs. > > Suggested-by: Lars-Peter Clausen > Sig

Re: [PATCH 6/6] staging: iio: ad9832: clean-up regulator 'reg'

2016-11-05 Thread Jonathan Cameron
On 31/10/16 17:04, Eva Rachel Retuya wrote: > Rename regulator 'reg' to 'avdd' so as to be clear what regulator it > stands for specifically. Additionally, get rid of local variable 'reg' > and use direct assignment instead. Update also the goto label pertaining > to the avdd regulator during disab

Re: [PATCH 1/9] staging: iio: tsl2583: i2c_smbus_write_byte() / i2c_smbus_read_byte() migration

2016-11-06 Thread Jonathan Cameron
On 03/11/16 12:56, Brian Masney wrote: > There were several places where the driver would first call > i2c_smbus_write_byte() to select the register on the device, and then > call i2c_smbus_read_byte() to get the contents of that register. The > code would look roughly like: > > /* Select register

Re: [PATCH 1/9] staging: iio: tsl2583: i2c_smbus_write_byte() / i2c_smbus_read_byte() migration

2016-11-06 Thread Jonathan Cameron
On 03/11/16 12:56, Brian Masney wrote: > There were several places where the driver would first call > i2c_smbus_write_byte() to select the register on the device, and then > call i2c_smbus_read_byte() to get the contents of that register. The > code would look roughly like: > > /* Select register

Re: [PATCH 2/9] staging: iio: tsl2583: removed unused code from device probing

2016-11-06 Thread Jonathan Cameron
On 03/11/16 12:56, Brian Masney wrote: > taos_probe() queries the all of the sensor's registers and loads all of > the values into a buffer stored on the stack. Only the chip ID register > was actually used. Change the probe function to just query the chip ID > register on the device. > > Verified

Re: [PATCH 3/9] staging: iio: tsl2583: fixed ordering of comments

2016-11-06 Thread Jonathan Cameron
On 03/11/16 12:56, Brian Masney wrote: > in taos_defaults() > > The comments in taos_defaults() appear after the line of code > that they apply to. This patch moves the comments so that they appear > before the code. Some of the comments were updated to be more > informative. > > Signed-off-by: B

Re: [PATCH 4/9] staging: iio: tsl2583: remove redundant power off sequence in taos_chip_on()

2016-11-06 Thread Jonathan Cameron
On 03/11/16 12:56, Brian Masney wrote: > taos_chip_on() explicitly turns the sensor power on and then writes the > 8 registers that are stored in taos_config. The first register in > taos_config is the CONTROL register and the configuration is set to > turn the power off. The existing state sequenc

Re: [PATCH 5/9] staging: iio: tsl2583: don't shutdown chip when updating the lux table

2016-11-06 Thread Jonathan Cameron
On 03/11/16 12:56, Brian Masney wrote: > in_illuminance_lux_table_store() shuts down the chip, updates the > contents of the lux table, and then turns the chip back on. The values > in lux table are not used by the chip and are only used internally by > the driver. It is not necessary to change the

Re: [PATCH 6/9] staging: iio: tsl2583: remove redudant i2c call in taos_als_calibrate()

2016-11-06 Thread Jonathan Cameron
On 03/11/16 12:56, Brian Masney wrote: > taos_als_calibrate() queries the control register to determine if the > unit is powered on and has the ADC enabled. It then queries the same > register a second time to determine if the ADC reading is valid. This > patch removes the redundant i2c_smbus_read_

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 Jonathan Cameron
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. The chip would continue to use the old > parameters. Extracted out tsl2583_set_als_gain() and > tsl2583_

Re: [PATCH 8/9] staging: iio: tsl2583: check if chip is suspended in in_illuminance_calibrate_store

2016-11-06 Thread Jonathan Cameron
On 03/11/16 12:56, Brian Masney wrote: > 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 bei

Re: [PATCH 9/9] staging: iio: tsl2583: remove redundant write to the control register in taos_probe()

2016-11-06 Thread Jonathan Cameron
On 03/11/16 12:56, Brian Masney wrote: > taos_probe() calls i2c_smbus_write_byte() to select the control > register, however there is no subsequent calls to i2c_smbus_read_byte(). > The write call is unnecessary and is removed by this patch. > > Verified that the driver still functions correctly u

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 Jonathan Cameron
On 06/11/16 14:23, Brian Masney wrote: > On Sun, Nov 06, 2016 at 12:03:53PM +0000, 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 we

Re: [PATCH] staging: iio: ad9832: allocate data before using

2016-11-08 Thread Jonathan Cameron
On 08/11/16 14:00, Arnd Bergmann wrote: > The regulator changes assigned data to an uninitialized pointer: > > drivers/staging/iio/frequency/ad9832.c: In function 'ad9832_probe': > drivers/staging/iio/frequency/ad9832.c:214:11: error: 'st' may be used > uninitialized in this function [-Werror=may

Re: [PATCH] staging: iio: tsl2583: fix unused function warning

2016-11-08 Thread Jonathan Cameron
On 08/11/16 14:01, Arnd Bergmann wrote: > Removing a call to the taos_chip_off() makes it unused when CONFIG_PM > is disabled: > > drivers/staging/iio/light/tsl2583.c:438:12: error: ‘taos_chip_off’ defined > but not used [-Werror=unused-function] > > This removes all the #ifdef in this file, and

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

2016-11-08 Thread Jonathan Cameron
On 08/11/16 10:16, Brian Masney wrote: > 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 > --- > drivers/staging/iio/light/tsl2583.c | 3 ++- > 1 file changed, 2 insertions(

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

2016-11-08 Thread Jonathan Cameron
On 08/11/16 10:16, Brian Masney wrote: > Move tsl2580, tsl2581, tsl2583 driver out of staging into mainline. > > Signed-off-by: Brian Masney A few minor bits and bobs inline - might need to push one or two into relevant earlier patches, but was easier to just review the whole code in here as I'm

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

2016-11-12 Thread Jonathan Cameron
On 10/11/16 09:25, Brian Masney wrote: > taos_chip_on() reads an eight member array called taos_config > that contains the desired state of the chip's registers. Only four > of the registers actually need to be written to. The four that do > not need to be written to are for the {low,high} byte of

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

2016-11-12 Thread Jonathan Cameron
On 10/11/16 09:25, 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. The chip would continue to use the old > parameters. Extracted out tsl2583_set_als_gain() and > tsl2583_

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

2016-11-12 Thread Jonathan Cameron
On 10/11/16 09:25, Brian Masney wrote: > 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 bei

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

2016-11-12 Thread Jonathan Cameron
On 12/11/16 16:24, Jonathan Cameron wrote: > On 10/11/16 09:25, Brian Masney wrote: >> 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

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

2016-11-12 Thread Jonathan Cameron
On 10/11/16 09:25, Brian Masney wrote: > 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. >

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

2016-11-12 Thread Jonathan Cameron
On 10/11/16 09:25, Brian Masney wrote: > The device probing and the suspend/resume code checks a flag internal to > the driver that determines whether or not the chip is in a working > state. These checks are not needed. This patch removes the unnecessary > checks. It will do no harm to the hardwar

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

2016-11-12 Thread Jonathan Cameron
On 10/11/16 09:25, Brian Masney wrote: > 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 Better perhaps to

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

2016-11-12 Thread Jonathan Cameron
On 10/11/16 09:25, Brian Masney wrote: > in_illuminance_lux_table_store assumes that an unsigned int is 32 bits. > Replace this with sizeof(unsigned int). > > Signed-off-by: Brian Masney Preferred to use sizeof(value[0]) in case it changes type sometime in the future? > --- > drivers/staging/ii

Re: [PATCH v3 21/28] staging: iio: tsl2583: move from a global to a per device lux table

2016-11-12 Thread Jonathan Cameron
On 10/11/16 09:25, Brian Masney wrote: > The driver contains a global lux table that can be updated via sysfs. > Change this to a per device lux table so that multiple devices can be > hooked up to the same system with different lux tables. > > There are 10 entries, plus 1 for the termination segm

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

2016-11-12 Thread Jonathan Cameron
On 10/11/16 09:26, Brian Masney wrote: > Move tsl2580, tsl2581, tsl2583 driver out of staging into mainline. > > Signed-off-by: Brian Masney The rest of the series (that I haven't commented on) looks good to me. I'll pick them up once those few minor changes are sorted. Thanks, Jonathan > ---

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

2016-11-12 Thread Jonathan Cameron
On 12/11/16 16:59, Brian Masney wrote: > On Sat, Nov 12, 2016 at 04:36:37PM +0000, Jonathan Cameron wrote: >> On 10/11/16 09:25, Brian Masney wrote: >>> If channel 0 does not have any data, then the code sets the lux to zero. >>> The corresponding comment says that the l

Re: [PATCH v4 02/26] staging: iio: tsl2583: remove unnecessary chip status check in taos_get_lux

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > 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. >

Re: [PATCH v4 01/26] staging: iio: tsl2583: check if chip is in a working state in in_illuminance_calibrate_store

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > in_illuminance_calibrate_store() did not check to see if the chip is > in a working state. 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 change

Re: [PATCH v4 03/26] staging: iio: tsl2583: remove unnecessary chip status checks in suspend/resume

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > The device probing and the suspend/resume code checks a flag internal to > the driver that determines whether or not the chip is in a working > state. These checks are not needed. This patch removes the unnecessary > checks. It will do no harm to the hardwar

Re: [PATCH v4 04/26] staging: iio: tsl2583: change current chip state from a tristate to a bool

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > 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 Masn

Re: [PATCH v4 05/26] staging: iio: tsl2583: remove redundant write to the control register in taos_probe()

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > taos_probe() calls i2c_smbus_write_byte() to select the control > register, however there are no subsequent calls to > i2c_smbus_read_byte(). The write call is unnecessary and is removed by > this patch. > > Verified that the driver still functions correctl

Re: [PATCH v4 06/26] staging: iio: tsl2583: remove the FSF's mailing address

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > 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

Re: [PATCH v4 07/26] staging: iio: tsl2583: cleaned up logging

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, 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 log message. This also clarifies some of the error messages to match > the code and ensures that the correct prior

Re: [PATCH v4 08/26] staging: iio: tsl2583: unify function and variable prefix to tsl2583_

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > 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_s

Re: [PATCH v4 09/26] staging: iio: tsl2583: fix alignment of #define values

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > 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 Applied. > -

Re: [PATCH v4 10/26] staging: iio: tsl2583: fix comparison between signed and unsigned integers

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > Fixed warning found by make W=2: > > warning: comparison between signed and unsigned integer expressions > [-Wsign-compare] > > Signed-off-by: Brian Masney Applied. > --- > drivers/staging/iio/light/tsl2583.c | 7 --- > 1 file changed, 4 insertions(+

Re: [PATCH v4 11/26] staging: iio: tsl2583: change newlines to improve readability

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > Add and remove newlines to improve code readability in preparation for > moving the driver out of staging. > > Signed-off-by: Brian Masney Applied > --- > drivers/staging/iio/light/tsl2583.c | 14 -- > 1 file changed, 12 insertions(+), 2 delet

Re: [PATCH v4 12/26] staging: iio: tsl2583: combine sysfs documentation

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > 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 > Suggested-by: Peter Meerwald-Stadler Applied. >

Re: [PATCH v4 13/26] staging: iio: tsl2583: fix multiline comment syntax

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > 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-b

Re: [PATCH v4 14/26] staging: iio: tsl2583: updated code comment to match what the code does

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > 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. It also > clarifies the comment about why 0 is retu

Re: [PATCH v4 15/26] staging: iio: tsl2583: moved code block inside else statement

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > 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 App

Re: [PATCH v4 16/26] staging: iio: tsl2583: change tsl2583_als_calibrate() to return 0 on success

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > tsl2583_als_calibrate() returns the newly computed gain_trim if the > calibration was successful. This function is only called by > in_illuminance_calibrate_store() and the return value inside that > sysfs attribute is only checked to see if an error was ret

Re: [PATCH v4 17/26] staging: iio: tsl2583: remove unnecessary parentheses

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > in_illuminance_lux_table_store() contains some unnecessary parentheses. > This patch removes them since they provide no value. > > Signed-off-by: Brian Masney Applied. > --- > drivers/staging/iio/light/tsl2583.c | 4 ++-- > 1 file changed, 2 insertions(+)

Re: [PATCH v4 18/26] staging: iio: tsl2583: don't assume an unsigned int is 32 bits

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > in_illuminance_lux_table_store assumes that an unsigned int is 32 bits. > Replace this with sizeof(value[1]). > > Signed-off-by: Brian Masney Applied. > --- > drivers/staging/iio/light/tsl2583.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >

Re: [PATCH v4 19/26] staging: iio: tsl2583: move from a global to a per device lux table

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > The driver contains a global lux table that can be updated via sysfs. > Change this to a per device lux table so that multiple devices can be > hooked up to the same system with different lux tables. > > There are 10 entries, plus 1 for the termination segm

Re: [PATCH v4 20/26] staging: iio: tsl2583: add tsl2583 to list of supported devices in the header

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > The header only listed the tsl2580 and tsl2581 devices as supported by > this driver. This patch adds the tsl2583 since it is also supported by > this driver. > > Signed-off-by: Brian Masney Applied. > --- > drivers/staging/iio/light/tsl2583.c | 2 +- > 1

Re: [PATCH v4 22/26] staging: iio: tsl2583: remove comment for tsl2583_probe()

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > The comment for tsl2583_probe() does not provide any useful value. > This patch removes the comment. > > Signed-off-by: Brian Masney Applied > --- > drivers/staging/iio/light/tsl2583.c | 4 > 1 file changed, 4 deletions(-) > > diff --git a/drivers/

Re: [PATCH v4 21/26] staging: iio: tsl2583: clarified comment about clearing interrupts

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > 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 Applied. > --- > drivers/staging/iio/light/t

Re: [PATCH v4 23/26] staging: iio: tsl2583: remove unnecessary memset call

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > The entries in the lux table (als_device_lux) can be updated via sysfs > through the function in_illuminance_lux_table_store(). The last row in > the table must be terminated with values that are zero. The sysfs code > already ensures that the last row is al

Re: [PATCH v4 24/26] staging: iio: tsl2583: remove unnecessary variable initialization

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > 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 Applied. > --- > drivers/staging/iio/light/tsl2583.c | 4 ++-- > 1 file ch

Re: [PATCH v4 25/26] staging: iio: tsl2583: add copyright and MODULE_AUTHOR

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > 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 mis

Re: [PATCH v4 26/26] staging: iio: tsl2583: move out of staging

2016-11-13 Thread Jonathan Cameron
On 12/11/16 18:19, Brian Masney wrote: > Move tsl2580, tsl2581, tsl2583 driver out of staging into mainline. > > Signed-off-by: Brian Masney I had another read through on this one. A few oddites. I fixed up the indentation one way back in your patch fixing alignment. Made applying this patch mo

<    3   4   5   6   7   8   9   10   11   >