Message ID | 1509904804-4608-2-git-send-email-harinath922@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 2017-11-05 19:00, Harinath Nampally wrote: > Rename time step look up struct to generic name > as the values in the look table are same for all > the other events like pulse, transient etc. > > Signed-off-by: Harinath Nampally <harinath922@gmail.com> Acked-by: Martin Kepplinger <martink@posteo.de> -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sun, 5 Nov 2017 21:36:25 +0100 Martin Kepplinger <martink@posteo.de> wrote: > On 2017-11-05 19:00, Harinath Nampally wrote: > > Rename time step look up struct to generic name > > as the values in the look table are same for all > > the other events like pulse, transient etc. > > > > Signed-off-by: Harinath Nampally <harinath922@gmail.com> > > Acked-by: Martin Kepplinger <martink@posteo.de> > Applied. -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index bfd4bc8..16adf47 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -284,7 +284,7 @@ static const int mma8452_samp_freq[8][2] = { }; /* Datasheet table: step time "Relationship with the ODR" (sample frequency) */ -static const unsigned int mma8452_transient_time_step_us[4][8] = { +static const unsigned int mma8452_time_step_us[4][8] = { { 1250, 2500, 5000, 10000, 20000, 20000, 20000, 20000 }, /* normal */ { 1250, 2500, 5000, 10000, 20000, 80000, 80000, 80000 }, /* l p l n */ { 1250, 2500, 2500, 2500, 2500, 2500, 2500, 2500 }, /* high res*/ @@ -826,7 +826,7 @@ static int mma8452_read_event_value(struct iio_dev *indio_dev, if (power_mode < 0) return power_mode; - us = ret * mma8452_transient_time_step_us[power_mode][ + us = ret * mma8452_time_step_us[power_mode][ mma8452_get_odr_index(data)]; *val = us / USEC_PER_SEC; *val2 = us % USEC_PER_SEC; @@ -883,7 +883,7 @@ static int mma8452_write_event_value(struct iio_dev *indio_dev, return ret; steps = (val * USEC_PER_SEC + val2) / - mma8452_transient_time_step_us[ret][ + mma8452_time_step_us[ret][ mma8452_get_odr_index(data)]; if (steps < 0 || steps > 0xff)
Rename time step look up struct to generic name as the values in the look table are same for all the other events like pulse, transient etc. Signed-off-by: Harinath Nampally <harinath922@gmail.com> --- v4: Shorter subject line and better description in commit message drivers/iio/accel/mma8452.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)