Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354221
b: refs/heads/master
c: 5ade763
h: refs/heads/master
i:
  354219: 013491d
v: v3
  • Loading branch information
Jonathan Cameron committed Jan 26, 2013
1 parent 6c635f0 commit 172e1ed
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a9fbbee8a2e90f88ff605ec72b388ec20b808ee4
refs/heads/master: 5ade7633ac324098b31ae859f83cee73129d74d3
66 changes: 33 additions & 33 deletions trunk/drivers/staging/iio/light/tsl2563.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,49 +41,49 @@
#include "tsl2563.h"

/* Use this many bits for fraction part. */
#define ADC_FRAC_BITS (14)
#define ADC_FRAC_BITS 14

/* Given number of 1/10000's in ADC_FRAC_BITS precision. */
#define FRAC10K(f) (((f) * (1L << (ADC_FRAC_BITS))) / (10000))

/* Bits used for fraction in calibration coefficients.*/
#define CALIB_FRAC_BITS (10)
#define CALIB_FRAC_BITS 10
/* 0.5 in CALIB_FRAC_BITS precision */
#define CALIB_FRAC_HALF (1 << (CALIB_FRAC_BITS - 1))
/* Make a fraction from a number n that was multiplied with b. */
#define CALIB_FRAC(n, b) (((n) << CALIB_FRAC_BITS) / (b))
/* Decimal 10^(digits in sysfs presentation) */
#define CALIB_BASE_SYSFS (1000)

#define TSL2563_CMD (0x80)
#define TSL2563_CLEARINT (0x40)

#define TSL2563_REG_CTRL (0x00)
#define TSL2563_REG_TIMING (0x01)
#define TSL2563_REG_LOWLOW (0x02) /* data0 low threshold, 2 bytes */
#define TSL2563_REG_LOWHIGH (0x03)
#define TSL2563_REG_HIGHLOW (0x04) /* data0 high threshold, 2 bytes */
#define TSL2563_REG_HIGHHIGH (0x05)
#define TSL2563_REG_INT (0x06)
#define TSL2563_REG_ID (0x0a)
#define TSL2563_REG_DATA0LOW (0x0c) /* broadband sensor value, 2 bytes */
#define TSL2563_REG_DATA0HIGH (0x0d)
#define TSL2563_REG_DATA1LOW (0x0e) /* infrared sensor value, 2 bytes */
#define TSL2563_REG_DATA1HIGH (0x0f)

#define TSL2563_CMD_POWER_ON (0x03)
#define TSL2563_CMD_POWER_OFF (0x00)
#define TSL2563_CTRL_POWER_MASK (0x03)

#define TSL2563_TIMING_13MS (0x00)
#define TSL2563_TIMING_100MS (0x01)
#define TSL2563_TIMING_400MS (0x02)
#define TSL2563_TIMING_MASK (0x03)
#define TSL2563_TIMING_GAIN16 (0x10)
#define TSL2563_TIMING_GAIN1 (0x00)

#define TSL2563_INT_DISBLED (0x00)
#define TSL2563_INT_LEVEL (0x10)
#define CALIB_BASE_SYSFS 1000

#define TSL2563_CMD 0x80
#define TSL2563_CLEARINT 0x40

#define TSL2563_REG_CTRL 0x00
#define TSL2563_REG_TIMING 0x01
#define TSL2563_REG_LOWLOW 0x02 /* data0 low threshold, 2 bytes */
#define TSL2563_REG_LOWHIGH 0x03
#define TSL2563_REG_HIGHLOW 0x04 /* data0 high threshold, 2 bytes */
#define TSL2563_REG_HIGHHIGH 0x05
#define TSL2563_REG_INT 0x06
#define TSL2563_REG_ID 0x0a
#define TSL2563_REG_DATA0LOW 0x0c /* broadband sensor value, 2 bytes */
#define TSL2563_REG_DATA0HIGH 0x0d
#define TSL2563_REG_DATA1LOW 0x0e /* infrared sensor value, 2 bytes */
#define TSL2563_REG_DATA1HIGH 0x0f

#define TSL2563_CMD_POWER_ON 0x03
#define TSL2563_CMD_POWER_OFF 0x00
#define TSL2563_CTRL_POWER_MASK 0x03

#define TSL2563_TIMING_13MS 0x00
#define TSL2563_TIMING_100MS 0x01
#define TSL2563_TIMING_400MS 0x02
#define TSL2563_TIMING_MASK 0x03
#define TSL2563_TIMING_GAIN16 0x10
#define TSL2563_TIMING_GAIN1 0x00

#define TSL2563_INT_DISBLED 0x00
#define TSL2563_INT_LEVEL 0x10
#define TSL2563_INT_PERSIST(n) ((n) & 0x0F)

struct tsl2563_gainlevel_coeff {
Expand Down

0 comments on commit 172e1ed

Please sign in to comment.