summaryrefslogtreecommitdiff
path: root/drivers/iio/magnetometer
AgeCommit message (Collapse)Author
2015-05-10iio: magn: bmc150_magn: add oversampling ratioIrina Tirdea
Export the oversampling ratio so that the user can change the number of repetions for x/y/z axis. The sampling frequency is limited by the oversampling ratio. The available sampling frequencies might change depending on the values of oversampling_ratio. The specification can be downloaded from: http://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS000-04.pdf. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-05-10iio: magn: Add support for BMC150 magnetometerIrina Tirdea
Add support for the Bosh BMC150 Magnetometer. The specification can be downloaded from: http://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS000-04.pdf. The chip contains both an accelerometer and a magnetometer. This patch adds support only for the magnetometer part. The temperature compensation formulas are based on bmm050_api.c authored by contact@bosch.sensortec.com. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-05-10iio: Allow compile test of GPIO consumers if !GPIOLIBGeert Uytterhoeven
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer functionality only, can still be compiled if GPIOLIB is not enabled. Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where appropriate. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Jonathan Cameron <jic23@kernel.org> Cc: linux-iio@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-05-09Merge tag 'iio-for-v4.2a' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: First round of new drivers, functionality and cleanups for the 4.2 cycle New drivers / device support * st sensors driver, lsm303dlh magnetometer support. * ltr501 - support ltr301 and ltr559 chips. New functionality * IIO_CHAN_INFO_CALIBEMISSIVITY for thermopile sensors. * kxcjk1013 - make driver operational with external trigger. * Add iio targets to the tools Makefile. Cleanups * st sensors - more helpful error message if device id wrong or irq request fails, explicitly make the Block Data Update optional rather than relying on writes to address 0 not doing anything, make interrupt support optional (Not always wired, and not all devices actually have an interrupt line.) * kxcjk-1013 white space additions for readability, add the KXCJ9000 ACPI id as seen in the wild. * sx9500 - GPIO reset support, refactor the GPIO interrupt code, add power management, optimize power usage by powering down when possible, rename the gpio interrupt pin to be more useful, trivial return path simplification, trivial formatting fixes. * isl29018 - move towards ABI compliance with a view to moving this driver out of staging, add some brackets to ensure code works as expected. Note there is no actual bug as the condition being tested is always true (with current devices). * ltr501 - add regmap support to get caching etc for later patches, fix a parameter sanity check that always fails (bug introduced earlier in this series), ACPI enumeration support, interrupt rate control support, interrupt support in general and integration time control support, code alignment cleanups. * mma9553 - a number of little cleanups following a review from Hartmut after I'd already applied the original driver patch. * tmp006 - prefix some defines with TMP006 for consistency. * tsl4531 - cleanup some wrong prefixes, presumably from copy and paste. * mlx90614 - check for errors in read values, add power management, add emissivity setting, add device tree binding documentation, fix a duplicate const warning. * ti_am335x_adc - refactor the DT parsing into a separate function.
2015-05-07iio: magnetometer: support for lsm303dlhLinus Walleij
The LSM303DLH accelerometer/magnetometer has a different device identification method than using register 0x0f, instead three registers contain a magic value. We rely on WhoAmI to be zero for this variant. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-04-26iio:st_sensors: Fix oops when probing SPI devicesAlban Bedel
In SPI mode the transfer buffer is locked with a mutex. However this mutex is only initilized after the probe, but some transfer needs to be done in the probe. To fix this bug we move the mutex initialization at the beginning of the device probe. Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de> Acked-by: Denis Ciocca <denis.ciocca@st.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-04-14Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid Pull HID updates from Jiri Kosina: - quite a few firmware fixes for RMI driver by Andrew Duggan - huion and uclogic drivers have been substantially overlaping in functionality laterly. This redundancy is fixed by hid-huion driver being merged into hid-uclogic; work done by Benjamin Tissoires and Nikolai Kondrashov - i2c-hid now supports ACPI GPIO interrupts; patch from Mika Westerberg - Some of the quirks, that got separated into individual drivers, have historically had EXPERT dependency. As HID subsystem matured (as well as the individual drivers), this made less and less sense. This dependency is now being removed by patch from Jean Delvare - Logitech lg4ff driver received a couple of improvements for mode switching, by Michal Malý - multitouch driver now supports clickpads, patches by Benjamin Tissoires and Seth Forshee - hid-sensor framework received a substantial update; namely support for Custom and Generic pages is being added; work done by Srinivas Pandruvada - wacom driver received substantial update; it now supports i2c-conntected devices (Mika Westerberg), Bamboo PADs are now properly supported (Benjamin Tissoires), much improved battery reporting (Jason Gerecke) and pen proximity cleanups (Ping Cheng) - small assorted fixes and device ID additions * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (68 commits) HID: sensor: Update document for custom sensor HID: sensor: Custom and Generic sensor support HID: debug: fix error handling in hid_debug_events_read() Input - mt: Fix input_mt_get_slot_by_key HID: logitech-hidpp: fix error return code HID: wacom: Add support for Cintiq 13HD Touch HID: logitech-hidpp: add a module parameter to keep firmware gestures HID: usbhid: yet another mouse with ALWAYS_POLL HID: usbhid: more mice with ALWAYS_POLL HID: wacom: set stylus_in_proximity before checking touch_down HID: wacom: use wacom_wac_finger_count_touches to set touch_down HID: wacom: remove hardcoded WACOM_QUIRK_MULTI_INPUT HID: pidff: effect can't be NULL HID: add quirk for PIXART OEM mouse used by HP HID: add HP OEM mouse to quirk ALWAYS_POLL HID: wacom: ask for a in-prox report when it was missed HID: hid-sensor-hub: Fix sparse warning HID: hid-sensor-hub: fix attribute read for logical usage id HID: plantronics: fix Kconfig default HID: pidff: support more than one concurrent effect ...
2015-04-13Merge branch 'for-4.1/sensor-hub' into for-linusJiri Kosina
Conflicts: drivers/iio/common/hid-sensors/hid-sensor-trigger.c include/linux/hid-sensor-hub.h
2015-04-01iio: magnetometer: mag3110: Place driver on standby on errorCristina Opriceana
Place driver on standby mode on error in order to prevent wasting power. Move standby function above to be seen by the new call. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-28iio: ak8975: fix AK09911 dependenciesArnd Bergmann
ak8975 depends on I2C and GPIOLIB, so any symbols that selects ak8975 must have the same dependency, or we get build errors: drivers/iio/magnetometer/ak8975.c: In function 'ak8975_who_i_am': drivers/iio/magnetometer/ak8975.c:393:2: error: implicit declaration of function 'i2c_smbus_read_i2c_block_data' [-Werror=implicit-function-declaration] ret = i2c_smbus_read_i2c_block_data(client, AK09912_REG_WIA1, ^ drivers/iio/magnetometer/ak8975.c: In function 'ak8975_set_mode': drivers/iio/magnetometer/ak8975.c:431:2: error: implicit declaration of function 'i2c_smbus_write_byte_data' [-Werror=implicit-function-declaration] ret = i2c_smbus_write_byte_data(data->client, Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 57e73a423b1e85 ("iio: ak8975: add ak09911 and ak09912 support") Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-02-23HID: hid-sensor-hub: Extend API for async readsSrinivas Pandruvada
Add additional flag to read in async mode. In this mode the caller will get reply via registered callback for capture_sample. Callbacks can be registered using sensor_hub_register_callback function. The usage id parameter of the capture_sample can be matched with the usage id of the requested attribute. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-01-27iio: magnetometer: ak8975: Add AK8963Srinivas Pandruvada
Added AK8963 in the id table. Unfortunately some commercial devices using caps version ak8963. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-01-25iio: hid-sensor-magn-3d: Introduce PMSrinivas Pandruvada
Use common hid sensor iio pm functions. Also the poll time read and wait is part of power up function of hid sensor iio pm function, so remove from the client drivers. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-12-12iio: ak8975: add ak09911 and ak09912 supportGwendal Grignou
Add 2 new definition entries to support ak0991x compass. Add a more advanced function to check we are dealing with the expected device. Remove standalone driver for ak09911. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-12-12iio: ak8975: add definition structure per compass typeGwendal Grignou
For each type of compass supported (AK8975 and AK8963), add a definition structure for register masks, important registers, raw data interpretation. This change will make integrating new type of devices easier. Remove i2c register cache. It is only used for one single register. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-22iio: ak8975: minor fixesGwendal Grignou
Fixes code duplication, return of function. Check client->irq properly when setting up optional irq handler. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-05Merge tag 'iio-for-3.19a' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: First round of new drivers, features and cleanups for IIO in the 3.19 cycle. New drivers / supported parts * rockchip - rk3066-tsadc variant * si7020 humidity and temperature sensor * mcp320x - add mcp3001, mcp3002, mcp3004, mcp3008, mcp3201, mcp3202 * bmp280 pressure and temperature sensor * Qualcomm SPMI PMIC current ADC driver * Exynos_adc - support exynos7 New features * vf610-adc - add temperature sensor support * Documentation of current attributes, scaled pressure, offset and scaled humidity, RGBC intensity gain factor and scale applied to differential voltage channels. * Bring iio_event_monitor up to date with newer modifiers. * Add of_xlate function to allow for complex channel mappings from the device tree. * Add -g parameter to generic_buffer example to allow for devices with directly fed (no trigger) buffers. * Move exynos driver over to syscon for PMU register access. Cleanups, fixes for new drivers * lis3l02dq drop an unneeded else. * st sensors - renam st_sensors to st_sensor_settings (for clarity) * st sensors - drop an unused parameter from all the probe utility functions. * vf610 better error handling and tidy up. * si7020 - cleanups following merge * as3935 - drop some unnecessary semicolons. * bmp280 - fix the pressure calculation.
2014-10-04iio:common: Set the device pointer into ST common sensors libraryDenis CIOCCA
Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-04iio:magnetometer: Removed unnecessary parameter on common_probe functionDenis CIOCCA
Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-04iio:imu: changed structure name from st_sensors to st_sensor_settingsDenis CIOCCA
This patch change structure name and related variables names. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-22Merge 3.17-rc6 into staging-next.Greg Kroah-Hartman
We want the fixes in there, and it resolves a merge issue with drivers/iio/accel/bma180.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-14iio: magn: ak8975: fix unnecessary casting between char* and const char*Irina Tirdea
Use const char* instead of casting const char* to char*. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-14iio:magnetometer: bugfix magnetometers gain valuesiio-fixes-3.17aDenis CIOCCA
This patch fix gains values. The first driver was designed using engineering samples, in mass production the values are changed. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Cc: Stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-08-26iio: remove .owner field for driver using module_platform_driverSanjeev Sharma
This patch removes the .owner field for drivers which use the platform_driver_register api because this is overriden in _platform_driver_register. Signed-off-by: Sanjeev Sharma <Sanjeev_Sharma@mentor.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-27iio: hid-sensor-magn-3d: Fix build warningReyad Attiyat
Fix build warning, sizeof() called on dynamically sized pointer, by removing the call and the dependent function parameter. It is not needed or used in this driver, when pushing values to an iio buffer. Changes from v1 - Fix mistake in varible name Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-24Merge tag 'iio-for-3.17d' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Fourth round of IIO new drivers, functionality and cleanups for the 3.17 cycle New functionality * A new modifier to indicate that a rotation is relative to either true or magnetic north. This is to be used by some magnetometers that provide data in this way. * hid magnetometer now supports output rotations from various variants on North * HMC5843 driver converted to regmap and reworked to allow easy support of other similar devices. Support for HMC5983 added via both i2c and SPI. * Rework of Exynos driver to simplify extension to support more devices. * Addition of support for the Exynos3250 ADC (which requires an additional clock) Support for quite a few more devices on its way. Cleanups * ad7997 - a number of cleanups and tweaks to how the events are controlled to make it more intuitive. * kxcjk - cleanups and minor fixes for this new driver.
2014-07-20iio: hid-sensor-magn-3d: Add support for rotation from northReyad Attiyat
Add the HID usage attribute ID's and IIO channel info for rotation from north support. Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-20iio: hid-sensor-magn-3d: Scan for usage attributes before setting up iio ↵Reyad Attiyat
channels Scan for and count the HID usage attributes supported by the driver. This allows for the driver to only setup the IIO channels for the sensor usages present in the HID USB reports. Changes from v5 -Fixed kernel panic from invalid pointer dereference -Fixed variable assignment style Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-13Merge 3.16-rc5 into staging-nextGreg Kroah-Hartman
We want the fixes in -rc5 in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11iio: st_sensors: add devicetree probing supportLinus Walleij
The I2C devices that make up the STMicroelectronics MEMS sensors may be sneakily enabled by cleverly giving the device node the same name as a string match from the platform device ID table. However the right method is to use the compatible string. On detection, the ST sensors use the ID string to probe and instatiate the right sensor driver, so pass the kernel-internal ID string in the .data field of the OF match table, and set the I2C client name to this name when a compatible match is used. This avoids having misc Linux-specific strings floating around in the device tree. Cc: Lee Jones <lee.jones@linaro.org> Cc: Denis CIOCCA <denis.ciocca@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-07iio:st sensors: remove custom sampling frequence attribute in favour of core ↵Jonathan Cameron
support. This allows in kernel client drivers to access this Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: Denis Ciocca <denis.ciocca@st.com> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
2014-07-05iio: hid-sensor-magn-3d: Fix return valuesSachin Kamat
IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored the actual return values (which could be -EINVAL) and instead returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO upon success. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-06-29Merge tag 'iio-for-3.17b' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second round of new drivers and cleanups for IIO in the 3.17 cycle. New drivers * mcp4902, mcp4912 and mcp4922 SPI DAC driver. * max1027, max1029 and max1031 SPI ADC driver. Cleanups * cm32181 - use devm APIs to simplify error paths. * ak8975 - use devm APIs to simplify error paths. * ad9850 - drop some unused defines and an unnecessary goto. * hmc5843 - add missing devices to the device id table and the documentation. * ad9832 - small formatting cleanups. * sca3000 - hide direct use of the stufftoread element by adding a data_available function. This is a precursor for the addition of buffer watermarks to the subsystem but stands as a good cleanup on its own.
2014-06-29iio: magnetometer: ak8975: Use devm_* APIsBeomho Seo
This patch use devm_* APIs make driver simpler. Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-06-22Merge 3.16-rc2 into staging-nextGreg Kroah-Hartman
We want the staging fixes here as well.
2014-06-18Merge tag 'iio-fixes-for-3.16a' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus Jonathan writes: First set of IIO fixes for the 3.16 cycle. A mixed bag of fixes, many of which feel just to late for 3.15. * hid sensors - some devices need a feature report request in order to change power state. This isn't part of the spec, but has been observed on several devices and does no harm to others. * mpl3115 has had two errors in the buffer description fixed. The presure is signed, not unsigned and the temperature has 12 bits rather than 16. These could lead to incorrect interpretation of the data in userspace. * tsl2x7x - the high byte of the proximity thresholds should be written along with the low byte (which was). This could lead to interesting results with large thresholds. * twl4030 - a flag to specify processed values were required was not set when initializing a reading. As such values returned were in an unknown state. Fixed by simply initializing it appropriately. * IIO_SIMPLE_DUMMY_BUFFER did not select IIO_BUFFER leading to randconfig build errors. * ak8975 was applying an unwanted le16_to_cpu conversion as the i2c framework already performs one. As such for big endian systems, the bytes would be in the wrong order in the magnetic field measurements reported. * mxs-lradc - the controllable voltage dividers were not enabled / disabled for later channels than the first one during conversion. * at91_adc error handling returned -ENOMEM in a u8. Return value of at91_adc_get_trigger_value_by_name changed to int thus allowing -ENOMEM and also original values to be returned. * mcb - mcb_request_mem returns and ERR_PTR but the caller was checking for NULL to detect an error.
2014-06-16iio: AK09911 : 3 axis compass supportSrinivas Pandruvada
Added IIO magnetometer driver for AK09911. In functionality is resembles AK8975 or AK8963. But there are several differences, so instead of modifying existing AK8975 driver and keep it clean, implemented as a separate driver. The key differences are: - Register map is different and have different indexes - AK09911 is a very compact interface with no DRDY pin. So no support of interrupt or GPIO poll - Even for polled mode no mention on ST2 register, which is required in ak8975 driver - mode values are different for fuse access Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-06-07iio: Fix endianness issue in ak8975_read_axis()Peter Meerwald
i2c_smbus_read_word_data() does host endian conversion already, no need for le16_to_cpu() Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: Stable@vger.kernel.org
2014-05-05iio: hid-sensors: Compass 3D: Raw read supportSrinivas Pandruvada
Added support for raw reading of channel. If the sensor is powered off, it will turn on for reading value Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Add API to power on/offSrinivas Pandruvada
Added an API to allow client drivers to turn ON and OFF sensors for quick read. Added data_read as counting varaible instead of boolean, so that sensor is powered off only when last user released it. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-05iio: hid-sensors: Compass 3D: adjust scale and offsetSrinivas Pandruvada
Using units and unit exponent to calculate scale which is compliant to IIO ABI. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-03iio: ak8975: Fix issue with the nameSrinivas Pandruvada
Fixing issue caused by clash of two patches, one adding a name with the acpi enumeration patch. 54ab3e24 Beomho Seo 2014-04-02 @572 indio_dev->name = id->name; d913971e Srinivas Pandruvada 2014-03-19 574 indio_dev->name = name; The name added by commit 54ab3e24 is not required as this is already added by taking care of case where id is NULL. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-03iio:magnetometer:mag3110: Enable user offset calibrationPeter Meerwald
add IIO_CHAN_INFO_CALIBBIAS Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-05-03iio:magnetometer:mag3110: Fix initialization of ctrl_reg1Peter Meerwald
DR bits need to be shifted; since MAG3110_CTRL_DR_DEFAULT is zero, the change has no effect Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-04-26iio: st_sensors: move regulator retrieveal to coreiio-for-3.16aLinus Walleij
Currently the pressure sensor has code to retrieve and enable two regulators for Vdd and Vdd IO, but actually these voltage inputs are found on all of these ST sensors, so move the regulator handling to the core and make sure all the ST sensors call these functions on probe() and remove() to enable/disable power. Here also mover over to obtaining the regulator from the *parent* device of the IIO device, as the IIO device is created on-the-fly in this very subsystem it very unlikely evert have any regulators attached to it whatsoever. It is much more likely that the parent is a platform device, possibly instantiated from a device tree, which in turn have Vdd and Vdd IO supplied assigned to it. Cc: Lee Jones <lee.jones@linaro.org> Cc: Denis CIOCCA <denis.ciocca@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-04-26iio: st_sensors: announce registered sensorsLinus Walleij
It is pretty helpful to know already from dmesg that a certain device is successfully registered, instead of having to browse sysfs to see if it's actually there. Cc: Lee Jones <lee.jones@linaro.org> Cc: Denis CIOCCA <denis.ciocca@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-03-29iio: ak8975: Added ACPI enumerationSrinivas Pandruvada
Added capability so that this device can be enumerated via ACPI. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-03-22iio: ak8975 : Add AK8963 compatibility mode supportSrinivas Pandruvada
AK8963 and AK8975 use same register definitions, except the range of X,Y,Z values. Added support of 8963 based on i2c_device_id. Unfortunately there is no way to detect the type via registers, both device registers return 0x48 as id of chipset. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-25iio:magnetometer:mag3110: Fix unreachable codePeter Meerwald
drivers/iio/magnetometer/mag3110.c:197 mag3110_read_raw() info: ignoring unreachable code. drivers/iio/magnetometer/mag3110.c 185 case IIO_CHAN_INFO_SCALE: 186 switch (chan->type) { 187 case IIO_MAGN: 188 *val = 0; 189 *val2 = 1000; 190 return IIO_VAL_INT_PLUS_MICRO; 191 case IIO_TEMP: 192 *val = 1000; 193 return IIO_VAL_INT; 194 default: 195 return -EINVAL; 196 } 197 return IIO_VAL_INT_PLUS_MICRO; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ introduced by f9279d3a, mag3110: Scale factor missing Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-15iio:magnetometer:mag3110: Scale factor missing for temperaturePeter Meerwald
temperature is reported in milli-Celsius Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>