Lines Matching refs:ld

23 static void lcd_notify_blank(struct lcd_device *ld, struct device *display_dev,  in lcd_notify_blank()  argument
26 guard(mutex)(&ld->ops_lock); in lcd_notify_blank()
28 if (!ld->ops || !ld->ops->set_power) in lcd_notify_blank()
30 if (ld->ops->controls_device && !ld->ops->controls_device(ld, display_dev)) in lcd_notify_blank()
33 ld->ops->set_power(ld, power); in lcd_notify_blank()
38 struct lcd_device *ld; in lcd_notify_blank_all() local
42 list_for_each_entry(ld, &lcd_dev_list, entry) in lcd_notify_blank_all()
43 lcd_notify_blank(ld, display_dev, power); in lcd_notify_blank_all()
47 static void lcd_notify_mode_change(struct lcd_device *ld, struct device *display_dev, in lcd_notify_mode_change() argument
50 guard(mutex)(&ld->ops_lock); in lcd_notify_mode_change()
52 if (!ld->ops || !ld->ops->set_mode) in lcd_notify_mode_change()
54 if (ld->ops->controls_device && !ld->ops->controls_device(ld, display_dev)) in lcd_notify_mode_change()
57 ld->ops->set_mode(ld, width, height); in lcd_notify_mode_change()
63 struct lcd_device *ld; in lcd_notify_mode_change_all() local
67 list_for_each_entry(ld, &lcd_dev_list, entry) in lcd_notify_mode_change_all()
68 lcd_notify_mode_change(ld, display_dev, width, height); in lcd_notify_mode_change_all()
76 struct lcd_device *ld = to_lcd_device(dev); in lcd_power_show() local
78 mutex_lock(&ld->ops_lock); in lcd_power_show()
79 if (ld->ops && ld->ops->get_power) in lcd_power_show()
80 rc = sprintf(buf, "%d\n", ld->ops->get_power(ld)); in lcd_power_show()
83 mutex_unlock(&ld->ops_lock); in lcd_power_show()
92 struct lcd_device *ld = to_lcd_device(dev); in lcd_power_store() local
101 mutex_lock(&ld->ops_lock); in lcd_power_store()
102 if (ld->ops && ld->ops->set_power) { in lcd_power_store()
104 ld->ops->set_power(ld, power); in lcd_power_store()
107 mutex_unlock(&ld->ops_lock); in lcd_power_store()
117 struct lcd_device *ld = to_lcd_device(dev); in contrast_show() local
119 mutex_lock(&ld->ops_lock); in contrast_show()
120 if (ld->ops && ld->ops->get_contrast) in contrast_show()
121 rc = sprintf(buf, "%d\n", ld->ops->get_contrast(ld)); in contrast_show()
122 mutex_unlock(&ld->ops_lock); in contrast_show()
131 struct lcd_device *ld = to_lcd_device(dev); in contrast_store() local
140 mutex_lock(&ld->ops_lock); in contrast_store()
141 if (ld->ops && ld->ops->set_contrast) { in contrast_store()
143 ld->ops->set_contrast(ld, contrast); in contrast_store()
146 mutex_unlock(&ld->ops_lock); in contrast_store()
155 struct lcd_device *ld = to_lcd_device(dev); in max_contrast_show() local
157 return sprintf(buf, "%d\n", ld->props.max_contrast); in max_contrast_show()
163 struct lcd_device *ld = to_lcd_device(dev); in lcd_device_release() local
164 kfree(ld); in lcd_device_release()
234 void lcd_device_unregister(struct lcd_device *ld) in lcd_device_unregister() argument
236 if (!ld) in lcd_device_unregister()
240 list_del(&ld->entry); in lcd_device_unregister()
242 mutex_lock(&ld->ops_lock); in lcd_device_unregister()
243 ld->ops = NULL; in lcd_device_unregister()
244 mutex_unlock(&ld->ops_lock); in lcd_device_unregister()
246 device_unregister(&ld->dev); in lcd_device_unregister()
309 void devm_lcd_device_unregister(struct device *dev, struct lcd_device *ld) in devm_lcd_device_unregister() argument
314 devm_lcd_device_match, ld); in devm_lcd_device_unregister()