Lines Matching +full:max +full:- +full:brightness
1 // SPDX-License-Identifier: GPL-2.0-only
4 * https://www.kinet-ic.com/uploads/web/KTD2801/KTD2801-04b.pdf
8 #include <linux/leds-expresswire.h>
36 u8 brightness = (u8) backlight_get_brightness(bd); in ktd2801_update_status() local
39 expresswire_power_off(&ktd2801->props); in ktd2801_update_status()
40 ktd2801->was_on = false; in ktd2801_update_status()
44 if (!ktd2801->was_on) { in ktd2801_update_status()
45 expresswire_enable(&ktd2801->props); in ktd2801_update_status()
46 ktd2801->was_on = true; in ktd2801_update_status()
49 expresswire_write_u8(&ktd2801->props, brightness); in ktd2801_update_status()
60 struct device *dev = &pdev->dev; in ktd2801_backlight_probe()
63 u32 brightness, max_brightness; in ktd2801_backlight_probe() local
68 return -ENOMEM; in ktd2801_backlight_probe()
69 ktd2801->was_on = true; in ktd2801_backlight_probe()
70 ktd2801->props.timing = ktd2801_timing; in ktd2801_backlight_probe()
72 ret = device_property_read_u32(dev, "max-brightness", &max_brightness); in ktd2801_backlight_probe()
76 dev_err(dev, "illegal max brightness specified\n"); in ktd2801_backlight_probe()
80 ret = device_property_read_u32(dev, "default-brightness", &brightness); in ktd2801_backlight_probe()
82 brightness = KTD2801_DEFAULT_BRIGHTNESS; in ktd2801_backlight_probe()
83 if (brightness > max_brightness) { in ktd2801_backlight_probe()
84 dev_err(dev, "default brightness exceeds max\n"); in ktd2801_backlight_probe()
85 brightness = max_brightness; in ktd2801_backlight_probe()
88 ktd2801->props.ctrl_gpio = devm_gpiod_get(dev, "ctrl", GPIOD_OUT_HIGH); in ktd2801_backlight_probe()
89 if (IS_ERR(ktd2801->props.ctrl_gpio)) in ktd2801_backlight_probe()
90 return dev_err_probe(dev, PTR_ERR(ktd2801->props.ctrl_gpio), in ktd2801_backlight_probe()
92 gpiod_set_consumer_name(ktd2801->props.ctrl_gpio, dev_name(dev)); in ktd2801_backlight_probe()
100 bd->props.max_brightness = max_brightness; in ktd2801_backlight_probe()
101 bd->props.brightness = brightness; in ktd2801_backlight_probe()
103 ktd2801->bd = bd; in ktd2801_backlight_probe()
118 .name = "ktd2801-backlight",