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)
commit9604ed758dd807e749326ae8735f483567d1c35f
tree100148be0f624b1003ce8dd92f47b20e0859ca48
parentc2ea1d0cadde4e8e818b9f0bb13d9c457b7f0334
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