summaryrefslogtreecommitdiff
path: root/sys/dev/i2c/tsl2560.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-12-23 17:46:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-12-23 17:46:40 +0000
commit456453067d1414c6f4097d6aeaf996624183d72b (patch)
treeb3a5f4f9a05a1aba0dd603c6eb3a6ff0cd86ee9f /sys/dev/i2c/tsl2560.c
parent2da4a587cf08c4fd33f160fe0f40ff89d9d3a3c3 (diff)
adapt to new two-level sensor api; Constantine A. Murenin
Diffstat (limited to 'sys/dev/i2c/tsl2560.c')
-rw-r--r--sys/dev/i2c/tsl2560.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/i2c/tsl2560.c b/sys/dev/i2c/tsl2560.c
index 28ea49cd4a9..e5dd30ba1a6 100644
--- a/sys/dev/i2c/tsl2560.c
+++ b/sys/dev/i2c/tsl2560.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tsl2560.c,v 1.3 2006/01/19 17:08:39 grange Exp $ */
+/* $OpenBSD: tsl2560.c,v 1.4 2006/12/23 17:46:39 deraadt Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -41,6 +41,7 @@ struct tsl_softc {
i2c_addr_t sc_addr;
struct sensor sc_sensor;
+ struct sensordev sc_sensordev;
};
int tsl_match(struct device *, void *, void *);
@@ -115,17 +116,17 @@ tsl_attach(struct device *parent, struct device *self, void *aux)
}
/* Initialize sensor data. */
- strlcpy(sc->sc_sensor.device, sc->sc_dev.dv_xname,
- sizeof(sc->sc_sensor.device));
+ strlcpy(sc->sc_sensordev.xname, sc->sc_dev.dv_xname,
+ sizeof(sc->sc_sensordev.xname));
sc->sc_sensor.type = SENSOR_LUX;
- strlcpy(sc->sc_sensor.desc, "LUX", sizeof(sc->sc_sensor.desc));
if (sensor_task_register(sc, tsl_refresh, 5)) {
printf(": unable to register update task\n");
return;
}
- sensor_add(&sc->sc_sensor);
+ sensor_attach(&sc->sc_sensordev, &sc->sc_sensor);
+ sensordev_install(&sc->sc_sensordev);
printf("\n");
}