History log of /linux/drivers/iio/magnetometer/ak8975.c (Results 26 – 50 of 65)
Revision Date Author Comments
# fb158971 21-Feb-2019 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

iio: Allow to read mount matrix from ACPI

Currently mount matrix is allowed in Device Tree, though there is
no technical issue to extend it to support ACPI.

Convert the function to use device_prope

iio: Allow to read mount matrix from ACPI

Currently mount matrix is allowed in Device Tree, though there is
no technical issue to extend it to support ACPI.

Convert the function to use device_property_read_string_array() and
thus allow to read mount matrix from ACPI if available.

Example of use in _DSD method:

Name (_DSD, Package ()
{
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package ()
{
Package () { "mount-matrix", Package() {
"1", "0", "0",
"0", "0.866", "0.5",
"0", "-0.5", "0.866",
} },
}
})

At the same time drop the "of" prefix from its name and
convert current users.

No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

show more ...


# 0a9ff2a1 25-Nov-2018 Stephan Gerhold <stephan@gerhold.net>

iio: magnetometer: ak8975: Add the "AKM9911" ACPI HID

This HID is used on the ASUS MeMO Pad 7 (ME176C) tablet.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Jonathan Cameron <

iio: magnetometer: ak8975: Add the "AKM9911" ACPI HID

This HID is used on the ASUS MeMO Pad 7 (ME176C) tablet.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

show more ...


# 9ed24845 03-Nov-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

iio: magnetometer: ak8975: Add another ACPI ID

Add new ACPI ID for ak9911 as had been found on prototype board.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jon

iio: magnetometer: ak8975: Add another ACPI ID

Add new ACPI ID for ak9911 as had been found on prototype board.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

show more ...


# 7f307262 23-Jul-2017 Jonathan Cameron <jic23@kernel.org>

iio:magnetometer: drop assign iio_info.driver_module and iio_trigger_ops.owner

The equivalent of both of these are now done via macro magic when
the relevant register calls are made. The actual str

iio:magnetometer: drop assign iio_info.driver_module and iio_trigger_ops.owner

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 <Jonathan.Cameron@huawei.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>

show more ...


# 2aac3388 27-Jun-2017 Matthias Kaehlcke <mka@chromium.org>

iio: magnetometer: Only declare ACPI table when ACPI is enable

Don't inflate the kernel size with data that isn't used. The conditional
declaration also fixes the following warning when building wit

iio: magnetometer: Only declare ACPI table when ACPI is enable

Don't inflate the kernel size with data that isn't used. The conditional
declaration also fixes the following warning when building with clang:

drivers/iio/magnetometer/ak8975.c:704:36: error: variable 'ak_acpi_match'
is not needed and will not be emitted
[-Werror,-Wunneeded-internal-declaration]

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# 69c72ec9 25-Sep-2016 Sandhya Bankar <bankarsandhya512@gmail.com>

drivers: iio: magnetometer: Fix sparse endianness warnings cast to restricted __be16

Fix the following sparse endianness warnings:

drivers/iio/magnetometer/ak8975.c:716:16: warning: cast to restric

drivers: iio: magnetometer: Fix sparse endianness warnings cast to restricted __be16

Fix the following sparse endianness warnings:

drivers/iio/magnetometer/ak8975.c:716:16: warning: cast to restricted __le16
drivers/iio/magnetometer/ak8975.c:837:19: warning: cast to restricted __le16
drivers/iio/magnetometer/ak8975.c:838:19: warning: cast to restricted __le16
drivers/iio/magnetometer/ak8975.c:839:19: warning: cast to restricted __le16

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# cde4cb5d 29-Jun-2016 Linus Walleij <linus.walleij@linaro.org>

iio: magn: ak8975: deploy runtime and system PM

This adds runtime PM support to the AK8975 driver. It solves two
problems:

- After reading the first value the chip was left in MODE_ONCE,
meaning

iio: magn: ak8975: deploy runtime and system PM

This adds runtime PM support to the AK8975 driver. It solves two
problems:

- After reading the first value the chip was left in MODE_ONCE,
meaning (presumably) it may be consuming more power. Now the
runtime PM hooks kick in and set it to POWER_DOWN.

- Regulators were simply enabled and left on, making it
impossible to turn the power consuming regulators off because
of the increased refcount. We now disable the regulators at
autosuspend.

- We also handle system suspend: by using pm_runtime_force_suspend()
and pm_runtime_force_resume() from the system PM sleep hooks,
the runtime PM code is managing the power also for this case.
It is currently not completely optimal: when the system resumes
the AK8975 goes into active mode even if noone is going to use
it: currently the force calls need to be paired, but the runtime
PM people are working on making it possible to leave devices
runtime suspended when coming back from sleep.

Inspired by my work on the BH1780 light sensor driver.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# 8d06cd25 29-Jun-2016 Linus Walleij <linus.walleij@linaro.org>

iio: magn: ak8975: make sure to power down at remove()

The code was not powering the magnetometer down properly at
remove(): just cutting the regulators without first setting the
device in power off

iio: magn: ak8975: make sure to power down at remove()

The code was not powering the magnetometer down properly at
remove(): just cutting the regulators without first setting the
device in power off mode. Fix this.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# b1037c1a 29-Jun-2016 Linus Walleij <linus.walleij@linaro.org>

iio: magn: ak8975: allow a delay after enabling regulators

The datasheet actually specifies that we need to wait atleast
500us after powering on the device before trying to set mode.

Signed-off-by:

iio: magn: ak8975: allow a delay after enabling regulators

The datasheet actually specifies that we need to wait atleast
500us after powering on the device before trying to set mode.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# 9e6c16d9 29-Jun-2016 Linus Walleij <linus.walleij@linaro.org>

iio: magn: ak8975: refactor regulator handlers

Move the regulator_get() calls directly into the probe() function,
keep only the power_on()/power_off() functions to flick the
regulators on/off.

Sign

iio: magn: ak8975: refactor regulator handlers

Move the regulator_get() calls directly into the probe() function,
keep only the power_on()/power_off() functions to flick the
regulators on/off.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# b21d3f34 29-Jun-2016 Linus Walleij <linus.walleij@linaro.org>

iio: magn: ak8975: add Vid regulator

The AK8975 has two power sources: Vdd (analog voltage supply)
and Vid (digital voltage supply). Optionally also obtain the Vid
supply regulator and enable it.

I

iio: magn: ak8975: add Vid regulator

The AK8975 has two power sources: Vdd (analog voltage supply)
and Vid (digital voltage supply). Optionally also obtain the Vid
supply regulator and enable it.

If an error occurs when enabling one of the regulators: bail out.

Cc: Gregor Boirie <gregor.boirie@parrot.com>
Cc: Richard Leitner <dev@g0hl1n.net>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# 90e96fdd 29-Jun-2016 Linus Walleij <linus.walleij@linaro.org>

iio: magn: ak8975: fix regulator usage

IS_ERR_OR_NULL() should never be used with regulators because
a NULL pointer may be a perfectly valid dummy regulator

We should always succeed to fetch and en

iio: magn: ak8975: fix regulator usage

IS_ERR_OR_NULL() should never be used with regulators because
a NULL pointer may be a perfectly valid dummy regulator

We should always succeed to fetch and enable a regulator, but
it may be a dummy. That is fine, so bail out for any real
errors or probe deferrals

Include the error code in the warning print so we know what
kind of problem we're dealing with (for example it is nice to
see if it is a probe deferral).

As we will bail out of probe if the regulator is erroneous,
just issue regulator_disable() on the poweroff path: it will
succeed.

Cc: Mark Brown <broonie@kernel.org>
Cc: Lars-Peter Clausen Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# bc2b7dab 09-Mar-2016 Gregor Boirie <gregor.boirie@parrot.com>

iio:core: timestamping clock selection support

Adds a new per-device sysfs attribute "current_timestamp_clock" to allow
userspace to select a particular POSIX clock for buffered samples and
events t

iio:core: timestamping clock selection support

Adds a new per-device sysfs attribute "current_timestamp_clock" to allow
userspace to select a particular POSIX clock for buffered samples and
events timestamping.

Following clocks, as listed in clock_gettime(2), are supported:
CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW,
CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME and
CLOCK_TAI.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Acked-by: Sanchayan Maity <maitysanchayan@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# a8175ba3 29-Apr-2016 Crestez Dan Leonard <leonard.crestez@intel.com>

iio: ak8975: Support adapters limited to BYTE_DATA

The device has simple 8-bit registers but the driver incorrectly uses
block or word reads without checking functionality bits.

Fix by using i2c_sm

iio: ak8975: Support adapters limited to BYTE_DATA

The device has simple 8-bit registers but the driver incorrectly uses
block or word reads without checking functionality bits.

Fix by using i2c_smbus_read_i2c_block_data_or_emulated instead of
i2c_smbus_read_i2c_block_data or i2c_smbus_read_word_data. This will
check functionality bits and use the fastest available transfer method.

Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# 97eacb91 20-Apr-2016 Gregor Boirie <gregor.boirie@parrot.com>

iio:ak8975: add mounting matrix support

Expose a rotation matrix to indicate userspace the chip orientation with
respect to the overall hardware system.
Matrix is retrieved from "in_mount_matrix". I

iio:ak8975: add mounting matrix support

Expose a rotation matrix to indicate userspace the chip orientation with
respect to the overall hardware system.
Matrix is retrieved from "in_mount_matrix". It is declared into ak8975 DTS
entry as a "mount-matrix" property.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# 05be8d41 05-Apr-2016 Richard Leitner <dev@g0hl1n.net>

iio: ak8975: fix maybe-uninitialized warning

If i2c_device_id *id is NULL and acpi_match_device returns NULL too,
then chipset may be unitialized when accessing &ak_def_array[chipset] in
ak8975_prob

iio: ak8975: fix maybe-uninitialized warning

If i2c_device_id *id is NULL and acpi_match_device returns NULL too,
then chipset may be unitialized when accessing &ak_def_array[chipset] in
ak8975_probe. Therefore initialize chipset to AK_MAX_TYPE, which will
return an error when not changed.

This patch fixes the following maybe-uninitialized warning:

drivers/iio/magnetometer/ak8975.c: In function ‘ak8975_probe’:
drivers/iio/magnetometer/ak8975.c:788:14: warning: ‘chipset’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
data->def = &ak_def_array[chipset];

Signed-off-by: Richard Leitner <dev@g0hl1n.net>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# 07d2390e 04-Apr-2016 Krzysztof Kozlowski <k.kozlowski@samsung.com>

iio: ak8975: Fix NULL pointer exception on early interrupt

In certain probe conditions the interrupt came right after registering
the handler causing a NULL pointer exception because of uninitialize

iio: ak8975: Fix NULL pointer exception on early interrupt

In certain probe conditions the interrupt came right after registering
the handler causing a NULL pointer exception because of uninitialized
waitqueue:

$ udevadm trigger
i2c-gpio i2c-gpio-1: using pins 143 (SDA) and 144 (SCL)
i2c-gpio i2c-gpio-3: using pins 53 (SDA) and 52 (SCL)
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = e8b38000
[00000000] *pgd=00000000
Internal error: Oops: 5 [#1] SMP ARM
Modules linked in: snd_soc_i2s(+) i2c_gpio(+) snd_soc_idma snd_soc_s3c_dma snd_soc_core snd_pcm_dmaengine snd_pcm snd_timer snd soundcore ac97_bus spi_s3c64xx pwm_samsung dwc2 exynos_adc phy_exynos_usb2 exynosdrm exynos_rng rng_core rtc_s3c
CPU: 0 PID: 717 Comm: data-provider-m Not tainted 4.6.0-rc1-next-20160401-00011-g1b8d87473b9e-dirty #101
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
(...)
(__wake_up_common) from [<c0379624>] (__wake_up+0x38/0x4c)
(__wake_up) from [<c0a41d30>] (ak8975_irq_handler+0x28/0x30)
(ak8975_irq_handler) from [<c0386720>] (handle_irq_event_percpu+0x88/0x140)
(handle_irq_event_percpu) from [<c038681c>] (handle_irq_event+0x44/0x68)
(handle_irq_event) from [<c0389c40>] (handle_edge_irq+0xf0/0x19c)
(handle_edge_irq) from [<c0385e04>] (generic_handle_irq+0x24/0x34)
(generic_handle_irq) from [<c05ee360>] (exynos_eint_gpio_irq+0x50/0x68)
(exynos_eint_gpio_irq) from [<c0386720>] (handle_irq_event_percpu+0x88/0x140)
(handle_irq_event_percpu) from [<c038681c>] (handle_irq_event+0x44/0x68)
(handle_irq_event) from [<c0389a70>] (handle_fasteoi_irq+0xb4/0x194)
(handle_fasteoi_irq) from [<c0385e04>] (generic_handle_irq+0x24/0x34)
(generic_handle_irq) from [<c03860b4>] (__handle_domain_irq+0x5c/0xb4)
(__handle_domain_irq) from [<c0301774>] (gic_handle_irq+0x54/0x94)
(gic_handle_irq) from [<c030c910>] (__irq_usr+0x50/0x80)

The bug was reproduced on exynos4412-trats2 (with a max77693 device also
using i2c-gpio) after building max77693 as a module.

Cc: <stable@vger.kernel.org>
Fixes: 94a6d5cf7caa ("iio:ak8975 Implement data ready interrupt handling")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# 26b89d7d 14-Apr-2016 Slawomir Stepien <sst@poczta.fm>

iio: magnetometer: ak8975: put else and brace at the same line

This fixes the error reported by checkpatch.pl:

ERROR: else should follow close brace '}'

Signed-off-by: Slawomir Stepien <sst@poczta

iio: magnetometer: ak8975: put else and brace at the same line

This fixes the error reported by checkpatch.pl:

ERROR: else should follow close brace '}'

Signed-off-by: Slawomir Stepien <sst@poczta.fm>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# bc11ca4a 08-Apr-2016 Gregor Boirie <gregor.boirie@parrot.com>

iio:magnetometer:ak8975: triggered buffer support

This will be used together with an external trigger (e.g hrtimer based
software trigger).

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
S

iio:magnetometer:ak8975: triggered buffer support

This will be used together with an external trigger (e.g hrtimer based
software trigger).

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# a9b72c90 17-Mar-2016 Gregor Boirie <gregor.boirie@parrot.com>

iio:magnetometer:ak8975: fix missing regulator_disable

Ensure optional regulator is properly disabled when present.

Fixes: 63d5d525cbbc ("iio:magnetometer:ak8975: power regulator support")
Signed-o

iio:magnetometer:ak8975: fix missing regulator_disable

Ensure optional regulator is properly disabled when present.

Fixes: 63d5d525cbbc ("iio:magnetometer:ak8975: power regulator support")
Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# 63d5d525 03-Mar-2016 Gregor Boirie <gregor.boirie@parrot.com>

iio:magnetometer:ak8975: power regulator support

Add support for an optional regulator which, if found into device-tree,
will power on device at probing time.
The regulator is declared into ak8975 D

iio:magnetometer:ak8975: power regulator support

Add support for an optional regulator which, if found into device-tree,
will power on device at probing time.
The regulator is declared into ak8975 DTS entry as a "vdd-supply" property.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# d3546af6 03-Mar-2016 Gregor Boirie <gregor.boirie@parrot.com>

iio:magnetometer:ak8975: remove unused field

Remove unused struct ak8975_data attrs field.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>


# 55c0c530 03-Mar-2016 Gregor Boirie <gregor.boirie@parrot.com>

iio:magnetometer:ak8975: fix uninitialized chipset

ak_def_array bounds are not properly checked in case of ACPI matching
failure. GCC warns with the following message at line 799:
‘chipset’ may be u

iio:magnetometer:ak8975: fix uninitialized chipset

ak_def_array bounds are not properly checked in case of ACPI matching
failure. GCC warns with the following message at line 799:
‘chipset’ may be used uninitialized in this function.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# f78c5f96 05-Jan-2016 Julia Lawall <Julia.Lawall@lip6.fr>

iio: ak8975: constify ak_def structures

The ak_def structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Sig

iio: ak8975: constify ak_def structures

The ak_def structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# 2d8339d0 09-Jan-2015 Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

iio: magnetometer: ak8975: Add AK8963

Added AK8963 in the id table. Unfortunately some commercial devices
using caps version ak8963.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.in

iio: magnetometer: ak8975: Add AK8963

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>

show more ...


123