Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 The Android Open Source Project |
Christopher N. Hesse | ae27148 | 2016-12-01 15:51:12 +0100 | [diff] [blame] | 3 | * Copyright (C) 2015-2016 The CyanogenMod Project |
Simon Shields | 310d199 | 2017-02-18 20:55:11 +1100 | [diff] [blame] | 4 | * Copyright (C) 2017 The LineageOS Project |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 5 | * |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | * you may not use this file except in compliance with the License. |
| 8 | * You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
| 17 | */ |
| 18 | |
| 19 | #define LOG_TAG "SamsungLightsHAL" |
| 20 | /* #define LOG_NDEBUG 0 */ |
| 21 | |
| 22 | #include <cutils/log.h> |
| 23 | #include <stdlib.h> |
| 24 | #include <string.h> |
| 25 | #include <unistd.h> |
| 26 | #include <errno.h> |
| 27 | #include <fcntl.h> |
| 28 | #include <pthread.h> |
| 29 | |
| 30 | #include <sys/ioctl.h> |
| 31 | #include <sys/types.h> |
| 32 | |
| 33 | #include <hardware/lights.h> |
Christopher N. Hesse | 898e1fe | 2016-12-07 12:12:23 +0100 | [diff] [blame] | 34 | #include <liblights/samsung_lights_helper.h> |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 35 | |
Christopher N. Hesse | ae27148 | 2016-12-01 15:51:12 +0100 | [diff] [blame] | 36 | #include "samsung_lights.h" |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 37 | |
| 38 | #define COLOR_MASK 0x00ffffff |
| 39 | |
Christopher N. Hesse | f3c6a42 | 2016-12-05 22:11:55 +0100 | [diff] [blame] | 40 | #define MAX_INPUT_BRIGHTNESS 255 |
| 41 | |
Christopher N. Hesse | a8fe2a1 | 2016-12-31 17:14:47 +0100 | [diff] [blame] | 42 | enum component_mask_t { |
| 43 | COMPONENT_BACKLIGHT = 0x1, |
| 44 | COMPONENT_BUTTON_LIGHT = 0x2, |
| 45 | COMPONENT_LED = 0x4, |
| 46 | }; |
| 47 | |
Simon Shields | 310d199 | 2017-02-18 20:55:11 +1100 | [diff] [blame] | 48 | enum light_t { |
| 49 | TYPE_BATTERY = 0, |
| 50 | TYPE_NOTIFICATION = 1, |
| 51 | TYPE_ATTENTION = 2, |
| 52 | }; |
| 53 | |
Christopher N. Hesse | a8fe2a1 | 2016-12-31 17:14:47 +0100 | [diff] [blame] | 54 | // Assume backlight is always supported |
| 55 | static int hw_components = COMPONENT_BACKLIGHT; |
| 56 | |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 57 | static pthread_once_t g_init = PTHREAD_ONCE_INIT; |
| 58 | static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER; |
| 59 | |
Christopher N. Hesse | f3c6a42 | 2016-12-05 22:11:55 +0100 | [diff] [blame] | 60 | struct backlight_config { |
| 61 | int cur_brightness, max_brightness; |
| 62 | }; |
| 63 | |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 64 | struct led_config { |
| 65 | unsigned int color; |
| 66 | int delay_on, delay_off; |
| 67 | }; |
| 68 | |
Christopher N. Hesse | f3c6a42 | 2016-12-05 22:11:55 +0100 | [diff] [blame] | 69 | static struct backlight_config g_backlight; // For panel backlight |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 70 | static struct led_config g_leds[3]; // For battery, notifications, and attention. |
| 71 | static int g_cur_led = -1; // Presently showing LED of the above. |
| 72 | |
Christopher N. Hesse | a8fe2a1 | 2016-12-31 17:14:47 +0100 | [diff] [blame] | 73 | void check_component_support() |
| 74 | { |
| 75 | if (access(BUTTON_BRIGHTNESS_NODE, W_OK) == 0) |
| 76 | hw_components |= COMPONENT_BUTTON_LIGHT; |
| 77 | if (access(LED_BLINK_NODE, W_OK) == 0) |
| 78 | hw_components |= COMPONENT_LED; |
| 79 | } |
| 80 | |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 81 | void init_g_lock(void) |
| 82 | { |
| 83 | pthread_mutex_init(&g_lock, NULL); |
| 84 | } |
| 85 | |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 86 | static int write_str(char const *path, const char* value) |
| 87 | { |
| 88 | int fd; |
| 89 | static int already_warned; |
| 90 | |
| 91 | already_warned = 0; |
| 92 | |
| 93 | ALOGV("write_str: path %s, value %s", path, value); |
| 94 | fd = open(path, O_RDWR); |
| 95 | |
| 96 | if (fd >= 0) { |
| 97 | int amt = write(fd, value, strlen(value)); |
| 98 | close(fd); |
| 99 | return amt == -1 ? -errno : 0; |
| 100 | } else { |
| 101 | if (already_warned == 0) { |
Christopher N. Hesse | b5b9500 | 2017-03-04 15:04:16 +0100 | [diff] [blame] | 102 | ALOGE("write_str failed to open %s", path); |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 103 | already_warned = 1; |
| 104 | } |
| 105 | return -errno; |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | static int rgb_to_brightness(struct light_state_t const *state) |
| 110 | { |
| 111 | int color = state->color & COLOR_MASK; |
| 112 | |
| 113 | return ((77*((color>>16) & 0x00ff)) |
| 114 | + (150*((color>>8) & 0x00ff)) + (29*(color & 0x00ff))) >> 8; |
| 115 | } |
| 116 | |
| 117 | static int set_light_backlight(struct light_device_t *dev __unused, |
| 118 | struct light_state_t const *state) |
| 119 | { |
| 120 | int err = 0; |
| 121 | int brightness = rgb_to_brightness(state); |
Christopher N. Hesse | f3c6a42 | 2016-12-05 22:11:55 +0100 | [diff] [blame] | 122 | int max_brightness = g_backlight.max_brightness; |
| 123 | |
| 124 | /* |
Luca Stefani | a042209 | 2017-03-13 14:53:14 +0100 | [diff] [blame] | 125 | * If max panel brightness is not the default (255), |
| 126 | * apply linear scaling across the accepted range. |
Christopher N. Hesse | f3c6a42 | 2016-12-05 22:11:55 +0100 | [diff] [blame] | 127 | */ |
Luca Stefani | a042209 | 2017-03-13 14:53:14 +0100 | [diff] [blame] | 128 | if (max_brightness != MAX_INPUT_BRIGHTNESS) { |
Christopher N. Hesse | f3c6a42 | 2016-12-05 22:11:55 +0100 | [diff] [blame] | 129 | int old_brightness = brightness; |
| 130 | brightness = brightness * max_brightness / MAX_INPUT_BRIGHTNESS; |
Christopher N. Hesse | b5b9500 | 2017-03-04 15:04:16 +0100 | [diff] [blame] | 131 | ALOGV("%s: scaling brightness %d => %d", __func__, |
Christopher N. Hesse | f3c6a42 | 2016-12-05 22:11:55 +0100 | [diff] [blame] | 132 | old_brightness, brightness); |
| 133 | } |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 134 | |
| 135 | pthread_mutex_lock(&g_lock); |
Christopher N. Hesse | 898e1fe | 2016-12-07 12:12:23 +0100 | [diff] [blame] | 136 | err = set_cur_panel_brightness(brightness); |
Christopher N. Hesse | f3c6a42 | 2016-12-05 22:11:55 +0100 | [diff] [blame] | 137 | if (err == 0) |
| 138 | g_backlight.cur_brightness = brightness; |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 139 | |
| 140 | pthread_mutex_unlock(&g_lock); |
| 141 | return err; |
| 142 | } |
| 143 | |
| 144 | static int set_light_buttons(struct light_device_t* dev __unused, |
| 145 | struct light_state_t const* state) |
| 146 | { |
| 147 | int err = 0; |
| 148 | int on = (state->color & COLOR_MASK); |
| 149 | |
| 150 | pthread_mutex_lock(&g_lock); |
| 151 | |
Christopher N. Hesse | 898e1fe | 2016-12-07 12:12:23 +0100 | [diff] [blame] | 152 | err = set_cur_button_brightness(on ? 1 : 0); |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 153 | |
| 154 | pthread_mutex_unlock(&g_lock); |
| 155 | |
| 156 | return err; |
| 157 | } |
| 158 | |
| 159 | static int close_lights(struct light_device_t *dev) |
| 160 | { |
| 161 | ALOGV("close_light is called"); |
| 162 | if (dev) |
| 163 | free(dev); |
| 164 | |
| 165 | return 0; |
| 166 | } |
| 167 | |
| 168 | /* LEDs */ |
| 169 | static int write_leds(const struct led_config *led) |
| 170 | { |
| 171 | static const struct led_config led_off = {0, 0, 0}; |
| 172 | |
| 173 | char blink[32]; |
| 174 | int count, err; |
| 175 | int color; |
| 176 | |
| 177 | if (led == NULL) |
| 178 | led = &led_off; |
| 179 | |
| 180 | count = snprintf(blink, |
| 181 | sizeof(blink) - 1, |
| 182 | "0x%08x %d %d", |
| 183 | led->color, |
| 184 | led->delay_on, |
| 185 | led->delay_off); |
| 186 | if (count < 0) { |
| 187 | return -errno; |
| 188 | } else if ((unsigned int)count >= sizeof(blink)-1) { |
| 189 | ALOGE("%s: Truncated string: blink=\"%s\".", __func__, blink); |
| 190 | return -EINVAL; |
| 191 | } |
| 192 | |
Christopher N. Hesse | b5b9500 | 2017-03-04 15:04:16 +0100 | [diff] [blame] | 193 | ALOGV("%s: color=0x%08x, delay_on=%d, delay_off=%d, blink=%s", |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 194 | __func__, led->color, led->delay_on, led->delay_off, blink); |
| 195 | |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 196 | pthread_mutex_lock(&g_lock); |
Christopher N. Hesse | ae27148 | 2016-12-01 15:51:12 +0100 | [diff] [blame] | 197 | err = write_str(LED_BLINK_NODE, blink); |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 198 | pthread_mutex_unlock(&g_lock); |
| 199 | |
| 200 | return err; |
| 201 | } |
| 202 | |
Simon Shields | 310d199 | 2017-02-18 20:55:11 +1100 | [diff] [blame] | 203 | static int calibrate_color(int color, int brightness) |
| 204 | { |
| 205 | int red = ((color >> 16) & 0xFF) * LED_ADJUSTMENT_R; |
| 206 | int green = ((color >> 8) & 0xFF) * LED_ADJUSTMENT_G; |
| 207 | int blue = (color & 0xFF) * LED_ADJUSTMENT_B; |
| 208 | |
| 209 | return (((red * brightness) / 255) << 16) + (((green * brightness) / 255) << 8) + ((blue * brightness) / 255); |
| 210 | } |
| 211 | |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 212 | static int set_light_leds(struct light_state_t const *state, int type) |
| 213 | { |
| 214 | struct led_config *led; |
| 215 | int err = 0; |
Simon Shields | 310d199 | 2017-02-18 20:55:11 +1100 | [diff] [blame] | 216 | int adjusted_brightness; |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 217 | |
| 218 | ALOGV("%s: type=%d, color=0x%010x, fM=%d, fOnMS=%d, fOffMs=%d.", __func__, |
| 219 | type, state->color,state->flashMode, state->flashOnMS, state->flashOffMS); |
| 220 | |
| 221 | if (type < 0 || (size_t)type >= sizeof(g_leds)/sizeof(g_leds[0])) { |
| 222 | return -EINVAL; |
| 223 | } |
| 224 | |
| 225 | /* type is one of: |
| 226 | * 0. battery |
| 227 | * 1. notifications |
| 228 | * 2. attention |
| 229 | * which are multiplexed onto the same physical LED in the above order. */ |
| 230 | led = &g_leds[type]; |
| 231 | |
| 232 | switch (state->flashMode) { |
| 233 | case LIGHT_FLASH_NONE: |
| 234 | /* Set LED to a solid color, spec is unclear on the exact behavior here. */ |
| 235 | led->delay_on = led->delay_off = 0; |
| 236 | break; |
| 237 | case LIGHT_FLASH_TIMED: |
| 238 | case LIGHT_FLASH_HARDWARE: |
| 239 | led->delay_on = state->flashOnMS; |
| 240 | led->delay_off = state->flashOffMS; |
| 241 | break; |
| 242 | default: |
| 243 | return -EINVAL; |
| 244 | } |
| 245 | |
Simon Shields | 310d199 | 2017-02-18 20:55:11 +1100 | [diff] [blame] | 246 | switch (type) { |
| 247 | case TYPE_BATTERY: |
| 248 | adjusted_brightness = LED_BRIGHTNESS_BATTERY; |
| 249 | break; |
| 250 | case TYPE_NOTIFICATION: |
| 251 | adjusted_brightness = LED_BRIGHTNESS_NOTIFICATION; |
| 252 | break; |
| 253 | case TYPE_ATTENTION: |
| 254 | adjusted_brightness = LED_BRIGHTNESS_ATTENTION; |
| 255 | break; |
| 256 | default: |
| 257 | adjusted_brightness = 255; |
| 258 | } |
| 259 | |
| 260 | |
| 261 | |
| 262 | led->color = calibrate_color(state->color & COLOR_MASK, adjusted_brightness); |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 263 | |
| 264 | if (led->color > 0) { |
| 265 | /* This LED is lit. */ |
| 266 | if (type >= g_cur_led) { |
| 267 | /* And it has the highest priority, so show it. */ |
| 268 | err = write_leds(led); |
| 269 | g_cur_led = type; |
| 270 | } |
| 271 | } else { |
| 272 | /* This LED is not (any longer) lit. */ |
| 273 | if (type == g_cur_led) { |
| 274 | /* But it is currently showing, switch to a lower-priority LED. */ |
| 275 | int i; |
| 276 | |
| 277 | for (i = type-1; i >= 0; i--) { |
| 278 | if (g_leds[i].color > 0) { |
| 279 | /* Found a lower-priority LED to switch to. */ |
| 280 | err = write_leds(&g_leds[i]); |
| 281 | goto switched; |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | /* No LEDs are lit, turn off. */ |
| 286 | err = write_leds(NULL); |
| 287 | switched: |
| 288 | g_cur_led = i; |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | return err; |
| 293 | } |
| 294 | |
| 295 | static int set_light_leds_battery(struct light_device_t *dev __unused, |
| 296 | struct light_state_t const *state) |
| 297 | { |
Simon Shields | 310d199 | 2017-02-18 20:55:11 +1100 | [diff] [blame] | 298 | return set_light_leds(state, TYPE_BATTERY); |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | static int set_light_leds_notifications(struct light_device_t *dev __unused, |
| 302 | struct light_state_t const *state) |
| 303 | { |
Simon Shields | 310d199 | 2017-02-18 20:55:11 +1100 | [diff] [blame] | 304 | return set_light_leds(state, TYPE_NOTIFICATION); |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 305 | } |
| 306 | |
| 307 | static int set_light_leds_attention(struct light_device_t *dev __unused, |
| 308 | struct light_state_t const *state) |
| 309 | { |
| 310 | struct light_state_t fixed; |
| 311 | |
| 312 | memcpy(&fixed, state, sizeof(fixed)); |
| 313 | |
| 314 | /* The framework does odd things with the attention lights, fix them up to |
| 315 | * do something sensible here. */ |
| 316 | switch (fixed.flashMode) { |
| 317 | case LIGHT_FLASH_NONE: |
| 318 | /* LightsService.Light::stopFlashing calls with non-zero color. */ |
| 319 | fixed.color = 0; |
| 320 | break; |
| 321 | case LIGHT_FLASH_HARDWARE: |
| 322 | /* PowerManagerService::setAttentionLight calls with onMS=3, offMS=0, which |
| 323 | * just makes for a slightly-dimmer LED. */ |
| 324 | if (fixed.flashOnMS > 0 && fixed.flashOffMS == 0) |
| 325 | fixed.flashMode = LIGHT_FLASH_NONE; |
| 326 | fixed.color = 0x000000ff; |
| 327 | break; |
| 328 | } |
| 329 | |
Simon Shields | 310d199 | 2017-02-18 20:55:11 +1100 | [diff] [blame] | 330 | return set_light_leds(&fixed, TYPE_ATTENTION); |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 331 | } |
| 332 | |
| 333 | static int open_lights(const struct hw_module_t *module, char const *name, |
| 334 | struct hw_device_t **device) |
| 335 | { |
Christopher N. Hesse | a8fe2a1 | 2016-12-31 17:14:47 +0100 | [diff] [blame] | 336 | int requested_component; |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 337 | int (*set_light)(struct light_device_t *dev, |
| 338 | struct light_state_t const *state); |
| 339 | |
Christopher N. Hesse | a8fe2a1 | 2016-12-31 17:14:47 +0100 | [diff] [blame] | 340 | check_component_support(); |
| 341 | |
| 342 | if (0 == strcmp(LIGHT_ID_BACKLIGHT, name)) { |
| 343 | requested_component = COMPONENT_BACKLIGHT; |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 344 | set_light = set_light_backlight; |
Christopher N. Hesse | a8fe2a1 | 2016-12-31 17:14:47 +0100 | [diff] [blame] | 345 | } else if (0 == strcmp(LIGHT_ID_BUTTONS, name)) { |
| 346 | requested_component = COMPONENT_BUTTON_LIGHT; |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 347 | set_light = set_light_buttons; |
Christopher N. Hesse | a8fe2a1 | 2016-12-31 17:14:47 +0100 | [diff] [blame] | 348 | } else if (0 == strcmp(LIGHT_ID_BATTERY, name)) { |
| 349 | requested_component = COMPONENT_LED; |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 350 | set_light = set_light_leds_battery; |
Christopher N. Hesse | a8fe2a1 | 2016-12-31 17:14:47 +0100 | [diff] [blame] | 351 | } else if (0 == strcmp(LIGHT_ID_NOTIFICATIONS, name)) { |
| 352 | requested_component = COMPONENT_LED; |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 353 | set_light = set_light_leds_notifications; |
Christopher N. Hesse | a8fe2a1 | 2016-12-31 17:14:47 +0100 | [diff] [blame] | 354 | } else if (0 == strcmp(LIGHT_ID_ATTENTION, name)) { |
| 355 | requested_component = COMPONENT_LED; |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 356 | set_light = set_light_leds_attention; |
Christopher N. Hesse | a8fe2a1 | 2016-12-31 17:14:47 +0100 | [diff] [blame] | 357 | } else { |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 358 | return -EINVAL; |
Christopher N. Hesse | a8fe2a1 | 2016-12-31 17:14:47 +0100 | [diff] [blame] | 359 | } |
| 360 | |
| 361 | if ((hw_components & requested_component) == 0) { |
| 362 | ALOGV("%s: component 0x%x not supported by device", __func__, |
| 363 | requested_component); |
| 364 | return -EINVAL; |
| 365 | } |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 366 | |
Christopher N. Hesse | 898e1fe | 2016-12-07 12:12:23 +0100 | [diff] [blame] | 367 | int max_brightness = get_max_panel_brightness(); |
Christopher N. Hesse | f3c6a42 | 2016-12-05 22:11:55 +0100 | [diff] [blame] | 368 | if (max_brightness < 0) { |
| 369 | ALOGE("%s: failed to read max panel brightness, fallback to 255!", |
| 370 | __func__); |
| 371 | max_brightness = 255; |
| 372 | } |
| 373 | g_backlight.max_brightness = max_brightness; |
| 374 | |
Christopher N. Hesse | 79a9b15 | 2016-01-26 12:17:55 +0100 | [diff] [blame] | 375 | pthread_once(&g_init, init_g_lock); |
| 376 | |
| 377 | struct light_device_t *dev = malloc(sizeof(struct light_device_t)); |
| 378 | memset(dev, 0, sizeof(*dev)); |
| 379 | |
| 380 | dev->common.tag = HARDWARE_DEVICE_TAG; |
| 381 | dev->common.version = 0; |
| 382 | dev->common.module = (struct hw_module_t *)module; |
| 383 | dev->common.close = (int (*)(struct hw_device_t *))close_lights; |
| 384 | dev->set_light = set_light; |
| 385 | |
| 386 | *device = (struct hw_device_t *)dev; |
| 387 | |
| 388 | return 0; |
| 389 | } |
| 390 | |
| 391 | static struct hw_module_methods_t lights_module_methods = { |
| 392 | .open = open_lights, |
| 393 | }; |
| 394 | |
| 395 | struct hw_module_t HAL_MODULE_INFO_SYM = { |
| 396 | .tag = HARDWARE_MODULE_TAG, |
| 397 | .version_major = 1, |
| 398 | .version_minor = 0, |
| 399 | .id = LIGHTS_HARDWARE_MODULE_ID, |
| 400 | .name = "Samsung Lights Module", |
| 401 | .author = "The CyanogenMod Project", |
| 402 | .methods = &lights_module_methods, |
| 403 | }; |