Home | History | Annotate | Download | only in lights

Lines Matching refs:lights

17 #define LOG_TAG "lights"
31 #include <hardware/lights.h>
71 static int write_brightness(struct dragon_lights *lights, int brightness)
77 lights->sysfs_path);
79 ALOG_ONCE(lights->logged_failures, OP_BRIGHTNESS_PATH,
86 ALOG_ONCE(lights->logged_failures, OP_WRITE_OPEN,
93 ALOG_ONCE(lights->logged_failures, OP_BRIGHTNESS_VALUE,
101 ALOG_ONCE(lights->logged_failures, OP_BRIGHTNESS_WRITE,
113 static int read_max_brightness(struct dragon_lights *lights, int *value)
119 lights->sysfs_path);
121 ALOG_ONCE(lights->logged_failures, OP_MAX_BRIGHTNESS_PATH,
128 ALOG_ONCE(lights->logged_failures, OP_MAX_BRIGHTNESS_OPEN,
135 ALOG_ONCE(lights->logged_failures, OP_MAX_BRIGHTNESS_READ,
159 struct dragon_lights *lights = to_dragon_lights(dev);
171 pthread_mutex_lock(&lights->lock);
172 err = write_brightness(lights, brightness);
173 pthread_mutex_unlock(&lights->lock);
180 struct dragon_lights *lights = (struct dragon_lights *)dev;
181 if (lights)
182 free(lights);
189 struct dragon_lights *lights;
196 lights = malloc(sizeof(*lights));
197 if (lights == NULL) {
198 ALOGE("failed to allocate lights memory");
201 memset(lights, 0, sizeof(*lights));
203 pthread_mutex_init(&lights->lock, NULL);
205 lights->sysfs_path = kBacklightPath;
207 ret = read_max_brightness(lights, &lights->max_brightness);
209 close_lights((struct hw_device_t *)lights);
213 lights->base.common.tag = HARDWARE_DEVICE_TAG;
214 lights->base.common.version = 0;
215 lights->base.common.module = (struct hw_module_t *)module;
216 lights->base.common.close = close_lights;
217 lights->base.set_light = set_light_backlight;
219 *device = (struct hw_device_t *)lights;
232 .name = "dragon lights module",