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
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
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(
.
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
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/
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
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
-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
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
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
.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
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
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
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
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
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
.
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/{
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/
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
.
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
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.
-
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
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
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
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 +---
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
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
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
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
. 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
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.
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
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
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
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
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
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
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
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.
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 +--
:
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
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
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
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
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
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 ++---
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
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 +++-
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
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
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
.
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
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
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
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
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
-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
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
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
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.
-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
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 ++
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
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.
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
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 +-
.
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
. 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.
-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
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
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
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
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
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
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
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
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
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.
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
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.
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(
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
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.
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
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
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.
./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
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
-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
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.
>
>
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:
> > >
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
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
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 +
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
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
().
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
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
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
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 - 100 of 319 matches
Mail list logo