Lines Matching defs:tps65217_bl

3  * tps65217_bl.c
19 struct tps65217_bl {
26 static int tps65217_bl_enable(struct tps65217_bl *tps65217_bl)
30 rc = tps65217_set_bits(tps65217_bl->tps, TPS65217_REG_WLEDCTRL1,
34 dev_err(tps65217_bl->dev,
39 tps65217_bl->is_enabled = true;
41 dev_dbg(tps65217_bl->dev, "backlight enabled\n");
46 static int tps65217_bl_disable(struct tps65217_bl *tps65217_bl)
50 rc = tps65217_clear_bits(tps65217_bl->tps,
55 dev_err(tps65217_bl->dev,
60 tps65217_bl->is_enabled = false;
62 dev_dbg(tps65217_bl->dev, "backlight disabled\n");
69 struct tps65217_bl *tps65217_bl = bl_get_data(bl);
74 rc = tps65217_reg_write(tps65217_bl->tps,
79 dev_err(tps65217_bl->dev,
84 dev_dbg(tps65217_bl->dev, "brightness set to %d\n", brightness);
86 if (!tps65217_bl->is_enabled)
87 rc = tps65217_bl_enable(tps65217_bl);
89 rc = tps65217_bl_disable(tps65217_bl);
100 static int tps65217_bl_hw_init(struct tps65217_bl *tps65217_bl,
105 rc = tps65217_bl_disable(tps65217_bl);
112 rc = tps65217_clear_bits(tps65217_bl->tps,
117 dev_err(tps65217_bl->dev,
123 dev_dbg(tps65217_bl->dev, "selected ISET1 current level\n");
129 rc = tps65217_set_bits(tps65217_bl->tps, TPS65217_REG_WLEDCTRL1,
133 dev_err(tps65217_bl->dev,
139 dev_dbg(tps65217_bl->dev, "selected ISET2 current level\n");
144 dev_err(tps65217_bl->dev,
150 rc = tps65217_set_bits(tps65217_bl->tps,
156 dev_err(tps65217_bl->dev,
256 struct tps65217_bl *tps65217_bl;
264 tps65217_bl = devm_kzalloc(&pdev->dev, sizeof(*tps65217_bl),
266 if (tps65217_bl == NULL)
269 tps65217_bl->tps = tps;
270 tps65217_bl->dev = &pdev->dev;
271 tps65217_bl->is_enabled = false;
273 rc = tps65217_bl_hw_init(tps65217_bl, pdata);
281 tps65217_bl->bl = devm_backlight_device_register(&pdev->dev, pdev->name,
282 tps65217_bl->dev, tps65217_bl,
284 if (IS_ERR(tps65217_bl->bl)) {
285 dev_err(tps65217_bl->dev,
287 return PTR_ERR(tps65217_bl->bl);
290 tps65217_bl->bl->props.brightness = pdata->dft_brightness;
291 backlight_update_status(tps65217_bl->bl);
292 platform_set_drvdata(pdev, tps65217_bl);