Lines Matching +full:enabled +full:- +full:strings

1 // SPDX-License-Identifier: GPL-2.0
3 // Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com/
9 #include <linux/leds-ti-lmu-common.h>
15 #include <linux/mfd/ti-lmu.h>
16 #include <linux/mfd/ti-lmu-register.h>
30 * @led_sources: The LED strings supported in this array
31 * @num_leds: Number of LED strings are supported in this array
49 return ti_lmu_common_set_brightness(&chip->lmu_data, brt_val); in lm36274_brightness_set()
57 for (i = 0; i < chip->num_leds; i++) in lm36274_init()
58 enable_val |= (1 << chip->led_sources[i]); in lm36274_init()
61 dev_err(chip->dev, "No LEDs were enabled\n"); in lm36274_init()
62 return -EINVAL; in lm36274_init()
67 return regmap_write(chip->regmap, LM36274_REG_BL_EN, enable_val); in lm36274_init()
73 struct device *dev = chip->dev; in lm36274_parse_dt()
79 return -EINVAL; in lm36274_parse_dt()
83 init_data->fwnode = child; in lm36274_parse_dt()
84 init_data->devicename = chip->pdev->name; in lm36274_parse_dt()
86 init_data->default_label = ":"; in lm36274_parse_dt()
88 chip->num_leds = fwnode_property_count_u32(child, "led-sources"); in lm36274_parse_dt()
89 if (chip->num_leds <= 0) { in lm36274_parse_dt()
90 ret = -ENODEV; in lm36274_parse_dt()
94 ret = fwnode_property_read_u32_array(child, "led-sources", in lm36274_parse_dt()
95 chip->led_sources, chip->num_leds); in lm36274_parse_dt()
97 dev_err(dev, "led-sources property missing\n"); in lm36274_parse_dt()
109 struct ti_lmu *lmu = dev_get_drvdata(pdev->dev.parent); in lm36274_probe()
114 chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); in lm36274_probe()
116 return -ENOMEM; in lm36274_probe()
118 chip->pdev = pdev; in lm36274_probe()
119 chip->dev = &pdev->dev; in lm36274_probe()
120 chip->regmap = lmu->regmap; in lm36274_probe()
125 dev_err(chip->dev, "Failed to parse DT node\n"); in lm36274_probe()
132 dev_err(chip->dev, "Failed to init the device\n"); in lm36274_probe()
136 chip->lmu_data.regmap = chip->regmap; in lm36274_probe()
137 chip->lmu_data.max_brightness = MAX_BRIGHTNESS_11BIT; in lm36274_probe()
138 chip->lmu_data.msb_brightness_reg = LM36274_REG_BRT_MSB; in lm36274_probe()
139 chip->lmu_data.lsb_brightness_reg = LM36274_REG_BRT_LSB; in lm36274_probe()
141 chip->led_dev.max_brightness = MAX_BRIGHTNESS_11BIT; in lm36274_probe()
142 chip->led_dev.brightness_set_blocking = lm36274_brightness_set; in lm36274_probe()
144 ret = devm_led_classdev_register_ext(chip->dev, &chip->led_dev, in lm36274_probe()
147 dev_err(chip->dev, "Failed to register LED for node %pfw\n", in lm36274_probe()
156 { .compatible = "ti,lm36274-backlight", },
164 .name = "lm36274-leds",