summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* iio:adc:berlin2-adc: use short operator formatHartmut Knaack2015-08-021-3/+2
| | | | | | | | | | | | Use augmented assignment to subtract the offset for negative temperature values. Specify the amount of private data to be allocated through devm_iio_device_alloc() with sizeof(*priv), as it is shorter and common practice in IIO. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adc:berlin2-adc: constify iio_chan_specHartmut Knaack2015-08-021-1/+1
| | | | | | | | Mark berlin2_adc_channels array as constant. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adc:berlin2-adc: pass up real error codeHartmut Knaack2015-08-021-2/+2
| | | | | | | | Pass up the real error code returned by platform_get_irq_byname(). Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: iio_utils: Make calc_digits staticJoo Aun Saw2015-08-021-1/+1
| | | | | | Signed-off-by: Joo Aun Saw <jasaw@dius.com.au> Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: iio_utils: remove unnecessary define guardJoo Aun Saw2015-08-021-5/+0
| | | | | | Signed-off-by: Joo Aun Saw <jasaw@dius.com.au> Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: print error message when buffer enable failsIrina Tirdea2015-08-021-1/+4
| | | | | | | | | | | Running generic_buffer without enabling any channel of the sensor will fail without printing any error message. Add an error message that indicates buffer enable failed. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: fix mask for 32 bit sensor dataIrina Tirdea2015-08-021-1/+1
| | | | | | | | | | | | | | | When the the sensor data uses 32 bits out of 32, generic_buffer prints the value 0 for all data read. In this case, the mask is shifted 32 bits, which is beyond the size of an integer. This will lead to the mask always being 0. Before printing, the mask is applied to the raw value, thus generating a final value of 0. Fix the mask by shifting a 64 bit value instead of an integer. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* include: linux: iio: Add missing kernel doc fieldCristina Opriceana2015-08-021-1/+2
| | | | | | | Fix kernel doc for the iio_dev_attr structure by adding its missing field. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* include: linux: iio: Fix function parameter name in kernel docCristina Opriceana2015-08-021-1/+1
| | | | | | | Fix buffer name from kernel doc according to the function parameter. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: event: Add missing fields in kernel docsCristina Opriceana2015-08-021-0/+6
| | | | | | | | Fix kernel docs warnings by adding the missing fields, each with its associated description. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: buffer: Fix kernel docs warningsCristina Opriceana2015-08-021-1/+14
| | | | | | | | Fix kernel docs for structures and functions in order to remove some warnings when the documentation gets generated. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: core: Add function params for kernel docsCristina Opriceana2015-08-021-5/+20
| | | | | | | | | This patch adds the missing fields in kernel docs to remove some warnings that appear when the IIO Documentation DocBook is generated. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: magn: bmc150_magn: do not set power state twice when setting trigger stateIrina Tirdea2015-08-021-8/+2
| | | | | | | | | | | | When setting the trigger state, the device power state is set through buffer preenable and postdisable hooks. There is no need to also set it in the trigger set state call. Remove duplicate set power state from the trigger set state call. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: magn: bmc150_magn: add locking comment for runtime resumeIrina Tirdea2015-08-021-0/+3
| | | | | | | | Runtime resume function is called with the data->mutex lock held. Add a comment to indicate this. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:magnetometer:bmc150_magn: use descriptive name for maskHartmut Knaack2015-08-021-2/+3
| | | | | | | | | Define and use a descriptive name for the repetition registers data mask, instead of a 'magic' value. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:magnetometer:bmc150_magn: expand mutex in trigger_handlerHartmut Knaack2015-08-021-1/+1
| | | | | | | | | Keep the mutex locked, until the content of data->buffer has been pushed out. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: mlx90614: Define magic numbersCrt Mori2015-08-021-6/+14
| | | | | | | | | | | | Translates the magic constant numbers to named macros and add some additional comments about their meaning. The diff is made towards togreg branch as that branch seems to have the most recent updates of mlx90614 driver (many are yet to be merged). Signed-off-by: Crt Mori <cmo@melexis.com> Acked-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: mmc35240: minor change to improve code readibilityTeodora Baluta2015-08-021-13/+13
| | | | | | | This patch changes two variables to arrays to improve code readibility. Signed-off-by: Teodora Baluta <teodora.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: Export OF module alias information in missing driversJavier Martinez Canillas2015-08-025-0/+5
| | | | | | | | | | | | | | | | | | | | | | | The I2C core always reports the MODALIAS uevent as "i2c:<client name" regardless if the driver was matched using the I2C id_table or the of_match_table. So technically there's no need for a driver to export the OF table since currently it's not used. In fact, the I2C device ID table is mandatory for I2C drivers since a i2c_device_id is passed to the driver's probe function even if the I2C core used the OF table to match the driver. And since the I2C core uses different tables, OF-only drivers needs to have duplicated data that has to be kept in sync and also the dev node compatible manufacturer prefix is stripped when reporting the MODALIAS. To avoid the above, the I2C core behavior may be changed in the future to not require an I2C device table for OF-only drivers and report the OF module alias. So, it's better to also export the OF table to prevent breaking module autoloading if that happens. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: Export I2C module alias information in missing driversJavier Martinez Canillas2015-08-023-0/+3
| | | | | | | | | | | The I2C core always reports the MODALIAS uevent as "i2c:<client name" regardless if the driver was matched using the I2C id_table or the of_match_table. So the driver needs to export the I2C table and this be built into the module or udev won't have the necessary information to auto load the correct module when the device is added. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: make scale and offset files optionalJoo Aun Saw2015-07-231-2/+2
| | | | | | | | | Make scale and offset optional by adding -ENOENT check as not all drivers implement them. Signed-off-by: Joo Aun Saw <jasaw@dius.com.au> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: st-magn: add support for lsm303agr magnetometerGiuseppe Barba2015-07-235-0/+90
| | | | | | | | This adds support for the lsm303agr magnetometer. Signed-off-by: Giuseppe Barba <giuseppe.barba@st.com> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: st-accel: add support for lsm303agr accelerometerGiuseppe Barba2015-07-235-0/+9
| | | | | | | | This adds support for the lsm303agr accelerometer. Signed-off-by: Giuseppe Barba <giuseppe.barba@st.com> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: st_magn: Add irq trigger handlingGiuseppe Barba2015-07-233-1/+21
| | | | | | | | Add irq trigger handling for magnetometer also Signed-off-by: Giuseppe Barba <giuseppe.barba@st.com> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: st-sensors: add support for single full scale deviceGiuseppe Barba2015-07-231-0/+3
| | | | | | | | | | Some sensors could have only one full scale value. This means that the sensor hasn't a full scale register. This commit add a check on the configured full scale address to support such kind of sensors. Signed-off-by: Giuseppe Barba <giuseppe.barba@st.com> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: st-sensors: add configuration for WhoAmI addressGiuseppe Barba2015-07-236-26/+39
| | | | | | | | | | | This patch permits to configure the WhoAmI register address because some device could have not a standard address for this register. Signed-off-by: Giuseppe Barba <giuseppe.barba@st.com> Reviewed-by: Denis Ciocca <denis.ciocca@st.com> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: fix drivers that consider 0 as a valid IRQ in client->irqOctavian Purdila2015-07-234-7/+7
| | | | | | | | | | | | | | | | Since patch "i2c / ACPI: Use 0 to indicate that device does not have interrupt assigned" [1], 0 is not a valid i2c client irq anymore, so change all driver's checks accordingly. The same issue occurs when the device is instantiated via device tree with no IRQ, or from the i2c sysfs interface, even before the patch above. [1] http://lkml.kernel.org/g/<1430908148-201129-3-git-send-email-mika.westerberg@linux.intel.com> Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: Send error messages to stderrCristina Opriceana2015-07-204-47/+59
| | | | | | | | | | | This patch indends to make some cleanup and send printf error messages to stderr. The changes were performed with coccinelle for failure messages and manual for other cases, such as wrong usage messages. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: Add ARRAY_SIZE macroCristina Opriceana2015-07-202-1/+3
| | | | | | | | | | Calculation of the length of an array can be done with the ARRAY_SIZE macro to make code more abstract and remove the associated checkpatch.pl warning. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: Remove unnecessary bracesCristina Opriceana2015-07-201-2/+1
| | | | | | | | | Single statement blocks don’t need braces. Found with checkpatch.pl. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: Remove explicit NULL comparisonCristina Opriceana2015-07-203-35/+35
| | | | | | | | | Remove explicit NULL comparison and write it in its simpler form as recommended by checkpatch.pl. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: light: Add support for TXC PA12 als and proximity sensorAdriana Reus2015-07-203-0/+495
| | | | | | | | Add support for TXC PA12203001 als and proximity sensor. Support for raw illuminance and proximity readings. Signed-off-by: Adriana Reus <adriana.reus@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: light: add support for TI's opt3001 light sensorAndreas Dannenberg2015-07-203-0/+815
| | | | | | | | | | | | | | | | TI's opt3001 light sensor is a simple and yet powerful little device. The device provides 99% IR rejection, automatic full-scale, very low power consumption and measurements from 0.01 to 83k lux. This patch adds support for that device using the IIO framework. See http://www.ti.com/product/opt3001 for more information. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: dht11: Use new function ktime_get_resolution_ns()Harald Geyer2015-07-201-20/+22
| | | | | | | | | | | | | | | | | | | This cleans up the most ugly workaround in this driver. There are no functional changes yet in the decoding algorithm, but we improve the following things: * Get rid of spurious warning messages on systems with fast HRTIMER. * If the clock is not fast enough for decoding to work, we give up immediately. * In that case we return EAGAIN instead of EIO, so it's easier to discriminate causes of failure. Returning EAGAIN is somewhat controversial: It's technically correct as a faster clock might become available. OTOH once all clocks are enabled this is a permanent error. There is no ECLOCKTOOSLOW error code. Signed-off-by: Harald Geyer <harald@ccbib.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: dht11: avoid multiple assignments to make checkpatch.pl --strict happyHarald Geyer2015-07-201-1/+2
| | | | | | | We just do the assignments in two steps. Signed-off-by: Harald Geyer <harald@ccbib.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: dht11: add comment to make checkpatch.pl --strict happyHarald Geyer2015-07-201-0/+1
| | | | | | | Explain why the driver needs a mutex. Signed-off-by: Harald Geyer <harald@ccbib.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: dht11: whitespace changes to make checkpatch.pl --strict happyHarald Geyer2015-07-201-12/+13
| | | | | | | | | | | * add spaces around binary operators in cases where it reduces readability * align multiline statements around opening parenthesis Reported-by: Hartmut Knaack <knaack.h@gmx.de> in Message-ID: <55919E72.3010807@gmx.de> Signed-off-by: Harald Geyer <harald@ccbib.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: vf610: Determine sampling frequencies by using minimum sample timeSanchayan Maity2015-07-202-4/+80
| | | | | | | | | | | | | | | | | | | | | The driver currently does not take into account the minimum sample time as per the Figure 6-8 Chapter 9.1.1 12-bit ADC electrical characteristics. We set a static amount of cycles instead of considering the sample time as a given value, which depends on hardware characteristics. Determine sampling frequencies by first reading the device tree property node and then calculating the required Long Sample Time Adder (LSTAdder) value, based on the ADC clock frequency and sample time value obtained from the device tree. This LSTAdder value is then used for calculating the sampling frequencies possible. In case the sample time property is not specified through the device tree, a safe default value of 1000ns is assumed. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> Acked-by: Stefan Agner <stefan@agner.ch> Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: mcp320x: Add support for mcp3301Andrea Galbusera2015-07-203-3/+18
| | | | | | | This adds support for Microchip's 13 bit 1 channel AD converter MCP3301 Signed-off-by: Andrea Galbusera <gizero@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:magnetometer:bmc150_magn: replace magic valueHartmut Knaack2015-07-191-1/+3
| | | | | | | | Construct the scanmask using its descriptive axis names (as used in iio_chan_spec) instead of a 'magic' value. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: magnetometer: mmc35240: Add DT binding docJandy Gou2015-07-191-0/+13
| | | | | Signed-off-by: Jandy Gou <qingsong.gou@ck-telecom.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: magnetometer: mmc35240: Add DT bindingJandy Gou2015-07-191-0/+7
| | | | | | Signed-off-by: Jandy Gou <qingsong.gou@ck-telecom.com> Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:light:acpi-als: add missing prefixesHartmut Knaack2015-07-191-9/+9
| | | | | | | Some macros and a function were missing the acpi_als_ prefix, so add it. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: mxs-lradc: add datasheet name for every usable channelStefan Wahren2015-07-191-18/+62
| | | | | | | | | | | In order to provide a channel name to in kernel consumers add the datasheet names for every usable AD channel. Since the channel names differ between i.MX23 and i.MX28, we need to separate the channel specs. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: mxs-lradc: reorder header includesStefan Wahren2015-07-191-12/+12
| | | | | | | | This patch reorder the header includes alphabetically. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: mxs-lradc: remove unnecessary header includesStefan Wahren2015-07-191-5/+0
| | | | | | | | This patch removes the unnecessary header includes. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: mxs-lradc: add missing includeStefan Wahren2015-07-191-0/+1
| | | | | | | | This patch adds the missing include for mutex handling. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: mxs-lradc: fix some spelling errorsStefan Wahren2015-07-191-5/+5
| | | | | | | | This patch fix some spelling errors in the comments. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: mxs-lradc: clarify supported devicesStefan Wahren2015-07-192-10/+10
| | | | | | | | | | At the beginning the driver supported only i.MX28 SoC, but now the whole MXS platform. So remove any confusing comments which apply only to i.MX28. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: Documentation: Remove bytes_per_datum attributeCristina Opriceana2015-07-191-7/+0
| | | | | | | | Remove sysfs bytes_per_datum device attribute ABI documentation since the attribute is not present anymore. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
OpenPOWER on IntegriCloud