Lines Matching refs:ld
48 struct lcd_device *ld = container_of(self, struct lcd_device, fb_notif); in fb_notifier_callback() local
53 guard(mutex)(&ld->ops_lock); in fb_notifier_callback()
55 if (!ld->ops) in fb_notifier_callback()
57 if (ld->ops->controls_device && !ld->ops->controls_device(ld, info->device)) in fb_notifier_callback()
59 if (fb_lcd && fb_lcd != ld) in fb_notifier_callback()
65 if (ld->ops->set_power) in fb_notifier_callback()
66 ld->ops->set_power(ld, power); in fb_notifier_callback()
70 if (ld->ops->set_mode) in fb_notifier_callback()
71 ld->ops->set_mode(ld, videomode->xres, videomode->yres); in fb_notifier_callback()
77 static int lcd_register_fb(struct lcd_device *ld) in lcd_register_fb() argument
79 memset(&ld->fb_notif, 0, sizeof(ld->fb_notif)); in lcd_register_fb()
80 ld->fb_notif.notifier_call = fb_notifier_callback; in lcd_register_fb()
81 return fb_register_client(&ld->fb_notif); in lcd_register_fb()
84 static void lcd_unregister_fb(struct lcd_device *ld) in lcd_unregister_fb() argument
86 fb_unregister_client(&ld->fb_notif); in lcd_unregister_fb()
89 static int lcd_register_fb(struct lcd_device *ld) in lcd_register_fb() argument
94 static inline void lcd_unregister_fb(struct lcd_device *ld) in lcd_unregister_fb() argument
103 struct lcd_device *ld = to_lcd_device(dev); in lcd_power_show() local
105 mutex_lock(&ld->ops_lock); in lcd_power_show()
106 if (ld->ops && ld->ops->get_power) in lcd_power_show()
107 rc = sprintf(buf, "%d\n", ld->ops->get_power(ld)); in lcd_power_show()
110 mutex_unlock(&ld->ops_lock); in lcd_power_show()
119 struct lcd_device *ld = to_lcd_device(dev); in lcd_power_store() local
128 mutex_lock(&ld->ops_lock); in lcd_power_store()
129 if (ld->ops && ld->ops->set_power) { in lcd_power_store()
131 ld->ops->set_power(ld, power); in lcd_power_store()
134 mutex_unlock(&ld->ops_lock); in lcd_power_store()
144 struct lcd_device *ld = to_lcd_device(dev); in contrast_show() local
146 mutex_lock(&ld->ops_lock); in contrast_show()
147 if (ld->ops && ld->ops->get_contrast) in contrast_show()
148 rc = sprintf(buf, "%d\n", ld->ops->get_contrast(ld)); in contrast_show()
149 mutex_unlock(&ld->ops_lock); in contrast_show()
158 struct lcd_device *ld = to_lcd_device(dev); in contrast_store() local
167 mutex_lock(&ld->ops_lock); in contrast_store()
168 if (ld->ops && ld->ops->set_contrast) { in contrast_store()
170 ld->ops->set_contrast(ld, contrast); in contrast_store()
173 mutex_unlock(&ld->ops_lock); in contrast_store()
182 struct lcd_device *ld = to_lcd_device(dev); in max_contrast_show() local
184 return sprintf(buf, "%d\n", ld->props.max_contrast); in max_contrast_show()
190 struct lcd_device *ld = to_lcd_device(dev); in lcd_device_release() local
191 kfree(ld); in lcd_device_release()
264 void lcd_device_unregister(struct lcd_device *ld) in lcd_device_unregister() argument
266 if (!ld) in lcd_device_unregister()
269 mutex_lock(&ld->ops_lock); in lcd_device_unregister()
270 ld->ops = NULL; in lcd_device_unregister()
271 mutex_unlock(&ld->ops_lock); in lcd_device_unregister()
272 lcd_unregister_fb(ld); in lcd_device_unregister()
274 device_unregister(&ld->dev); in lcd_device_unregister()
337 void devm_lcd_device_unregister(struct device *dev, struct lcd_device *ld) in devm_lcd_device_unregister() argument
342 devm_lcd_device_match, ld); in devm_lcd_device_unregister()