diff options
author | Peter Meerwald <pmeerw@pmeerw.net> | 2015-04-15 16:39:37 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-04-18 15:35:31 -0400 |
commit | 6fa273c1aaa0ab0c22ac4b52879e6bfeea516369 (patch) | |
tree | ddc9d5c239ee694d1848968d30715c8eb39a2a42 | |
parent | 6b57573bd0cd92c54a44ade46c6362b732d55a6c (diff) |
iio:tsl2563: Use tsl2563_ prefix for driver's functions
just cleanup, no functional change
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/iio/light/tsl2563.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c index 94daa9fc1247..12731d6b89ec 100644 --- a/drivers/iio/light/tsl2563.c +++ b/drivers/iio/light/tsl2563.c | |||
@@ -240,7 +240,7 @@ static int tsl2563_read_id(struct tsl2563_chip *chip, u8 *id) | |||
240 | * convert between normalized values and HW values obtained using given | 240 | * convert between normalized values and HW values obtained using given |
241 | * timing and gain settings. | 241 | * timing and gain settings. |
242 | */ | 242 | */ |
243 | static int adc_shiftbits(u8 timing) | 243 | static int tsl2563_adc_shiftbits(u8 timing) |
244 | { | 244 | { |
245 | int shift = 0; | 245 | int shift = 0; |
246 | 246 | ||
@@ -263,9 +263,9 @@ static int adc_shiftbits(u8 timing) | |||
263 | } | 263 | } |
264 | 264 | ||
265 | /* Convert a HW ADC value to normalized scale. */ | 265 | /* Convert a HW ADC value to normalized scale. */ |
266 | static u32 normalize_adc(u16 adc, u8 timing) | 266 | static u32 tsl2563_normalize_adc(u16 adc, u8 timing) |
267 | { | 267 | { |
268 | return adc << adc_shiftbits(timing); | 268 | return adc << tsl2563_adc_shiftbits(timing); |
269 | } | 269 | } |
270 | 270 | ||
271 | static void tsl2563_wait_adc(struct tsl2563_chip *chip) | 271 | static void tsl2563_wait_adc(struct tsl2563_chip *chip) |
@@ -350,8 +350,8 @@ static int tsl2563_get_adc(struct tsl2563_chip *chip) | |||
350 | retry = tsl2563_adjust_gainlevel(chip, adc0); | 350 | retry = tsl2563_adjust_gainlevel(chip, adc0); |
351 | } | 351 | } |
352 | 352 | ||
353 | chip->data0 = normalize_adc(adc0, chip->gainlevel->gaintime); | 353 | chip->data0 = tsl2563_normalize_adc(adc0, chip->gainlevel->gaintime); |
354 | chip->data1 = normalize_adc(adc1, chip->gainlevel->gaintime); | 354 | chip->data1 = tsl2563_normalize_adc(adc1, chip->gainlevel->gaintime); |
355 | 355 | ||
356 | if (!chip->int_enabled) | 356 | if (!chip->int_enabled) |
357 | schedule_delayed_work(&chip->poweroff_work, 5 * HZ); | 357 | schedule_delayed_work(&chip->poweroff_work, 5 * HZ); |
@@ -361,13 +361,13 @@ out: | |||
361 | return ret; | 361 | return ret; |
362 | } | 362 | } |
363 | 363 | ||
364 | static inline int calib_to_sysfs(u32 calib) | 364 | static inline int tsl2563_calib_to_sysfs(u32 calib) |
365 | { | 365 | { |
366 | return (int) (((calib * CALIB_BASE_SYSFS) + | 366 | return (int) (((calib * CALIB_BASE_SYSFS) + |
367 | CALIB_FRAC_HALF) >> CALIB_FRAC_BITS); | 367 | CALIB_FRAC_HALF) >> CALIB_FRAC_BITS); |
368 | } | 368 | } |
369 | 369 | ||
370 | static inline u32 calib_from_sysfs(int value) | 370 | static inline u32 tsl2563_calib_from_sysfs(int value) |
371 | { | 371 | { |
372 | return (((u32) value) << CALIB_FRAC_BITS) / CALIB_BASE_SYSFS; | 372 | return (((u32) value) << CALIB_FRAC_BITS) / CALIB_BASE_SYSFS; |
373 | } | 373 | } |
@@ -426,7 +426,7 @@ static const struct tsl2563_lux_coeff lux_table[] = { | |||
426 | }; | 426 | }; |
427 | 427 | ||
428 | /* Convert normalized, scaled ADC values to lux. */ | 428 | /* Convert normalized, scaled ADC values to lux. */ |
429 | static unsigned int adc_to_lux(u32 adc0, u32 adc1) | 429 | static unsigned int tsl2563_adc_to_lux(u32 adc0, u32 adc1) |
430 | { | 430 | { |
431 | const struct tsl2563_lux_coeff *lp = lux_table; | 431 | const struct tsl2563_lux_coeff *lp = lux_table; |
432 | unsigned long ratio, lux, ch0 = adc0, ch1 = adc1; | 432 | unsigned long ratio, lux, ch0 = adc0, ch1 = adc1; |
@@ -442,7 +442,7 @@ static unsigned int adc_to_lux(u32 adc0, u32 adc1) | |||
442 | } | 442 | } |
443 | 443 | ||
444 | /* Apply calibration coefficient to ADC count. */ | 444 | /* Apply calibration coefficient to ADC count. */ |
445 | static u32 calib_adc(u32 adc, u32 calib) | 445 | static u32 tsl2563_calib_adc(u32 adc, u32 calib) |
446 | { | 446 | { |
447 | unsigned long scaled = adc; | 447 | unsigned long scaled = adc; |
448 | 448 | ||
@@ -463,9 +463,9 @@ static int tsl2563_write_raw(struct iio_dev *indio_dev, | |||
463 | if (mask != IIO_CHAN_INFO_CALIBSCALE) | 463 | if (mask != IIO_CHAN_INFO_CALIBSCALE) |
464 | return -EINVAL; | 464 | return -EINVAL; |
465 | if (chan->channel2 == IIO_MOD_LIGHT_BOTH) | 465 | if (chan->channel2 == IIO_MOD_LIGHT_BOTH) |
466 | chip->calib0 = calib_from_sysfs(val); | 466 | chip->calib0 = tsl2563_calib_from_sysfs(val); |
467 | else if (chan->channel2 == IIO_MOD_LIGHT_IR) | 467 | else if (chan->channel2 == IIO_MOD_LIGHT_IR) |
468 | chip->calib1 = calib_from_sysfs(val); | 468 | chip->calib1 = tsl2563_calib_from_sysfs(val); |
469 | else | 469 | else |
470 | return -EINVAL; | 470 | return -EINVAL; |
471 | 471 | ||
@@ -491,11 +491,11 @@ static int tsl2563_read_raw(struct iio_dev *indio_dev, | |||
491 | ret = tsl2563_get_adc(chip); | 491 | ret = tsl2563_get_adc(chip); |
492 | if (ret) | 492 | if (ret) |
493 | goto error_ret; | 493 | goto error_ret; |
494 | calib0 = calib_adc(chip->data0, chip->calib0) * | 494 | calib0 = tsl2563_calib_adc(chip->data0, chip->calib0) * |
495 | chip->cover_comp_gain; | 495 | chip->cover_comp_gain; |
496 | calib1 = calib_adc(chip->data1, chip->calib1) * | 496 | calib1 = tsl2563_calib_adc(chip->data1, chip->calib1) * |
497 | chip->cover_comp_gain; | 497 | chip->cover_comp_gain; |
498 | *val = adc_to_lux(calib0, calib1); | 498 | *val = tsl2563_adc_to_lux(calib0, calib1); |
499 | ret = IIO_VAL_INT; | 499 | ret = IIO_VAL_INT; |
500 | break; | 500 | break; |
501 | case IIO_INTENSITY: | 501 | case IIO_INTENSITY: |
@@ -515,9 +515,9 @@ static int tsl2563_read_raw(struct iio_dev *indio_dev, | |||
515 | 515 | ||
516 | case IIO_CHAN_INFO_CALIBSCALE: | 516 | case IIO_CHAN_INFO_CALIBSCALE: |
517 | if (chan->channel2 == IIO_MOD_LIGHT_BOTH) | 517 | if (chan->channel2 == IIO_MOD_LIGHT_BOTH) |
518 | *val = calib_to_sysfs(chip->calib0); | 518 | *val = tsl2563_calib_to_sysfs(chip->calib0); |
519 | else | 519 | else |
520 | *val = calib_to_sysfs(chip->calib1); | 520 | *val = tsl2563_calib_to_sysfs(chip->calib1); |
521 | ret = IIO_VAL_INT; | 521 | ret = IIO_VAL_INT; |
522 | break; | 522 | break; |
523 | default: | 523 | default: |
@@ -750,8 +750,8 @@ static int tsl2563_probe(struct i2c_client *client, | |||
750 | chip->high_thres = 0xffff; | 750 | chip->high_thres = 0xffff; |
751 | chip->gainlevel = tsl2563_gainlevel_table; | 751 | chip->gainlevel = tsl2563_gainlevel_table; |
752 | chip->intr = TSL2563_INT_PERSIST(4); | 752 | chip->intr = TSL2563_INT_PERSIST(4); |
753 | chip->calib0 = calib_from_sysfs(CALIB_BASE_SYSFS); | 753 | chip->calib0 = tsl2563_calib_from_sysfs(CALIB_BASE_SYSFS); |
754 | chip->calib1 = calib_from_sysfs(CALIB_BASE_SYSFS); | 754 | chip->calib1 = tsl2563_calib_from_sysfs(CALIB_BASE_SYSFS); |
755 | 755 | ||
756 | if (pdata) | 756 | if (pdata) |
757 | chip->cover_comp_gain = pdata->cover_comp_gain; | 757 | chip->cover_comp_gain = pdata->cover_comp_gain; |