Commit 4e24c171 authored by Brian Masney's avatar Brian Masney Committed by Jonathan Cameron

staging: iio: tsl2x7x: rename driver to tsl2772

This patch renames this driver from tsl2x7x to tsl2772 since it is
highly likely that additional devices will be added to this driver that
do not match that wildcard. The tsl2772 driver name was selected since
that is currently the device with the most features that are supported
by this driver.

This patch also adds Brian Masney's copyright to tsl2772.h for all of
the work that has been done to move this driver out of staging.
Signed-off-by: default avatarBrian Masney <masneyb@onstation.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent da18e890
......@@ -3,7 +3,7 @@
#
menu "Light sensors"
config TSL2x7x
config TSL2772
tristate "TAOS TSL/TMD2x71 and TSL/TMD2x72 Family of light and proximity sensors"
depends on I2C
help
......
......@@ -2,4 +2,4 @@
# Makefile for industrial I/O Light sensors
#
obj-$(CONFIG_TSL2x7x) += tsl2x7x.o
obj-$(CONFIG_TSL2772) += tsl2772.o
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Device driver for monitoring ambient light intensity (lux)
* and proximity (prox) within the TAOS TSL2X7X family of devices.
* and proximity (prox) within the TAOS TSL2772 family of devices.
*
* Copyright (c) 2012, TAOS Corporation.
* Copyright (c) 2017-2018 Brian Masney <masneyb@onstation.org>
*/
#ifndef __TSL2X7X_H
#define __TSL2X7X_H
#ifndef __TSL2772_H
#define __TSL2772_H
struct tsl2x7x_lux {
struct tsl2772_lux {
unsigned int ch0;
unsigned int ch1;
};
/* Max number of segments allowable in LUX table */
#define TSL2X7X_MAX_LUX_TABLE_SIZE 6
#define TSL2772_MAX_LUX_TABLE_SIZE 6
/* The default LUX tables all have 3 elements. */
#define TSL2X7X_DEF_LUX_TABLE_SZ 3
#define TSL2X7X_DEFAULT_TABLE_BYTES (sizeof(struct tsl2x7x_lux) * \
TSL2X7X_DEF_LUX_TABLE_SZ)
#define TSL2772_DEF_LUX_TABLE_SZ 3
#define TSL2772_DEFAULT_TABLE_BYTES (sizeof(struct tsl2772_lux) * \
TSL2772_DEF_LUX_TABLE_SZ)
/* Proximity diode to use */
#define TSL2X7X_DIODE0 0x01
#define TSL2X7X_DIODE1 0x02
#define TSL2X7X_DIODE_BOTH 0x03
#define TSL2772_DIODE0 0x01
#define TSL2772_DIODE1 0x02
#define TSL2772_DIODE_BOTH 0x03
/* LED Power */
#define TSL2X7X_100_mA 0x00
#define TSL2X7X_50_mA 0x01
#define TSL2X7X_25_mA 0x02
#define TSL2X7X_13_mA 0x03
#define TSL2772_100_mA 0x00
#define TSL2772_50_mA 0x01
#define TSL2772_25_mA 0x02
#define TSL2772_13_mA 0x03
/**
* struct tsl2x7x_settings - Settings for the tsl2x7x driver
* struct tsl2772_settings - Settings for the tsl2772 driver
* @als_time: Integration time of the ALS channel ADCs in 2.73 ms
* increments. Total integration time is
* (256 - als_time) * 2.73.
* @als_gain: Index into the tsl2x7x_als_gain array.
* @als_gain: Index into the tsl2772_als_gain array.
* @als_gain_trim: Default gain trim to account for aperture effects.
* @wait_time: Time between proximity and ALS cycles in 2.73
* periods.
* @prox_time: Integration time of the proximity ADC in 2.73 ms
* increments. Total integration time is
* (256 - prx_time) * 2.73.
* @prox_gain: Index into the tsl2x7x_prx_gain array.
* @prox_gain: Index into the tsl2772_prx_gain array.
* @als_prox_config: The value of the ALS / Proximity configuration
* register.
* @als_cal_target: Known external ALS reading for calibration.
......@@ -64,7 +65,7 @@ struct tsl2x7x_lux {
* LED(s) for proximity sensing.
* @prox_power The amount of power to use for the external LED(s).
*/
struct tsl2x7x_settings {
struct tsl2772_settings {
int als_time;
int als_gain;
int als_gain_trim;
......@@ -88,13 +89,13 @@ struct tsl2x7x_settings {
};
/**
* struct tsl2X7X_platform_data - Platform callback, glass and defaults
* struct tsl2772_platform_data - Platform callback, glass and defaults
* @platform_lux_table: Device specific glass coefficents
* @platform_default_settings: Device specific power on defaults
*/
struct tsl2X7X_platform_data {
struct tsl2x7x_lux platform_lux_table[TSL2X7X_MAX_LUX_TABLE_SIZE];
struct tsl2x7x_settings *platform_default_settings;
struct tsl2772_platform_data {
struct tsl2772_lux platform_lux_table[TSL2772_MAX_LUX_TABLE_SIZE];
struct tsl2772_settings *platform_default_settings;
};
#endif /* __TSL2X7X_H */
#endif /* __TSL2772_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment