Lines Matching refs:bl
34 static inline int lm3533_bl_get_ctrlbank_id(struct lm3533_bl *bl) in lm3533_bl_get_ctrlbank_id() argument
36 return bl->id; in lm3533_bl_get_ctrlbank_id()
41 struct lm3533_bl *bl = bl_get_data(bd); in lm3533_bl_update_status() local
43 return lm3533_ctrlbank_set_brightness(&bl->cb, backlight_get_brightness(bd)); in lm3533_bl_update_status()
48 struct lm3533_bl *bl = bl_get_data(bd); in lm3533_bl_get_brightness() local
52 ret = lm3533_ctrlbank_get_brightness(&bl->cb, &val); in lm3533_bl_get_brightness()
67 struct lm3533_bl *bl = dev_get_drvdata(dev); in show_id() local
69 return scnprintf(buf, PAGE_SIZE, "%d\n", bl->id); in show_id()
75 struct lm3533_bl *bl = dev_get_drvdata(dev); in show_als_channel() local
76 unsigned channel = lm3533_bl_get_ctrlbank_id(bl); in show_als_channel()
84 struct lm3533_bl *bl = dev_get_drvdata(dev); in show_als_en() local
85 int ctrlbank = lm3533_bl_get_ctrlbank_id(bl); in show_als_en()
91 ret = lm3533_read(bl->lm3533, LM3533_REG_CTRLBANK_AB_BCONF, &val); in show_als_en()
105 struct lm3533_bl *bl = dev_get_drvdata(dev); in store_als_en() local
106 int ctrlbank = lm3533_bl_get_ctrlbank_id(bl); in store_als_en()
122 ret = lm3533_update(bl->lm3533, LM3533_REG_CTRLBANK_AB_BCONF, val, in store_als_en()
133 struct lm3533_bl *bl = dev_get_drvdata(dev); in show_linear() local
139 ret = lm3533_read(bl->lm3533, LM3533_REG_CTRLBANK_AB_BCONF, &val); in show_linear()
143 mask = 1 << (2 * lm3533_bl_get_ctrlbank_id(bl) + 1); in show_linear()
157 struct lm3533_bl *bl = dev_get_drvdata(dev); in store_linear() local
166 mask = 1 << (2 * lm3533_bl_get_ctrlbank_id(bl) + 1); in store_linear()
173 ret = lm3533_update(bl->lm3533, LM3533_REG_CTRLBANK_AB_BCONF, val, in store_linear()
185 struct lm3533_bl *bl = dev_get_drvdata(dev); in show_pwm() local
189 ret = lm3533_ctrlbank_get_pwm(&bl->cb, &val); in show_pwm()
200 struct lm3533_bl *bl = dev_get_drvdata(dev); in store_pwm() local
207 ret = lm3533_ctrlbank_set_pwm(&bl->cb, val); in store_pwm()
233 struct lm3533_bl *bl = dev_get_drvdata(dev); in lm3533_bl_attr_is_visible() local
238 if (!bl->lm3533->have_als) in lm3533_bl_attr_is_visible()
250 static int lm3533_bl_setup(struct lm3533_bl *bl, in lm3533_bl_setup() argument
255 ret = lm3533_ctrlbank_set_max_current(&bl->cb, pdata->max_current); in lm3533_bl_setup()
259 return lm3533_ctrlbank_set_pwm(&bl->cb, pdata->pwm); in lm3533_bl_setup()
266 struct lm3533_bl *bl; in lm3533_bl_probe() local
288 bl = devm_kzalloc(&pdev->dev, sizeof(*bl), GFP_KERNEL); in lm3533_bl_probe()
289 if (!bl) in lm3533_bl_probe()
292 bl->lm3533 = lm3533; in lm3533_bl_probe()
293 bl->id = pdev->id; in lm3533_bl_probe()
295 bl->cb.lm3533 = lm3533; in lm3533_bl_probe()
296 bl->cb.id = lm3533_bl_get_ctrlbank_id(bl); in lm3533_bl_probe()
297 bl->cb.dev = NULL; /* until registered */ in lm3533_bl_probe()
304 pdev->dev.parent, bl, &lm3533_bl_ops, in lm3533_bl_probe()
311 bl->bd = bd; in lm3533_bl_probe()
312 bl->cb.dev = &bl->bd->dev; in lm3533_bl_probe()
314 platform_set_drvdata(pdev, bl); in lm3533_bl_probe()
324 ret = lm3533_bl_setup(bl, pdata); in lm3533_bl_probe()
328 ret = lm3533_ctrlbank_enable(&bl->cb); in lm3533_bl_probe()
342 struct lm3533_bl *bl = platform_get_drvdata(pdev); in lm3533_bl_remove() local
343 struct backlight_device *bd = bl->bd; in lm3533_bl_remove()
350 lm3533_ctrlbank_disable(&bl->cb); in lm3533_bl_remove()
357 struct lm3533_bl *bl = dev_get_drvdata(dev); in lm3533_bl_suspend() local
361 return lm3533_ctrlbank_disable(&bl->cb); in lm3533_bl_suspend()
366 struct lm3533_bl *bl = dev_get_drvdata(dev); in lm3533_bl_resume() local
370 return lm3533_ctrlbank_enable(&bl->cb); in lm3533_bl_resume()
378 struct lm3533_bl *bl = platform_get_drvdata(pdev); in lm3533_bl_shutdown() local
382 lm3533_ctrlbank_disable(&bl->cb); in lm3533_bl_shutdown()