xref: /linux/drivers/iio/light/cm32181.c (revision 1463a166b4eafc654874528ba5e2f66dbdfb8048)
1971672c0SKevin Tsai /*
2971672c0SKevin Tsai  * Copyright (C) 2013 Capella Microsystems Inc.
3971672c0SKevin Tsai  * Author: Kevin Tsai <ktsai@capellamicro.com>
4971672c0SKevin Tsai  *
5971672c0SKevin Tsai  * This program is free software; you can redistribute it and/or modify it
6971672c0SKevin Tsai  * under the terms of the GNU General Public License version 2, as published
7971672c0SKevin Tsai  * by the Free Software Foundation.
8971672c0SKevin Tsai  */
9971672c0SKevin Tsai 
10971672c0SKevin Tsai #include <linux/delay.h>
11971672c0SKevin Tsai #include <linux/err.h>
12971672c0SKevin Tsai #include <linux/i2c.h>
13971672c0SKevin Tsai #include <linux/mutex.h>
14971672c0SKevin Tsai #include <linux/module.h>
15971672c0SKevin Tsai #include <linux/interrupt.h>
16971672c0SKevin Tsai #include <linux/regulator/consumer.h>
17971672c0SKevin Tsai #include <linux/iio/iio.h>
18971672c0SKevin Tsai #include <linux/iio/sysfs.h>
19971672c0SKevin Tsai #include <linux/iio/events.h>
20971672c0SKevin Tsai #include <linux/init.h>
21971672c0SKevin Tsai 
22971672c0SKevin Tsai /* Registers Address */
23971672c0SKevin Tsai #define CM32181_REG_ADDR_CMD		0x00
24971672c0SKevin Tsai #define CM32181_REG_ADDR_ALS		0x04
25971672c0SKevin Tsai #define CM32181_REG_ADDR_STATUS		0x06
26971672c0SKevin Tsai #define CM32181_REG_ADDR_ID		0x07
27971672c0SKevin Tsai 
28971672c0SKevin Tsai /* Number of Configurable Registers */
29971672c0SKevin Tsai #define CM32181_CONF_REG_NUM		0x01
30971672c0SKevin Tsai 
31971672c0SKevin Tsai /* CMD register */
32971672c0SKevin Tsai #define CM32181_CMD_ALS_ENABLE		0x00
33971672c0SKevin Tsai #define CM32181_CMD_ALS_DISABLE		0x01
34971672c0SKevin Tsai #define CM32181_CMD_ALS_INT_EN		0x02
35971672c0SKevin Tsai 
36971672c0SKevin Tsai #define CM32181_CMD_ALS_IT_SHIFT	6
37971672c0SKevin Tsai #define CM32181_CMD_ALS_IT_MASK		(0x0F << CM32181_CMD_ALS_IT_SHIFT)
38971672c0SKevin Tsai #define CM32181_CMD_ALS_IT_DEFAULT	(0x00 << CM32181_CMD_ALS_IT_SHIFT)
39971672c0SKevin Tsai 
40971672c0SKevin Tsai #define CM32181_CMD_ALS_SM_SHIFT	11
41971672c0SKevin Tsai #define CM32181_CMD_ALS_SM_MASK		(0x03 << CM32181_CMD_ALS_SM_SHIFT)
42971672c0SKevin Tsai #define CM32181_CMD_ALS_SM_DEFAULT	(0x01 << CM32181_CMD_ALS_SM_SHIFT)
43971672c0SKevin Tsai 
44971672c0SKevin Tsai #define CM32181_MLUX_PER_BIT		5	/* ALS_SM=01 IT=800ms */
45971672c0SKevin Tsai #define CM32181_MLUX_PER_BIT_BASE_IT	800000	/* Based on IT=800ms */
46971672c0SKevin Tsai #define	CM32181_CALIBSCALE_DEFAULT	1000
47971672c0SKevin Tsai #define CM32181_CALIBSCALE_RESOLUTION	1000
48971672c0SKevin Tsai #define MLUX_PER_LUX			1000
49971672c0SKevin Tsai 
50971672c0SKevin Tsai static const u8 cm32181_reg[CM32181_CONF_REG_NUM] = {
51971672c0SKevin Tsai 	CM32181_REG_ADDR_CMD,
52971672c0SKevin Tsai };
53971672c0SKevin Tsai 
54971672c0SKevin Tsai static const int als_it_bits[] = {12, 8, 0, 1, 2, 3};
55971672c0SKevin Tsai static const int als_it_value[] = {25000, 50000, 100000, 200000, 400000,
56971672c0SKevin Tsai 	800000};
57971672c0SKevin Tsai 
58971672c0SKevin Tsai struct cm32181_chip {
59971672c0SKevin Tsai 	struct i2c_client *client;
60971672c0SKevin Tsai 	struct mutex lock;
61971672c0SKevin Tsai 	u16 conf_regs[CM32181_CONF_REG_NUM];
62971672c0SKevin Tsai 	int calibscale;
63971672c0SKevin Tsai };
64971672c0SKevin Tsai 
65971672c0SKevin Tsai /**
66971672c0SKevin Tsai  * cm32181_reg_init() - Initialize CM32181 registers
67971672c0SKevin Tsai  * @cm32181:	pointer of struct cm32181.
68971672c0SKevin Tsai  *
69971672c0SKevin Tsai  * Initialize CM32181 ambient light sensor register to default values.
70971672c0SKevin Tsai  *
71971672c0SKevin Tsai  * Return: 0 for success; otherwise for error code.
72971672c0SKevin Tsai  */
73971672c0SKevin Tsai static int cm32181_reg_init(struct cm32181_chip *cm32181)
74971672c0SKevin Tsai {
75971672c0SKevin Tsai 	struct i2c_client *client = cm32181->client;
76971672c0SKevin Tsai 	int i;
77971672c0SKevin Tsai 	s32 ret;
78971672c0SKevin Tsai 
79971672c0SKevin Tsai 	ret = i2c_smbus_read_word_data(client, CM32181_REG_ADDR_ID);
80971672c0SKevin Tsai 	if (ret < 0)
81971672c0SKevin Tsai 		return ret;
82971672c0SKevin Tsai 
83971672c0SKevin Tsai 	/* check device ID */
84971672c0SKevin Tsai 	if ((ret & 0xFF) != 0x81)
85971672c0SKevin Tsai 		return -ENODEV;
86971672c0SKevin Tsai 
87971672c0SKevin Tsai 	/* Default Values */
88971672c0SKevin Tsai 	cm32181->conf_regs[CM32181_REG_ADDR_CMD] = CM32181_CMD_ALS_ENABLE |
89971672c0SKevin Tsai 			CM32181_CMD_ALS_IT_DEFAULT | CM32181_CMD_ALS_SM_DEFAULT;
90971672c0SKevin Tsai 	cm32181->calibscale = CM32181_CALIBSCALE_DEFAULT;
91971672c0SKevin Tsai 
92971672c0SKevin Tsai 	/* Initialize registers*/
93971672c0SKevin Tsai 	for (i = 0; i < CM32181_CONF_REG_NUM; i++) {
94971672c0SKevin Tsai 		ret = i2c_smbus_write_word_data(client, cm32181_reg[i],
95971672c0SKevin Tsai 			cm32181->conf_regs[i]);
96971672c0SKevin Tsai 		if (ret < 0)
97971672c0SKevin Tsai 			return ret;
98971672c0SKevin Tsai 	}
99971672c0SKevin Tsai 
100971672c0SKevin Tsai 	return 0;
101971672c0SKevin Tsai }
102971672c0SKevin Tsai 
103971672c0SKevin Tsai /**
104971672c0SKevin Tsai  *  cm32181_read_als_it() - Get sensor integration time (ms)
105971672c0SKevin Tsai  *  @cm32181:	pointer of struct cm32181
106*1463a166SBeomho Seo  *  @val2:	pointer of int to load the als_it value.
107971672c0SKevin Tsai  *
108971672c0SKevin Tsai  *  Report the current integartion time by millisecond.
109971672c0SKevin Tsai  *
110*1463a166SBeomho Seo  *  Return: IIO_VAL_INT_PLUS_MICRO for success, otherwise -EINVAL.
111971672c0SKevin Tsai  */
112*1463a166SBeomho Seo static int cm32181_read_als_it(struct cm32181_chip *cm32181, int *val2)
113971672c0SKevin Tsai {
114971672c0SKevin Tsai 	u16 als_it;
115971672c0SKevin Tsai 	int i;
116971672c0SKevin Tsai 
117971672c0SKevin Tsai 	als_it = cm32181->conf_regs[CM32181_REG_ADDR_CMD];
118971672c0SKevin Tsai 	als_it &= CM32181_CMD_ALS_IT_MASK;
119971672c0SKevin Tsai 	als_it >>= CM32181_CMD_ALS_IT_SHIFT;
120971672c0SKevin Tsai 	for (i = 0; i < ARRAY_SIZE(als_it_bits); i++) {
121971672c0SKevin Tsai 		if (als_it == als_it_bits[i]) {
122*1463a166SBeomho Seo 			*val2 = als_it_value[i];
123*1463a166SBeomho Seo 			return IIO_VAL_INT_PLUS_MICRO;
124971672c0SKevin Tsai 		}
125971672c0SKevin Tsai 	}
126971672c0SKevin Tsai 
127971672c0SKevin Tsai 	return -EINVAL;
128971672c0SKevin Tsai }
129971672c0SKevin Tsai 
130971672c0SKevin Tsai /**
131971672c0SKevin Tsai  * cm32181_write_als_it() - Write sensor integration time
132971672c0SKevin Tsai  * @cm32181:	pointer of struct cm32181.
133971672c0SKevin Tsai  * @val:	integration time by millisecond.
134971672c0SKevin Tsai  *
135971672c0SKevin Tsai  * Convert integration time (ms) to sensor value.
136971672c0SKevin Tsai  *
137971672c0SKevin Tsai  * Return: i2c_smbus_write_word_data command return value.
138971672c0SKevin Tsai  */
139971672c0SKevin Tsai static int cm32181_write_als_it(struct cm32181_chip *cm32181, int val)
140971672c0SKevin Tsai {
141971672c0SKevin Tsai 	struct i2c_client *client = cm32181->client;
142971672c0SKevin Tsai 	u16 als_it;
143971672c0SKevin Tsai 	int ret, i, n;
144971672c0SKevin Tsai 
145971672c0SKevin Tsai 	n = ARRAY_SIZE(als_it_value);
146971672c0SKevin Tsai 	for (i = 0; i < n; i++)
147971672c0SKevin Tsai 		if (val <= als_it_value[i])
148971672c0SKevin Tsai 			break;
149971672c0SKevin Tsai 	if (i >= n)
150971672c0SKevin Tsai 		i = n - 1;
151971672c0SKevin Tsai 
152971672c0SKevin Tsai 	als_it = als_it_bits[i];
153971672c0SKevin Tsai 	als_it <<= CM32181_CMD_ALS_IT_SHIFT;
154971672c0SKevin Tsai 
155971672c0SKevin Tsai 	mutex_lock(&cm32181->lock);
156971672c0SKevin Tsai 	cm32181->conf_regs[CM32181_REG_ADDR_CMD] &=
157971672c0SKevin Tsai 		~CM32181_CMD_ALS_IT_MASK;
158971672c0SKevin Tsai 	cm32181->conf_regs[CM32181_REG_ADDR_CMD] |=
159971672c0SKevin Tsai 		als_it;
160971672c0SKevin Tsai 	ret = i2c_smbus_write_word_data(client, CM32181_REG_ADDR_CMD,
161971672c0SKevin Tsai 			cm32181->conf_regs[CM32181_REG_ADDR_CMD]);
162971672c0SKevin Tsai 	mutex_unlock(&cm32181->lock);
163971672c0SKevin Tsai 
164971672c0SKevin Tsai 	return ret;
165971672c0SKevin Tsai }
166971672c0SKevin Tsai 
167971672c0SKevin Tsai /**
168971672c0SKevin Tsai  * cm32181_get_lux() - report current lux value
169971672c0SKevin Tsai  * @cm32181:	pointer of struct cm32181.
170971672c0SKevin Tsai  *
171971672c0SKevin Tsai  * Convert sensor raw data to lux.  It depends on integration
172971672c0SKevin Tsai  * time and claibscale variable.
173971672c0SKevin Tsai  *
174971672c0SKevin Tsai  * Return: Positive value is lux, otherwise is error code.
175971672c0SKevin Tsai  */
176971672c0SKevin Tsai static int cm32181_get_lux(struct cm32181_chip *cm32181)
177971672c0SKevin Tsai {
178971672c0SKevin Tsai 	struct i2c_client *client = cm32181->client;
179971672c0SKevin Tsai 	int ret;
180971672c0SKevin Tsai 	int als_it;
181971672c0SKevin Tsai 	unsigned long lux;
182971672c0SKevin Tsai 
183971672c0SKevin Tsai 	ret = cm32181_read_als_it(cm32181, &als_it);
184971672c0SKevin Tsai 	if (ret < 0)
185971672c0SKevin Tsai 		return -EINVAL;
186971672c0SKevin Tsai 
187971672c0SKevin Tsai 	lux = CM32181_MLUX_PER_BIT;
188971672c0SKevin Tsai 	lux *= CM32181_MLUX_PER_BIT_BASE_IT;
189971672c0SKevin Tsai 	lux /= als_it;
190971672c0SKevin Tsai 
191971672c0SKevin Tsai 	ret = i2c_smbus_read_word_data(client, CM32181_REG_ADDR_ALS);
192971672c0SKevin Tsai 	if (ret < 0)
193971672c0SKevin Tsai 		return ret;
194971672c0SKevin Tsai 
195971672c0SKevin Tsai 	lux *= ret;
196971672c0SKevin Tsai 	lux *= cm32181->calibscale;
197971672c0SKevin Tsai 	lux /= CM32181_CALIBSCALE_RESOLUTION;
198971672c0SKevin Tsai 	lux /= MLUX_PER_LUX;
199971672c0SKevin Tsai 
200971672c0SKevin Tsai 	if (lux > 0xFFFF)
201971672c0SKevin Tsai 		lux = 0xFFFF;
202971672c0SKevin Tsai 
203971672c0SKevin Tsai 	return lux;
204971672c0SKevin Tsai }
205971672c0SKevin Tsai 
206971672c0SKevin Tsai static int cm32181_read_raw(struct iio_dev *indio_dev,
207971672c0SKevin Tsai 			    struct iio_chan_spec const *chan,
208971672c0SKevin Tsai 			    int *val, int *val2, long mask)
209971672c0SKevin Tsai {
210971672c0SKevin Tsai 	struct cm32181_chip *cm32181 = iio_priv(indio_dev);
211971672c0SKevin Tsai 	int ret;
212971672c0SKevin Tsai 
213971672c0SKevin Tsai 	switch (mask) {
214971672c0SKevin Tsai 	case IIO_CHAN_INFO_PROCESSED:
215971672c0SKevin Tsai 		ret = cm32181_get_lux(cm32181);
216971672c0SKevin Tsai 		if (ret < 0)
217971672c0SKevin Tsai 			return ret;
218971672c0SKevin Tsai 		*val = ret;
219971672c0SKevin Tsai 		return IIO_VAL_INT;
220971672c0SKevin Tsai 	case IIO_CHAN_INFO_CALIBSCALE:
221971672c0SKevin Tsai 		*val = cm32181->calibscale;
222971672c0SKevin Tsai 		return IIO_VAL_INT;
223971672c0SKevin Tsai 	case IIO_CHAN_INFO_INT_TIME:
224*1463a166SBeomho Seo 		ret = cm32181_read_als_it(cm32181, val2);
225971672c0SKevin Tsai 		return ret;
226971672c0SKevin Tsai 	}
227971672c0SKevin Tsai 
228971672c0SKevin Tsai 	return -EINVAL;
229971672c0SKevin Tsai }
230971672c0SKevin Tsai 
231971672c0SKevin Tsai static int cm32181_write_raw(struct iio_dev *indio_dev,
232971672c0SKevin Tsai 			     struct iio_chan_spec const *chan,
233971672c0SKevin Tsai 			     int val, int val2, long mask)
234971672c0SKevin Tsai {
235971672c0SKevin Tsai 	struct cm32181_chip *cm32181 = iio_priv(indio_dev);
236971672c0SKevin Tsai 	int ret;
237971672c0SKevin Tsai 
238971672c0SKevin Tsai 	switch (mask) {
239971672c0SKevin Tsai 	case IIO_CHAN_INFO_CALIBSCALE:
240971672c0SKevin Tsai 		cm32181->calibscale = val;
241971672c0SKevin Tsai 		return val;
242971672c0SKevin Tsai 	case IIO_CHAN_INFO_INT_TIME:
243*1463a166SBeomho Seo 		ret = cm32181_write_als_it(cm32181, val2);
244971672c0SKevin Tsai 		return ret;
245971672c0SKevin Tsai 	}
246971672c0SKevin Tsai 
247971672c0SKevin Tsai 	return -EINVAL;
248971672c0SKevin Tsai }
249971672c0SKevin Tsai 
250971672c0SKevin Tsai /**
251971672c0SKevin Tsai  * cm32181_get_it_available() - Get available ALS IT value
252971672c0SKevin Tsai  * @dev:	pointer of struct device.
253971672c0SKevin Tsai  * @attr:	pointer of struct device_attribute.
254971672c0SKevin Tsai  * @buf:	pointer of return string buffer.
255971672c0SKevin Tsai  *
256971672c0SKevin Tsai  * Display the available integration time values by millisecond.
257971672c0SKevin Tsai  *
258971672c0SKevin Tsai  * Return: string length.
259971672c0SKevin Tsai  */
260971672c0SKevin Tsai static ssize_t cm32181_get_it_available(struct device *dev,
261971672c0SKevin Tsai 			struct device_attribute *attr, char *buf)
262971672c0SKevin Tsai {
263971672c0SKevin Tsai 	int i, n, len;
264971672c0SKevin Tsai 
265971672c0SKevin Tsai 	n = ARRAY_SIZE(als_it_value);
266971672c0SKevin Tsai 	for (i = 0, len = 0; i < n; i++)
267*1463a166SBeomho Seo 		len += sprintf(buf + len, "0.%06u ", als_it_value[i]);
268971672c0SKevin Tsai 	return len + sprintf(buf + len, "\n");
269971672c0SKevin Tsai }
270971672c0SKevin Tsai 
271971672c0SKevin Tsai static const struct iio_chan_spec cm32181_channels[] = {
272971672c0SKevin Tsai 	{
273971672c0SKevin Tsai 		.type = IIO_LIGHT,
274971672c0SKevin Tsai 		.info_mask_separate =
275971672c0SKevin Tsai 			BIT(IIO_CHAN_INFO_PROCESSED) |
276971672c0SKevin Tsai 			BIT(IIO_CHAN_INFO_CALIBSCALE) |
277971672c0SKevin Tsai 			BIT(IIO_CHAN_INFO_INT_TIME),
278971672c0SKevin Tsai 	}
279971672c0SKevin Tsai };
280971672c0SKevin Tsai 
281971672c0SKevin Tsai static IIO_DEVICE_ATTR(in_illuminance_integration_time_available,
282971672c0SKevin Tsai 			S_IRUGO, cm32181_get_it_available, NULL, 0);
283971672c0SKevin Tsai 
284971672c0SKevin Tsai static struct attribute *cm32181_attributes[] = {
285971672c0SKevin Tsai 	&iio_dev_attr_in_illuminance_integration_time_available.dev_attr.attr,
286971672c0SKevin Tsai 	NULL,
287971672c0SKevin Tsai };
288971672c0SKevin Tsai 
289971672c0SKevin Tsai static const struct attribute_group cm32181_attribute_group = {
290971672c0SKevin Tsai 	.attrs = cm32181_attributes
291971672c0SKevin Tsai };
292971672c0SKevin Tsai 
293971672c0SKevin Tsai static const struct iio_info cm32181_info = {
294971672c0SKevin Tsai 	.driver_module		= THIS_MODULE,
295971672c0SKevin Tsai 	.read_raw		= &cm32181_read_raw,
296971672c0SKevin Tsai 	.write_raw		= &cm32181_write_raw,
297971672c0SKevin Tsai 	.attrs			= &cm32181_attribute_group,
298971672c0SKevin Tsai };
299971672c0SKevin Tsai 
300971672c0SKevin Tsai static int cm32181_probe(struct i2c_client *client,
301971672c0SKevin Tsai 			const struct i2c_device_id *id)
302971672c0SKevin Tsai {
303971672c0SKevin Tsai 	struct cm32181_chip *cm32181;
304971672c0SKevin Tsai 	struct iio_dev *indio_dev;
305971672c0SKevin Tsai 	int ret;
306971672c0SKevin Tsai 
307971672c0SKevin Tsai 	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*cm32181));
308971672c0SKevin Tsai 	if (!indio_dev) {
309971672c0SKevin Tsai 		dev_err(&client->dev, "devm_iio_device_alloc failed\n");
310971672c0SKevin Tsai 		return -ENOMEM;
311971672c0SKevin Tsai 	}
312971672c0SKevin Tsai 
313971672c0SKevin Tsai 	cm32181 = iio_priv(indio_dev);
314971672c0SKevin Tsai 	i2c_set_clientdata(client, indio_dev);
315971672c0SKevin Tsai 	cm32181->client = client;
316971672c0SKevin Tsai 
317971672c0SKevin Tsai 	mutex_init(&cm32181->lock);
318971672c0SKevin Tsai 	indio_dev->dev.parent = &client->dev;
319971672c0SKevin Tsai 	indio_dev->channels = cm32181_channels;
320971672c0SKevin Tsai 	indio_dev->num_channels = ARRAY_SIZE(cm32181_channels);
321971672c0SKevin Tsai 	indio_dev->info = &cm32181_info;
322971672c0SKevin Tsai 	indio_dev->name = id->name;
323971672c0SKevin Tsai 	indio_dev->modes = INDIO_DIRECT_MODE;
324971672c0SKevin Tsai 
325971672c0SKevin Tsai 	ret = cm32181_reg_init(cm32181);
326971672c0SKevin Tsai 	if (ret) {
327971672c0SKevin Tsai 		dev_err(&client->dev,
328971672c0SKevin Tsai 			"%s: register init failed\n",
329971672c0SKevin Tsai 			__func__);
330971672c0SKevin Tsai 		return ret;
331971672c0SKevin Tsai 	}
332971672c0SKevin Tsai 
333971672c0SKevin Tsai 	ret = iio_device_register(indio_dev);
334971672c0SKevin Tsai 	if (ret) {
335971672c0SKevin Tsai 		dev_err(&client->dev,
336971672c0SKevin Tsai 			"%s: regist device failed\n",
337971672c0SKevin Tsai 			__func__);
338971672c0SKevin Tsai 		return ret;
339971672c0SKevin Tsai 	}
340971672c0SKevin Tsai 
341971672c0SKevin Tsai 	return 0;
342971672c0SKevin Tsai }
343971672c0SKevin Tsai 
344971672c0SKevin Tsai static int cm32181_remove(struct i2c_client *client)
345971672c0SKevin Tsai {
346971672c0SKevin Tsai 	struct iio_dev *indio_dev = i2c_get_clientdata(client);
347971672c0SKevin Tsai 
348971672c0SKevin Tsai 	iio_device_unregister(indio_dev);
349971672c0SKevin Tsai 	return 0;
350971672c0SKevin Tsai }
351971672c0SKevin Tsai 
352971672c0SKevin Tsai static const struct i2c_device_id cm32181_id[] = {
353971672c0SKevin Tsai 	{ "cm32181", 0 },
354971672c0SKevin Tsai 	{ }
355971672c0SKevin Tsai };
356971672c0SKevin Tsai 
357971672c0SKevin Tsai MODULE_DEVICE_TABLE(i2c, cm32181_id);
358971672c0SKevin Tsai 
359971672c0SKevin Tsai static const struct of_device_id cm32181_of_match[] = {
360971672c0SKevin Tsai 	{ .compatible = "capella,cm32181" },
361971672c0SKevin Tsai 	{ }
362971672c0SKevin Tsai };
363971672c0SKevin Tsai 
364971672c0SKevin Tsai static struct i2c_driver cm32181_driver = {
365971672c0SKevin Tsai 	.driver = {
366971672c0SKevin Tsai 		.name	= "cm32181",
367971672c0SKevin Tsai 		.of_match_table = of_match_ptr(cm32181_of_match),
368971672c0SKevin Tsai 		.owner	= THIS_MODULE,
369971672c0SKevin Tsai 	},
370971672c0SKevin Tsai 	.id_table       = cm32181_id,
371971672c0SKevin Tsai 	.probe		= cm32181_probe,
372971672c0SKevin Tsai 	.remove		= cm32181_remove,
373971672c0SKevin Tsai };
374971672c0SKevin Tsai 
375971672c0SKevin Tsai module_i2c_driver(cm32181_driver);
376971672c0SKevin Tsai 
377971672c0SKevin Tsai MODULE_AUTHOR("Kevin Tsai <ktsai@capellamicro.com>");
378971672c0SKevin Tsai MODULE_DESCRIPTION("CM32181 ambient light sensor driver");
379971672c0SKevin Tsai MODULE_LICENSE("GPL");
380