summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBrian Masney <masneyb@onstation.org>2018-05-10 20:12:23 -0400
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2018-05-12 12:40:04 +0100
commitc06c4d793584b965bf5fa3fb107f6279643574e2 (patch)
tree1b4a003ad15dc6d519613544b2a3fc74fa569a4f /drivers
parent4e24c1719f3485780b2be559e5fc11d091139935 (diff)
downloadlinux-stable-c06c4d793584b965bf5fa3fb107f6279643574e2.tar.gz
linux-stable-c06c4d793584b965bf5fa3fb107f6279643574e2.tar.bz2
linux-stable-c06c4d793584b965bf5fa3fb107f6279643574e2.zip
staging: iio: tsl2x7x/tsl2772: move out of staging
Move the tsl2772 driver out of staging and into mainline. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iio/light/Kconfig8
-rw-r--r--drivers/iio/light/Makefile1
-rw-r--r--drivers/iio/light/tsl2772.c (renamed from drivers/staging/iio/light/tsl2772.c)2
-rw-r--r--drivers/staging/iio/Kconfig1
-rw-r--r--drivers/staging/iio/Makefile1
-rw-r--r--drivers/staging/iio/light/Kconfig14
-rw-r--r--drivers/staging/iio/light/Makefile5
-rw-r--r--drivers/staging/iio/light/tsl2772.h101
8 files changed, 10 insertions, 123 deletions
diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig
index 074e50657366..c7ef8d1862d6 100644
--- a/drivers/iio/light/Kconfig
+++ b/drivers/iio/light/Kconfig
@@ -409,6 +409,14 @@ config TSL2583
Provides support for the TAOS tsl2580, tsl2581 and tsl2583 devices.
Access ALS data via iio, sysfs.
+config TSL2772
+ tristate "TAOS TSL/TMD2x71 and TSL/TMD2x72 Family of light and proximity sensors"
+ depends on I2C
+ help
+ Support for: tsl2571, tsl2671, tmd2671, tsl2771, tmd2771, tsl2572, tsl2672,
+ tmd2672, tsl2772, tmd2772 devices.
+ Provides iio_events and direct access via sysfs.
+
config TSL4531
tristate "TAOS TSL4531 ambient light sensors"
depends on I2C
diff --git a/drivers/iio/light/Makefile b/drivers/iio/light/Makefile
index f1777036d4f8..80943af5d627 100644
--- a/drivers/iio/light/Makefile
+++ b/drivers/iio/light/Makefile
@@ -40,6 +40,7 @@ obj-$(CONFIG_ST_UVIS25_SPI) += st_uvis25_spi.o
obj-$(CONFIG_TCS3414) += tcs3414.o
obj-$(CONFIG_TCS3472) += tcs3472.o
obj-$(CONFIG_TSL2583) += tsl2583.o
+obj-$(CONFIG_TSL2772) += tsl2772.o
obj-$(CONFIG_TSL4531) += tsl4531.o
obj-$(CONFIG_US5182D) += us5182d.o
obj-$(CONFIG_VCNL4000) += vcnl4000.o
diff --git a/drivers/staging/iio/light/tsl2772.c b/drivers/iio/light/tsl2772.c
index a59bf39c28d4..34d42a2504c9 100644
--- a/drivers/staging/iio/light/tsl2772.c
+++ b/drivers/iio/light/tsl2772.c
@@ -19,7 +19,7 @@
#include <linux/iio/events.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
-#include "tsl2772.h"
+#include <linux/platform_data/tsl2772.h>
/* Cal defs */
#define PROX_STAT_CAL 0
diff --git a/drivers/staging/iio/Kconfig b/drivers/staging/iio/Kconfig
index bd9445956511..aee2335a25a1 100644
--- a/drivers/staging/iio/Kconfig
+++ b/drivers/staging/iio/Kconfig
@@ -11,7 +11,6 @@ source "drivers/staging/iio/cdc/Kconfig"
source "drivers/staging/iio/frequency/Kconfig"
source "drivers/staging/iio/gyro/Kconfig"
source "drivers/staging/iio/impedance-analyzer/Kconfig"
-source "drivers/staging/iio/light/Kconfig"
source "drivers/staging/iio/meter/Kconfig"
source "drivers/staging/iio/resolver/Kconfig"
diff --git a/drivers/staging/iio/Makefile b/drivers/staging/iio/Makefile
index e99a375c07b9..c28d657497de 100644
--- a/drivers/staging/iio/Makefile
+++ b/drivers/staging/iio/Makefile
@@ -10,6 +10,5 @@ obj-y += cdc/
obj-y += frequency/
obj-y += gyro/
obj-y += impedance-analyzer/
-obj-y += light/
obj-y += meter/
obj-y += resolver/
diff --git a/drivers/staging/iio/light/Kconfig b/drivers/staging/iio/light/Kconfig
deleted file mode 100644
index dfa37386ad2c..000000000000
--- a/drivers/staging/iio/light/Kconfig
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Light sensors
-#
-menu "Light sensors"
-
-config TSL2772
- tristate "TAOS TSL/TMD2x71 and TSL/TMD2x72 Family of light and proximity sensors"
- depends on I2C
- help
- Support for: tsl2571, tsl2671, tmd2671, tsl2771, tmd2771, tsl2572, tsl2672,
- tmd2672, tsl2772, tmd2772 devices.
- Provides iio_events and direct access via sysfs.
-
-endmenu
diff --git a/drivers/staging/iio/light/Makefile b/drivers/staging/iio/light/Makefile
deleted file mode 100644
index e7e77a11f02a..000000000000
--- a/drivers/staging/iio/light/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for industrial I/O Light sensors
-#
-
-obj-$(CONFIG_TSL2772) += tsl2772.o
diff --git a/drivers/staging/iio/light/tsl2772.h b/drivers/staging/iio/light/tsl2772.h
deleted file mode 100644
index f8ade15a35e2..000000000000
--- a/drivers/staging/iio/light/tsl2772.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Device driver for monitoring ambient light intensity (lux)
- * 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 __TSL2772_H
-#define __TSL2772_H
-
-struct tsl2772_lux {
- unsigned int ch0;
- unsigned int ch1;
-};
-
-/* Max number of segments allowable in LUX table */
-#define TSL2772_MAX_LUX_TABLE_SIZE 6
-/* The default LUX tables all have 3 elements. */
-#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 TSL2772_DIODE0 0x01
-#define TSL2772_DIODE1 0x02
-#define TSL2772_DIODE_BOTH 0x03
-
-/* LED Power */
-#define TSL2772_100_mA 0x00
-#define TSL2772_50_mA 0x01
-#define TSL2772_25_mA 0x02
-#define TSL2772_13_mA 0x03
-
-/**
- * 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 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 tsl2772_prx_gain array.
- * @als_prox_config: The value of the ALS / Proximity configuration
- * register.
- * @als_cal_target: Known external ALS reading for calibration.
- * @als_persistence: H/W Filters, Number of 'out of limits' ALS readings.
- * @als_interrupt_en: Enable/Disable ALS interrupts
- * @als_thresh_low: CH0 'low' count to trigger interrupt.
- * @als_thresh_high: CH0 'high' count to trigger interrupt.
- * @prox_persistence: H/W Filters, Number of 'out of limits' proximity
- * readings.
- * @prox_interrupt_en: Enable/Disable proximity interrupts.
- * @prox_thres_low: Low threshold proximity detection.
- * @prox_thres_high: High threshold proximity detection.
- * @prox_pulse_count: Number if proximity emitter pulses.
- * @prox_max_samples_cal: The number of samples that are taken when performing
- * a proximity calibration.
- * @prox_diode Which diode(s) to use for driving the external
- * LED(s) for proximity sensing.
- * @prox_power The amount of power to use for the external LED(s).
- */
-struct tsl2772_settings {
- int als_time;
- int als_gain;
- int als_gain_trim;
- int wait_time;
- int prox_time;
- int prox_gain;
- int als_prox_config;
- int als_cal_target;
- u8 als_persistence;
- bool als_interrupt_en;
- int als_thresh_low;
- int als_thresh_high;
- u8 prox_persistence;
- bool prox_interrupt_en;
- int prox_thres_low;
- int prox_thres_high;
- int prox_pulse_count;
- int prox_max_samples_cal;
- int prox_diode;
- int prox_power;
-};
-
-/**
- * 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 tsl2772_platform_data {
- struct tsl2772_lux platform_lux_table[TSL2772_MAX_LUX_TABLE_SIZE];
- struct tsl2772_settings *platform_default_settings;
-};
-
-#endif /* __TSL2772_H */