22 #include <linux/kernel.h>
23 #include <linux/i2c.h>
24 #include <linux/errno.h>
28 #include <linux/slab.h>
29 #include <linux/module.h>
36 #define PROX_STAT_CAL 0
37 #define PROX_STAT_SAMP 1
38 #define MAX_SAMPLES_CAL 200
41 #define TRITON_ID 0x00
42 #define SWORDFISH_ID 0x30
43 #define HALIBUT_ID 0x20
46 #define TSL2X7X_LUX_CALC_OVER_FLOW 65535
53 #define TSL2X7X_MAX_CONFIG_REG 16
56 #define TSL2X7X_CNTRL 0x00
57 #define TSL2X7X_ALS_TIME 0X01
58 #define TSL2X7X_PRX_TIME 0x02
59 #define TSL2X7X_WAIT_TIME 0x03
60 #define TSL2X7X_ALS_MINTHRESHLO 0X04
61 #define TSL2X7X_ALS_MINTHRESHHI 0X05
62 #define TSL2X7X_ALS_MAXTHRESHLO 0X06
63 #define TSL2X7X_ALS_MAXTHRESHHI 0X07
64 #define TSL2X7X_PRX_MINTHRESHLO 0X08
65 #define TSL2X7X_PRX_MINTHRESHHI 0X09
66 #define TSL2X7X_PRX_MAXTHRESHLO 0X0A
67 #define TSL2X7X_PRX_MAXTHRESHHI 0X0B
68 #define TSL2X7X_PERSISTENCE 0x0C
69 #define TSL2X7X_PRX_CONFIG 0x0D
70 #define TSL2X7X_PRX_COUNT 0x0E
71 #define TSL2X7X_GAIN 0x0F
72 #define TSL2X7X_NOTUSED 0x10
73 #define TSL2X7X_REVID 0x11
74 #define TSL2X7X_CHIPID 0x12
75 #define TSL2X7X_STATUS 0x13
76 #define TSL2X7X_ALS_CHAN0LO 0x14
77 #define TSL2X7X_ALS_CHAN0HI 0x15
78 #define TSL2X7X_ALS_CHAN1LO 0x16
79 #define TSL2X7X_ALS_CHAN1HI 0x17
80 #define TSL2X7X_PRX_LO 0x18
81 #define TSL2X7X_PRX_HI 0x19
84 #define TSL2X7X_CMD_REG 0x80
85 #define TSL2X7X_CMD_SPL_FN 0x60
87 #define TSL2X7X_CMD_PROX_INT_CLR 0X05
88 #define TSL2X7X_CMD_ALS_INT_CLR 0x06
89 #define TSL2X7X_CMD_PROXALS_INT_CLR 0X07
92 #define TSL2X7X_CNTL_ADC_ENBL 0x02
93 #define TSL2X7X_CNTL_PWR_ON 0x01
96 #define TSL2X7X_STA_ADC_VALID 0x01
97 #define TSL2X7X_STA_PRX_VALID 0x02
98 #define TSL2X7X_STA_ADC_PRX_VALID (TSL2X7X_STA_ADC_VALID |\
99 TSL2X7X_STA_PRX_VALID)
100 #define TSL2X7X_STA_ALS_INTR 0x10
101 #define TSL2X7X_STA_PRX_INTR 0x20
104 #define TSL2X7X_CNTL_REG_CLEAR 0x00
105 #define TSL2X7X_CNTL_PROX_INT_ENBL 0X20
106 #define TSL2X7X_CNTL_ALS_INT_ENBL 0X10
107 #define TSL2X7X_CNTL_WAIT_TMR_ENBL 0X08
108 #define TSL2X7X_CNTL_PROX_DET_ENBL 0X04
109 #define TSL2X7X_CNTL_PWRON 0x01
110 #define TSL2X7X_CNTL_ALSPON_ENBL 0x03
111 #define TSL2X7X_CNTL_INTALSPON_ENBL 0x13
112 #define TSL2X7X_CNTL_PROXPON_ENBL 0x0F
113 #define TSL2X7X_CNTL_INTPROXPON_ENBL 0x2F
116 #define TSL2X7X_DIODE0 0x10
117 #define TSL2X7X_DIODE1 0x20
118 #define TSL2X7X_DIODE_BOTH 0x30
121 #define TSL2X7X_mA100 0x00
122 #define TSL2X7X_mA50 0x40
123 #define TSL2X7X_mA25 0x80
124 #define TSL2X7X_mA13 0xD0
125 #define TSL2X7X_MAX_TIMER_CNT (0xFF)
128 #define TSL2X7X_EVENT_MASK \
129 (IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING) | \
130 IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING)),
132 #define TSL2X7X_MIN_ITIME 3
202 static const struct tsl2x7x_lux tsl2x71_lux_table[] = {
203 { 14461, 611, 1211 },
208 static const struct tsl2x7x_lux tmd2x71_lux_table[] = {
214 static const struct tsl2x7x_lux tsl2x72_lux_table[] = {
220 static const struct tsl2x7x_lux tmd2x72_lux_table[] = {
226 static const struct tsl2x7x_lux *tsl2x7x_default_lux_table_group[] = {
246 .als_gain_trim = 1000,
247 .als_cal_target = 150,
248 .als_thresh_low = 200,
249 .als_thresh_high = 256,
253 .prox_thres_high = 512,
254 .prox_max_samples_cal = 30,
255 .prox_pulse_count = 8
258 static const s16 tsl2X7X_als_gainadj[] = {
265 static const s16 tsl2X7X_prx_gainadj[] = {
281 static const u8 device_channel_config[] = {
304 int integer = 0, fract = 0, fract_mult = 100000;
305 bool integer_part =
true, negative =
false;
313 if (
'0' <= *buf && *buf <=
'9') {
315 integer = integer*10 + *buf -
'0';
317 fract += fract_mult*(*buf -
'0');
322 }
else if (*buf ==
'\n') {
323 if (*(buf + 1) ==
'\0')
327 }
else if (*buf ==
'.') {
328 integer_part =
false;
342 result->
fract = fract;
362 dev_err(&client->
dev,
"%s: failed to write register %x\n"
372 dev_err(&client->
dev,
"%s: failed to read register %x\n"
393 static int tsl2x7x_get_lux(
struct iio_dev *indio_dev)
417 ret = tsl2x7x_i2c_read(chip->
client,
421 "%s: Failed to read STATUS Reg\n", __func__);
427 "%s: data not valid yet\n", __func__);
432 for (i = 0; i < 4; i++) {
433 ret = tsl2x7x_i2c_read(chip->
client,
438 "%s: failed to read. err=%x\n", __func__, ret);
450 "%s: i2c_write_command failed - err = %d\n",
473 ratio = (ch1 << 15) / ch0;
486 lux = ch0lux - ch1lux;
490 if (ch1lux > ch0lux) {
491 dev_dbg(&chip->
client->dev,
"ch1lux > ch0lux-return last value\n");
515 lux = (lux + 500) / 1000;
537 static int tsl2x7x_get_prox(
struct iio_dev *indio_dev)
547 "%s: Can't get prox mutex\n", __func__);
551 ret = tsl2x7x_i2c_read(chip->
client,
555 "%s: i2c err=%d\n", __func__, ret);
565 if (!(status & TSL2X7X_STA_ADC_VALID))
578 for (i = 0; i < 2; i++) {
579 ret = tsl2x7x_i2c_read(chip->
client,
606 if (chip->
pdata && chip->
pdata->platform_default_settings != 0)
608 chip->
pdata->platform_default_settings,
609 sizeof(tsl2x7x_default_settings));
612 &tsl2x7x_default_settings,
613 sizeof(tsl2x7x_default_settings));
616 if (chip->
pdata && chip->
pdata->platform_lux_table[0].ratio != 0)
618 chip->
pdata->platform_lux_table,
619 sizeof(chip->
pdata->platform_lux_table));
622 (
struct tsl2x7x_lux *)tsl2x7x_default_lux_table_group[chip->
id],
632 static int tsl2x7x_als_calibrate(
struct iio_dev *indio_dev)
644 "%s: failed to write CNTRL register, ret=%d\n",
653 "%s: failed: ADC not enabled\n", __func__);
661 "%s: failed to write ctrl reg: ret=%d\n",
667 if ((reg_val & TSL2X7X_STA_ADC_VALID) != TSL2X7X_STA_ADC_VALID) {
669 "%s: failed: STATUS - ADC not valid.\n", __func__);
673 lux_val = tsl2x7x_get_lux(indio_dev);
676 "%s: failed to get lux\n", __func__);
682 if ((gain_trim_val < 250) || (gain_trim_val > 4000))
687 "%s als_calibrate completed\n", chip->
client->name);
689 return (
int) gain_trim_val;
692 static int tsl2x7x_chip_on(
struct iio_dev *indio_dev)
704 chip->
pdata->power_on(indio_dev);
745 als_time = (als_count * 27 + 5) / 10;
765 "%s: failed on CNTRL reg.\n", __func__);
777 "%s: failed on write to reg %d.\n", __func__, i);
793 "%s: failed on 2nd CTRL reg.\n", __func__);
812 "%s: failed in tsl2x7x_IOCTL_INT_SET.\n",
821 "%s: Failed to clear Int status\n",
830 static int tsl2x7x_chip_off(
struct iio_dev *indio_dev)
858 int tsl2x7x_invoke_change(
struct iio_dev *indio_dev)
867 tsl2x7x_chip_off(indio_dev);
869 tsl2x7x_chip_on(indio_dev);
872 tsl2x7x_chip_off(indio_dev);
881 void tsl2x7x_prox_calculate(
int *
data,
int length,
894 for (i = 0; i <
length; i++) {
895 sample_sum += data[
i];
902 for (i = 0; i <
length; i++) {
903 tmp = data[
i] - statP->
mean;
904 sample_sum += tmp *
tmp;
916 static void tsl2x7x_prox_cal(
struct iio_dev *indio_dev)
928 "%s: max prox samples cal is too big: %d\n",
934 tsl2x7x_chip_off(indio_dev);
941 tsl2x7x_chip_on(indio_dev);
946 tsl2x7x_get_prox(indio_dev);
952 tsl2x7x_chip_off(indio_dev);
954 tsl2x7x_prox_calculate(prox_history,
961 "%s proximity threshold set to %d\n",
967 tsl2x7x_chip_on(indio_dev);
973 struct tsl2X7X_chip *chip = iio_priv(dev_to_iio_dev(dev));
981 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
988 tsl2x7x_chip_on(indio_dev);
990 tsl2x7x_chip_off(indio_dev);
995 static ssize_t tsl2x7x_gain_available_show(
struct device *dev,
998 struct tsl2X7X_chip *chip = iio_priv(dev_to_iio_dev(dev));
1013 static ssize_t tsl2x7x_prox_gain_available_show(
struct device *dev,
1022 struct tsl2X7X_chip *chip = iio_priv(dev_to_iio_dev(dev));
1036 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
1043 tsl2x7x_parse_buffer(buf, &result);
1045 result.
fract /= 1000;
1053 tsl2x7x_invoke_change(indio_dev);
1058 static IIO_CONST_ATTR(in_illuminance0_integration_time_available,
1061 static ssize_t tsl2x7x_als_cal_target_show(
struct device *dev,
1064 struct tsl2X7X_chip *chip = iio_priv(dev_to_iio_dev(dev));
1070 static ssize_t tsl2x7x_als_cal_target_store(
struct device *dev,
1073 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
1075 unsigned long value;
1077 if (kstrtoul(buf, 0, &value))
1083 tsl2x7x_invoke_change(indio_dev);
1089 static ssize_t tsl2x7x_als_persistence_show(
struct device *dev,
1092 struct tsl2X7X_chip *chip = iio_priv(dev_to_iio_dev(dev));
1093 int y, z, filter_delay;
1099 y = (filter_delay / 1000);
1100 z = (filter_delay % 1000);
1105 static ssize_t tsl2x7x_als_persistence_store(
struct device *dev,
1108 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
1111 int y, z, filter_delay;
1115 tsl2x7x_parse_buffer(buf, &result);
1117 result.
fract /= 1000;
1128 __func__, filter_delay);
1130 tsl2x7x_invoke_change(indio_dev);
1135 static ssize_t tsl2x7x_prox_persistence_show(
struct device *dev,
1138 struct tsl2X7X_chip *chip = iio_priv(dev_to_iio_dev(dev));
1139 int y, z, filter_delay;
1145 y = (filter_delay / 1000);
1146 z = (filter_delay % 1000);
1151 static ssize_t tsl2x7x_prox_persistence_store(
struct device *dev,
1154 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
1157 int y, z, filter_delay;
1161 tsl2x7x_parse_buffer(buf, &result);
1163 result.
fract /= 1000;
1174 __func__, filter_delay);
1176 tsl2x7x_invoke_change(indio_dev);
1184 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
1191 tsl2x7x_als_calibrate(indio_dev);
1193 tsl2x7x_invoke_change(indio_dev);
1201 struct tsl2X7X_chip *chip = iio_priv(dev_to_iio_dev(dev));
1226 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
1239 if ((n % 3) || n < 6 ||
1241 dev_info(dev,
"LUX TABLE INPUT ERROR 1 Value[0]=%d\n", n);
1245 if ((value[(n - 2)] | value[(n - 1)] | value[n]) != 0) {
1246 dev_info(dev,
"LUX TABLE INPUT ERROR 2 Value[0]=%d\n", n);
1251 tsl2x7x_chip_off(indio_dev);
1257 tsl2x7x_invoke_change(indio_dev);
1262 static ssize_t tsl2x7x_do_prox_calibrate(
struct device *dev,
1265 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
1272 tsl2x7x_prox_cal(indio_dev);
1274 tsl2x7x_invoke_change(indio_dev);
1279 static int tsl2x7x_read_interrupt_config(
struct iio_dev *indio_dev,
1293 static int tsl2x7x_write_interrupt_config(
struct iio_dev *indio_dev,
1311 tsl2x7x_invoke_change(indio_dev);
1316 static int tsl2x7x_write_thresh(
struct iio_dev *indio_dev,
1346 tsl2x7x_invoke_change(indio_dev);
1351 static int tsl2x7x_read_thresh(
struct iio_dev *indio_dev,
1384 static int tsl2x7x_read_raw(
struct iio_dev *indio_dev,
1395 switch (chan->
type) {
1397 tsl2x7x_get_lux(indio_dev);
1407 switch (chan->
type) {
1409 tsl2x7x_get_lux(indio_dev);
1417 tsl2x7x_get_prox(indio_dev);
1447 static int tsl2x7x_write_raw(
struct iio_dev *indio_dev,
1522 tsl2x7x_invoke_change(indio_dev);
1528 tsl2x7x_power_state_show, tsl2x7x_power_state_store);
1531 tsl2x7x_prox_gain_available_show,
NULL);
1534 tsl2x7x_gain_available_show,
NULL);
1537 tsl2x7x_als_time_show, tsl2x7x_als_time_store);
1540 tsl2x7x_als_cal_target_show, tsl2x7x_als_cal_target_store);
1543 tsl2x7x_do_calibrate);
1546 tsl2x7x_do_prox_calibrate);
1549 tsl2x7x_luxtable_show, tsl2x7x_luxtable_store);
1552 tsl2x7x_als_persistence_show, tsl2x7x_als_persistence_store);
1555 tsl2x7x_prox_persistence_show, tsl2x7x_prox_persistence_store);
1558 static int tsl2x7x_device_id(
unsigned char *
id,
int target)
1582 static irqreturn_t tsl2x7x_event_handler(
int irq,
void *
private)
1584 struct iio_dev *indio_dev =
private;
1595 tsl2x7x_get_prox(indio_dev);
1605 tsl2x7x_get_lux(indio_dev);
1619 "%s: Failed to clear irq from event handler. err = %d\n",
1625 static struct attribute *tsl2x7x_ALS_device_attrs[] = {
1626 &dev_attr_power_state.attr,
1627 &dev_attr_in_illuminance0_calibscale_available.attr,
1628 &dev_attr_in_illuminance0_integration_time.attr,
1629 &iio_const_attr_in_illuminance0_integration_time_available\
1631 &dev_attr_in_illuminance0_target_input.attr,
1632 &dev_attr_in_illuminance0_calibrate.attr,
1633 &dev_attr_in_illuminance0_lux_table.attr,
1637 static struct attribute *tsl2x7x_PRX_device_attrs[] = {
1638 &dev_attr_power_state.attr,
1639 &dev_attr_in_proximity0_calibrate.attr,
1643 static struct attribute *tsl2x7x_ALSPRX_device_attrs[] = {
1644 &dev_attr_power_state.attr,
1645 &dev_attr_in_illuminance0_calibscale_available.attr,
1646 &dev_attr_in_illuminance0_integration_time.attr,
1647 &iio_const_attr_in_illuminance0_integration_time_available\
1649 &dev_attr_in_illuminance0_target_input.attr,
1650 &dev_attr_in_illuminance0_calibrate.attr,
1651 &dev_attr_in_illuminance0_lux_table.attr,
1652 &dev_attr_in_proximity0_calibrate.attr,
1656 static struct attribute *tsl2x7x_PRX2_device_attrs[] = {
1657 &dev_attr_power_state.attr,
1658 &dev_attr_in_proximity0_calibrate.attr,
1659 &dev_attr_in_proximity0_calibscale_available.attr,
1663 static struct attribute *tsl2x7x_ALSPRX2_device_attrs[] = {
1664 &dev_attr_power_state.attr,
1665 &dev_attr_in_illuminance0_calibscale_available.attr,
1666 &dev_attr_in_illuminance0_integration_time.attr,
1667 &iio_const_attr_in_illuminance0_integration_time_available\
1669 &dev_attr_in_illuminance0_target_input.attr,
1670 &dev_attr_in_illuminance0_calibrate.attr,
1671 &dev_attr_in_illuminance0_lux_table.attr,
1672 &dev_attr_in_proximity0_calibrate.attr,
1673 &dev_attr_in_proximity0_calibscale_available.attr,
1677 static struct attribute *tsl2X7X_ALS_event_attrs[] = {
1678 &dev_attr_in_intensity0_thresh_period.attr,
1681 static struct attribute *tsl2X7X_PRX_event_attrs[] = {
1682 &dev_attr_in_proximity0_thresh_period.attr,
1686 static struct attribute *tsl2X7X_ALSPRX_event_attrs[] = {
1687 &dev_attr_in_intensity0_thresh_period.attr,
1688 &dev_attr_in_proximity0_thresh_period.attr,
1692 static const struct attribute_group tsl2X7X_device_attr_group_tbl[] = {
1694 .attrs = tsl2x7x_ALS_device_attrs,
1697 .attrs = tsl2x7x_PRX_device_attrs,
1700 .attrs = tsl2x7x_ALSPRX_device_attrs,
1703 .attrs = tsl2x7x_PRX2_device_attrs,
1706 .attrs = tsl2x7x_ALSPRX2_device_attrs,
1712 .attrs = tsl2X7X_ALS_event_attrs,
1716 .attrs = tsl2X7X_PRX_event_attrs,
1720 .attrs = tsl2X7X_ALSPRX_event_attrs,
1725 static const struct iio_info tsl2X7X_device_info[] = {
1727 .attrs = &tsl2X7X_device_attr_group_tbl[
ALS],
1728 .event_attrs = &tsl2X7X_event_attr_group_tbl[
ALS],
1730 .read_raw = &tsl2x7x_read_raw,
1731 .write_raw = &tsl2x7x_write_raw,
1732 .read_event_value = &tsl2x7x_read_thresh,
1733 .write_event_value = &tsl2x7x_write_thresh,
1734 .read_event_config = &tsl2x7x_read_interrupt_config,
1735 .write_event_config = &tsl2x7x_write_interrupt_config,
1738 .attrs = &tsl2X7X_device_attr_group_tbl[
PRX],
1739 .event_attrs = &tsl2X7X_event_attr_group_tbl[
PRX],
1741 .read_raw = &tsl2x7x_read_raw,
1742 .write_raw = &tsl2x7x_write_raw,
1743 .read_event_value = &tsl2x7x_read_thresh,
1744 .write_event_value = &tsl2x7x_write_thresh,
1745 .read_event_config = &tsl2x7x_read_interrupt_config,
1746 .write_event_config = &tsl2x7x_write_interrupt_config,
1749 .attrs = &tsl2X7X_device_attr_group_tbl[
ALSPRX],
1750 .event_attrs = &tsl2X7X_event_attr_group_tbl[
ALSPRX],
1752 .read_raw = &tsl2x7x_read_raw,
1753 .write_raw = &tsl2x7x_write_raw,
1754 .read_event_value = &tsl2x7x_read_thresh,
1755 .write_event_value = &tsl2x7x_write_thresh,
1756 .read_event_config = &tsl2x7x_read_interrupt_config,
1757 .write_event_config = &tsl2x7x_write_interrupt_config,
1760 .attrs = &tsl2X7X_device_attr_group_tbl[
PRX2],
1761 .event_attrs = &tsl2X7X_event_attr_group_tbl[
PRX],
1763 .read_raw = &tsl2x7x_read_raw,
1764 .write_raw = &tsl2x7x_write_raw,
1765 .read_event_value = &tsl2x7x_read_thresh,
1766 .write_event_value = &tsl2x7x_write_thresh,
1767 .read_event_config = &tsl2x7x_read_interrupt_config,
1768 .write_event_config = &tsl2x7x_write_interrupt_config,
1771 .attrs = &tsl2X7X_device_attr_group_tbl[
ALSPRX2],
1772 .event_attrs = &tsl2X7X_event_attr_group_tbl[
ALSPRX],
1774 .read_raw = &tsl2x7x_read_raw,
1775 .write_raw = &tsl2x7x_write_raw,
1776 .read_event_value = &tsl2x7x_read_thresh,
1777 .write_event_value = &tsl2x7x_write_thresh,
1778 .read_event_config = &tsl2x7x_read_interrupt_config,
1779 .write_event_config = &tsl2x7x_write_interrupt_config,
1805 .chan_table_elements = 3,
1806 .info = &tsl2X7X_device_info[
ALS],
1818 .chan_table_elements = 1,
1819 .info = &tsl2X7X_device_info[
PRX],
1849 .chan_table_elements = 4,
1850 .info = &tsl2X7X_device_info[
ALSPRX],
1863 .chan_table_elements = 1,
1864 .info = &tsl2X7X_device_info[
PRX2],
1895 .chan_table_elements = 4,
1896 .info = &tsl2X7X_device_info[
ALSPRX2],
1912 chip = iio_priv(indio_dev);
1914 i2c_set_clientdata(clientp, indio_dev);
1916 ret = tsl2x7x_i2c_read(chip->
client,
1921 if ((!tsl2x7x_device_id(&device_id, id->driver_data)) ||
1922 (tsl2x7x_device_id(&device_id, id->driver_data) == -
EINVAL)) {
1924 "%s: i2c device found does not match expected id\n",
1931 dev_err(&clientp->
dev,
"%s: write to cmd reg failed. err = %d\n",
1942 chip->
pdata = clientp->
dev.platform_data;
1943 chip->
id =
id->driver_data;
1945 &tsl2x7x_chip_info_tbl[device_channel_config[
id->driver_data]];
1948 indio_dev->
dev.parent = &clientp->
dev;
1957 &tsl2x7x_event_handler,
1963 "%s: irq request failed", __func__);
1969 tsl2x7x_defaults(chip);
1971 tsl2x7x_chip_on(indio_dev);
1976 "%s: iio registration failed\n", __func__);
1993 static int tsl2x7x_suspend(
struct device *dev)
2000 ret = tsl2x7x_chip_off(indio_dev);
2004 if (chip->
pdata && chip->
pdata->platform_power) {
2006 chip->
pdata->platform_power(dev, pmm);
2012 static int tsl2x7x_resume(
struct device *dev)
2018 if (chip->
pdata && chip->
pdata->platform_power) {
2020 chip->
pdata->platform_power(dev, pmm);
2024 ret = tsl2x7x_chip_on(indio_dev);
2031 struct iio_dev *indio_dev = i2c_get_clientdata(client);
2033 tsl2x7x_chip_off(indio_dev);
2060 static const struct dev_pm_ops tsl2x7x_pm_ops = {
2061 .suspend = tsl2x7x_suspend,
2062 .resume = tsl2x7x_resume,
2069 .pm = &tsl2x7x_pm_ops,
2071 .id_table = tsl2x7x_idtable,
2072 .probe = tsl2x7x_probe,