~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/platform_data/tsl2772.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0+ */
  2 /*
  3  * Device driver for monitoring ambient light intensity (lux)
  4  * and proximity (prox) within the TAOS TSL2772 family of devices.
  5  *
  6  * Copyright (c) 2012, TAOS Corporation.
  7  * Copyright (c) 2017-2018 Brian Masney <masneyb@onstation.org>
  8  */
  9 
 10 #ifndef __TSL2772_H
 11 #define __TSL2772_H
 12 
 13 struct tsl2772_lux {
 14         unsigned int ch0;
 15         unsigned int ch1;
 16 };
 17 
 18 /* Max number of segments allowable in LUX table */
 19 #define TSL2772_MAX_LUX_TABLE_SIZE              6
 20 /* The default LUX tables all have 3 elements.  */
 21 #define TSL2772_DEF_LUX_TABLE_SZ                3
 22 #define TSL2772_DEFAULT_TABLE_BYTES (sizeof(struct tsl2772_lux) * \
 23                                      TSL2772_DEF_LUX_TABLE_SZ)
 24 
 25 /* Proximity diode to use */
 26 #define TSL2772_DIODE0                  0x01
 27 #define TSL2772_DIODE1                  0x02
 28 #define TSL2772_DIODE_BOTH              0x03
 29 
 30 /* LED Power */
 31 #define TSL2772_100_mA                  0x00
 32 #define TSL2772_50_mA                   0x01
 33 #define TSL2772_25_mA                   0x02
 34 #define TSL2772_13_mA                   0x03
 35 
 36 /**
 37  * struct tsl2772_settings - Settings for the tsl2772 driver
 38  *  @als_time:              Integration time of the ALS channel ADCs in 2.73 ms
 39  *                          increments. Total integration time is
 40  *                          (256 - als_time) * 2.73.
 41  *  @als_gain:              Index into the tsl2772_als_gain array.
 42  *  @als_gain_trim:         Default gain trim to account for aperture effects.
 43  *  @wait_time:             Time between proximity and ALS cycles in 2.73
 44  *                          periods.
 45  *  @prox_time:             Integration time of the proximity ADC in 2.73 ms
 46  *                          increments. Total integration time is
 47  *                          (256 - prx_time) * 2.73.
 48  *  @prox_gain:             Index into the tsl2772_prx_gain array.
 49  *  @als_prox_config:       The value of the ALS / Proximity configuration
 50  *                          register.
 51  *  @als_cal_target:        Known external ALS reading for calibration.
 52  *  @als_persistence:       H/W Filters, Number of 'out of limits' ALS readings.
 53  *  @als_interrupt_en:      Enable/Disable ALS interrupts
 54  *  @als_thresh_low:        CH0 'low' count to trigger interrupt.
 55  *  @als_thresh_high:       CH0 'high' count to trigger interrupt.
 56  *  @prox_persistence:      H/W Filters, Number of 'out of limits' proximity
 57  *                          readings.
 58  *  @prox_interrupt_en:     Enable/Disable proximity interrupts.
 59  *  @prox_thres_low:        Low threshold proximity detection.
 60  *  @prox_thres_high:       High threshold proximity detection.
 61  *  @prox_pulse_count:      Number if proximity emitter pulses.
 62  *  @prox_max_samples_cal:  The number of samples that are taken when performing
 63  *                          a proximity calibration.
 64  *  @prox_diode             Which diode(s) to use for driving the external
 65  *                          LED(s) for proximity sensing.
 66  *  @prox_power             The amount of power to use for the external LED(s).
 67  */
 68 struct tsl2772_settings {
 69         int als_time;
 70         int als_gain;
 71         int als_gain_trim;
 72         int wait_time;
 73         int prox_time;
 74         int prox_gain;
 75         int als_prox_config;
 76         int als_cal_target;
 77         u8 als_persistence;
 78         bool als_interrupt_en;
 79         int als_thresh_low;
 80         int als_thresh_high;
 81         u8 prox_persistence;
 82         bool prox_interrupt_en;
 83         int prox_thres_low;
 84         int prox_thres_high;
 85         int prox_pulse_count;
 86         int prox_max_samples_cal;
 87         int prox_diode;
 88         int prox_power;
 89 };
 90 
 91 /**
 92  * struct tsl2772_platform_data - Platform callback, glass and defaults
 93  * @platform_lux_table:        Device specific glass coefficents
 94  * @platform_default_settings: Device specific power on defaults
 95  */
 96 struct tsl2772_platform_data {
 97         struct tsl2772_lux platform_lux_table[TSL2772_MAX_LUX_TABLE_SIZE];
 98         struct tsl2772_settings *platform_default_settings;
 99 };
100 
101 #endif /* __TSL2772_H */
102 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php