summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/magnetometer
AgeCommit message (Collapse)Author
2016-02-09iio: hmc5843: Fix comment style warningsCristina Moraru
Fix comment style warnings in order to comply with Coding Style standard provided by Documentation/CodingStyle. This patch solves following issue found with checkpatch: WARNING: Block comments use a trailing */ on a separate line Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-09iio: hmc5843: Swap suspend and resume implementationsCristina Moraru
Swap implementations of hmc5843_common_suspend and hmc5843_common_resume functions for they have been inversed. Device should go on SLEEP mode on suspend and on CONTINUOUS mode on resume. Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-11-05Merge tag 'spi-v4.4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "Quite a lot of activity in SPI this cycle, almost all of it in drivers with a few minor improvements and tweaks in the core. - Updates to pxa2xx to support Intel Broxton and multiple chip selects. - Support for big endian in the bcm63xx driver. - Multiple slave support for the mt8173 - New driver for the auxiliary SPI controller in bcm2835 SoCs. - Support for Layerscale SoCs in the Freescale DSPI driver" * tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (87 commits) spi: pxa2xx: Rework self-initiated platform data creation for non-ACPI spi: pxa2xx: Add support for Intel Broxton spi: pxa2xx: Detect number of enabled Intel LPSS SPI chip select signals spi: pxa2xx: Add output control for multiple Intel LPSS chip selects spi: pxa2xx: Use LPSS prefix for defines that are Intel LPSS specific spi: Add DSPI support for layerscape family spi: ti-qspi: improve ->remove() callback spi/spi-xilinx: Fix race condition on last word read spi: Drop owner assignment from spi_drivers spi: Add THIS_MODULE to spi_driver in SPI core spi: Setup the master controller driver before setting the chipselect spi: dw: replace magic constant by DW_SPI_DR spi: mediatek: mt8173 spi multiple devices support spi: mediatek: handle controller_data in mtk_spi_setup spi: mediatek: remove mtk_spi_config spi: mediatek: Update document devicetree bindings to support multiple devices spi: fix kernel-doc warnings about missing return desc in spi.c spi: fix kernel-doc warnings about missing return desc in spi.h spi: pxa2xx: Align a few defines spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip select ...
2015-10-28spi: Drop owner assignment from spi_driversAndrew F. Davis
An spi_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Andrew F. Davis <afd@ti.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-25staging: iio: magnetometer: Remove explicit comparisonsCristina Moraru
Remove comparisons to 0 or NULL Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-22staging: iio: hmc5843: Export missing SPI module alias informationJavier Martinez Canillas
The SPI core always reports the MODALIAS uevent as "spi:<modalias>" regardless of the mechanism that was used to register the device (i.e: OF or board code) and the table that is used later to match the driver with the device (i.e: SPI id table or OF match table). So drivers needs to export the SPI id table and this be built into the module or udev won't have the necessary information to autoload the needed driver module when the device is added. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-08-16staging: iio: hmc5843: Set iio name dynamicallyYong Li
Load the driver using the below command: echo hmc5983 0x1e > /sys/bus/i2c/devices/i2c-?/new_device In sysfs, the iio name is hmc5843, however the i2c name is hmc5983, they are inconsistent. With this patch, the iio name will be the same as the i2c device name Signed-off-by: Yong Li <sdliyong@gmail.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-03-24Merge tag 'iio-for-4.1a' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: First set of new drivers, cleanups and functionality for IIO in the 4.1 cycle. New drivers * CM3323 color sensor. * MS5611 pressure and temperature sensor. New functionality * mup6050 - create mux clients for devices described via ACPI. The reasoning and approach taken in this patch are complex. Basically there is no otherway of finding out what is there than by some esoteric look ups in the ACPI data. * cm3232 - PM support * itg3200 - suspend/resume support * mcp320x - add more ADCs to the kconfig to reflect what the driver supports (this patch and the bindings got left behind when the support was added a while back). Docs / utils * ti-adc128s052 - DT bindings. * mcp3422 - DT bindings. * mcp320x - DT bindings * ABI docs for event threshold scale attributes, in_magn_offset, proximity scan_element and thresh falling/rising values for accelerometers. All elements long in use that have slipped by being explicitly documented. * Tidy up the tools previously in drivers/staging/iio/Documentation and move them out to /tools/iio. Yet another move that should have happened long ago. This time Roberta Dobrescu did the leg work. Thanks! Core Cleanups * Export userspace IIO headers. We should have done the appropriate header splitting a long time ago. Thanks to Daniel for sorting this out. * Refactor the registring of attributes for buffers to move all non-custom ones to a vector allowing easier additions to the current set in the future. Driver Cleanups * gpiod related cleanups. Make use of the additional parameter to specify initial direciton to avoid extra code. * bmc150 - Various refactorings to reduce code repitition and prepare for hardware buffer support. Some of these cleanups are good even without the new functionality. * kmx61 - direct use of index to an array avoiding a structure element which was always the index to an element in an array of that structure. * vf610 - avoid incorrect type for return from wait_for_completion_timeout. * gp2ap020a00f - use put_unaligned_le32 for slight code simplification. * ade7754 - improve error handling including suppressing some build warnings. * ade7759 - improve error handling including suppressing some build warnings. * hmc5843 - Long line and indentation fixes. Also some constifying of various constant data. * ade7854 - 80+ character line splitting. * ad2s1210 - fix wrong printf format string. * mxs-lradc - fix wrong printf format string. * ade7954-i2c - code alignment fixes and other trivial but worthwhile bits. * periodic rtc trigger - make the frequency type an unsigned int as it is always treated as such. * jsa1212 - constify struct regmap_config as it is constant. * ad7793 - typo in the MODULE_DESCRIPTION * mma9551 - check gpiod_to_irq errors. Note that this doesn't actually cause any trouble but is worth tidying up as obviously incorrect. * mlx90614 - refactor the register symbols to make it clear which reads are to RAM not PROM.
2015-03-23Staging: iio: Fix file header to match standardsCristina Opriceana
Fix file header to match Linux Kernel style. Remove Free Software Foundation reference to silence the checkpatch.pl warning. Add driver description and correct spelling mistakes. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-23Staging: iio: Place driver in sleep mode on errorCristina Opriceana
Put device in sleep mode if an error is encountered after initialization in order to avoid wasting power. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-23Staging: iio: Add kernel-doc for struct hmc5843Cristina Opriceana
This patch documents the struct hmc5843 specific data following this warning: "CHECK: struct mutex definition without comment". Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20Staging: iio: Remove line over 80 charactersCristina Opriceana
Rename variable in order to fix the 80 characters per line warning. Found by checkpatch.pl Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20Staging: iio: Remove multiple blank linesCristina Opriceana
This patch removes blank uneeded lines in order to remove the folowing checkpatch.pl warning: "Please don't use multiple blank lines". Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20Staging: iio: Align function parameters to match first rowCristina Opriceana
This patch improves coding style by aligning parameters in iio/magnetometer function calls, to remove the following warning: "CHECK: Alignment should match open parenthesis". Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20Staging: iio: Simplify NULL pointer conditionCristina Opriceana
Replace NULL comparrison with its shorter form. Done with coccinelle: @replace_rule@ expression e; @@ -e == NULL + !e Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-07staging: iio: hmc5843: Set iio name property in sysfsMarek Belisko
Without this change file name for hmc5843 is empty in /sys/bus/iio/devices/iio\:device*/name With this change name is reported correctly: cat /sys/bus/iio/devices/iio\:device*/name hmc5843 Signed-off-by: Marek Belisko <marek@goldelico.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-25staging:iio:hmc5843: Constify register tables and struct regmap_configKrzysztof Kozlowski
The regmap_access_table and regmap_config structures may be const because they are not modified by the driver and regmap_init() accepts pointer to const. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-02-08Staging:iio:hmc5843:Coding Style CorrectionTolga Ceylan
Indentation corrections in struct initializations and one line over 80 characters split into two lines Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-08-02staging: iio: hmc5843_core: fix sparse warningsTeodora Baluta
Fix the following sparse warnings: CHECK drivers/staging/iio/magnetometer/hmc5843_core.c drivers/staging/iio/magnetometer/hmc5843_core.c:138:70: warning: incorrect type in argument 3 (different signedness) drivers/staging/iio/magnetometer/hmc5843_core.c:138:70: expected unsigned int *val drivers/staging/iio/magnetometer/hmc5843_core.c:138:70: got int *<noident> drivers/staging/iio/magnetometer/hmc5843_core.c:215:64: warning: incorrect type in argument 3 (different signedness) drivers/staging/iio/magnetometer/hmc5843_core.c:215:64: expected unsigned int *val drivers/staging/iio/magnetometer/hmc5843_core.c:215:64: got int *<noident> drivers/staging/iio/magnetometer/hmc5843_core.c:354:72: warning: incorrect type in argument 3 (different signedness) drivers/staging/iio/magnetometer/hmc5843_core.c:354:72: expected unsigned int *val drivers/staging/iio/magnetometer/hmc5843_core.c:354:72: got int *<noident> drivers/staging/iio/magnetometer/hmc5843_core.c:362:72: warning: incorrect type in argument 3 (different signedness) drivers/staging/iio/magnetometer/hmc5843_core.c:362:72: expected unsigned int *val drivers/staging/iio/magnetometer/hmc5843_core.c:362:72: got int *<noident> Signed-off-by: Teodora Baluta <teodora.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-23staging:iio:hmc5843: Add support for spi hmc5983Josef Gajdusek
This patch adds support for the hmc5983 spi interface. This chip is almost identical to the hmc5883. The difference being added temperature compensation, additional available sample rate (220Hz) and an SPI interface. Signed-off-by: Josef Gajdusek <atx@atx.name> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-23staging:iio:hmc5843: Add support for i2c hmc5983Josef Gajdusek
This patch adds support for the hmc5983 i2c interface. This chip is almost identical to the hmc5883. The difference being added temperature compensation, additional available sample rate (220Hz) and an SPI interface. Signed-off-by: Josef Gajdusek <atx@atx.name> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-23staging:iio:hmc5843: register <-> value arrays now can have different lengthsJosef Gajdusek
Changed structure of struct hmc5843_chip_info to include length of translation arrays. Code previously using #defined constant has been changed accordingly. This allows to integrate devices which do have different amounts of available rates/scales. Signed-off-by: Josef Gajdusek <atx@atx.name> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-23staging:iio:hmc5843: Split hmc5843.c to multiple filesJosef Gajdusek
This patch splits hmc5843.c to multiple files - the interface-agnostic hmc5843_core.c, i2c specific hmc5843_i2c.c and header file hmc5843.h. This is another step to add support of SPI-enabled hmc5983. Signed-off-by: Josef Gajdusek <atx@atx.name> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-23staging:iio:hmc5843: Added regmap supportJosef Gajdusek
This patch changes hmc5843.c to use regmap. This provides transparent caching to the code as well as abstraction necessary to add support for SPI-based hmc5983. Signed-off-by: Josef Gajdusek <atx@atx.name> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-06-29staging: iio: hmc5843: Add all available models to device tree id table.Marek Belisko
Signed-off-by: Marek Belisko <marek@goldelico.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-12-24Merge tag 'iio-for-3.14b' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: 2nd round of new IIO drivers, features and cleanups for the 3.14 cycle. New drivers * HID inclinometer driver. * DHT11 humidity driver. Note that previous humidity drivers have been in hwmon, but no one was ever entirely happy with that, and they should find a more comfortable home in IIO (their original placement in hwmon was my fault - oops). As this is our first humidity driver, core support is also added. New features * Two of mxs-lradc channels are internally wired to a temperature sensor, make this explicit in the driver by providing the relevant temperature channel. * Add support for blocking IO on buffers. * Add a data_available call back to the interface between buffer implementations and the core. This is much cleaner than the old, 'stufftoread' flag. Implemented in the kfifo buffer. Cleanups * Last user of the old event configuration interface is converted and the old interface dropped. Nice to be rid of this thanks to Lars-Peter's hard work! * Replace all remaining instances of the IIO_ST macro with explicit filling of the scan_type structure within struct iio_chan_spec. This macro was a bad idea, that rapidly ceased to cover all elements of the structure. Miss reading of the macro arguements has led to a number of bugs so lets just get rid of it. The final removal patch is awaiting for some fixes to make their way into mainline. In a couple of drivers, no elements of scan_type were even being used so in those case, it has been dropped entirely. * Drop a couple of of_match_ptr helper uses in drivers where devicetree is not optional and hence the structures being protected by this always exist. * Fix up some cases where data was read from a device in a particular byte order, but he code placed it into a s16 or similar. These were highlighted by Sparse. * Use the new ATTRIBUTE_GROUPS macro to drop some boiler plate in the triggers core code. * ad7746 and ad7280a - stop storing buffers on the stack, giving cleaner code and possibly avoiding issues with i2c bus drivers that assume they can dma directly into the buffer. Note that this cannot currently happen as the the i2c_smbus_read_i2c_block_data function has a memcpy from the buffer actually passed to the bus driver. I missed this element of the commit message and don't think it is major enough to rebase the iio tree. * ad5791 and ad5504 stop storing buffers on the stack for an SPI driver. Unlike the i2c drivers, this is a real issue for SPI drivers which can dma directly into the buffer supplied.
2013-12-24Merge 3.13-rc5 into staging-nextGreg Kroah-Hartman
This resolves a merge issue with drivers/staging/imx-drm/imx-drm-core.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-22staging: iio: hmc5843: Remove redundant of_match_ptr helperSachin Kamat
'hmc5843_of_match' is always compiled in. Hence the helper macro is not needed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-12-17staging:iio:mag:hmc5843 fix incorrect endianness of channel as a result of ↵Jonathan Cameron
missuse of the IIO_ST macro. This driver sets the shift value equal to IIO_BE (or 1) rather than setting that to 0 and specificying the endianness. This means the channel type is missreported as [be|le]:u16/16>>1 where the be|le is dependent on the cpu native endianness, rather than be:u16/16>>0 resulting in any userspace code using this information, miss converting the channel and generating thoroughly trashed data. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Cc: stable@vger.kernel.org
2013-12-03Merge v3.13-rc2 into staging-nextGreg Kroah-Hartman
we want these fixes in here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-24iio:magnetometer:hmc5843 - add basic dt supportNeilBrown
Compatible string, documenation and an optional gpio for the dataready pin. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-09staging:iio: Fix hmc5843 Kconfig dependenciesPeter Meerwald
trigger / buffer handling was introduced in changeset cb9b9a82 staging:iio:hmc5843: Add trigger handling Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17staging:iio:hmc5843: Trivial cleanupPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17staging:iio:hmc5843: Check initialization and chip identifierPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17staging:iio:hmc5843: Introduce _set_range_gain()Peter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17staging:iio:hmc5843: Rename _set_rate() to _set_samp_freq()Peter Meerwald
move locking inside _set() function Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17staging:iio:hmc5843: Reorganize _set_meas_conf()Peter Meerwald
move locking inside _set() function Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17staging:iio:hmc5843: Rename _configure() to _set_mode()Peter Meerwald
and be consistent with other setter functions in that first argument is hmc5843_data Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17staging:iio:hmc5843: Remove ability to change operating modePeter Meerwald
only continuous mode is supported for now; the driver could/should be switched to single conversion mode operating mode should be determined by the way IIO accesses the device and not exposed explicitly Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17staging:iio:hmc5843: Add trigger handlingPeter Meerwald
v3: * use __be16 instead of s16 v2 (thanks to Jonathan Cameron): * drop dynamic buffer allocation, buffer is in hmc5842_data * grab timestamp near data acquisition * restrict available scan masks (only read all axis) Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17staging:iio:hmc5843: Always read all channels values otherwise no updatesPeter Meerwald
v2: * use __be16 instead of s16 Split out data ready/wait for read measurement fix bug in case reading status register fails Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17staging:iio:hmc5843: Rename _check_samp_freq to get_samp_freq_indexPeter Meerwald
and drop/inline helper functions _check_int_plus_micros() and _show_int_plus_micros() Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-17staging:iio:hmc5843: Use SCALE instead of magn_rangePeter Meerwald
v3: * rename _check_scale() to _get_scale_index() v2: * use SCALE instead of CALIBSCALE to control the range/gain of measurements Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-01staging:iio:hmc5843: Introduce helper functions to show/check list of int pairsPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-01staging:iio:hmc5843: Tighten commentsPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-01staging:iio:hmc5843: Remove unused LSB register #definesPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-01staging:iio:hmc5843: Use INFO_SAMP_FREQPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-01staging:iio:hmc5843: Rewrite init functionPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-01staging:iio:hmc5843: Add pointer to i2c client to data structPeter Meerwald
and use it to simplify code Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-25Merge 3.12-rc2 into staging-next.Greg Kroah-Hartman
This resolves the merge problem with two iio drivers that Stephen Rothwell pointed out. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>