]> git.baikalelectronics.ru Git - kernel.git/commit
iio: magnetometer: ak8975: Add gpio reset support
authorJonathan Albrieux <jonathan.albrieux@gmail.com>
Thu, 28 May 2020 15:01:05 +0000 (17:01 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 14 Jun 2020 10:49:31 +0000 (11:49 +0100)
commit969d6013bb95413ff45579d3abbfce222139a9f5
tree100148be0f624b1003ce8dd92f47b20e0859ca48
parentc2e6f48d56fb25ea482a291861902e31a03b8d55
iio: magnetometer: ak8975: Add gpio reset support

According to AK09911 datasheet, if reset gpio is provided then
deassert reset on ak8975_power_on() and assert reset on ak8975_power_off().

Without reset's deassertion during ak8975_power_on(), driver's probe fails
on ak8975_who_i_am() while checking for device identity for AK09911 chip.

AK09911 has an active low reset gpio to handle register's reset.
AK09911 datasheet says that, if not used, reset pin should be connected
to VID. This patch emulates this situation.

Signed-off-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/magnetometer/ak8975.c