aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorBenson Leung <bleung@chromium.org>2013-02-01 17:34:45 -0500
committerMatthew Garrett <matthew.garrett@nebula.com>2013-02-27 08:30:39 -0500
commitaabf3f442b0f42b3a37ed7beb8d5f3f249b812ca (patch)
tree5adc8596e18562d38cdf796883cca8eba9608c52 /drivers/platform/x86
parent261f171f571a82c1f990d484c374aa3f7236fe5e (diff)
Platform: x86: chromeos_laptop - Add Taos tsl2563 device
Two legacy Chromebooks, the Cr-48, and the Acer AC700, are equipped with a Taos tsl2563 light sensor. This will instantiate the sensor on those laptops. Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/chromeos_laptop.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/platform/x86/chromeos_laptop.c b/drivers/platform/x86/chromeos_laptop.c
index 9293c66d52c1..188b7dac7780 100644
--- a/drivers/platform/x86/chromeos_laptop.c
+++ b/drivers/platform/x86/chromeos_laptop.c
@@ -27,6 +27,7 @@
27 27
28#define CYAPA_TP_I2C_ADDR 0x67 28#define CYAPA_TP_I2C_ADDR 0x67
29#define ISL_ALS_I2C_ADDR 0x44 29#define ISL_ALS_I2C_ADDR 0x44
30#define TAOS_ALS_I2C_ADDR 0x29
30 31
31static struct i2c_client *als; 32static struct i2c_client *als;
32static struct i2c_client *tp; 33static struct i2c_client *tp;
@@ -49,6 +50,10 @@ static struct i2c_board_info __initdata isl_als_device = {
49 I2C_BOARD_INFO("isl29018", ISL_ALS_I2C_ADDR), 50 I2C_BOARD_INFO("isl29018", ISL_ALS_I2C_ADDR),
50}; 51};
51 52
53static struct i2c_board_info __initdata tsl2563_als_device = {
54 I2C_BOARD_INFO("tsl2563", TAOS_ALS_I2C_ADDR),
55};
56
52static struct i2c_client __init *__add_probed_i2c_device( 57static struct i2c_client __init *__add_probed_i2c_device(
53 const char *name, 58 const char *name,
54 int bus, 59 int bus,
@@ -159,6 +164,13 @@ static int __init setup_isl29018_als(const struct dmi_system_id *id)
159 return 0; 164 return 0;
160} 165}
161 166
167static int __init setup_tsl2563_als(const struct dmi_system_id *id)
168{
169 /* add tsl2563 light sensor on smbus */
170 als = add_smbus_device(NULL, &tsl2563_als_device);
171 return 0;
172}
173
162static struct dmi_system_id __initdata chromeos_laptop_dmi_table[] = { 174static struct dmi_system_id __initdata chromeos_laptop_dmi_table[] = {
163 { 175 {
164 .ident = "Samsung Series 5 550 - Touchpad", 176 .ident = "Samsung Series 5 550 - Touchpad",
@@ -183,6 +195,20 @@ static struct dmi_system_id __initdata chromeos_laptop_dmi_table[] = {
183 }, 195 },
184 .callback = setup_cyapa_smbus_tp, 196 .callback = setup_cyapa_smbus_tp,
185 }, 197 },
198 {
199 .ident = "Cr-48 - Light Sensor",
200 .matches = {
201 DMI_MATCH(DMI_PRODUCT_NAME, "Mario"),
202 },
203 .callback = setup_tsl2563_als,
204 },
205 {
206 .ident = "Acer AC700 - Light Sensor",
207 .matches = {
208 DMI_MATCH(DMI_PRODUCT_NAME, "ZGB"),
209 },
210 .callback = setup_tsl2563_als,
211 },
186 { } 212 { }
187}; 213};
188MODULE_DEVICE_TABLE(dmi, chromeos_laptop_dmi_table); 214MODULE_DEVICE_TABLE(dmi, chromeos_laptop_dmi_table);