GNU Linux-libre 4.9.309-gnu1
[releases.git] / drivers / iio / light / max44000.c
1 /*
2  * MAX44000 Ambient and Infrared Proximity Sensor
3  *
4  * Copyright (c) 2016, Intel Corporation.
5  *
6  * This file is subject to the terms and conditions of version 2 of
7  * the GNU General Public License.  See the file COPYING in the main
8  * directory of this archive for more details.
9  *
10  * Data sheet: https://datasheets.maximintegrated.com/en/ds/MAX44000.pdf
11  *
12  * 7-bit I2C slave address 0x4a
13  */
14
15 #include <linux/module.h>
16 #include <linux/init.h>
17 #include <linux/i2c.h>
18 #include <linux/regmap.h>
19 #include <linux/util_macros.h>
20 #include <linux/iio/iio.h>
21 #include <linux/iio/sysfs.h>
22 #include <linux/iio/buffer.h>
23 #include <linux/iio/trigger_consumer.h>
24 #include <linux/iio/triggered_buffer.h>
25 #include <linux/acpi.h>
26
27 #define MAX44000_DRV_NAME               "max44000"
28
29 /* Registers in datasheet order */
30 #define MAX44000_REG_STATUS             0x00
31 #define MAX44000_REG_CFG_MAIN           0x01
32 #define MAX44000_REG_CFG_RX             0x02
33 #define MAX44000_REG_CFG_TX             0x03
34 #define MAX44000_REG_ALS_DATA_HI        0x04
35 #define MAX44000_REG_ALS_DATA_LO        0x05
36 #define MAX44000_REG_PRX_DATA           0x16
37 #define MAX44000_REG_ALS_UPTHR_HI       0x06
38 #define MAX44000_REG_ALS_UPTHR_LO       0x07
39 #define MAX44000_REG_ALS_LOTHR_HI       0x08
40 #define MAX44000_REG_ALS_LOTHR_LO       0x09
41 #define MAX44000_REG_PST                0x0a
42 #define MAX44000_REG_PRX_IND            0x0b
43 #define MAX44000_REG_PRX_THR            0x0c
44 #define MAX44000_REG_TRIM_GAIN_GREEN    0x0f
45 #define MAX44000_REG_TRIM_GAIN_IR       0x10
46
47 /* REG_CFG bits */
48 #define MAX44000_CFG_ALSINTE            0x01
49 #define MAX44000_CFG_PRXINTE            0x02
50 #define MAX44000_CFG_MASK               0x1c
51 #define MAX44000_CFG_MODE_SHUTDOWN      0x00
52 #define MAX44000_CFG_MODE_ALS_GIR       0x04
53 #define MAX44000_CFG_MODE_ALS_G         0x08
54 #define MAX44000_CFG_MODE_ALS_IR        0x0c
55 #define MAX44000_CFG_MODE_ALS_PRX       0x10
56 #define MAX44000_CFG_MODE_PRX           0x14
57 #define MAX44000_CFG_TRIM               0x20
58
59 /*
60  * Upper 4 bits are not documented but start as 1 on powerup
61  * Setting them to 0 causes proximity to misbehave so set them to 1
62  */
63 #define MAX44000_REG_CFG_RX_DEFAULT 0xf0
64
65 /* REG_RX bits */
66 #define MAX44000_CFG_RX_ALSTIM_MASK     0x0c
67 #define MAX44000_CFG_RX_ALSTIM_SHIFT    2
68 #define MAX44000_CFG_RX_ALSPGA_MASK     0x03
69 #define MAX44000_CFG_RX_ALSPGA_SHIFT    0
70
71 /* REG_TX bits */
72 #define MAX44000_LED_CURRENT_MASK       0xf
73 #define MAX44000_LED_CURRENT_MAX        11
74 #define MAX44000_LED_CURRENT_DEFAULT    6
75
76 #define MAX44000_ALSDATA_OVERFLOW       0x4000
77
78 struct max44000_data {
79         struct mutex lock;
80         struct regmap *regmap;
81         /* Ensure naturally aligned timestamp */
82         struct {
83                 u16 channels[2];
84                 s64 ts __aligned(8);
85         } scan;
86 };
87
88 /* Default scale is set to the minimum of 0.03125 or 1 / (1 << 5) lux */
89 #define MAX44000_ALS_TO_LUX_DEFAULT_FRACTION_LOG2 5
90
91 /* Scale can be multiplied by up to 128x via ALSPGA for measurement gain */
92 static const int max44000_alspga_shift[] = {0, 2, 4, 7};
93 #define MAX44000_ALSPGA_MAX_SHIFT 7
94
95 /*
96  * Scale can be multiplied by up to 64x via ALSTIM because of lost resolution
97  *
98  * This scaling factor is hidden from userspace and instead accounted for when
99  * reading raw values from the device.
100  *
101  * This makes it possible to cleanly expose ALSPGA as IIO_CHAN_INFO_SCALE and
102  * ALSTIM as IIO_CHAN_INFO_INT_TIME without the values affecting each other.
103  *
104  * Handling this internally is also required for buffer support because the
105  * channel's scan_type can't be modified dynamically.
106  */
107 static const int max44000_alstim_shift[] = {0, 2, 4, 6};
108 #define MAX44000_ALSTIM_SHIFT(alstim) (2 * (alstim))
109
110 /* Available integration times with pretty manual alignment: */
111 static const int max44000_int_time_avail_ns_array[] = {
112            100000000,
113             25000000,
114              6250000,
115              1562500,
116 };
117 static const char max44000_int_time_avail_str[] =
118         "0.100 "
119         "0.025 "
120         "0.00625 "
121         "0.0015625";
122
123 /* Available scales (internal to ulux) with pretty manual alignment: */
124 static const int max44000_scale_avail_ulux_array[] = {
125             31250,
126            125000,
127            500000,
128           4000000,
129 };
130 static const char max44000_scale_avail_str[] =
131         "0.03125 "
132         "0.125 "
133         "0.5 "
134          "4";
135
136 #define MAX44000_SCAN_INDEX_ALS 0
137 #define MAX44000_SCAN_INDEX_PRX 1
138
139 static const struct iio_chan_spec max44000_channels[] = {
140         {
141                 .type = IIO_LIGHT,
142                 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
143                 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) |
144                                             BIT(IIO_CHAN_INFO_INT_TIME),
145                 .scan_index = MAX44000_SCAN_INDEX_ALS,
146                 .scan_type = {
147                         .sign           = 'u',
148                         .realbits       = 14,
149                         .storagebits    = 16,
150                 }
151         },
152         {
153                 .type = IIO_PROXIMITY,
154                 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
155                 .scan_index = MAX44000_SCAN_INDEX_PRX,
156                 .scan_type = {
157                         .sign           = 'u',
158                         .realbits       = 8,
159                         .storagebits    = 16,
160                 }
161         },
162         IIO_CHAN_SOFT_TIMESTAMP(2),
163         {
164                 .type = IIO_CURRENT,
165                 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
166                                       BIT(IIO_CHAN_INFO_SCALE),
167                 .extend_name = "led",
168                 .output = 1,
169                 .scan_index = -1,
170         },
171 };
172
173 static int max44000_read_alstim(struct max44000_data *data)
174 {
175         unsigned int val;
176         int ret;
177
178         ret = regmap_read(data->regmap, MAX44000_REG_CFG_RX, &val);
179         if (ret < 0)
180                 return ret;
181         return (val & MAX44000_CFG_RX_ALSTIM_MASK) >> MAX44000_CFG_RX_ALSTIM_SHIFT;
182 }
183
184 static int max44000_write_alstim(struct max44000_data *data, int val)
185 {
186         return regmap_write_bits(data->regmap, MAX44000_REG_CFG_RX,
187                                  MAX44000_CFG_RX_ALSTIM_MASK,
188                                  val << MAX44000_CFG_RX_ALSTIM_SHIFT);
189 }
190
191 static int max44000_read_alspga(struct max44000_data *data)
192 {
193         unsigned int val;
194         int ret;
195
196         ret = regmap_read(data->regmap, MAX44000_REG_CFG_RX, &val);
197         if (ret < 0)
198                 return ret;
199         return (val & MAX44000_CFG_RX_ALSPGA_MASK) >> MAX44000_CFG_RX_ALSPGA_SHIFT;
200 }
201
202 static int max44000_write_alspga(struct max44000_data *data, int val)
203 {
204         return regmap_write_bits(data->regmap, MAX44000_REG_CFG_RX,
205                                  MAX44000_CFG_RX_ALSPGA_MASK,
206                                  val << MAX44000_CFG_RX_ALSPGA_SHIFT);
207 }
208
209 static int max44000_read_alsval(struct max44000_data *data)
210 {
211         u16 regval;
212         int alstim, ret;
213
214         ret = regmap_bulk_read(data->regmap, MAX44000_REG_ALS_DATA_HI,
215                                &regval, sizeof(regval));
216         if (ret < 0)
217                 return ret;
218         alstim = ret = max44000_read_alstim(data);
219         if (ret < 0)
220                 return ret;
221
222         regval = be16_to_cpu(regval);
223
224         /*
225          * Overflow is explained on datasheet page 17.
226          *
227          * It's a warning that either the G or IR channel has become saturated
228          * and that the value in the register is likely incorrect.
229          *
230          * The recommendation is to change the scale (ALSPGA).
231          * The driver just returns the max representable value.
232          */
233         if (regval & MAX44000_ALSDATA_OVERFLOW)
234                 return 0x3FFF;
235
236         return regval << MAX44000_ALSTIM_SHIFT(alstim);
237 }
238
239 static int max44000_write_led_current_raw(struct max44000_data *data, int val)
240 {
241         /* Maybe we should clamp the value instead? */
242         if (val < 0 || val > MAX44000_LED_CURRENT_MAX)
243                 return -ERANGE;
244         if (val >= 8)
245                 val += 4;
246         return regmap_write_bits(data->regmap, MAX44000_REG_CFG_TX,
247                                  MAX44000_LED_CURRENT_MASK, val);
248 }
249
250 static int max44000_read_led_current_raw(struct max44000_data *data)
251 {
252         unsigned int regval;
253         int ret;
254
255         ret = regmap_read(data->regmap, MAX44000_REG_CFG_TX, &regval);
256         if (ret < 0)
257                 return ret;
258         regval &= MAX44000_LED_CURRENT_MASK;
259         if (regval >= 8)
260                 regval -= 4;
261         return regval;
262 }
263
264 static int max44000_read_raw(struct iio_dev *indio_dev,
265                              struct iio_chan_spec const *chan,
266                              int *val, int *val2, long mask)
267 {
268         struct max44000_data *data = iio_priv(indio_dev);
269         int alstim, alspga;
270         unsigned int regval;
271         int ret;
272
273         switch (mask) {
274         case IIO_CHAN_INFO_RAW:
275                 switch (chan->type) {
276                 case IIO_LIGHT:
277                         mutex_lock(&data->lock);
278                         ret = max44000_read_alsval(data);
279                         mutex_unlock(&data->lock);
280                         if (ret < 0)
281                                 return ret;
282                         *val = ret;
283                         return IIO_VAL_INT;
284
285                 case IIO_PROXIMITY:
286                         mutex_lock(&data->lock);
287                         ret = regmap_read(data->regmap, MAX44000_REG_PRX_DATA, &regval);
288                         mutex_unlock(&data->lock);
289                         if (ret < 0)
290                                 return ret;
291                         *val = regval;
292                         return IIO_VAL_INT;
293
294                 case IIO_CURRENT:
295                         mutex_lock(&data->lock);
296                         ret = max44000_read_led_current_raw(data);
297                         mutex_unlock(&data->lock);
298                         if (ret < 0)
299                                 return ret;
300                         *val = ret;
301                         return IIO_VAL_INT;
302
303                 default:
304                         return -EINVAL;
305                 }
306
307         case IIO_CHAN_INFO_SCALE:
308                 switch (chan->type) {
309                 case IIO_CURRENT:
310                         /* Output register is in 10s of miliamps */
311                         *val = 10;
312                         return IIO_VAL_INT;
313
314                 case IIO_LIGHT:
315                         mutex_lock(&data->lock);
316                         alspga = ret = max44000_read_alspga(data);
317                         mutex_unlock(&data->lock);
318                         if (ret < 0)
319                                 return ret;
320
321                         /* Avoid negative shifts */
322                         *val = (1 << MAX44000_ALSPGA_MAX_SHIFT);
323                         *val2 = MAX44000_ALS_TO_LUX_DEFAULT_FRACTION_LOG2
324                                         + MAX44000_ALSPGA_MAX_SHIFT
325                                         - max44000_alspga_shift[alspga];
326                         return IIO_VAL_FRACTIONAL_LOG2;
327
328                 default:
329                         return -EINVAL;
330                 }
331
332         case IIO_CHAN_INFO_INT_TIME:
333                 mutex_lock(&data->lock);
334                 alstim = ret = max44000_read_alstim(data);
335                 mutex_unlock(&data->lock);
336
337                 if (ret < 0)
338                         return ret;
339                 *val = 0;
340                 *val2 = max44000_int_time_avail_ns_array[alstim];
341                 return IIO_VAL_INT_PLUS_NANO;
342
343         default:
344                 return -EINVAL;
345         }
346 }
347
348 static int max44000_write_raw(struct iio_dev *indio_dev,
349                               struct iio_chan_spec const *chan,
350                               int val, int val2, long mask)
351 {
352         struct max44000_data *data = iio_priv(indio_dev);
353         int ret;
354
355         if (mask == IIO_CHAN_INFO_RAW && chan->type == IIO_CURRENT) {
356                 mutex_lock(&data->lock);
357                 ret = max44000_write_led_current_raw(data, val);
358                 mutex_unlock(&data->lock);
359                 return ret;
360         } else if (mask == IIO_CHAN_INFO_INT_TIME && chan->type == IIO_LIGHT) {
361                 s64 valns = val * NSEC_PER_SEC + val2;
362                 int alstim = find_closest_descending(valns,
363                                 max44000_int_time_avail_ns_array,
364                                 ARRAY_SIZE(max44000_int_time_avail_ns_array));
365                 mutex_lock(&data->lock);
366                 ret = max44000_write_alstim(data, alstim);
367                 mutex_unlock(&data->lock);
368                 return ret;
369         } else if (mask == IIO_CHAN_INFO_SCALE && chan->type == IIO_LIGHT) {
370                 s64 valus = val * USEC_PER_SEC + val2;
371                 int alspga = find_closest(valus,
372                                 max44000_scale_avail_ulux_array,
373                                 ARRAY_SIZE(max44000_scale_avail_ulux_array));
374                 mutex_lock(&data->lock);
375                 ret = max44000_write_alspga(data, alspga);
376                 mutex_unlock(&data->lock);
377                 return ret;
378         }
379
380         return -EINVAL;
381 }
382
383 static int max44000_write_raw_get_fmt(struct iio_dev *indio_dev,
384                                       struct iio_chan_spec const *chan,
385                                       long mask)
386 {
387         if (mask == IIO_CHAN_INFO_INT_TIME && chan->type == IIO_LIGHT)
388                 return IIO_VAL_INT_PLUS_NANO;
389         else if (mask == IIO_CHAN_INFO_SCALE && chan->type == IIO_LIGHT)
390                 return IIO_VAL_INT_PLUS_MICRO;
391         else
392                 return IIO_VAL_INT;
393 }
394
395 static IIO_CONST_ATTR(illuminance_integration_time_available, max44000_int_time_avail_str);
396 static IIO_CONST_ATTR(illuminance_scale_available, max44000_scale_avail_str);
397
398 static struct attribute *max44000_attributes[] = {
399         &iio_const_attr_illuminance_integration_time_available.dev_attr.attr,
400         &iio_const_attr_illuminance_scale_available.dev_attr.attr,
401         NULL
402 };
403
404 static const struct attribute_group max44000_attribute_group = {
405         .attrs = max44000_attributes,
406 };
407
408 static const struct iio_info max44000_info = {
409         .driver_module          = THIS_MODULE,
410         .read_raw               = max44000_read_raw,
411         .write_raw              = max44000_write_raw,
412         .write_raw_get_fmt      = max44000_write_raw_get_fmt,
413         .attrs                  = &max44000_attribute_group,
414 };
415
416 static bool max44000_readable_reg(struct device *dev, unsigned int reg)
417 {
418         switch (reg) {
419         case MAX44000_REG_STATUS:
420         case MAX44000_REG_CFG_MAIN:
421         case MAX44000_REG_CFG_RX:
422         case MAX44000_REG_CFG_TX:
423         case MAX44000_REG_ALS_DATA_HI:
424         case MAX44000_REG_ALS_DATA_LO:
425         case MAX44000_REG_PRX_DATA:
426         case MAX44000_REG_ALS_UPTHR_HI:
427         case MAX44000_REG_ALS_UPTHR_LO:
428         case MAX44000_REG_ALS_LOTHR_HI:
429         case MAX44000_REG_ALS_LOTHR_LO:
430         case MAX44000_REG_PST:
431         case MAX44000_REG_PRX_IND:
432         case MAX44000_REG_PRX_THR:
433         case MAX44000_REG_TRIM_GAIN_GREEN:
434         case MAX44000_REG_TRIM_GAIN_IR:
435                 return true;
436         default:
437                 return false;
438         }
439 }
440
441 static bool max44000_writeable_reg(struct device *dev, unsigned int reg)
442 {
443         switch (reg) {
444         case MAX44000_REG_CFG_MAIN:
445         case MAX44000_REG_CFG_RX:
446         case MAX44000_REG_CFG_TX:
447         case MAX44000_REG_ALS_UPTHR_HI:
448         case MAX44000_REG_ALS_UPTHR_LO:
449         case MAX44000_REG_ALS_LOTHR_HI:
450         case MAX44000_REG_ALS_LOTHR_LO:
451         case MAX44000_REG_PST:
452         case MAX44000_REG_PRX_IND:
453         case MAX44000_REG_PRX_THR:
454         case MAX44000_REG_TRIM_GAIN_GREEN:
455         case MAX44000_REG_TRIM_GAIN_IR:
456                 return true;
457         default:
458                 return false;
459         }
460 }
461
462 static bool max44000_volatile_reg(struct device *dev, unsigned int reg)
463 {
464         switch (reg) {
465         case MAX44000_REG_STATUS:
466         case MAX44000_REG_ALS_DATA_HI:
467         case MAX44000_REG_ALS_DATA_LO:
468         case MAX44000_REG_PRX_DATA:
469                 return true;
470         default:
471                 return false;
472         }
473 }
474
475 static bool max44000_precious_reg(struct device *dev, unsigned int reg)
476 {
477         return reg == MAX44000_REG_STATUS;
478 }
479
480 static const struct regmap_config max44000_regmap_config = {
481         .reg_bits       = 8,
482         .val_bits       = 8,
483
484         .max_register   = MAX44000_REG_PRX_DATA,
485         .readable_reg   = max44000_readable_reg,
486         .writeable_reg  = max44000_writeable_reg,
487         .volatile_reg   = max44000_volatile_reg,
488         .precious_reg   = max44000_precious_reg,
489
490         .use_single_rw  = 1,
491         .cache_type     = REGCACHE_RBTREE,
492 };
493
494 static irqreturn_t max44000_trigger_handler(int irq, void *p)
495 {
496         struct iio_poll_func *pf = p;
497         struct iio_dev *indio_dev = pf->indio_dev;
498         struct max44000_data *data = iio_priv(indio_dev);
499         int index = 0;
500         unsigned int regval;
501         int ret;
502
503         mutex_lock(&data->lock);
504         if (test_bit(MAX44000_SCAN_INDEX_ALS, indio_dev->active_scan_mask)) {
505                 ret = max44000_read_alsval(data);
506                 if (ret < 0)
507                         goto out_unlock;
508                 data->scan.channels[index++] = ret;
509         }
510         if (test_bit(MAX44000_SCAN_INDEX_PRX, indio_dev->active_scan_mask)) {
511                 ret = regmap_read(data->regmap, MAX44000_REG_PRX_DATA, &regval);
512                 if (ret < 0)
513                         goto out_unlock;
514                 data->scan.channels[index] = regval;
515         }
516         mutex_unlock(&data->lock);
517
518         iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
519                                            iio_get_time_ns(indio_dev));
520         iio_trigger_notify_done(indio_dev->trig);
521         return IRQ_HANDLED;
522
523 out_unlock:
524         mutex_unlock(&data->lock);
525         iio_trigger_notify_done(indio_dev->trig);
526         return IRQ_HANDLED;
527 }
528
529 static int max44000_probe(struct i2c_client *client,
530                           const struct i2c_device_id *id)
531 {
532         struct max44000_data *data;
533         struct iio_dev *indio_dev;
534         int ret, reg;
535
536         indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
537         if (!indio_dev)
538                 return -ENOMEM;
539         data = iio_priv(indio_dev);
540         data->regmap = devm_regmap_init_i2c(client, &max44000_regmap_config);
541         if (IS_ERR(data->regmap)) {
542                 dev_err(&client->dev, "regmap_init failed!\n");
543                 return PTR_ERR(data->regmap);
544         }
545
546         i2c_set_clientdata(client, indio_dev);
547         mutex_init(&data->lock);
548         indio_dev->dev.parent = &client->dev;
549         indio_dev->info = &max44000_info;
550         indio_dev->name = MAX44000_DRV_NAME;
551         indio_dev->channels = max44000_channels;
552         indio_dev->num_channels = ARRAY_SIZE(max44000_channels);
553
554         /*
555          * The device doesn't have a reset function so we just clear some
556          * important bits at probe time to ensure sane operation.
557          *
558          * Since we don't support interrupts/events the threshold values are
559          * not important. We also don't touch trim values.
560          */
561
562         /* Reset ALS scaling bits */
563         ret = regmap_write(data->regmap, MAX44000_REG_CFG_RX,
564                            MAX44000_REG_CFG_RX_DEFAULT);
565         if (ret < 0) {
566                 dev_err(&client->dev, "failed to write default CFG_RX: %d\n",
567                         ret);
568                 return ret;
569         }
570
571         /*
572          * By default the LED pulse used for the proximity sensor is disabled.
573          * Set a middle value so that we get some sort of valid data by default.
574          */
575         ret = max44000_write_led_current_raw(data, MAX44000_LED_CURRENT_DEFAULT);
576         if (ret < 0) {
577                 dev_err(&client->dev, "failed to write init config: %d\n", ret);
578                 return ret;
579         }
580
581         /* Reset CFG bits to ALS_PRX mode which allows easy reading of both values. */
582         reg = MAX44000_CFG_TRIM | MAX44000_CFG_MODE_ALS_PRX;
583         ret = regmap_write(data->regmap, MAX44000_REG_CFG_MAIN, reg);
584         if (ret < 0) {
585                 dev_err(&client->dev, "failed to write init config: %d\n", ret);
586                 return ret;
587         }
588
589         /* Read status at least once to clear any stale interrupt bits. */
590         ret = regmap_read(data->regmap, MAX44000_REG_STATUS, &reg);
591         if (ret < 0) {
592                 dev_err(&client->dev, "failed to read init status: %d\n", ret);
593                 return ret;
594         }
595
596         ret = iio_triggered_buffer_setup(indio_dev, NULL, max44000_trigger_handler, NULL);
597         if (ret < 0) {
598                 dev_err(&client->dev, "iio triggered buffer setup failed\n");
599                 return ret;
600         }
601
602         return iio_device_register(indio_dev);
603 }
604
605 static int max44000_remove(struct i2c_client *client)
606 {
607         struct iio_dev *indio_dev = i2c_get_clientdata(client);
608
609         iio_device_unregister(indio_dev);
610         iio_triggered_buffer_cleanup(indio_dev);
611
612         return 0;
613 }
614
615 static const struct i2c_device_id max44000_id[] = {
616         {"max44000", 0},
617         { }
618 };
619 MODULE_DEVICE_TABLE(i2c, max44000_id);
620
621 #ifdef CONFIG_ACPI
622 static const struct acpi_device_id max44000_acpi_match[] = {
623         {"MAX44000", 0},
624         { }
625 };
626 MODULE_DEVICE_TABLE(acpi, max44000_acpi_match);
627 #endif
628
629 static struct i2c_driver max44000_driver = {
630         .driver = {
631                 .name   = MAX44000_DRV_NAME,
632                 .acpi_match_table = ACPI_PTR(max44000_acpi_match),
633         },
634         .probe          = max44000_probe,
635         .remove         = max44000_remove,
636         .id_table       = max44000_id,
637 };
638
639 module_i2c_driver(max44000_driver);
640
641 MODULE_AUTHOR("Crestez Dan Leonard <leonard.crestez@intel.com>");
642 MODULE_DESCRIPTION("MAX44000 Ambient and Infrared Proximity Sensor");
643 MODULE_LICENSE("GPL v2");