.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * LED driver : leds-ktd2692.c |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2015 Samsung Electronics |
---|
5 | 6 | * Ingi Kim <ingi2.kim@samsung.com> |
---|
6 | | - * |
---|
7 | | - * This program is free software; you can redistribute it and/or modify |
---|
8 | | - * it under the terms of the GNU General Public License version 2 as |
---|
9 | | - * published by the Free Software Foundation. |
---|
10 | 7 | */ |
---|
11 | 8 | |
---|
12 | 9 | #include <linux/delay.h> |
---|
.. | .. |
---|
22 | 19 | /* Value related the movie mode */ |
---|
23 | 20 | #define KTD2692_MOVIE_MODE_CURRENT_LEVELS 16 |
---|
24 | 21 | #define KTD2692_MM_TO_FL_RATIO(x) ((x) / 3) |
---|
25 | | -#define KTD2962_MM_MIN_CURR_THRESHOLD_SCALE 8 |
---|
| 22 | +#define KTD2692_MM_MIN_CURR_THRESHOLD_SCALE 8 |
---|
26 | 23 | |
---|
27 | 24 | /* Value related the flash mode */ |
---|
28 | 25 | #define KTD2692_FLASH_MODE_TIMEOUT_LEVELS 8 |
---|
.. | .. |
---|
253 | 250 | ktd2692_expresswire_reset(led); |
---|
254 | 251 | gpiod_direction_output(led->aux_gpio, KTD2692_LOW); |
---|
255 | 252 | |
---|
256 | | - ktd2692_expresswire_write(led, (KTD2962_MM_MIN_CURR_THRESHOLD_SCALE - 1) |
---|
| 253 | + ktd2692_expresswire_write(led, (KTD2692_MM_MIN_CURR_THRESHOLD_SCALE - 1) |
---|
257 | 254 | | KTD2692_REG_MM_MIN_CURR_THRESHOLD_BASE); |
---|
258 | 255 | ktd2692_expresswire_write(led, KTD2692_FLASH_MODE_CURR_PERCENT(45) |
---|
259 | 256 | | KTD2692_REG_FLASH_CURRENT_BASE); |
---|
.. | .. |
---|
273 | 270 | static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev, |
---|
274 | 271 | struct ktd2692_led_config_data *cfg) |
---|
275 | 272 | { |
---|
276 | | - struct device_node *np = dev->of_node; |
---|
| 273 | + struct device_node *np = dev_of_node(dev); |
---|
277 | 274 | struct device_node *child_node; |
---|
278 | 275 | int ret; |
---|
279 | 276 | |
---|
280 | | - if (!dev->of_node) |
---|
| 277 | + if (!dev_of_node(dev)) |
---|
281 | 278 | return -ENXIO; |
---|
282 | 279 | |
---|
283 | 280 | led->ctrl_gpio = devm_gpiod_get(dev, "ctrl", GPIOD_ASIS); |
---|