16 Nov, 2018
1 commit
-
Before this commit sensor_hub_input_attr_get_raw_value() failed to take
the signedness of 16 and 8 bit values into account, returning e.g.
65436 instead of -100 for the z-axis reading of an accelerometer.This commit adds a new is_signed parameter to the function and makes all
callers pass the appropriate value for this.While at it, this commit also fixes up some neighboring lines where
statements were needlessly split over 2 lines to improve readability.Signed-off-by: Hans de Goede
Acked-by: Srinivas Pandruvada
Acked-by: Benjamin Tissoires
Cc:
Signed-off-by: Jonathan Cameron
18 Feb, 2018
1 commit
-
Add GPLv2+ SPDX identifier and update email for author's drivers.
Signed-off-by: Matt Ranostay
Signed-off-by: Jonathan Cameron
17 Feb, 2018
1 commit
-
The old code was based on a DHT11 datasheet which specifies a measurement
range of 20%-90% RH. Turns out the sensor actually reports values outside
this range, so we should support it as far as possible.Reported-by: Edward Attfield
Signed-off-by: Harald Geyer
Signed-off-by: Jonathan Cameron
31 Jan, 2018
4 commits
-
Remove unnecessary unaligned access routine in hts221_read_oneshot() and
the related includeSigned-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron -
Introduce regmap API support to access to i2c/spi bus instead of
using a custom support.
Remove lock mutex since concurrency is already managed by regmap APISigned-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron -
Signed-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron -
Remove following sparse warnings in hts221_parse_temp_caldata() and in
hts221_parse_rh_caldata():
drivers/iio/humidity/hts221_core.c:302:19: warning: cast to
restricted __le16
drivers/iio/humidity/hts221_core.c:314:18: warning: cast to
restricted __le16
drivers/iio/humidity/hts221_core.c:320:18: warning: cast to
restricted __le16
drivers/iio/humidity/hts221_core.c:355:18: warning: cast to
restricted __le16
drivers/iio/humidity/hts221_core.c:361:18: warning: cast to
restricted __le16Fixes: e4a70e3e7d84 ("iio: humidity: add support to hts221 rh/temp combo device")
Signed-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron
08 Jan, 2018
1 commit
-
Move duplicated i2c/spi probe code in hts221_probe()
Signed-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron
Signed-off-by: Greg Kroah-Hartman
14 Nov, 2017
1 commit
-
Pull staging and IIO updates from Greg KH:
"Here is the "big" staging and IIO driver update for 4.15-rc1.Lots and lots of little changes, almost all minor code cleanups as the
Outreachy application process happened during this development cycle.
Also happened was a lot of IIO driver activity, and the typec USB code
moving out of staging to drivers/usb (same commits are in the USB tree
on a persistent branch to not cause merge issues.)Overall, it's a wash, I think we added a few hundred more lines than
removed, but really only a few thousand were modified at all.All of these have been in linux-next for a while. There might be a
merge issue with Al's vfs tree in the pi433 driver (take his changes,
they are always better), and the media tree with some of the odd
atomisp cleanups (take the media tree's version)"* tag 'staging-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (507 commits)
staging: lustre: add SPDX identifiers to all lustre files
staging: greybus: Remove redundant license text
staging: greybus: add SPDX identifiers to all greybus driver files
staging: ccree: simplify ioread/iowrite
staging: ccree: simplify registers access
staging: ccree: simplify error handling logic
staging: ccree: remove dead code
staging: ccree: handle limiting of DMA masks
staging: ccree: copy IV to DMAable memory
staging: fbtft: remove redundant initialization of buf
staging: sm750fb: Fix parameter mistake in poke32
staging: wilc1000: Fix bssid buffer offset in Txq
staging: fbtft: fb_ssd1331: fix mirrored display
staging: android: Fix checkpatch.pl error
staging: greybus: loopback: convert loopback to use generic async operations
staging: greybus: operation: add private data with get/set accessors
staging: greybus: loopback: Fix iteration count on async path
staging: greybus: loopback: Hold per-connection mutex across operations
staging: greybus/loopback: use ktime_get() for time intervals
staging: fsl-dpaa2/eth: Extra headroom in RX buffers
...
02 Nov, 2017
1 commit
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
23 Aug, 2017
1 commit
-
The equivalent of both of these are now done via macro magic when
the relevant register calls are made. The actual structure
elements will shortly go away.Signed-off-by: Jonathan Cameron
Reviewed-by: Lars-Peter Clausen
26 Jul, 2017
2 commits
-
Move data-ready configuration in hts221_buffer.c since it is only related
to trigger logicSigned-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron -
Add open drain support in order to share requested IRQ line between
hts221 device and other peripheralsSigned-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron
23 Jul, 2017
6 commits
-
Add support for active low interrupts (IRQF_TRIGGER_LOW and
IRQF_TRIGGER_FALLING). Configure the device as active high or low
according to the requested irq line.Signed-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron -
Signed-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron -
Configure sensor ODR just in hts221_write_raw() in order to avoid
to set device sample rate multiple times.Signed-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron -
GENMASK(6, 3) in CTRL_REG1 and GENMASK(6, 2) in CTRL_REG2 are marked
reserved. Do not changed the original value (not declared in the
datasheet) during power-down/suspend routines.Fixes: e4a70e3e7d84 (iio: humidity: add support to hts221 rh/temp device)
Fixes: b7079eeac5da (iio: humidity: hts221: add power management support)
Signed-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron -
Enable Block Data Update in hts221_probe() in order to avoid to reconfigure
it every time the sensor is enabledSigned-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron -
Move bit-shift in hts221_write_with_mask() instead of coding
the shift depth in the configured value. That change will be necessary
to fix an issue in device power-down procedure.
Simplify hts221_avg_list table managementSigned-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron
01 Jul, 2017
3 commits
-
Add of_match_table for Measurement-Specialties htu21 temperature & humidity sensor and humidity part of MS8607 sensor
Signed-off-by: Manivannan Sadhasivam
Signed-off-by: Jonathan Cameron -
Add of_match_table and point it to a list of compatible device tree
device id's.Signed-off-by: Michael Stecklein
Signed-off-by: Jonathan Cameron -
Include datasheet links, add i2c_device_id entries, and update
kconfig help for compatible HDC10xx devices: HDC1000, HDC1008,
HDC1010, HDC1050, and HDC1080.Signed-off-by: Michael Stecklein
Signed-off-by: Jonathan Cameron
14 May, 2017
1 commit
-
Add system sleep power management support to hts221 driver
Signed-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron
02 Apr, 2017
1 commit
-
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)Signed-off-by: simran singhal
Signed-off-by: Jonathan Cameron
01 Apr, 2017
1 commit
-
Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};@ok1@
identifier r1.i;
position p;
struct iio_info x;
@@
x.attrs=&i@p;@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;File size before:
text data bss dec hex filename
3459 488 0 3947 f6b drivers/iio/humidity/hdc100x.oFile size after:
text data bss dec hex filename
3507 424 0 3931 f5b drivers/iio/humidity/hdc100x.oSigned-off-by: simran singhal
Signed-off-by: Jonathan Cameron
26 Mar, 2017
1 commit
-
Environmental humidity sensor is a hid defined sensor,
it shows raw humidity measurement of air.More information can be found in:
http://www.usb.org/developers/hidpage/HUTRR39b.pdfAccording to IIO ABI definition, humidityrelative data output unit is
milli percent. Add the unit convert from percent to milli percent.Signed-off-by: Song Hongyan
Signed-off-by: Jonathan Cameron
06 Feb, 2017
1 commit
-
This resolves the merge errors that were reported in linux-next and it
picks up the staging and IIO fixes that we need/want in here as well.Signed-off-by: Greg Kroah-Hartman
22 Jan, 2017
1 commit
-
The DHT22 (AM2302) datasheet specifies that the LOW start pulse should not
exceed 20ms. However, observations with an oscilloscope of an RPi Model 2B
(rev 1.1) communicating with a DHT22 sensor showed that the driver was
consistently sending start pulses longer than 20ms:Kernel 4.7.10-v7+ (n=132):
Minimum pulse length: 20.20ms
Maximum: 29.84ms
Mean: 24.96ms
StDev: 2.82ms
Sensor response rate: 100%
Read success rate: 76%On kernel 4.8, the start pulse was so long that the sensor would not even
respond 97% of the time:Kernel 4.8.16-v7+ (n=100):
Minimum pulse length: 30.4ms
Maximum: 74.4ms
Mean: 39.3ms
StDev: 10.2ms
Sensor response rate: 3%
Read success rate: 3%The driver would return ETIMEDOUT and write log messages like this:
[ 51.430987] dht11 dht11@0: Only 1 signal edges detected
[ 66.311019] dht11 dht11@0: Only 0 signal edges detectedReplacing msleep(18) with usleep_range(18000, 20000) made the pulse length
sane again and restored responsiveness:Kernel 4.8.16-v7+ with usleep_range (n=123):
Minimum pulse length: 18.16ms
Maximum: 20.20ms
Mean: 19.85ms
StDev: 0.51ms
Sensor response rate: 100%
Read success rate: 84%Cc: stable@vger.kernel.org
Signed-off-by: John Brooks
Reviewed-by: Harald Geyer
Signed-off-by: Jonathan Cameron
03 Dec, 2016
1 commit
-
Support driver probe by reading unique HID on systems based on ACPI instead
of DT compatible strings.Signed-off-by: Shrirang Bagul
Signed-off-by: Jonathan Cameron
02 Nov, 2016
2 commits
-
This adds devicetree support for the si7020 iio driver. Since it works
well without requiring any additional property, its compatible string is
added to the trivial i2c devices bindings list.Signed-off-by: Paul Kocialkowski
Acked-by: Rob Herring
Signed-off-by: Jonathan Cameron -
Remove duplicated include.
Signed-off-by: Wei Yongjun
Signed-off-by: Jonathan Cameron
24 Oct, 2016
2 commits
-
Triggered buffer support uses the HDC100X's dual acquisition mode
to read both humidity and temperature in one shot.This patch depends on
447136effbf4 ("iio: humidity: hdc100x: fix sensor data reads of
temp and humidity")Signed-off-by: Alison Schofield
Cc: Daniel Baluta
Signed-off-by: Jonathan Cameron -
Add support to STM HTS221 humidity + temperature sensor
http://www.st.com/resource/en/datasheet/hts221.pdf
- continuous mode support
- i2c support
- spi support
- trigger mode supportSigned-off-by: Lorenzo Bianconi
Signed-off-by: Jonathan Cameron
05 Sep, 2016
1 commit
-
We want the staging fixes in here as well to handle merge issues.
Signed-off-by: Greg Kroah-Hartman
16 Aug, 2016
2 commits
-
hdc100x supports Texas Instruments HDC1000 and HDC1008 relative
humidity and temperature sensors. Add these product names to
Kconfig.Signed-off-by: Alison Schofield
Cc: Daniel Baluta
Signed-off-by: Jonathan Cameron -
Replace the i2c_smbus_read_byte commmands used to retrieve the sensor
data with an i2c_master_recv command.The smbus read byte method fails because the device does not expect a
stop condition after sending the first byte. When we issue the second
read, we are getting the first byte again. Net effect is that of the 14
bits used for the measurement, the 8 most significant bits are correct,
the lower 6 are not.None of the smbus read protocols follow the pattern this device requires
(S Addr Rd [A] Data [A] Data NA P), hence the switch to an i2c receive
transaction.Applicable from original introduction of this driver, but will require
backporting due to churn in the code.Signed-off-by: Alison Schofield
Cc: Daniel Baluta
Cc:
Signed-off-by: Jonathan Cameron
15 Aug, 2016
2 commits
-
Select IIO_BUFFER and IIO_TRIGGERED_BUFFER to compile.
Remove IIO_TRIGGER if present since IIO_BUFFER selects it.Signed-off-by: Alison Schofield
Cc: Daniel Baluta
Signed-off-by: Jonathan Cameron -
Use the iio_pollfunc_store_time parameter during triggered buffer
set-up to get valid timestamps.Signed-off-by: Alison Schofield
Cc: Daniel Baluta
Reviewed-By: Tiberiu Breana
Cc:
Signed-off-by: Jonathan Cameron
20 Jun, 2016
1 commit
-
We want the fixes in here, and we can resolve a merge issue in
drivers/iio/industrialio-trigger.cSigned-off-by: Greg Kroah-Hartman
03 Jun, 2016
1 commit
-
Shifting sensor data to the right 2 bits was incorrect and caused the
scaling values + offsets to be invalid.Reported-by: Alison Schofield
Signed-off-by: Matt Ranostay
Tested-by: Alison Schofield
Cc:
Signed-off-by: Jonathan Cameron