NFS: Don't clear desc->pg_moreio in nfs_do_recoalesce()
[linux/fpc-iii.git] / drivers / iio / proximity / sx9500.c
blobfa40f6d0ca394f0ae41f6509d6f6c3079062b77e
1 /*
2 * Copyright (c) 2014 Intel Corporation
4 * Driver for Semtech's SX9500 capacitive proximity/button solution.
5 * Datasheet available at
6 * <http://www.semtech.com/images/datasheet/sx9500.pdf>.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published by
10 * the Free Software Foundation.
13 #include <linux/kernel.h>
14 #include <linux/slab.h>
15 #include <linux/module.h>
16 #include <linux/i2c.h>
17 #include <linux/irq.h>
18 #include <linux/acpi.h>
19 #include <linux/gpio/consumer.h>
20 #include <linux/regmap.h>
22 #include <linux/iio/iio.h>
23 #include <linux/iio/buffer.h>
24 #include <linux/iio/sysfs.h>
25 #include <linux/iio/events.h>
26 #include <linux/iio/trigger.h>
27 #include <linux/iio/triggered_buffer.h>
28 #include <linux/iio/trigger_consumer.h>
30 #define SX9500_DRIVER_NAME "sx9500"
31 #define SX9500_IRQ_NAME "sx9500_event"
32 #define SX9500_GPIO_NAME "sx9500_gpio"
34 /* Register definitions. */
35 #define SX9500_REG_IRQ_SRC 0x00
36 #define SX9500_REG_STAT 0x01
37 #define SX9500_REG_IRQ_MSK 0x03
39 #define SX9500_REG_PROX_CTRL0 0x06
40 #define SX9500_REG_PROX_CTRL1 0x07
41 #define SX9500_REG_PROX_CTRL2 0x08
42 #define SX9500_REG_PROX_CTRL3 0x09
43 #define SX9500_REG_PROX_CTRL4 0x0a
44 #define SX9500_REG_PROX_CTRL5 0x0b
45 #define SX9500_REG_PROX_CTRL6 0x0c
46 #define SX9500_REG_PROX_CTRL7 0x0d
47 #define SX9500_REG_PROX_CTRL8 0x0e
49 #define SX9500_REG_SENSOR_SEL 0x20
50 #define SX9500_REG_USE_MSB 0x21
51 #define SX9500_REG_USE_LSB 0x22
52 #define SX9500_REG_AVG_MSB 0x23
53 #define SX9500_REG_AVG_LSB 0x24
54 #define SX9500_REG_DIFF_MSB 0x25
55 #define SX9500_REG_DIFF_LSB 0x26
56 #define SX9500_REG_OFFSET_MSB 0x27
57 #define SX9500_REG_OFFSET_LSB 0x28
59 #define SX9500_REG_RESET 0x7f
61 /* Write this to REG_RESET to do a soft reset. */
62 #define SX9500_SOFT_RESET 0xde
64 #define SX9500_SCAN_PERIOD_MASK GENMASK(6, 4)
65 #define SX9500_SCAN_PERIOD_SHIFT 4
68 * These serve for identifying IRQ source in the IRQ_SRC register, and
69 * also for masking the IRQs in the IRQ_MSK register.
71 #define SX9500_CLOSE_IRQ BIT(6)
72 #define SX9500_FAR_IRQ BIT(5)
73 #define SX9500_CONVDONE_IRQ BIT(3)
75 #define SX9500_PROXSTAT_SHIFT 4
77 #define SX9500_NUM_CHANNELS 4
79 struct sx9500_data {
80 struct mutex mutex;
81 struct i2c_client *client;
82 struct iio_trigger *trig;
83 struct regmap *regmap;
85 * Last reading of the proximity status for each channel. We
86 * only send an event to user space when this changes.
88 bool prox_stat[SX9500_NUM_CHANNELS];
89 bool event_enabled[SX9500_NUM_CHANNELS];
90 bool trigger_enabled;
91 u16 *buffer;
94 static const struct iio_event_spec sx9500_events[] = {
96 .type = IIO_EV_TYPE_THRESH,
97 .dir = IIO_EV_DIR_EITHER,
98 .mask_separate = BIT(IIO_EV_INFO_ENABLE),
102 #define SX9500_CHANNEL(idx) \
104 .type = IIO_PROXIMITY, \
105 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
106 .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \
107 .indexed = 1, \
108 .channel = idx, \
109 .event_spec = sx9500_events, \
110 .num_event_specs = ARRAY_SIZE(sx9500_events), \
111 .scan_index = idx, \
112 .scan_type = { \
113 .sign = 'u', \
114 .realbits = 16, \
115 .storagebits = 16, \
116 .shift = 0, \
117 }, \
120 static const struct iio_chan_spec sx9500_channels[] = {
121 SX9500_CHANNEL(0),
122 SX9500_CHANNEL(1),
123 SX9500_CHANNEL(2),
124 SX9500_CHANNEL(3),
125 IIO_CHAN_SOFT_TIMESTAMP(4),
128 static const struct {
129 int val;
130 int val2;
131 } sx9500_samp_freq_table[] = {
132 {33, 333333},
133 {16, 666666},
134 {11, 111111},
135 {8, 333333},
136 {6, 666666},
137 {5, 0},
138 {3, 333333},
139 {2, 500000},
142 static const struct regmap_range sx9500_writable_reg_ranges[] = {
143 regmap_reg_range(SX9500_REG_IRQ_MSK, SX9500_REG_IRQ_MSK),
144 regmap_reg_range(SX9500_REG_PROX_CTRL0, SX9500_REG_PROX_CTRL8),
145 regmap_reg_range(SX9500_REG_SENSOR_SEL, SX9500_REG_SENSOR_SEL),
146 regmap_reg_range(SX9500_REG_OFFSET_MSB, SX9500_REG_OFFSET_LSB),
147 regmap_reg_range(SX9500_REG_RESET, SX9500_REG_RESET),
150 static const struct regmap_access_table sx9500_writeable_regs = {
151 .yes_ranges = sx9500_writable_reg_ranges,
152 .n_yes_ranges = ARRAY_SIZE(sx9500_writable_reg_ranges),
156 * All allocated registers are readable, so we just list unallocated
157 * ones.
159 static const struct regmap_range sx9500_non_readable_reg_ranges[] = {
160 regmap_reg_range(SX9500_REG_STAT + 1, SX9500_REG_STAT + 1),
161 regmap_reg_range(SX9500_REG_IRQ_MSK + 1, SX9500_REG_PROX_CTRL0 - 1),
162 regmap_reg_range(SX9500_REG_PROX_CTRL8 + 1, SX9500_REG_SENSOR_SEL - 1),
163 regmap_reg_range(SX9500_REG_OFFSET_LSB + 1, SX9500_REG_RESET - 1),
166 static const struct regmap_access_table sx9500_readable_regs = {
167 .no_ranges = sx9500_non_readable_reg_ranges,
168 .n_no_ranges = ARRAY_SIZE(sx9500_non_readable_reg_ranges),
171 static const struct regmap_range sx9500_volatile_reg_ranges[] = {
172 regmap_reg_range(SX9500_REG_IRQ_SRC, SX9500_REG_STAT),
173 regmap_reg_range(SX9500_REG_USE_MSB, SX9500_REG_OFFSET_LSB),
174 regmap_reg_range(SX9500_REG_RESET, SX9500_REG_RESET),
177 static const struct regmap_access_table sx9500_volatile_regs = {
178 .yes_ranges = sx9500_volatile_reg_ranges,
179 .n_yes_ranges = ARRAY_SIZE(sx9500_volatile_reg_ranges),
182 static const struct regmap_config sx9500_regmap_config = {
183 .reg_bits = 8,
184 .val_bits = 8,
186 .max_register = SX9500_REG_RESET,
187 .cache_type = REGCACHE_RBTREE,
189 .wr_table = &sx9500_writeable_regs,
190 .rd_table = &sx9500_readable_regs,
191 .volatile_table = &sx9500_volatile_regs,
194 static int sx9500_read_proximity(struct sx9500_data *data,
195 const struct iio_chan_spec *chan,
196 int *val)
198 int ret;
199 __be16 regval;
201 ret = regmap_write(data->regmap, SX9500_REG_SENSOR_SEL, chan->channel);
202 if (ret < 0)
203 return ret;
205 ret = regmap_bulk_read(data->regmap, SX9500_REG_USE_MSB, &regval, 2);
206 if (ret < 0)
207 return ret;
209 *val = 32767 - (s16)be16_to_cpu(regval);
211 return IIO_VAL_INT;
214 static int sx9500_read_samp_freq(struct sx9500_data *data,
215 int *val, int *val2)
217 int ret;
218 unsigned int regval;
220 mutex_lock(&data->mutex);
221 ret = regmap_read(data->regmap, SX9500_REG_PROX_CTRL0, &regval);
222 mutex_unlock(&data->mutex);
224 if (ret < 0)
225 return ret;
227 regval = (regval & SX9500_SCAN_PERIOD_MASK) >> SX9500_SCAN_PERIOD_SHIFT;
228 *val = sx9500_samp_freq_table[regval].val;
229 *val2 = sx9500_samp_freq_table[regval].val2;
231 return IIO_VAL_INT_PLUS_MICRO;
234 static int sx9500_read_raw(struct iio_dev *indio_dev,
235 const struct iio_chan_spec *chan,
236 int *val, int *val2, long mask)
238 struct sx9500_data *data = iio_priv(indio_dev);
239 int ret;
241 switch (chan->type) {
242 case IIO_PROXIMITY:
243 switch (mask) {
244 case IIO_CHAN_INFO_RAW:
245 if (iio_buffer_enabled(indio_dev))
246 return -EBUSY;
247 mutex_lock(&data->mutex);
248 ret = sx9500_read_proximity(data, chan, val);
249 mutex_unlock(&data->mutex);
250 return ret;
251 case IIO_CHAN_INFO_SAMP_FREQ:
252 return sx9500_read_samp_freq(data, val, val2);
253 default:
254 return -EINVAL;
256 default:
257 return -EINVAL;
261 static int sx9500_set_samp_freq(struct sx9500_data *data,
262 int val, int val2)
264 int i, ret;
266 for (i = 0; i < ARRAY_SIZE(sx9500_samp_freq_table); i++)
267 if (val == sx9500_samp_freq_table[i].val &&
268 val2 == sx9500_samp_freq_table[i].val2)
269 break;
271 if (i == ARRAY_SIZE(sx9500_samp_freq_table))
272 return -EINVAL;
274 mutex_lock(&data->mutex);
276 ret = regmap_update_bits(data->regmap, SX9500_REG_PROX_CTRL0,
277 SX9500_SCAN_PERIOD_MASK,
278 i << SX9500_SCAN_PERIOD_SHIFT);
280 mutex_unlock(&data->mutex);
282 return ret;
285 static int sx9500_write_raw(struct iio_dev *indio_dev,
286 const struct iio_chan_spec *chan,
287 int val, int val2, long mask)
289 struct sx9500_data *data = iio_priv(indio_dev);
291 switch (chan->type) {
292 case IIO_PROXIMITY:
293 switch (mask) {
294 case IIO_CHAN_INFO_SAMP_FREQ:
295 return sx9500_set_samp_freq(data, val, val2);
296 default:
297 return -EINVAL;
299 default:
300 return -EINVAL;
304 static irqreturn_t sx9500_irq_handler(int irq, void *private)
306 struct iio_dev *indio_dev = private;
307 struct sx9500_data *data = iio_priv(indio_dev);
309 if (data->trigger_enabled)
310 iio_trigger_poll(data->trig);
313 * Even if no event is enabled, we need to wake the thread to
314 * clear the interrupt state by reading SX9500_REG_IRQ_SRC. It
315 * is not possible to do that here because regmap_read takes a
316 * mutex.
318 return IRQ_WAKE_THREAD;
321 static irqreturn_t sx9500_irq_thread_handler(int irq, void *private)
323 struct iio_dev *indio_dev = private;
324 struct sx9500_data *data = iio_priv(indio_dev);
325 int ret;
326 unsigned int val, chan;
328 mutex_lock(&data->mutex);
330 ret = regmap_read(data->regmap, SX9500_REG_IRQ_SRC, &val);
331 if (ret < 0) {
332 dev_err(&data->client->dev, "i2c transfer error in irq\n");
333 goto out;
336 if (!(val & (SX9500_CLOSE_IRQ | SX9500_FAR_IRQ)))
337 goto out;
339 ret = regmap_read(data->regmap, SX9500_REG_STAT, &val);
340 if (ret < 0) {
341 dev_err(&data->client->dev, "i2c transfer error in irq\n");
342 goto out;
345 val >>= SX9500_PROXSTAT_SHIFT;
346 for (chan = 0; chan < SX9500_NUM_CHANNELS; chan++) {
347 int dir;
348 u64 ev;
349 bool new_prox = val & BIT(chan);
351 if (!data->event_enabled[chan])
352 continue;
353 if (new_prox == data->prox_stat[chan])
354 /* No change on this channel. */
355 continue;
357 dir = new_prox ? IIO_EV_DIR_FALLING :
358 IIO_EV_DIR_RISING;
359 ev = IIO_UNMOD_EVENT_CODE(IIO_PROXIMITY,
360 chan,
361 IIO_EV_TYPE_THRESH,
362 dir);
363 iio_push_event(indio_dev, ev, iio_get_time_ns());
364 data->prox_stat[chan] = new_prox;
367 out:
368 mutex_unlock(&data->mutex);
370 return IRQ_HANDLED;
373 static int sx9500_read_event_config(struct iio_dev *indio_dev,
374 const struct iio_chan_spec *chan,
375 enum iio_event_type type,
376 enum iio_event_direction dir)
378 struct sx9500_data *data = iio_priv(indio_dev);
380 if (chan->type != IIO_PROXIMITY || type != IIO_EV_TYPE_THRESH ||
381 dir != IIO_EV_DIR_EITHER)
382 return -EINVAL;
384 return data->event_enabled[chan->channel];
387 static int sx9500_write_event_config(struct iio_dev *indio_dev,
388 const struct iio_chan_spec *chan,
389 enum iio_event_type type,
390 enum iio_event_direction dir,
391 int state)
393 struct sx9500_data *data = iio_priv(indio_dev);
394 int ret, i;
395 bool any_active = false;
396 unsigned int irqmask;
398 if (chan->type != IIO_PROXIMITY || type != IIO_EV_TYPE_THRESH ||
399 dir != IIO_EV_DIR_EITHER)
400 return -EINVAL;
402 mutex_lock(&data->mutex);
404 data->event_enabled[chan->channel] = state;
406 for (i = 0; i < SX9500_NUM_CHANNELS; i++)
407 if (data->event_enabled[i]) {
408 any_active = true;
409 break;
412 irqmask = SX9500_CLOSE_IRQ | SX9500_FAR_IRQ;
413 if (any_active)
414 ret = regmap_update_bits(data->regmap, SX9500_REG_IRQ_MSK,
415 irqmask, irqmask);
416 else
417 ret = regmap_update_bits(data->regmap, SX9500_REG_IRQ_MSK,
418 irqmask, 0);
420 mutex_unlock(&data->mutex);
422 return ret;
425 static int sx9500_update_scan_mode(struct iio_dev *indio_dev,
426 const unsigned long *scan_mask)
428 struct sx9500_data *data = iio_priv(indio_dev);
430 mutex_lock(&data->mutex);
431 kfree(data->buffer);
432 data->buffer = kzalloc(indio_dev->scan_bytes, GFP_KERNEL);
433 mutex_unlock(&data->mutex);
435 if (data->buffer == NULL)
436 return -ENOMEM;
438 return 0;
441 static IIO_CONST_ATTR_SAMP_FREQ_AVAIL(
442 "2.500000 3.333333 5 6.666666 8.333333 11.111111 16.666666 33.333333");
444 static struct attribute *sx9500_attributes[] = {
445 &iio_const_attr_sampling_frequency_available.dev_attr.attr,
446 NULL,
449 static const struct attribute_group sx9500_attribute_group = {
450 .attrs = sx9500_attributes,
453 static const struct iio_info sx9500_info = {
454 .driver_module = THIS_MODULE,
455 .attrs = &sx9500_attribute_group,
456 .read_raw = &sx9500_read_raw,
457 .write_raw = &sx9500_write_raw,
458 .read_event_config = &sx9500_read_event_config,
459 .write_event_config = &sx9500_write_event_config,
460 .update_scan_mode = &sx9500_update_scan_mode,
463 static int sx9500_set_trigger_state(struct iio_trigger *trig,
464 bool state)
466 struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
467 struct sx9500_data *data = iio_priv(indio_dev);
468 int ret;
470 mutex_lock(&data->mutex);
472 ret = regmap_update_bits(data->regmap, SX9500_REG_IRQ_MSK,
473 SX9500_CONVDONE_IRQ,
474 state ? SX9500_CONVDONE_IRQ : 0);
475 if (ret == 0)
476 data->trigger_enabled = state;
478 mutex_unlock(&data->mutex);
480 return ret;
483 static const struct iio_trigger_ops sx9500_trigger_ops = {
484 .set_trigger_state = sx9500_set_trigger_state,
485 .owner = THIS_MODULE,
488 static irqreturn_t sx9500_trigger_handler(int irq, void *private)
490 struct iio_poll_func *pf = private;
491 struct iio_dev *indio_dev = pf->indio_dev;
492 struct sx9500_data *data = iio_priv(indio_dev);
493 int val, bit, ret, i = 0;
495 mutex_lock(&data->mutex);
497 for_each_set_bit(bit, indio_dev->active_scan_mask,
498 indio_dev->masklength) {
499 ret = sx9500_read_proximity(data, &indio_dev->channels[bit],
500 &val);
501 if (ret < 0)
502 goto out;
504 data->buffer[i++] = val;
507 iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
508 iio_get_time_ns());
510 out:
511 mutex_unlock(&data->mutex);
513 iio_trigger_notify_done(indio_dev->trig);
515 return IRQ_HANDLED;
518 struct sx9500_reg_default {
519 u8 reg;
520 u8 def;
523 static const struct sx9500_reg_default sx9500_default_regs[] = {
525 .reg = SX9500_REG_PROX_CTRL1,
526 /* Shield enabled, small range. */
527 .def = 0x43,
530 .reg = SX9500_REG_PROX_CTRL2,
531 /* x8 gain, 167kHz frequency, finest resolution. */
532 .def = 0x77,
535 .reg = SX9500_REG_PROX_CTRL3,
536 /* Doze enabled, 2x scan period doze, no raw filter. */
537 .def = 0x40,
540 .reg = SX9500_REG_PROX_CTRL4,
541 /* Average threshold. */
542 .def = 0x30,
545 .reg = SX9500_REG_PROX_CTRL5,
547 * Debouncer off, lowest average negative filter,
548 * highest average postive filter.
550 .def = 0x0f,
553 .reg = SX9500_REG_PROX_CTRL6,
554 /* Proximity detection threshold: 280 */
555 .def = 0x0e,
558 .reg = SX9500_REG_PROX_CTRL7,
560 * No automatic compensation, compensate each pin
561 * independently, proximity hysteresis: 32, close
562 * debouncer off, far debouncer off.
564 .def = 0x00,
567 .reg = SX9500_REG_PROX_CTRL8,
568 /* No stuck timeout, no periodic compensation. */
569 .def = 0x00,
572 .reg = SX9500_REG_PROX_CTRL0,
573 /* Scan period: 30ms, all sensors enabled. */
574 .def = 0x0f,
578 static int sx9500_init_device(struct iio_dev *indio_dev)
580 struct sx9500_data *data = iio_priv(indio_dev);
581 int ret, i;
582 unsigned int val;
584 ret = regmap_write(data->regmap, SX9500_REG_IRQ_MSK, 0);
585 if (ret < 0)
586 return ret;
588 ret = regmap_write(data->regmap, SX9500_REG_RESET,
589 SX9500_SOFT_RESET);
590 if (ret < 0)
591 return ret;
593 ret = regmap_read(data->regmap, SX9500_REG_IRQ_SRC, &val);
594 if (ret < 0)
595 return ret;
597 for (i = 0; i < ARRAY_SIZE(sx9500_default_regs); i++) {
598 ret = regmap_write(data->regmap,
599 sx9500_default_regs[i].reg,
600 sx9500_default_regs[i].def);
601 if (ret < 0)
602 return ret;
605 return 0;
608 static int sx9500_gpio_probe(struct i2c_client *client,
609 struct sx9500_data *data)
611 struct device *dev;
612 struct gpio_desc *gpio;
613 int ret;
615 if (!client)
616 return -EINVAL;
618 dev = &client->dev;
620 /* data ready gpio interrupt pin */
621 gpio = devm_gpiod_get_index(dev, SX9500_GPIO_NAME, 0, GPIOD_IN);
622 if (IS_ERR(gpio)) {
623 dev_err(dev, "acpi gpio get index failed\n");
624 return PTR_ERR(gpio);
627 ret = gpiod_to_irq(gpio);
629 dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio), ret);
631 return ret;
634 static int sx9500_probe(struct i2c_client *client,
635 const struct i2c_device_id *id)
637 int ret;
638 struct iio_dev *indio_dev;
639 struct sx9500_data *data;
641 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
642 if (indio_dev == NULL)
643 return -ENOMEM;
645 data = iio_priv(indio_dev);
646 data->client = client;
647 mutex_init(&data->mutex);
648 data->trigger_enabled = false;
650 data->regmap = devm_regmap_init_i2c(client, &sx9500_regmap_config);
651 if (IS_ERR(data->regmap))
652 return PTR_ERR(data->regmap);
654 sx9500_init_device(indio_dev);
656 indio_dev->dev.parent = &client->dev;
657 indio_dev->name = SX9500_DRIVER_NAME;
658 indio_dev->channels = sx9500_channels;
659 indio_dev->num_channels = ARRAY_SIZE(sx9500_channels);
660 indio_dev->info = &sx9500_info;
661 indio_dev->modes = INDIO_DIRECT_MODE;
662 i2c_set_clientdata(client, indio_dev);
664 if (client->irq <= 0)
665 client->irq = sx9500_gpio_probe(client, data);
667 if (client->irq > 0) {
668 ret = devm_request_threaded_irq(&client->dev, client->irq,
669 sx9500_irq_handler, sx9500_irq_thread_handler,
670 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
671 SX9500_IRQ_NAME, indio_dev);
672 if (ret < 0)
673 return ret;
675 data->trig = devm_iio_trigger_alloc(&client->dev,
676 "%s-dev%d", indio_dev->name, indio_dev->id);
677 if (!data->trig)
678 return -ENOMEM;
680 data->trig->dev.parent = &client->dev;
681 data->trig->ops = &sx9500_trigger_ops;
682 iio_trigger_set_drvdata(data->trig, indio_dev);
684 ret = iio_trigger_register(data->trig);
685 if (ret)
686 return ret;
689 ret = iio_triggered_buffer_setup(indio_dev, NULL,
690 sx9500_trigger_handler, NULL);
691 if (ret < 0)
692 goto out_trigger_unregister;
694 ret = iio_device_register(indio_dev);
695 if (ret < 0)
696 goto out_buffer_cleanup;
698 return 0;
700 out_buffer_cleanup:
701 iio_triggered_buffer_cleanup(indio_dev);
702 out_trigger_unregister:
703 if (client->irq > 0)
704 iio_trigger_unregister(data->trig);
706 return ret;
709 static int sx9500_remove(struct i2c_client *client)
711 struct iio_dev *indio_dev = i2c_get_clientdata(client);
712 struct sx9500_data *data = iio_priv(indio_dev);
714 iio_device_unregister(indio_dev);
715 iio_triggered_buffer_cleanup(indio_dev);
716 if (client->irq > 0)
717 iio_trigger_unregister(data->trig);
718 kfree(data->buffer);
720 return 0;
723 static const struct acpi_device_id sx9500_acpi_match[] = {
724 {"SSX9500", 0},
725 { },
727 MODULE_DEVICE_TABLE(acpi, sx9500_acpi_match);
729 static const struct i2c_device_id sx9500_id[] = {
730 {"sx9500", 0},
733 MODULE_DEVICE_TABLE(i2c, sx9500_id);
735 static struct i2c_driver sx9500_driver = {
736 .driver = {
737 .name = SX9500_DRIVER_NAME,
738 .acpi_match_table = ACPI_PTR(sx9500_acpi_match),
740 .probe = sx9500_probe,
741 .remove = sx9500_remove,
742 .id_table = sx9500_id,
744 module_i2c_driver(sx9500_driver);
746 MODULE_AUTHOR("Vlad Dogaru <vlad.dogaru@intel.com>");
747 MODULE_DESCRIPTION("Driver for Semtech SX9500 proximity sensor");
748 MODULE_LICENSE("GPL v2");