changed Makefile and profiles, added patches for kernel 2.6.24
[openwrt.git] / target / linux / s3c24xx / patches-2.6.24 / 1029-hxd8-tsl256x.patch.patch
1 From d238d3347d19a6df97670624bd0712e61b83b666 Mon Sep 17 00:00:00 2001
2 From: mokopatches <mokopatches@openmoko.org>
3 Date: Fri, 4 Apr 2008 11:34:17 +0100
4 Subject: [PATCH] hxd8-tsl256x.patch
5
6 ---
7  drivers/i2c/chips/Kconfig   |   10 ++
8  drivers/i2c/chips/Makefile  |    1 +
9  drivers/i2c/chips/tsl256x.c |  310 +++++++++++++++++++++++++++++++++++++++++++
10  drivers/i2c/chips/tsl256x.h |  154 +++++++++++++++++++++
11  include/linux/i2c-id.h      |    1 +
12  5 files changed, 476 insertions(+), 0 deletions(-)
13  create mode 100644 drivers/i2c/chips/tsl256x.c
14  create mode 100644 drivers/i2c/chips/tsl256x.h
15
16 diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
17 index c0011fc..bf0da3a 100644
18 --- a/drivers/i2c/chips/Kconfig
19 +++ b/drivers/i2c/chips/Kconfig
20 @@ -174,4 +174,14 @@ config MENELAUS
21           and other features that are often used in portable devices like
22           cell phones and PDAs.
23  
24 +config SENSORS_TSL256X
25 +       tristate "Texas TSL256X Ambient Light Sensor"
26 +       depends on I2C
27 +       help
28 +         If you say yes here you get support for the Texas TSL256X
29 +         ambient light sensor chip.
30 +
31 +         This driver can also be built as a module.  If so, the module
32 +         will be called tsl256x.
33 +
34  endmenu
35 diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
36 index 864e6cf..a4772c7 100644
37 --- a/drivers/i2c/chips/Makefile
38 +++ b/drivers/i2c/chips/Makefile
39 @@ -16,6 +16,7 @@ obj-$(CONFIG_ISP1301_OMAP)    += isp1301_omap.o
40  obj-$(CONFIG_TPS65010)         += tps65010.o
41  obj-$(CONFIG_MENELAUS)         += menelaus.o
42  obj-$(CONFIG_SENSORS_TSL2550)  += tsl2550.o
43 +obj-$(CONFIG_SENSORS_TSL256X)  += tsl256x.o
44  
45  ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
46  EXTRA_CFLAGS += -DDEBUG
47 diff --git a/drivers/i2c/chips/tsl256x.c b/drivers/i2c/chips/tsl256x.c
48 new file mode 100644
49 index 0000000..455ec5e
50 --- /dev/null
51 +++ b/drivers/i2c/chips/tsl256x.c
52 @@ -0,0 +1,310 @@
53 +/*
54 + * tsl256x.c  --  TSL256x Light Sensor driver
55 + *
56 + * Copyright 2007 by Fiwin.
57 + * Author: Alec Tsai <alec_tsai@fiwin.com.tw>
58 + *
59 + * This program is free software; you can redistribute it and/or modify
60 + * it under the terms of the GNU General Public License version 2 as
61 + * published by the Free Software Foundation.
62 + *
63 + * This I2C client driver refers to pcf50606.c.
64 + */
65 +
66 +#include <linux/module.h>
67 +#include <linux/init.h>
68 +#include <linux/i2c.h>
69 +#include <linux/types.h>
70 +#include <linux/input.h>
71 +
72 +#include "tsl256x.h"
73 +
74 +static unsigned short normal_i2c[] = { 0x39, I2C_CLIENT_END };
75 +/* Magic definition of all other variables and things */
76 +I2C_CLIENT_INSMOD;
77 +
78 +struct tsl256x_data {
79 +       struct i2c_client       client;
80 +       struct mutex            lock;
81 +       struct input_dev        *input_dev;
82 +};
83 +
84 +static struct i2c_driver tsl256x_driver;
85 +
86 +/******************************************************************************
87 + * Low-Level routines
88 + *****************************************************************************/
89 +static inline int __reg_write(struct tsl256x_data *tsl, u_int8_t reg,
90 +                                                               u_int8_t val)
91 +{
92 +       return i2c_smbus_write_byte_data(&tsl->client, reg, val);
93 +}
94 +
95 +static int reg_write(struct tsl256x_data *tsl, u_int8_t reg, u_int8_t val)
96 +{
97 +       int ret;
98 +
99 +       mutex_lock(&tsl->lock);
100 +       ret = __reg_write(tsl, reg, val);
101 +       mutex_unlock(&tsl->lock);
102 +
103 +       return ret;
104 +}
105 +
106 +static inline int32_t __reg_read(struct tsl256x_data *tsl, u_int8_t reg)
107 +{
108 +       int32_t ret;
109 +
110 +       ret = i2c_smbus_read_byte_data(&tsl->client, reg);
111 +
112 +       return ret;
113 +}
114 +
115 +static u_int8_t reg_read(struct tsl256x_data *tsl, u_int8_t reg)
116 +{
117 +       int32_t ret;
118 +
119 +       mutex_lock(&tsl->lock);
120 +       ret = __reg_read(tsl, reg);
121 +       mutex_unlock(&tsl->lock);
122 +
123 +       return ret & 0xff;
124 +}
125 +
126 +u_int32_t calculate_lux(u_int32_t iGain, u_int32_t iType, u_int32_t ch0,
127 +                                               u_int32_t ch1)
128 +{
129 +       u_int32_t channel0 = ch0 * 636 / 10;
130 +       u_int32_t channel1 = ch1 * 636 / 10;
131 +       u_int32_t lux_value = 0;
132 +       u_int32_t ratio = (channel1 * (2^RATIO_SCALE)) / channel0;
133 +       u_int32_t b = 0, m = 0;
134 +
135 +       if (0 == ch0)
136 +               return 0;
137 +       else {
138 +               if (ratio > (13 * (2^RATIO_SCALE) / 10))
139 +                       return 0;
140 +       }
141 +
142 +       switch (iType) {
143 +               case 0: // T package
144 +                       if ((ratio >= 0) && (ratio <= K1T)) {
145 +                               b = B1T;
146 +                               m = M1T;
147 +                       } else if (ratio <= K2T) {
148 +                               b = B2T;
149 +                               m = M2T;
150 +                       } else if (ratio <= K3T) {
151 +                               b = B3T;
152 +                               m = M3T;
153 +                       } else if (ratio <= K4T) {
154 +                               b = B4T;
155 +                               m = M4T;
156 +                       } else if (ratio <= K5T) {
157 +                               b = B5T;
158 +                               m = M5T;
159 +                       } else if (ratio <= K6T) {
160 +                               b = B6T;
161 +                               m = M6T;
162 +                       } else if (ratio <= K7T) {
163 +                               b = B7T;
164 +                               m = M7T;
165 +                       } else if (ratio > K8T) {
166 +                               b = B8T;
167 +                               m = M8T;
168 +                       }
169 +               break;
170 +               case 1:// CS package
171 +                       if ((ratio >= 0) && (ratio <= K1C)) {
172 +                               b = B1C;
173 +                               m = M1C;
174 +                       } else if (ratio <= K2C) {
175 +                               b = B2C;
176 +                               m = M2C;
177 +                       } else if (ratio <= K3C) {
178 +                               b = B3C;
179 +                               m = M3C;
180 +                       } else if (ratio <= K4C) {
181 +                               b = B4C;
182 +                               m = M4C;
183 +                       } else if (ratio <= K5C) {
184 +                               b = B5C;
185 +                               m = M5C;
186 +                       } else if (ratio <= K6C) {
187 +                               b = B6C;
188 +                               m = M6C;
189 +                       } else if (ratio <= K7C) {
190 +                               b = B7C;
191 +                               m = M7C;
192 +                       } else if (ratio > K8C) {
193 +                               b = B8C;
194 +                               m = M8C;
195 +                       }
196 +               break;
197 +               default:
198 +                       return 0;
199 +               break;
200 +       }
201 +
202 +       lux_value = ((channel0 * b) - (channel1 * m)) / 16384;
203 +       return(lux_value);
204 +}
205 +
206 +static ssize_t tsl256x_show_light_lux(struct device *dev,
207 +                                       struct device_attribute *attr, char *buf)
208 +{
209 +       struct i2c_client *client = to_i2c_client(dev);
210 +       struct tsl256x_data *tsl = i2c_get_clientdata(client);
211 +       u_int8_t low_byte_of_ch0 = 0, high_byte_of_ch0 = 0;
212 +       u_int8_t low_byte_of_ch1 = 0, high_byte_of_ch1 = 0;
213 +       u_int32_t adc_value_ch0, adc_value_ch1, adc_value;
214 +
215 +       low_byte_of_ch0 = reg_read(tsl, TSL256X_REG_DATA0LOW);
216 +       high_byte_of_ch0 = reg_read(tsl, TSL256X_REG_DATA0HIGH);
217 +       low_byte_of_ch1 = reg_read(tsl, TSL256X_REG_DATA1LOW);
218 +       high_byte_of_ch1 = reg_read(tsl, TSL256X_REG_DATA1HIGH);
219 +
220 +       adc_value_ch0 = (high_byte_of_ch0 * 256 + low_byte_of_ch0) * 16;
221 +       adc_value_ch1 = (high_byte_of_ch1 * 256 + low_byte_of_ch1) * 16;
222 +
223 +       adc_value = calculate_lux(0, 0, adc_value_ch0, adc_value_ch1);
224 +       return sprintf(buf, "%d\n", adc_value);
225 +}
226 +
227 +static DEVICE_ATTR(light_lux, S_IRUGO, tsl256x_show_light_lux, NULL);
228 +
229 +static int tsl256x_detect(struct i2c_adapter *adapter, int address, int kind)
230 +{
231 +       struct i2c_client *new_client = NULL;
232 +       struct tsl256x_data *tsl256x = NULL;
233 +       u_int8_t id = 0;
234 +       int res = 0;
235 +
236 +       if (!(tsl256x = kzalloc(sizeof(*tsl256x), GFP_KERNEL)))
237 +               return -ENOMEM;
238 +
239 +       mutex_init(&tsl256x->lock);
240 +       new_client = &tsl256x->client;
241 +       i2c_set_clientdata(new_client, tsl256x);
242 +       new_client->addr = address;
243 +       new_client->adapter = adapter;
244 +       new_client->driver = &tsl256x_driver;
245 +       new_client->flags = 0;
246 +       strlcpy(new_client->name, "tsl256x", I2C_NAME_SIZE);
247 +
248 +       /* now we try to detect the chip */
249 +       /* register with i2c core */
250 +       res = i2c_attach_client(new_client);
251 +       if (res) {
252 +               printk(KERN_DEBUG "[%s]Error: during i2c_attach_client()\n",
253 +                       new_client->name);
254 +               goto exit_free;
255 +       } else {
256 +               printk(KERN_INFO "TSL256X is attached to I2C bus.\n");
257 +       }
258 +
259 +       /* Configure TSL256X. */
260 +       {
261 +               /* Power up TSL256X. */
262 +               reg_write(tsl256x, TSL256X_REG_CONTROL, 0x03);
263 +
264 +               /* Check TSL256X ID. */
265 +               id = reg_read(tsl256x, TSL256X_REG_ID);
266 +               if (TSL2561_ID == (id & 0xF0)) {
267 +                       /* Configuring the Timing Register.
268 +                               High Gain (16x), integration time of 101ms. */
269 +                       reg_write(tsl256x, TSL256X_REG_TIMING, 0x11);
270 +               } else {
271 +                       goto exit_free;
272 +               }
273 +       }
274 +
275 +       res = device_create_file(&new_client->dev, &dev_attr_light_lux);
276 +       if (res)
277 +               goto exit_detach;
278 +
279 +       return 0;
280 +
281 +exit_free:
282 +       kfree(tsl256x);
283 +       return res;
284 +exit_detach:
285 +       i2c_detach_client(new_client);
286 +       return res;
287 +}
288 +
289 +static int tsl256x_attach_adapter(struct i2c_adapter *adapter)
290 +{
291 +       return i2c_probe(adapter, &addr_data, &tsl256x_detect);
292 +}
293 +
294 +static int tsl256x_detach_client(struct i2c_client *client)
295 +{
296 +       struct tsl256x_data *tsl256x = i2c_get_clientdata(client);
297 +
298 +       printk(KERN_INFO "Detach TSL256X from I2C bus.\n");
299 +
300 +       /* Power down TSL256X. */
301 +       reg_write(tsl256x, TSL256X_REG_CONTROL, 0x00);
302 +
303 +       device_remove_file(&client->dev, &dev_attr_light_lux);
304 +       kfree(tsl256x);
305 +
306 +       return 0;
307 +}
308 +
309 +#ifdef CONFIG_PM
310 +static int tsl256x_suspend(struct device *dev, pm_message_t state)
311 +{
312 +       struct i2c_client *client = to_i2c_client(dev);
313 +       struct tsl256x_data *tsl256x = i2c_get_clientdata(client);
314 +
315 +       /* Power down TSL256X. */
316 +       reg_write(tsl256x, TSL256X_REG_CONTROL, 0x00);
317 +
318 +       return 0;
319 +}
320 +
321 +static int tsl256x_resume(struct device *dev)
322 +{
323 +       struct i2c_client *client = to_i2c_client(dev);
324 +       struct tsl256x_data *tsl256x = i2c_get_clientdata(client);
325 +
326 +       /* Power up TSL256X. */
327 +       reg_write(tsl256x, TSL256X_REG_CONTROL, 0x03);
328 +
329 +       return 0;
330 +}
331 +#endif
332 +
333 +static struct i2c_driver tsl256x_driver = {
334 +       .driver = {
335 +               .name           = "tsl256x",
336 +               .owner          = THIS_MODULE,
337 +#ifdef CONFIG_PM
338 +               .suspend        = tsl256x_suspend,
339 +               .resume         = tsl256x_resume,
340 +#endif
341 +       },
342 +       .id                             = I2C_DRIVERID_TSL256X,
343 +       .attach_adapter = tsl256x_attach_adapter,
344 +       .detach_client  = tsl256x_detach_client,
345 +};
346 +
347 +static int __init tsl256x_init(void)
348 +{
349 +       return i2c_add_driver(&tsl256x_driver);
350 +}
351 +
352 +static void __exit tsl256x_exit(void)
353 +{
354 +       i2c_del_driver(&tsl256x_driver);
355 +}
356 +
357 +MODULE_AUTHOR("Alec Tsai <alec_tsai@fiwin.com.tw>");
358 +MODULE_LICENSE("GPL");
359 +
360 +module_init(tsl256x_init);
361 +module_exit(tsl256x_exit);
362 +
363 diff --git a/drivers/i2c/chips/tsl256x.h b/drivers/i2c/chips/tsl256x.h
364 new file mode 100644
365 index 0000000..88de0c6
366 --- /dev/null
367 +++ b/drivers/i2c/chips/tsl256x.h
368 @@ -0,0 +1,154 @@
369 +/*
370 + * tsl256x.h  --  TSL256x Light Sensor driver
371 + *
372 + * Copyright 2007 by Fiwin.
373 + * Author: Alec Tsai <alec_tsai@fiwin.com.tw>
374 + *
375 + * This program is free software; you can redistribute it and/or modify
376 + * it under the terms of the GNU General Public License version 2 as
377 + * published by the Free Software Foundation.
378 + *
379 + * The contents of header file is copied from TSL256x Datasheet.
380 + */
381 +
382 +#ifndef _TSL256X_H
383 +#define _TSL256X_H
384 +
385 +#define        TSL2560_ID              0x00
386 +#define        TSL2561_ID              0x10
387 +
388 +#define LUX_SCALE              14              /* scale by 2^14 */
389 +#define RATIO_SCALE            9               /*scale ratio by 2^9 */
390 +
391 +/******************************************************************************
392 + * Integration time scaling factors
393 + *****************************************************************************/
394 +#define CH_SCALE               10              /* scale channel values by 2^10 */
395 +#define CHSCALE_TINT0  0x7517  /* 322/11 * 2^CH_SCALE */
396 +#define CHSCALE_TINT1  0x0fe7  /* 322/81 * 2^CH_SCALE */
397 +
398 +/******************************************************************************
399 + * T Package coefficients
400 + *****************************************************************************/
401 +/*
402 + * For Ch1/Ch0=0.00 to 0.50
403 + * Lux/Ch0=0.0304.0.062*((Ch1/Ch0)^1.4)
404 + * piecewise approximation
405 + * For Ch1/Ch0=0.00 to 0.125:
406 + * Lux/Ch0=0.0304.0.0272*(Ch1/Ch0)
407 + *
408 + * For Ch1/Ch0=0.125 to 0.250:
409 + * Lux/Ch0=0.0325.0.0440*(Ch1/Ch0)
410 + *
411 + * For Ch1/Ch0=0.250 to 0.375:
412 + * Lux/Ch0=0.0351.0.0544*(Ch1/Ch0)
413 + *
414 + * For Ch1/Ch0=0.375 to 0.50:
415 + * Lux/Ch0=0.0381.0.0624*(Ch1/Ch0)
416 + *
417 + * For Ch1/Ch0=0.50 to 0.61:
418 + * Lux/Ch0=0.0224.0.031*(Ch1/Ch0)
419 + *
420 + * For Ch1/Ch0=0.61 to 0.80:
421 + * Lux/Ch0=0.0128.0.0153*(Ch1/Ch0)
422 + *
423 + * For Ch1/Ch0=0.80 to 1.30:
424 + * Lux/Ch0=0.00146.0.00112*(Ch1/Ch0)
425 + *
426 + * For Ch1/Ch0>1.3:
427 + * Lux/Ch0=0
428 + */
429 +#define K1T 0x0040 /* 0.125 * 2^RATIO_SCALE */
430 +#define B1T 0x01f2 /* 0.0304 * 2^LUX_SCALE */
431 +#define M1T 0x01be /* 0.0272 * 2^LUX_SCALE */
432 +#define K2T 0x0080 /* 0.250 * 2^RATIO_SCALE */
433 +#define B2T 0x0214 /* 0.0325 * 2^LUX_SCALE */
434 +#define M2T 0x02d1 /* 0.0440 * 2^LUX_SCALE */
435 +#define K3T 0x00c0 /* 0.375 * 2^RATIO_SCALE */
436 +#define B3T 0x023f /* 0.0351 * 2^LUX_SCALE */
437 +#define M3T 0x037b /* 0.0544 * 2^LUX_SCALE */
438 +#define K4T 0x0100 /* 0.50 * 2^RATIO_SCALE */
439 +#define B4T 0x0270 /* 0.0381 * 2^LUX_SCALE */
440 +#define M4T 0x03fe /* 0.0624 * 2^LUX_SCALE */
441 +#define K5T 0x0138 /* 0.61 * 2^RATIO_SCALE */
442 +#define B5T 0x016f /* 0.0224 * 2^LUX_SCALE */
443 +#define M5T 0x01fc /* 0.0310 * 2^LUX_SCALE */
444 +#define K6T 0x019a /* 0.80 * 2^RATIO_SCALE */
445 +#define B6T 0x00d2 /* 0.0128 * 2^LUX_SCALE */
446 +#define M6T 0x00fb /* 0.0153 * 2^LUX_SCALE */
447 +#define K7T 0x029a /* 1.3 * 2^RATIO_SCALE */
448 +#define B7T 0x0018 /* 0.00146 * 2^LUX_SCALE */
449 +#define M7T 0x0012 /* 0.00112 * 2^LUX_SCALE */
450 +#define K8T 0x029a /* 1.3 * 2^RATIO_SCALE */
451 +#define B8T 0x0000 /* 0.000 * 2^LUX_SCALE */
452 +#define M8T 0x0000 /* 0.000 * 2^LUX_SCALE */
453 +
454 +/******************************************************************************
455 + * CS package coefficients
456 + *****************************************************************************/
457 +/*
458 + * For 0 <= Ch1/Ch0 <= 0.52
459 + * Lux/Ch0 = 0.0315.0.0593*((Ch1/Ch0)^1.4)
460 + * piecewise approximation
461 + * For 0 <= Ch1/Ch0 <= 0.13
462 + * Lux/Ch0 = 0.0315.0.0262*(Ch1/Ch0)
463 + * For 0.13 <= Ch1/Ch0 <= 0.26
464 + * Lux/Ch0 = 0.0337.0.0430*(Ch1/Ch0)
465 + * For 0.26 <= Ch1/Ch0 <= 0.39
466 + * Lux/Ch0 = 0.0363.0.0529*(Ch1/Ch0)
467 + * For 0.39 <= Ch1/Ch0 <= 0.52
468 + * Lux/Ch0 = 0.0392.0.0605*(Ch1/Ch0)
469 + * For 0.52 < Ch1/Ch0 <= 0.65
470 + * Lux/Ch0 = 0.0229.0.0291*(Ch1/Ch0)
471 + * For 0.65 < Ch1/Ch0 <= 0.80
472 + * Lux/Ch0 = 0.00157.0.00180*(Ch1/Ch0)
473 + * For 0.80 < Ch1/Ch0 <= 1.30
474 + * Lux/Ch0 = 0.00338.0.00260*(Ch1/Ch0)
475 + * For Ch1/Ch0 > 1.30
476 + * Lux = 0
477 + */
478 +#define K1C 0x0043 /* 0.130 * 2^RATIO_SCALE */
479 +#define B1C 0x0204 /* 0.0315 * 2^LUX_SCALE */
480 +#define M1C 0x01ad /* 0.0262 * 2^LUX_SCALE */
481 +#define K2C 0x0085 /* 0.260 * 2^RATIO_SCALE */
482 +#define B2C 0x0228 /* 0.0337 * 2^LUX_SCALE */
483 +#define M2C 0x02c1 /* 0.0430 * 2^LUX_SCALE */
484 +#define K3C 0x00c8 /* 0.390 * 2^RATIO_SCALE */
485 +#define B3C 0x0253 /* 0.0363 * 2^LUX_SCALE */
486 +#define M3C 0x0363 /* 0.0529 * 2^LUX_SCALE */
487 +#define K4C 0x010a /* 0.520 * 2^RATIO_SCALE */
488 +#define B4C 0x0282 /* 0.0392 * 2^LUX_SCALE */
489 +#define M4C 0x03df /* 0.0605 * 2^LUX_SCALE */
490 +#define K5C 0x014d /* 0.65 * 2^RATIO_SCALE */
491 +#define B5C 0x0177 /* 0.0229 * 2^LUX_SCALE */
492 +#define M5C 0x01dd /* 0.0291 * 2^LUX_SCALE */
493 +#define K6C 0x019a /* 0.80 * 2^RATIO_SCALE */
494 +#define B6C 0x0101 /* 0.0157 * 2^LUX_SCALE */
495 +#define M6C 0x0127 /* 0.0180 * 2^LUX_SCALE */
496 +#define K7C 0x029a /* 1.3 * 2^RATIO_SCALE */
497 +#define B7C 0x0037 /* 0.00338 * 2^LUX_SCALE */
498 +#define M7C 0x002b /* 0.00260 * 2^LUX_SCALE */
499 +#define K8C 0x029a /* 1.3 * 2^RATIO_SCALE */
500 +#define B8C 0x0000 /* 0.000 * 2^LUX_SCALE */
501 +#define M8C 0x0000 /* 0.000 * 2^LUX_SCALE */
502 +
503 +/* TSL256x registers definition . */
504 +enum tsl256x_regs {
505 +       TSL256X_REG_CONTROL                     = 0x80, /* Control of basic functions */
506 +       TSL256X_REG_TIMING                      = 0x81, /* Integration time/gain control */
507 +       TSL256X_REG_THRESHLOWLOW        = 0x82, /* Low byte of low interrupt threshold */
508 +       TSL256X_REG_THRESHLOWHIGH       = 0x83, /* High byte of low interrupt threshold */
509 +       TSL256X_REG_THRESHHIGHLOW       = 0x84, /* Low byte of high interrupt threshold */
510 +       TSL256X_REG_THRESHHIGHHIGH      = 0x85, /* High byte of high interrupt threshold */
511 +       TSL256X_REG_INTERRUPT           = 0x86, /* Interrupt control */
512 +       TSL256X_REG_CRC                         = 0x88, /* Factory test - not a user register */
513 +       TSL256X_REG_ID                          = 0x8A, /* Part number/ Rev ID */
514 +       TSL256X_REG_DATA0LOW            = 0x8C, /* Low byte of ADC channel 0 */
515 +       TSL256X_REG_DATA0HIGH           = 0x8D, /* High byte of ADC channel 0 */
516 +       TSL256X_REG_DATA1LOW            = 0x8E, /* Low byte of ADC channel 1 */
517 +       TSL256X_REG_DATA1HIGH           = 0x8F, /* High byte of ADC channel 1 */
518 +       __NUM_TSL256X_REGS
519 +};
520 +
521 +#endif /* _TSL256X_H */
522 +
523 diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
524 index 9b8ae78..a089554 100644
525 --- a/include/linux/i2c-id.h
526 +++ b/include/linux/i2c-id.h
527 @@ -168,6 +168,7 @@
528  #define I2C_DRIVERID_W83L785TS 1047
529  #define I2C_DRIVERID_OV7670 1048       /* Omnivision 7670 camera */
530  #define I2C_DRIVERID_PCF50606 1049
531 +#define I2C_DRIVERID_TSL256X 1050
532  
533  /*
534   * ---- Adapter types ----------------------------------------------------
535 -- 
536 1.5.6.5
537