On 29/06/16 13:08, Linus Walleij wrote: > 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@xxxxxxxxxx> Applied. thanks > --- > ChangeLog v2->v3: > - Rebase > ChangeLog v1->v2: > - No changes. > --- > drivers/iio/magnetometer/ak8975.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c > index f72f51d1f3f5..c67cf3a6128d 100644 > --- a/drivers/iio/magnetometer/ak8975.c > +++ b/drivers/iio/magnetometer/ak8975.c > @@ -399,6 +399,12 @@ static int ak8975_power_on(const struct ak8975_data *data) > "Failed to enable specified Vid supply\n"); > return ret; > } > + /* > + * According to the datasheet the power supply rise time i 200us > + * and the minimum wait time before mode setting is 100us, in > + * total 300 us. Add some margin and say minimum 500us here. > + */ > + usleep_range(500, 1000); > return 0; > } > > -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html