Re: [PATCH 3/3] iio: magnetometer: ak8975: Add gpio reset support

2020-05-29 Thread Pavel Machek
Hi! > AK09911 has a reset gpio to handle register's reset. If reset gpio is > set to low it will trigger the reset. AK09911 datasheed says that if not > used reset pin should be connected to VID and this patch emulates this > situation > > Signed-off-by: Jonathan Albrieux > --- > drivers/iio/ma

Re: [PATCH 3/3] iio: magnetometer: ak8975: Add gpio reset support

2020-05-18 Thread Jonathan Albrieux
On Mon, May 18, 2020 at 08:51:29PM +0300, Andy Shevchenko wrote: > On Mon, May 18, 2020 at 8:43 PM Jonathan Albrieux > wrote: > > > > On Mon, May 18, 2020 at 07:43:17PM +0300, Andy Shevchenko wrote: > > > On Mon, May 18, 2020 at 06:01:20PM +0200, Jonathan Albrieux wrote: > > > > On Mon, May 18, 20

Re: [PATCH 3/3] iio: magnetometer: ak8975: Add gpio reset support

2020-05-18 Thread Andy Shevchenko
On Mon, May 18, 2020 at 8:43 PM Jonathan Albrieux wrote: > > On Mon, May 18, 2020 at 07:43:17PM +0300, Andy Shevchenko wrote: > > On Mon, May 18, 2020 at 06:01:20PM +0200, Jonathan Albrieux wrote: > > > On Mon, May 18, 2020 at 05:55:51PM +0300, Andy Shevchenko wrote: > > > > On Mon, May 18, 2020 a

Re: [PATCH 3/3] iio: magnetometer: ak8975: Add gpio reset support

2020-05-18 Thread Jonathan Albrieux
On Mon, May 18, 2020 at 07:43:17PM +0300, Andy Shevchenko wrote: > On Mon, May 18, 2020 at 06:01:20PM +0200, Jonathan Albrieux wrote: > > On Mon, May 18, 2020 at 05:55:51PM +0300, Andy Shevchenko wrote: > > > On Mon, May 18, 2020 at 4:38 PM Jonathan Albrieux > > > wrote: > > > > > > > + gpi

Re: [PATCH 3/3] iio: magnetometer: ak8975: Add gpio reset support

2020-05-18 Thread Andy Shevchenko
On Mon, May 18, 2020 at 06:01:20PM +0200, Jonathan Albrieux wrote: > On Mon, May 18, 2020 at 05:55:51PM +0300, Andy Shevchenko wrote: > > On Mon, May 18, 2020 at 4:38 PM Jonathan Albrieux > > wrote: > > > > > + gpiod_set_value_cansleep(data->reset_gpiod, 1); > > > > (1) > > > > ... > > >

Re: [PATCH 3/3] iio: magnetometer: ak8975: Add gpio reset support

2020-05-18 Thread Jonathan Albrieux
On Mon, May 18, 2020 at 05:55:51PM +0300, Andy Shevchenko wrote: > On Mon, May 18, 2020 at 4:38 PM Jonathan Albrieux > wrote: > > > + gpiod_set_value_cansleep(data->reset_gpiod, 1); > > (1) > > ... > > > + /* > > +* If reset pin is provided then will be set to high on power

Re: [PATCH 3/3] iio: magnetometer: ak8975: Add gpio reset support

2020-05-18 Thread Andy Shevchenko
On Mon, May 18, 2020 at 4:38 PM Jonathan Albrieux wrote: > + gpiod_set_value_cansleep(data->reset_gpiod, 1); (1) ... > + /* > +* If reset pin is provided then will be set to high on power on > +* and to low on power off according to AK09911 datasheet > +*/

[PATCH 3/3] iio: magnetometer: ak8975: Add gpio reset support

2020-05-18 Thread Jonathan Albrieux
Set reset gpio to high on ak8975_power_on, set reset gpio to low on ak8975_power_off. Without setting it to high on ak8975_power_on driver's probe fails on ak8975_who_i_am while checking for device identity for AK09911 chip AK09911 has a reset gpio to handle register's reset. If reset gpio is set