CHROMIUM: chromeos_laptop: fix ALS entries
authorVincent Palatin <vpalatin@chromium.org>
Thu, 22 Mar 2012 22:49:06 +0000 (15:49 -0700)
committerGrant Grundler <grundler@google.com>
Thu, 24 May 2012 22:14:40 +0000 (15:14 -0700)
- fix incorrect use of .matches to share callbacks among boards DMI
  matches entries :
  it's doing an AND operation between the DMI_MATCH clause.
- on Link, the ALS has been moved to the Panel DDC GMBus on Proto-1.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chromium-os:28217
TEST=on Link proto-1, verify that the ALS is detected properly at
startup and we can read its value from
/sys/bus/iio/devices/iio:device0/illuminance0_input node.

Change-Id: Ic4fdd765cb3c86b07112fd607b79644ebbe0a6cd
Reviewed-on: https://gerrit.chromium.org/gerrit/18910
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Bryan Freed <bfreed@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
Commit-Ready: Benson Leung <bleung@chromium.org>

drivers/platform/x86/chromeos_laptop.c

index 942c655..e315d3d 100644 (file)
@@ -241,6 +241,13 @@ static int setup_isl29018_als(const struct dmi_system_id *id)
        return 0;
 }
 
+static int setup_isl29023_als(const struct dmi_system_id *id)
+{
+       /* add isl29023 light sensor on Panel DDC GMBus */
+       als = add_i2c_device("lightsensor", I2C_ADAPTER_PANEL, &isl_als_device);
+       return 0;
+}
+
 static int setup_tsl2583_als(const struct dmi_system_id *id)
 {
        /* add tsl2583 light sensor */
@@ -273,11 +280,17 @@ static const struct dmi_system_id chromeos_laptop_dmi_table[] = {
        {
                .ident = "isl29018 - Light Sensor",
                .matches = {
-                       DMI_MATCH(DMI_PRODUCT_NAME, "Link"),
                        DMI_MATCH(DMI_PRODUCT_NAME, "Lumpy"),
                },
                .callback = setup_isl29018_als,
        },
+       {
+               .ident = "isl29023 - Light Sensor",
+               .matches = {
+                       DMI_MATCH(DMI_PRODUCT_NAME, "Link"),
+               },
+               .callback = setup_isl29023_als,
+       },
        {
                .ident = "tsl2583 - Light Sensor",
                .matches = {
@@ -289,6 +302,12 @@ static const struct dmi_system_id chromeos_laptop_dmi_table[] = {
                .ident = "tsl2563 - Light Sensor",
                .matches = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "Mario"),
+               },
+               .callback = setup_tsl2563_als,
+       },
+       {
+               .ident = "tsl2563 - Light Sensor",
+               .matches = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "ZGB"),
                },
                .callback = setup_tsl2563_als,