Lines Matching refs:ld
29 struct lcd_device *ld; in fb_notifier_callback() local
44 ld = container_of(self, struct lcd_device, fb_notif); in fb_notifier_callback()
45 if (!ld->ops) in fb_notifier_callback()
48 mutex_lock(&ld->ops_lock); in fb_notifier_callback()
49 if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) { in fb_notifier_callback()
51 if (ld->ops->set_power) in fb_notifier_callback()
52 ld->ops->set_power(ld, *(int *)evdata->data); in fb_notifier_callback()
54 if (ld->ops->early_set_power) in fb_notifier_callback()
55 ld->ops->early_set_power(ld, in fb_notifier_callback()
58 if (ld->ops->r_early_set_power) in fb_notifier_callback()
59 ld->ops->r_early_set_power(ld, in fb_notifier_callback()
62 if (ld->ops->set_mode) in fb_notifier_callback()
63 ld->ops->set_mode(ld, evdata->data); in fb_notifier_callback()
66 mutex_unlock(&ld->ops_lock); in fb_notifier_callback()
70 static int lcd_register_fb(struct lcd_device *ld) in lcd_register_fb() argument
72 memset(&ld->fb_notif, 0, sizeof(ld->fb_notif)); in lcd_register_fb()
73 ld->fb_notif.notifier_call = fb_notifier_callback; in lcd_register_fb()
74 return fb_register_client(&ld->fb_notif); in lcd_register_fb()
77 static void lcd_unregister_fb(struct lcd_device *ld) in lcd_unregister_fb() argument
79 fb_unregister_client(&ld->fb_notif); in lcd_unregister_fb()
82 static int lcd_register_fb(struct lcd_device *ld) in lcd_register_fb() argument
87 static inline void lcd_unregister_fb(struct lcd_device *ld) in lcd_unregister_fb() argument
96 struct lcd_device *ld = to_lcd_device(dev); in lcd_power_show() local
98 mutex_lock(&ld->ops_lock); in lcd_power_show()
99 if (ld->ops && ld->ops->get_power) in lcd_power_show()
100 rc = sprintf(buf, "%d\n", ld->ops->get_power(ld)); in lcd_power_show()
103 mutex_unlock(&ld->ops_lock); in lcd_power_show()
112 struct lcd_device *ld = to_lcd_device(dev); in lcd_power_store() local
121 mutex_lock(&ld->ops_lock); in lcd_power_store()
122 if (ld->ops && ld->ops->set_power) { in lcd_power_store()
124 ld->ops->set_power(ld, power); in lcd_power_store()
127 mutex_unlock(&ld->ops_lock); in lcd_power_store()
137 struct lcd_device *ld = to_lcd_device(dev); in contrast_show() local
139 mutex_lock(&ld->ops_lock); in contrast_show()
140 if (ld->ops && ld->ops->get_contrast) in contrast_show()
141 rc = sprintf(buf, "%d\n", ld->ops->get_contrast(ld)); in contrast_show()
142 mutex_unlock(&ld->ops_lock); in contrast_show()
151 struct lcd_device *ld = to_lcd_device(dev); in contrast_store() local
160 mutex_lock(&ld->ops_lock); in contrast_store()
161 if (ld->ops && ld->ops->set_contrast) { in contrast_store()
163 ld->ops->set_contrast(ld, contrast); in contrast_store()
166 mutex_unlock(&ld->ops_lock); in contrast_store()
175 struct lcd_device *ld = to_lcd_device(dev); in max_contrast_show() local
177 return sprintf(buf, "%d\n", ld->props.max_contrast); in max_contrast_show()
185 struct lcd_device *ld = to_lcd_device(dev); in lcd_device_release() local
186 kfree(ld); in lcd_device_release()
253 void lcd_device_unregister(struct lcd_device *ld) in lcd_device_unregister() argument
255 if (!ld) in lcd_device_unregister()
258 mutex_lock(&ld->ops_lock); in lcd_device_unregister()
259 ld->ops = NULL; in lcd_device_unregister()
260 mutex_unlock(&ld->ops_lock); in lcd_device_unregister()
261 lcd_unregister_fb(ld); in lcd_device_unregister()
263 device_unregister(&ld->dev); in lcd_device_unregister()
326 void devm_lcd_device_unregister(struct device *dev, struct lcd_device *ld) in devm_lcd_device_unregister() argument
331 devm_lcd_device_match, ld); in devm_lcd_device_unregister()