1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2013 Samsung Electronics Co., Ltd.
4 * Author: Beomho Seo <beomho.seo@samsung.com>
7 #include <linux/delay.h>
10 #include <linux/mutex.h>
11 #include <linux/module.h>
12 #include <linux/interrupt.h>
13 #include <linux/regulator/consumer.h>
14 #include <linux/iio/iio.h>
15 #include <linux/iio/sysfs.h>
16 #include <linux/iio/events.h>
18 /* Slave address 0x19 for PS of 7 bit addressing protocol for I2C */
19 #define CM36651_I2C_ADDR_PS 0x19
20 /* Alert Response Address */
21 #define CM36651_ARA 0x0C
23 /* Ambient light sensor */
24 #define CM36651_CS_CONF1 0x00
25 #define CM36651_CS_CONF2 0x01
26 #define CM36651_ALS_WH_M 0x02
27 #define CM36651_ALS_WH_L 0x03
28 #define CM36651_ALS_WL_M 0x04
29 #define CM36651_ALS_WL_L 0x05
30 #define CM36651_CS_CONF3 0x06
31 #define CM36651_CS_CONF_REG_NUM 0x02
33 /* Proximity sensor */
34 #define CM36651_PS_CONF1 0x00
35 #define CM36651_PS_THD 0x01
36 #define CM36651_PS_CANC 0x02
37 #define CM36651_PS_CONF2 0x03
38 #define CM36651_PS_REG_NUM 0x04
40 /* CS_CONF1 command code */
41 #define CM36651_ALS_ENABLE 0x00
42 #define CM36651_ALS_DISABLE 0x01
43 #define CM36651_ALS_INT_EN 0x02
44 #define CM36651_ALS_THRES 0x04
46 /* CS_CONF2 command code */
47 #define CM36651_CS_CONF2_DEFAULT_BIT 0x08
49 /* CS_CONF3 channel integration time */
50 #define CM36651_CS_IT1 0x00 /* Integration time 80 msec */
51 #define CM36651_CS_IT2 0x40 /* Integration time 160 msec */
52 #define CM36651_CS_IT3 0x80 /* Integration time 320 msec */
53 #define CM36651_CS_IT4 0xC0 /* Integration time 640 msec */
55 /* PS_CONF1 command code */
56 #define CM36651_PS_ENABLE 0x00
57 #define CM36651_PS_DISABLE 0x01
58 #define CM36651_PS_INT_EN 0x02
59 #define CM36651_PS_PERS2 0x04
60 #define CM36651_PS_PERS3 0x08
61 #define CM36651_PS_PERS4 0x0C
63 /* PS_CONF1 command code: integration time */
64 #define CM36651_PS_IT1 0x00 /* Integration time 0.32 msec */
65 #define CM36651_PS_IT2 0x10 /* Integration time 0.42 msec */
66 #define CM36651_PS_IT3 0x20 /* Integration time 0.52 msec */
67 #define CM36651_PS_IT4 0x30 /* Integration time 0.64 msec */
69 /* PS_CONF1 command code: duty ratio */
70 #define CM36651_PS_DR1 0x00 /* Duty ratio 1/80 */
71 #define CM36651_PS_DR2 0x40 /* Duty ratio 1/160 */
72 #define CM36651_PS_DR3 0x80 /* Duty ratio 1/320 */
73 #define CM36651_PS_DR4 0xC0 /* Duty ratio 1/640 */
75 /* PS_THD command code */
76 #define CM36651_PS_INITIAL_THD 0x05
78 /* PS_CANC command code */
79 #define CM36651_PS_CANC_DEFAULT 0x00
81 /* PS_CONF2 command code */
82 #define CM36651_PS_HYS1 0x00
83 #define CM36651_PS_HYS2 0x01
84 #define CM36651_PS_SMART_PERS_EN 0x02
85 #define CM36651_PS_DIR_INT 0x04
86 #define CM36651_PS_MS 0x10
88 #define CM36651_CS_COLOR_NUM 4
90 #define CM36651_CLOSE_PROXIMITY 0x32
91 #define CM36651_FAR_PROXIMITY 0x33
93 #define CM36651_CS_INT_TIME_AVAIL "0.08 0.16 0.32 0.64"
94 #define CM36651_PS_INT_TIME_AVAIL "0.000320 0.000420 0.000520 0.000640"
96 enum cm36651_operation_mode
{
99 CM36651_PROXIMITY_EV_EN
,
102 enum cm36651_light_channel_idx
{
103 CM36651_LIGHT_CHANNEL_IDX_RED
,
104 CM36651_LIGHT_CHANNEL_IDX_GREEN
,
105 CM36651_LIGHT_CHANNEL_IDX_BLUE
,
106 CM36651_LIGHT_CHANNEL_IDX_CLEAR
,
109 enum cm36651_command
{
110 CM36651_CMD_READ_RAW_LIGHT
,
111 CM36651_CMD_READ_RAW_PROXIMITY
,
112 CM36651_CMD_PROX_EV_EN
,
113 CM36651_CMD_PROX_EV_DIS
,
116 static const u8 cm36651_cs_reg
[CM36651_CS_CONF_REG_NUM
] = {
121 static const u8 cm36651_ps_reg
[CM36651_PS_REG_NUM
] = {
128 struct cm36651_data
{
129 const struct cm36651_platform_data
*pdata
;
130 struct i2c_client
*client
;
131 struct i2c_client
*ps_client
;
132 struct i2c_client
*ara_client
;
134 struct regulator
*vled_reg
;
136 int cs_int_time
[CM36651_CS_COLOR_NUM
];
138 u8 cs_ctrl_regs
[CM36651_CS_CONF_REG_NUM
];
139 u8 ps_ctrl_regs
[CM36651_PS_REG_NUM
];
140 u16 color
[CM36651_CS_COLOR_NUM
];
143 static int cm36651_setup_reg(struct cm36651_data
*cm36651
)
145 struct i2c_client
*client
= cm36651
->client
;
146 struct i2c_client
*ps_client
= cm36651
->ps_client
;
149 /* CS initialization */
150 cm36651
->cs_ctrl_regs
[CM36651_CS_CONF1
] = CM36651_ALS_ENABLE
|
152 cm36651
->cs_ctrl_regs
[CM36651_CS_CONF2
] = CM36651_CS_CONF2_DEFAULT_BIT
;
154 for (i
= 0; i
< CM36651_CS_CONF_REG_NUM
; i
++) {
155 ret
= i2c_smbus_write_byte_data(client
, cm36651_cs_reg
[i
],
156 cm36651
->cs_ctrl_regs
[i
]);
161 /* PS initialization */
162 cm36651
->ps_ctrl_regs
[CM36651_PS_CONF1
] = CM36651_PS_ENABLE
|
164 cm36651
->ps_ctrl_regs
[CM36651_PS_THD
] = CM36651_PS_INITIAL_THD
;
165 cm36651
->ps_ctrl_regs
[CM36651_PS_CANC
] = CM36651_PS_CANC_DEFAULT
;
166 cm36651
->ps_ctrl_regs
[CM36651_PS_CONF2
] = CM36651_PS_HYS2
|
167 CM36651_PS_DIR_INT
| CM36651_PS_SMART_PERS_EN
;
169 for (i
= 0; i
< CM36651_PS_REG_NUM
; i
++) {
170 ret
= i2c_smbus_write_byte_data(ps_client
, cm36651_ps_reg
[i
],
171 cm36651
->ps_ctrl_regs
[i
]);
176 /* Set shutdown mode */
177 ret
= i2c_smbus_write_byte_data(client
, CM36651_CS_CONF1
,
178 CM36651_ALS_DISABLE
);
182 ret
= i2c_smbus_write_byte_data(cm36651
->ps_client
,
183 CM36651_PS_CONF1
, CM36651_PS_DISABLE
);
190 static int cm36651_read_output(struct cm36651_data
*cm36651
,
191 struct iio_chan_spec
const *chan
, int *val
)
193 struct i2c_client
*client
= cm36651
->client
;
196 switch (chan
->type
) {
198 *val
= i2c_smbus_read_word_data(client
, chan
->address
);
202 ret
= i2c_smbus_write_byte_data(client
, CM36651_CS_CONF1
,
203 CM36651_ALS_DISABLE
);
210 *val
= i2c_smbus_read_byte(cm36651
->ps_client
);
214 if (!test_bit(CM36651_PROXIMITY_EV_EN
, &cm36651
->flags
)) {
215 ret
= i2c_smbus_write_byte_data(cm36651
->ps_client
,
216 CM36651_PS_CONF1
, CM36651_PS_DISABLE
);
230 static irqreturn_t
cm36651_irq_handler(int irq
, void *data
)
232 struct iio_dev
*indio_dev
= data
;
233 struct cm36651_data
*cm36651
= iio_priv(indio_dev
);
234 struct i2c_client
*client
= cm36651
->client
;
239 * The PS INT pin is an active low signal that PS INT move logic low
240 * when the object is detect. Once the MCU host received the PS INT
241 * "LOW" signal, the Host needs to read the data at Alert Response
242 * Address(ARA) to clear the PS INT signal. After clearing the PS
243 * INT pin, the PS INT signal toggles from low to high.
245 ret
= i2c_smbus_read_byte(cm36651
->ara_client
);
247 dev_err(&client
->dev
,
248 "%s: Data read failed: %d\n", __func__
, ret
);
252 case CM36651_CLOSE_PROXIMITY
:
253 ev_dir
= IIO_EV_DIR_RISING
;
255 case CM36651_FAR_PROXIMITY
:
256 ev_dir
= IIO_EV_DIR_FALLING
;
259 dev_err(&client
->dev
,
260 "%s: Data read wrong: %d\n", __func__
, ret
);
264 ev_code
= IIO_UNMOD_EVENT_CODE(IIO_PROXIMITY
,
265 CM36651_CMD_READ_RAW_PROXIMITY
,
266 IIO_EV_TYPE_THRESH
, ev_dir
);
268 iio_push_event(indio_dev
, ev_code
, iio_get_time_ns(indio_dev
));
273 static int cm36651_set_operation_mode(struct cm36651_data
*cm36651
, int cmd
)
275 struct i2c_client
*client
= cm36651
->client
;
276 struct i2c_client
*ps_client
= cm36651
->ps_client
;
280 case CM36651_CMD_READ_RAW_LIGHT
:
281 ret
= i2c_smbus_write_byte_data(client
, CM36651_CS_CONF1
,
282 cm36651
->cs_ctrl_regs
[CM36651_CS_CONF1
]);
284 case CM36651_CMD_READ_RAW_PROXIMITY
:
285 if (test_bit(CM36651_PROXIMITY_EV_EN
, &cm36651
->flags
))
286 return CM36651_PROXIMITY_EV_EN
;
288 ret
= i2c_smbus_write_byte_data(ps_client
, CM36651_PS_CONF1
,
289 cm36651
->ps_ctrl_regs
[CM36651_PS_CONF1
]);
291 case CM36651_CMD_PROX_EV_EN
:
292 if (test_bit(CM36651_PROXIMITY_EV_EN
, &cm36651
->flags
)) {
293 dev_err(&client
->dev
,
294 "Already proximity event enable state\n");
297 set_bit(CM36651_PROXIMITY_EV_EN
, &cm36651
->flags
);
299 ret
= i2c_smbus_write_byte_data(ps_client
,
300 cm36651_ps_reg
[CM36651_PS_CONF1
],
301 CM36651_PS_INT_EN
| CM36651_PS_PERS2
| CM36651_PS_IT2
);
304 dev_err(&client
->dev
, "Proximity enable event failed\n");
308 case CM36651_CMD_PROX_EV_DIS
:
309 if (!test_bit(CM36651_PROXIMITY_EV_EN
, &cm36651
->flags
)) {
310 dev_err(&client
->dev
,
311 "Already proximity event disable state\n");
314 clear_bit(CM36651_PROXIMITY_EV_EN
, &cm36651
->flags
);
315 ret
= i2c_smbus_write_byte_data(ps_client
,
316 CM36651_PS_CONF1
, CM36651_PS_DISABLE
);
321 dev_err(&client
->dev
, "Write register failed\n");
326 static int cm36651_read_channel(struct cm36651_data
*cm36651
,
327 struct iio_chan_spec
const *chan
, int *val
)
329 struct i2c_client
*client
= cm36651
->client
;
332 if (chan
->type
== IIO_LIGHT
)
333 cmd
= CM36651_CMD_READ_RAW_LIGHT
;
334 else if (chan
->type
== IIO_PROXIMITY
)
335 cmd
= CM36651_CMD_READ_RAW_PROXIMITY
;
339 ret
= cm36651_set_operation_mode(cm36651
, cmd
);
341 dev_err(&client
->dev
, "CM36651 set operation mode failed\n");
344 /* Delay for work after enable operation */
346 ret
= cm36651_read_output(cm36651
, chan
, val
);
348 dev_err(&client
->dev
, "CM36651 read output failed\n");
355 static int cm36651_read_int_time(struct cm36651_data
*cm36651
,
356 struct iio_chan_spec
const *chan
, int *val2
)
358 switch (chan
->type
) {
360 if (cm36651
->cs_int_time
[chan
->address
] == CM36651_CS_IT1
)
362 else if (cm36651
->cs_int_time
[chan
->address
] == CM36651_CS_IT2
)
364 else if (cm36651
->cs_int_time
[chan
->address
] == CM36651_CS_IT3
)
366 else if (cm36651
->cs_int_time
[chan
->address
] == CM36651_CS_IT4
)
372 if (cm36651
->ps_int_time
== CM36651_PS_IT1
)
374 else if (cm36651
->ps_int_time
== CM36651_PS_IT2
)
376 else if (cm36651
->ps_int_time
== CM36651_PS_IT3
)
378 else if (cm36651
->ps_int_time
== CM36651_PS_IT4
)
387 return IIO_VAL_INT_PLUS_MICRO
;
390 static int cm36651_write_int_time(struct cm36651_data
*cm36651
,
391 struct iio_chan_spec
const *chan
, int val
)
393 struct i2c_client
*client
= cm36651
->client
;
394 struct i2c_client
*ps_client
= cm36651
->ps_client
;
397 switch (chan
->type
) {
400 int_time
= CM36651_CS_IT1
;
401 else if (val
== 160000)
402 int_time
= CM36651_CS_IT2
;
403 else if (val
== 320000)
404 int_time
= CM36651_CS_IT3
;
405 else if (val
== 640000)
406 int_time
= CM36651_CS_IT4
;
410 ret
= i2c_smbus_write_byte_data(client
, CM36651_CS_CONF3
,
411 int_time
>> 2 * (chan
->address
));
413 dev_err(&client
->dev
, "CS integration time write failed\n");
416 cm36651
->cs_int_time
[chan
->address
] = int_time
;
420 int_time
= CM36651_PS_IT1
;
422 int_time
= CM36651_PS_IT2
;
424 int_time
= CM36651_PS_IT3
;
426 int_time
= CM36651_PS_IT4
;
430 ret
= i2c_smbus_write_byte_data(ps_client
,
431 CM36651_PS_CONF1
, int_time
);
433 dev_err(&client
->dev
, "PS integration time write failed\n");
436 cm36651
->ps_int_time
= int_time
;
445 static int cm36651_read_raw(struct iio_dev
*indio_dev
,
446 struct iio_chan_spec
const *chan
,
447 int *val
, int *val2
, long mask
)
449 struct cm36651_data
*cm36651
= iio_priv(indio_dev
);
452 mutex_lock(&cm36651
->lock
);
455 case IIO_CHAN_INFO_RAW
:
456 ret
= cm36651_read_channel(cm36651
, chan
, val
);
458 case IIO_CHAN_INFO_INT_TIME
:
460 ret
= cm36651_read_int_time(cm36651
, chan
, val2
);
466 mutex_unlock(&cm36651
->lock
);
471 static int cm36651_write_raw(struct iio_dev
*indio_dev
,
472 struct iio_chan_spec
const *chan
,
473 int val
, int val2
, long mask
)
475 struct cm36651_data
*cm36651
= iio_priv(indio_dev
);
476 struct i2c_client
*client
= cm36651
->client
;
479 if (mask
== IIO_CHAN_INFO_INT_TIME
) {
480 ret
= cm36651_write_int_time(cm36651
, chan
, val2
);
482 dev_err(&client
->dev
, "Integration time write failed\n");
488 static int cm36651_read_prox_thresh(struct iio_dev
*indio_dev
,
489 const struct iio_chan_spec
*chan
,
490 enum iio_event_type type
,
491 enum iio_event_direction dir
,
492 enum iio_event_info info
,
495 struct cm36651_data
*cm36651
= iio_priv(indio_dev
);
497 *val
= cm36651
->ps_ctrl_regs
[CM36651_PS_THD
];
502 static int cm36651_write_prox_thresh(struct iio_dev
*indio_dev
,
503 const struct iio_chan_spec
*chan
,
504 enum iio_event_type type
,
505 enum iio_event_direction dir
,
506 enum iio_event_info info
,
509 struct cm36651_data
*cm36651
= iio_priv(indio_dev
);
510 struct i2c_client
*client
= cm36651
->client
;
513 if (val
< 3 || val
> 255)
516 cm36651
->ps_ctrl_regs
[CM36651_PS_THD
] = val
;
517 ret
= i2c_smbus_write_byte_data(cm36651
->ps_client
, CM36651_PS_THD
,
518 cm36651
->ps_ctrl_regs
[CM36651_PS_THD
]);
521 dev_err(&client
->dev
, "PS threshold write failed: %d\n", ret
);
528 static int cm36651_write_prox_event_config(struct iio_dev
*indio_dev
,
529 const struct iio_chan_spec
*chan
,
530 enum iio_event_type type
,
531 enum iio_event_direction dir
,
534 struct cm36651_data
*cm36651
= iio_priv(indio_dev
);
537 mutex_lock(&cm36651
->lock
);
539 cmd
= state
? CM36651_CMD_PROX_EV_EN
: CM36651_CMD_PROX_EV_DIS
;
540 ret
= cm36651_set_operation_mode(cm36651
, cmd
);
542 mutex_unlock(&cm36651
->lock
);
547 static int cm36651_read_prox_event_config(struct iio_dev
*indio_dev
,
548 const struct iio_chan_spec
*chan
,
549 enum iio_event_type type
,
550 enum iio_event_direction dir
)
552 struct cm36651_data
*cm36651
= iio_priv(indio_dev
);
555 mutex_lock(&cm36651
->lock
);
557 event_en
= test_bit(CM36651_PROXIMITY_EV_EN
, &cm36651
->flags
);
559 mutex_unlock(&cm36651
->lock
);
564 #define CM36651_LIGHT_CHANNEL(_color, _idx) { \
566 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
567 BIT(IIO_CHAN_INFO_INT_TIME), \
570 .channel2 = IIO_MOD_LIGHT_##_color, \
573 static const struct iio_event_spec cm36651_event_spec[] = {
575 .type
= IIO_EV_TYPE_THRESH
,
576 .dir
= IIO_EV_DIR_EITHER
,
577 .mask_separate
= BIT(IIO_EV_INFO_VALUE
) |
578 BIT(IIO_EV_INFO_ENABLE
),
582 static const struct iio_chan_spec cm36651_channels
[] = {
584 .type
= IIO_PROXIMITY
,
585 .info_mask_separate
= BIT(IIO_CHAN_INFO_RAW
) |
586 BIT(IIO_CHAN_INFO_INT_TIME
),
587 .event_spec
= cm36651_event_spec
,
588 .num_event_specs
= ARRAY_SIZE(cm36651_event_spec
),
590 CM36651_LIGHT_CHANNEL(RED
, CM36651_LIGHT_CHANNEL_IDX_RED
),
591 CM36651_LIGHT_CHANNEL(GREEN
, CM36651_LIGHT_CHANNEL_IDX_GREEN
),
592 CM36651_LIGHT_CHANNEL(BLUE
, CM36651_LIGHT_CHANNEL_IDX_BLUE
),
593 CM36651_LIGHT_CHANNEL(CLEAR
, CM36651_LIGHT_CHANNEL_IDX_CLEAR
),
596 static IIO_CONST_ATTR(in_illuminance_integration_time_available
,
597 CM36651_CS_INT_TIME_AVAIL
);
598 static IIO_CONST_ATTR(in_proximity_integration_time_available
,
599 CM36651_PS_INT_TIME_AVAIL
);
601 static struct attribute
*cm36651_attributes
[] = {
602 &iio_const_attr_in_illuminance_integration_time_available
.dev_attr
.attr
,
603 &iio_const_attr_in_proximity_integration_time_available
.dev_attr
.attr
,
607 static const struct attribute_group cm36651_attribute_group
= {
608 .attrs
= cm36651_attributes
611 static const struct iio_info cm36651_info
= {
612 .read_raw
= &cm36651_read_raw
,
613 .write_raw
= &cm36651_write_raw
,
614 .read_event_value
= &cm36651_read_prox_thresh
,
615 .write_event_value
= &cm36651_write_prox_thresh
,
616 .read_event_config
= &cm36651_read_prox_event_config
,
617 .write_event_config
= &cm36651_write_prox_event_config
,
618 .attrs
= &cm36651_attribute_group
,
621 static int cm36651_probe(struct i2c_client
*client
,
622 const struct i2c_device_id
*id
)
624 struct cm36651_data
*cm36651
;
625 struct iio_dev
*indio_dev
;
628 indio_dev
= devm_iio_device_alloc(&client
->dev
, sizeof(*cm36651
));
632 cm36651
= iio_priv(indio_dev
);
634 cm36651
->vled_reg
= devm_regulator_get(&client
->dev
, "vled");
635 if (IS_ERR(cm36651
->vled_reg
)) {
636 dev_err(&client
->dev
, "get regulator vled failed\n");
637 return PTR_ERR(cm36651
->vled_reg
);
640 ret
= regulator_enable(cm36651
->vled_reg
);
642 dev_err(&client
->dev
, "enable regulator vled failed\n");
646 i2c_set_clientdata(client
, indio_dev
);
648 cm36651
->client
= client
;
649 cm36651
->ps_client
= i2c_new_dummy_device(client
->adapter
,
650 CM36651_I2C_ADDR_PS
);
651 if (IS_ERR(cm36651
->ps_client
)) {
652 dev_err(&client
->dev
, "%s: new i2c device failed\n", __func__
);
653 ret
= PTR_ERR(cm36651
->ps_client
);
654 goto error_disable_reg
;
657 cm36651
->ara_client
= i2c_new_dummy_device(client
->adapter
, CM36651_ARA
);
658 if (IS_ERR(cm36651
->ara_client
)) {
659 dev_err(&client
->dev
, "%s: new i2c device failed\n", __func__
);
660 ret
= PTR_ERR(cm36651
->ara_client
);
661 goto error_i2c_unregister_ps
;
664 mutex_init(&cm36651
->lock
);
665 indio_dev
->channels
= cm36651_channels
;
666 indio_dev
->num_channels
= ARRAY_SIZE(cm36651_channels
);
667 indio_dev
->info
= &cm36651_info
;
668 indio_dev
->name
= id
->name
;
669 indio_dev
->modes
= INDIO_DIRECT_MODE
;
671 ret
= cm36651_setup_reg(cm36651
);
673 dev_err(&client
->dev
, "%s: register setup failed\n", __func__
);
674 goto error_i2c_unregister_ara
;
677 ret
= request_threaded_irq(client
->irq
, NULL
, cm36651_irq_handler
,
678 IRQF_TRIGGER_FALLING
| IRQF_ONESHOT
,
679 "cm36651", indio_dev
);
681 dev_err(&client
->dev
, "%s: request irq failed\n", __func__
);
682 goto error_i2c_unregister_ara
;
685 ret
= iio_device_register(indio_dev
);
687 dev_err(&client
->dev
, "%s: regist device failed\n", __func__
);
694 free_irq(client
->irq
, indio_dev
);
695 error_i2c_unregister_ara
:
696 i2c_unregister_device(cm36651
->ara_client
);
697 error_i2c_unregister_ps
:
698 i2c_unregister_device(cm36651
->ps_client
);
700 regulator_disable(cm36651
->vled_reg
);
704 static int cm36651_remove(struct i2c_client
*client
)
706 struct iio_dev
*indio_dev
= i2c_get_clientdata(client
);
707 struct cm36651_data
*cm36651
= iio_priv(indio_dev
);
709 iio_device_unregister(indio_dev
);
710 regulator_disable(cm36651
->vled_reg
);
711 free_irq(client
->irq
, indio_dev
);
712 i2c_unregister_device(cm36651
->ps_client
);
713 i2c_unregister_device(cm36651
->ara_client
);
718 static const struct i2c_device_id cm36651_id
[] = {
723 MODULE_DEVICE_TABLE(i2c
, cm36651_id
);
725 static const struct of_device_id cm36651_of_match
[] = {
726 { .compatible
= "capella,cm36651" },
729 MODULE_DEVICE_TABLE(of
, cm36651_of_match
);
731 static struct i2c_driver cm36651_driver
= {
734 .of_match_table
= cm36651_of_match
,
736 .probe
= cm36651_probe
,
737 .remove
= cm36651_remove
,
738 .id_table
= cm36651_id
,
741 module_i2c_driver(cm36651_driver
);
743 MODULE_AUTHOR("Beomho Seo <beomho.seo@samsung.com>");
744 MODULE_DESCRIPTION("CM36651 proximity/ambient light sensor driver");
745 MODULE_LICENSE("GPL v2");