vcnl3020.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Support for Vishay VCNL3020 proximity sensor on i2c bus.
  4. * Based on Vishay VCNL4000 driver code.
  5. */
  6. #include <linux/module.h>
  7. #include <linux/i2c.h>
  8. #include <linux/err.h>
  9. #include <linux/delay.h>
  10. #include <linux/regmap.h>
  11. #include <linux/interrupt.h>
  12. #include <linux/iio/iio.h>
  13. #include <linux/iio/events.h>
  14. #define VCNL3020_PROD_ID 0x21
  15. #define VCNL_COMMAND 0x80 /* Command register */
  16. #define VCNL_PROD_REV 0x81 /* Product ID and Revision ID */
  17. #define VCNL_PROXIMITY_RATE 0x82 /* Rate of Proximity Measurement */
  18. #define VCNL_LED_CURRENT 0x83 /* IR LED current for proximity mode */
  19. #define VCNL_PS_RESULT_HI 0x87 /* Proximity result register, MSB */
  20. #define VCNL_PS_RESULT_LO 0x88 /* Proximity result register, LSB */
  21. #define VCNL_PS_ICR 0x89 /* Interrupt Control Register */
  22. #define VCNL_PS_LO_THR_HI 0x8a /* High byte of low threshold value */
  23. #define VCNL_PS_LO_THR_LO 0x8b /* Low byte of low threshold value */
  24. #define VCNL_PS_HI_THR_HI 0x8c /* High byte of high threshold value */
  25. #define VCNL_PS_HI_THR_LO 0x8d /* Low byte of high threshold value */
  26. #define VCNL_ISR 0x8e /* Interrupt Status Register */
  27. #define VCNL_PS_MOD_ADJ 0x8f /* Proximity Modulator Timing Adjustment */
  28. /* Bit masks for COMMAND register */
  29. #define VCNL_PS_RDY BIT(5) /* proximity data ready? */
  30. #define VCNL_PS_OD BIT(3) /* start on-demand proximity
  31. * measurement
  32. */
  33. /* Enables periodic proximity measurement */
  34. #define VCNL_PS_EN BIT(1)
  35. /* Enables state machine and LP oscillator for self timed measurements */
  36. #define VCNL_PS_SELFTIMED_EN BIT(0)
  37. /* Bit masks for ICR */
  38. /* Enable interrupts on low or high thresholds */
  39. #define VCNL_ICR_THRES_EN BIT(1)
  40. /* Bit masks for ISR */
  41. #define VCNL_INT_TH_HI BIT(0) /* High threshold hit */
  42. #define VCNL_INT_TH_LOW BIT(1) /* Low threshold hit */
  43. #define VCNL_ON_DEMAND_TIMEOUT_US 100000
  44. #define VCNL_POLL_US 20000
  45. static const int vcnl3020_prox_sampling_frequency[][2] = {
  46. {1, 950000},
  47. {3, 906250},
  48. {7, 812500},
  49. {16, 625000},
  50. {31, 250000},
  51. {62, 500000},
  52. {125, 0},
  53. {250, 0},
  54. };
  55. /**
  56. * struct vcnl3020_data - vcnl3020 specific data.
  57. * @regmap: device register map.
  58. * @dev: vcnl3020 device.
  59. * @rev: revision id.
  60. * @lock: lock for protecting access to device hardware registers.
  61. * @buf: __be16 buffer.
  62. */
  63. struct vcnl3020_data {
  64. struct regmap *regmap;
  65. struct device *dev;
  66. u8 rev;
  67. struct mutex lock;
  68. __be16 buf;
  69. };
  70. /**
  71. * struct vcnl3020_property - vcnl3020 property.
  72. * @name: property name.
  73. * @reg: i2c register offset.
  74. * @conversion_func: conversion function.
  75. */
  76. struct vcnl3020_property {
  77. const char *name;
  78. u32 reg;
  79. u32 (*conversion_func)(u32 *val);
  80. };
  81. static u32 microamp_to_reg(u32 *val)
  82. {
  83. /*
  84. * An example of conversion from uA to reg val:
  85. * 200000 uA == 200 mA == 20
  86. */
  87. return *val /= 10000;
  88. };
  89. static struct vcnl3020_property vcnl3020_led_current_property = {
  90. .name = "vishay,led-current-microamp",
  91. .reg = VCNL_LED_CURRENT,
  92. .conversion_func = microamp_to_reg,
  93. };
  94. static int vcnl3020_get_and_apply_property(struct vcnl3020_data *data,
  95. struct vcnl3020_property prop)
  96. {
  97. int rc;
  98. u32 val;
  99. rc = device_property_read_u32(data->dev, prop.name, &val);
  100. if (rc)
  101. return 0;
  102. if (prop.conversion_func)
  103. prop.conversion_func(&val);
  104. rc = regmap_write(data->regmap, prop.reg, val);
  105. if (rc) {
  106. dev_err(data->dev, "Error (%d) setting property (%s)\n",
  107. rc, prop.name);
  108. }
  109. return rc;
  110. }
  111. static int vcnl3020_init(struct vcnl3020_data *data)
  112. {
  113. int rc;
  114. unsigned int reg;
  115. rc = regmap_read(data->regmap, VCNL_PROD_REV, &reg);
  116. if (rc) {
  117. dev_err(data->dev,
  118. "Error (%d) reading product revision\n", rc);
  119. return rc;
  120. }
  121. if (reg != VCNL3020_PROD_ID) {
  122. dev_err(data->dev,
  123. "Product id (%x) did not match vcnl3020 (%x)\n", reg,
  124. VCNL3020_PROD_ID);
  125. return -ENODEV;
  126. }
  127. data->rev = reg;
  128. mutex_init(&data->lock);
  129. return vcnl3020_get_and_apply_property(data,
  130. vcnl3020_led_current_property);
  131. };
  132. static bool vcnl3020_is_in_periodic_mode(struct vcnl3020_data *data)
  133. {
  134. int rc;
  135. unsigned int cmd;
  136. rc = regmap_read(data->regmap, VCNL_COMMAND, &cmd);
  137. if (rc) {
  138. dev_err(data->dev,
  139. "Error (%d) reading command register\n", rc);
  140. return false;
  141. }
  142. return !!(cmd & VCNL_PS_SELFTIMED_EN);
  143. }
  144. static int vcnl3020_measure_proximity(struct vcnl3020_data *data, int *val)
  145. {
  146. int rc;
  147. unsigned int reg;
  148. mutex_lock(&data->lock);
  149. /* Protect against event capture. */
  150. if (vcnl3020_is_in_periodic_mode(data)) {
  151. rc = -EBUSY;
  152. goto err_unlock;
  153. }
  154. rc = regmap_write(data->regmap, VCNL_COMMAND, VCNL_PS_OD);
  155. if (rc)
  156. goto err_unlock;
  157. /* wait for data to become ready */
  158. rc = regmap_read_poll_timeout(data->regmap, VCNL_COMMAND, reg,
  159. reg & VCNL_PS_RDY, VCNL_POLL_US,
  160. VCNL_ON_DEMAND_TIMEOUT_US);
  161. if (rc) {
  162. dev_err(data->dev,
  163. "Error (%d) reading vcnl3020 command register\n", rc);
  164. goto err_unlock;
  165. }
  166. /* high & low result bytes read */
  167. rc = regmap_bulk_read(data->regmap, VCNL_PS_RESULT_HI, &data->buf,
  168. sizeof(data->buf));
  169. if (rc)
  170. goto err_unlock;
  171. *val = be16_to_cpu(data->buf);
  172. err_unlock:
  173. mutex_unlock(&data->lock);
  174. return rc;
  175. }
  176. static int vcnl3020_read_proxy_samp_freq(struct vcnl3020_data *data, int *val,
  177. int *val2)
  178. {
  179. int rc;
  180. unsigned int prox_rate;
  181. rc = regmap_read(data->regmap, VCNL_PROXIMITY_RATE, &prox_rate);
  182. if (rc)
  183. return rc;
  184. if (prox_rate >= ARRAY_SIZE(vcnl3020_prox_sampling_frequency))
  185. return -EINVAL;
  186. *val = vcnl3020_prox_sampling_frequency[prox_rate][0];
  187. *val2 = vcnl3020_prox_sampling_frequency[prox_rate][1];
  188. return 0;
  189. }
  190. static int vcnl3020_write_proxy_samp_freq(struct vcnl3020_data *data, int val,
  191. int val2)
  192. {
  193. unsigned int i;
  194. int index = -1;
  195. int rc;
  196. mutex_lock(&data->lock);
  197. /* Protect against event capture. */
  198. if (vcnl3020_is_in_periodic_mode(data)) {
  199. rc = -EBUSY;
  200. goto err_unlock;
  201. }
  202. for (i = 0; i < ARRAY_SIZE(vcnl3020_prox_sampling_frequency); i++) {
  203. if (val == vcnl3020_prox_sampling_frequency[i][0] &&
  204. val2 == vcnl3020_prox_sampling_frequency[i][1]) {
  205. index = i;
  206. break;
  207. }
  208. }
  209. if (index < 0) {
  210. rc = -EINVAL;
  211. goto err_unlock;
  212. }
  213. rc = regmap_write(data->regmap, VCNL_PROXIMITY_RATE, index);
  214. if (rc)
  215. dev_err(data->dev,
  216. "Error (%d) writing proximity rate register\n", rc);
  217. err_unlock:
  218. mutex_unlock(&data->lock);
  219. return rc;
  220. }
  221. static bool vcnl3020_is_thr_enabled(struct vcnl3020_data *data)
  222. {
  223. int rc;
  224. unsigned int icr;
  225. rc = regmap_read(data->regmap, VCNL_PS_ICR, &icr);
  226. if (rc) {
  227. dev_err(data->dev,
  228. "Error (%d) reading ICR register\n", rc);
  229. return false;
  230. }
  231. return !!(icr & VCNL_ICR_THRES_EN);
  232. }
  233. static int vcnl3020_read_event(struct iio_dev *indio_dev,
  234. const struct iio_chan_spec *chan,
  235. enum iio_event_type type,
  236. enum iio_event_direction dir,
  237. enum iio_event_info info,
  238. int *val, int *val2)
  239. {
  240. int rc;
  241. struct vcnl3020_data *data = iio_priv(indio_dev);
  242. switch (info) {
  243. case IIO_EV_INFO_VALUE:
  244. switch (dir) {
  245. case IIO_EV_DIR_RISING:
  246. rc = regmap_bulk_read(data->regmap, VCNL_PS_HI_THR_HI,
  247. &data->buf, sizeof(data->buf));
  248. if (rc < 0)
  249. return rc;
  250. *val = be16_to_cpu(data->buf);
  251. return IIO_VAL_INT;
  252. case IIO_EV_DIR_FALLING:
  253. rc = regmap_bulk_read(data->regmap, VCNL_PS_LO_THR_HI,
  254. &data->buf, sizeof(data->buf));
  255. if (rc < 0)
  256. return rc;
  257. *val = be16_to_cpu(data->buf);
  258. return IIO_VAL_INT;
  259. default:
  260. return -EINVAL;
  261. }
  262. default:
  263. return -EINVAL;
  264. }
  265. }
  266. static int vcnl3020_write_event(struct iio_dev *indio_dev,
  267. const struct iio_chan_spec *chan,
  268. enum iio_event_type type,
  269. enum iio_event_direction dir,
  270. enum iio_event_info info,
  271. int val, int val2)
  272. {
  273. int rc;
  274. struct vcnl3020_data *data = iio_priv(indio_dev);
  275. mutex_lock(&data->lock);
  276. switch (info) {
  277. case IIO_EV_INFO_VALUE:
  278. switch (dir) {
  279. case IIO_EV_DIR_RISING:
  280. /* 16 bit word/ low * high */
  281. data->buf = cpu_to_be16(val);
  282. rc = regmap_bulk_write(data->regmap, VCNL_PS_HI_THR_HI,
  283. &data->buf, sizeof(data->buf));
  284. if (rc < 0)
  285. goto err_unlock;
  286. rc = IIO_VAL_INT;
  287. goto err_unlock;
  288. case IIO_EV_DIR_FALLING:
  289. data->buf = cpu_to_be16(val);
  290. rc = regmap_bulk_write(data->regmap, VCNL_PS_LO_THR_HI,
  291. &data->buf, sizeof(data->buf));
  292. if (rc < 0)
  293. goto err_unlock;
  294. rc = IIO_VAL_INT;
  295. goto err_unlock;
  296. default:
  297. rc = -EINVAL;
  298. goto err_unlock;
  299. }
  300. default:
  301. rc = -EINVAL;
  302. goto err_unlock;
  303. }
  304. err_unlock:
  305. mutex_unlock(&data->lock);
  306. return rc;
  307. }
  308. static int vcnl3020_enable_periodic(struct iio_dev *indio_dev,
  309. struct vcnl3020_data *data)
  310. {
  311. int rc;
  312. int cmd;
  313. mutex_lock(&data->lock);
  314. /* Enable periodic measurement of proximity data. */
  315. cmd = VCNL_PS_EN | VCNL_PS_SELFTIMED_EN;
  316. rc = regmap_write(data->regmap, VCNL_COMMAND, cmd);
  317. if (rc) {
  318. dev_err(data->dev,
  319. "Error (%d) writing command register\n", rc);
  320. goto err_unlock;
  321. }
  322. /*
  323. * Enable interrupts on threshold, for proximity data by
  324. * default.
  325. */
  326. rc = regmap_write(data->regmap, VCNL_PS_ICR, VCNL_ICR_THRES_EN);
  327. if (rc)
  328. dev_err(data->dev,
  329. "Error (%d) reading ICR register\n", rc);
  330. err_unlock:
  331. mutex_unlock(&data->lock);
  332. return rc;
  333. }
  334. static int vcnl3020_disable_periodic(struct iio_dev *indio_dev,
  335. struct vcnl3020_data *data)
  336. {
  337. int rc;
  338. mutex_lock(&data->lock);
  339. rc = regmap_write(data->regmap, VCNL_COMMAND, 0);
  340. if (rc) {
  341. dev_err(data->dev,
  342. "Error (%d) writing command register\n", rc);
  343. goto err_unlock;
  344. }
  345. rc = regmap_write(data->regmap, VCNL_PS_ICR, 0);
  346. if (rc) {
  347. dev_err(data->dev,
  348. "Error (%d) writing ICR register\n", rc);
  349. goto err_unlock;
  350. }
  351. /* Clear interrupt flag bit */
  352. rc = regmap_write(data->regmap, VCNL_ISR, 0);
  353. if (rc)
  354. dev_err(data->dev,
  355. "Error (%d) writing ISR register\n", rc);
  356. err_unlock:
  357. mutex_unlock(&data->lock);
  358. return rc;
  359. }
  360. static int vcnl3020_config_threshold(struct iio_dev *indio_dev, bool state)
  361. {
  362. struct vcnl3020_data *data = iio_priv(indio_dev);
  363. if (state) {
  364. return vcnl3020_enable_periodic(indio_dev, data);
  365. } else {
  366. if (!vcnl3020_is_thr_enabled(data))
  367. return 0;
  368. return vcnl3020_disable_periodic(indio_dev, data);
  369. }
  370. }
  371. static int vcnl3020_write_event_config(struct iio_dev *indio_dev,
  372. const struct iio_chan_spec *chan,
  373. enum iio_event_type type,
  374. enum iio_event_direction dir,
  375. int state)
  376. {
  377. switch (chan->type) {
  378. case IIO_PROXIMITY:
  379. return vcnl3020_config_threshold(indio_dev, state);
  380. default:
  381. return -EINVAL;
  382. }
  383. }
  384. static int vcnl3020_read_event_config(struct iio_dev *indio_dev,
  385. const struct iio_chan_spec *chan,
  386. enum iio_event_type type,
  387. enum iio_event_direction dir)
  388. {
  389. struct vcnl3020_data *data = iio_priv(indio_dev);
  390. switch (chan->type) {
  391. case IIO_PROXIMITY:
  392. return vcnl3020_is_thr_enabled(data);
  393. default:
  394. return -EINVAL;
  395. }
  396. }
  397. static const struct iio_event_spec vcnl3020_event_spec[] = {
  398. {
  399. .type = IIO_EV_TYPE_THRESH,
  400. .dir = IIO_EV_DIR_RISING,
  401. .mask_separate = BIT(IIO_EV_INFO_VALUE),
  402. }, {
  403. .type = IIO_EV_TYPE_THRESH,
  404. .dir = IIO_EV_DIR_FALLING,
  405. .mask_separate = BIT(IIO_EV_INFO_VALUE),
  406. }, {
  407. .type = IIO_EV_TYPE_THRESH,
  408. .dir = IIO_EV_DIR_EITHER,
  409. .mask_separate = BIT(IIO_EV_INFO_ENABLE),
  410. },
  411. };
  412. static const struct iio_chan_spec vcnl3020_channels[] = {
  413. {
  414. .type = IIO_PROXIMITY,
  415. .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
  416. BIT(IIO_CHAN_INFO_SAMP_FREQ),
  417. .info_mask_separate_available = BIT(IIO_CHAN_INFO_SAMP_FREQ),
  418. .event_spec = vcnl3020_event_spec,
  419. .num_event_specs = ARRAY_SIZE(vcnl3020_event_spec),
  420. },
  421. };
  422. static int vcnl3020_read_raw(struct iio_dev *indio_dev,
  423. struct iio_chan_spec const *chan, int *val,
  424. int *val2, long mask)
  425. {
  426. int rc;
  427. struct vcnl3020_data *data = iio_priv(indio_dev);
  428. switch (mask) {
  429. case IIO_CHAN_INFO_RAW:
  430. rc = vcnl3020_measure_proximity(data, val);
  431. if (rc)
  432. return rc;
  433. return IIO_VAL_INT;
  434. case IIO_CHAN_INFO_SAMP_FREQ:
  435. rc = vcnl3020_read_proxy_samp_freq(data, val, val2);
  436. if (rc < 0)
  437. return rc;
  438. return IIO_VAL_INT_PLUS_MICRO;
  439. default:
  440. return -EINVAL;
  441. }
  442. }
  443. static int vcnl3020_write_raw(struct iio_dev *indio_dev,
  444. struct iio_chan_spec const *chan,
  445. int val, int val2, long mask)
  446. {
  447. struct vcnl3020_data *data = iio_priv(indio_dev);
  448. switch (mask) {
  449. case IIO_CHAN_INFO_SAMP_FREQ:
  450. return vcnl3020_write_proxy_samp_freq(data, val, val2);
  451. default:
  452. return -EINVAL;
  453. }
  454. }
  455. static int vcnl3020_read_avail(struct iio_dev *indio_dev,
  456. struct iio_chan_spec const *chan,
  457. const int **vals, int *type, int *length,
  458. long mask)
  459. {
  460. switch (mask) {
  461. case IIO_CHAN_INFO_SAMP_FREQ:
  462. *vals = (int *)vcnl3020_prox_sampling_frequency;
  463. *type = IIO_VAL_INT_PLUS_MICRO;
  464. *length = 2 * ARRAY_SIZE(vcnl3020_prox_sampling_frequency);
  465. return IIO_AVAIL_LIST;
  466. default:
  467. return -EINVAL;
  468. }
  469. }
  470. static const struct iio_info vcnl3020_info = {
  471. .read_raw = vcnl3020_read_raw,
  472. .write_raw = vcnl3020_write_raw,
  473. .read_avail = vcnl3020_read_avail,
  474. .read_event_value = vcnl3020_read_event,
  475. .write_event_value = vcnl3020_write_event,
  476. .read_event_config = vcnl3020_read_event_config,
  477. .write_event_config = vcnl3020_write_event_config,
  478. };
  479. static const struct regmap_config vcnl3020_regmap_config = {
  480. .reg_bits = 8,
  481. .val_bits = 8,
  482. .max_register = VCNL_PS_MOD_ADJ,
  483. };
  484. static irqreturn_t vcnl3020_handle_irq_thread(int irq, void *p)
  485. {
  486. struct iio_dev *indio_dev = p;
  487. struct vcnl3020_data *data = iio_priv(indio_dev);
  488. unsigned int isr;
  489. int rc;
  490. rc = regmap_read(data->regmap, VCNL_ISR, &isr);
  491. if (rc) {
  492. dev_err(data->dev, "Error (%d) reading reg (0x%x)\n",
  493. rc, VCNL_ISR);
  494. return IRQ_HANDLED;
  495. }
  496. if (!(isr & VCNL_ICR_THRES_EN))
  497. return IRQ_NONE;
  498. iio_push_event(indio_dev,
  499. IIO_UNMOD_EVENT_CODE(IIO_PROXIMITY, 1,
  500. IIO_EV_TYPE_THRESH,
  501. IIO_EV_DIR_RISING),
  502. iio_get_time_ns(indio_dev));
  503. rc = regmap_write(data->regmap, VCNL_ISR, isr & VCNL_ICR_THRES_EN);
  504. if (rc)
  505. dev_err(data->dev, "Error (%d) writing in reg (0x%x)\n",
  506. rc, VCNL_ISR);
  507. return IRQ_HANDLED;
  508. }
  509. static int vcnl3020_probe(struct i2c_client *client)
  510. {
  511. struct vcnl3020_data *data;
  512. struct iio_dev *indio_dev;
  513. struct regmap *regmap;
  514. int rc;
  515. regmap = devm_regmap_init_i2c(client, &vcnl3020_regmap_config);
  516. if (IS_ERR(regmap)) {
  517. dev_err(&client->dev, "regmap_init failed\n");
  518. return PTR_ERR(regmap);
  519. }
  520. indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
  521. if (!indio_dev)
  522. return -ENOMEM;
  523. data = iio_priv(indio_dev);
  524. i2c_set_clientdata(client, indio_dev);
  525. data->regmap = regmap;
  526. data->dev = &client->dev;
  527. rc = vcnl3020_init(data);
  528. if (rc)
  529. return rc;
  530. indio_dev->info = &vcnl3020_info;
  531. indio_dev->channels = vcnl3020_channels;
  532. indio_dev->num_channels = ARRAY_SIZE(vcnl3020_channels);
  533. indio_dev->name = "vcnl3020";
  534. indio_dev->modes = INDIO_DIRECT_MODE;
  535. if (client->irq) {
  536. rc = devm_request_threaded_irq(&client->dev, client->irq,
  537. NULL, vcnl3020_handle_irq_thread,
  538. IRQF_ONESHOT, indio_dev->name,
  539. indio_dev);
  540. if (rc) {
  541. dev_err(&client->dev,
  542. "Error (%d) irq request failed (%u)\n", rc,
  543. client->irq);
  544. return rc;
  545. }
  546. }
  547. return devm_iio_device_register(&client->dev, indio_dev);
  548. }
  549. static const struct of_device_id vcnl3020_of_match[] = {
  550. {
  551. .compatible = "vishay,vcnl3020",
  552. },
  553. {}
  554. };
  555. MODULE_DEVICE_TABLE(of, vcnl3020_of_match);
  556. static struct i2c_driver vcnl3020_driver = {
  557. .driver = {
  558. .name = "vcnl3020",
  559. .of_match_table = vcnl3020_of_match,
  560. },
  561. .probe_new = vcnl3020_probe,
  562. };
  563. module_i2c_driver(vcnl3020_driver);
  564. MODULE_AUTHOR("Ivan Mikhaylov <[email protected]>");
  565. MODULE_DESCRIPTION("Vishay VCNL3020 proximity sensor driver");
  566. MODULE_LICENSE("GPL");