Lines Matching +full:default +full:- +full:brightness
39 rc = tps65217_set_bits(tps65217_bl->tps, TPS65217_REG_WLEDCTRL1, in tps65217_bl_enable()
43 dev_err(tps65217_bl->dev, in tps65217_bl_enable()
48 tps65217_bl->is_enabled = true; in tps65217_bl_enable()
50 dev_dbg(tps65217_bl->dev, "backlight enabled\n"); in tps65217_bl_enable()
59 rc = tps65217_clear_bits(tps65217_bl->tps, in tps65217_bl_disable()
64 dev_err(tps65217_bl->dev, in tps65217_bl_disable()
69 tps65217_bl->is_enabled = false; in tps65217_bl_disable()
71 dev_dbg(tps65217_bl->dev, "backlight disabled\n"); in tps65217_bl_disable()
80 int brightness = backlight_get_brightness(bl); in tps65217_bl_update_status() local
82 if (brightness > 0) { in tps65217_bl_update_status()
83 rc = tps65217_reg_write(tps65217_bl->tps, in tps65217_bl_update_status()
85 brightness - 1, in tps65217_bl_update_status()
88 dev_err(tps65217_bl->dev, in tps65217_bl_update_status()
89 "failed to set brightness level: %d\n", rc); in tps65217_bl_update_status()
93 dev_dbg(tps65217_bl->dev, "brightness set to %d\n", brightness); in tps65217_bl_update_status()
95 if (!tps65217_bl->is_enabled) in tps65217_bl_update_status()
118 switch (pdata->isel) { in tps65217_bl_hw_init()
121 rc = tps65217_clear_bits(tps65217_bl->tps, in tps65217_bl_hw_init()
126 dev_err(tps65217_bl->dev, in tps65217_bl_hw_init()
132 dev_dbg(tps65217_bl->dev, "selected ISET1 current level\n"); in tps65217_bl_hw_init()
138 rc = tps65217_set_bits(tps65217_bl->tps, TPS65217_REG_WLEDCTRL1, in tps65217_bl_hw_init()
142 dev_err(tps65217_bl->dev, in tps65217_bl_hw_init()
148 dev_dbg(tps65217_bl->dev, "selected ISET2 current level\n"); in tps65217_bl_hw_init()
152 default: in tps65217_bl_hw_init()
153 dev_err(tps65217_bl->dev, in tps65217_bl_hw_init()
154 "invalid value for current level: %d\n", pdata->isel); in tps65217_bl_hw_init()
155 return -EINVAL; in tps65217_bl_hw_init()
159 rc = tps65217_set_bits(tps65217_bl->tps, in tps65217_bl_hw_init()
162 pdata->fdim, in tps65217_bl_hw_init()
165 dev_err(tps65217_bl->dev, in tps65217_bl_hw_init()
178 struct tps65217 *tps = dev_get_drvdata(pdev->dev.parent); in tps65217_bl_parse_dt()
183 node = of_get_child_by_name(tps->dev->of_node, "backlight"); in tps65217_bl_parse_dt()
185 return ERR_PTR(-ENODEV); in tps65217_bl_parse_dt()
187 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); in tps65217_bl_parse_dt()
189 err = ERR_PTR(-ENOMEM); in tps65217_bl_parse_dt()
193 pdata->isel = TPS65217_BL_ISET1; in tps65217_bl_parse_dt()
197 dev_err(&pdev->dev, in tps65217_bl_parse_dt()
199 err = ERR_PTR(-EINVAL); in tps65217_bl_parse_dt()
203 pdata->isel = val; in tps65217_bl_parse_dt()
206 pdata->fdim = TPS65217_BL_FDIM_200HZ; in tps65217_bl_parse_dt()
210 pdata->fdim = TPS65217_BL_FDIM_100HZ; in tps65217_bl_parse_dt()
214 pdata->fdim = TPS65217_BL_FDIM_200HZ; in tps65217_bl_parse_dt()
218 pdata->fdim = TPS65217_BL_FDIM_500HZ; in tps65217_bl_parse_dt()
222 pdata->fdim = TPS65217_BL_FDIM_1000HZ; in tps65217_bl_parse_dt()
225 default: in tps65217_bl_parse_dt()
226 dev_err(&pdev->dev, in tps65217_bl_parse_dt()
228 err = ERR_PTR(-EINVAL); in tps65217_bl_parse_dt()
233 if (!of_property_read_u32(node, "default-brightness", &val)) { in tps65217_bl_parse_dt()
235 dev_err(&pdev->dev, in tps65217_bl_parse_dt()
236 "invalid 'default-brightness' value in the device tree\n"); in tps65217_bl_parse_dt()
237 err = ERR_PTR(-EINVAL); in tps65217_bl_parse_dt()
241 pdata->dft_brightness = val; in tps65217_bl_parse_dt()
264 struct tps65217 *tps = dev_get_drvdata(pdev->dev.parent); in tps65217_bl_probe()
273 tps65217_bl = devm_kzalloc(&pdev->dev, sizeof(*tps65217_bl), in tps65217_bl_probe()
276 return -ENOMEM; in tps65217_bl_probe()
278 tps65217_bl->tps = tps; in tps65217_bl_probe()
279 tps65217_bl->dev = &pdev->dev; in tps65217_bl_probe()
280 tps65217_bl->is_enabled = false; in tps65217_bl_probe()
290 tps65217_bl->bl = devm_backlight_device_register(&pdev->dev, pdev->name, in tps65217_bl_probe()
291 tps65217_bl->dev, tps65217_bl, in tps65217_bl_probe()
293 if (IS_ERR(tps65217_bl->bl)) { in tps65217_bl_probe()
294 dev_err(tps65217_bl->dev, in tps65217_bl_probe()
296 return PTR_ERR(tps65217_bl->bl); in tps65217_bl_probe()
299 tps65217_bl->bl->props.brightness = pdata->dft_brightness; in tps65217_bl_probe()
300 backlight_update_status(tps65217_bl->bl); in tps65217_bl_probe()
308 { .compatible = "ti,tps65217-bl", },
317 .name = "tps65217-bl",