Lines Matching +full:static +full:- +full:enable

1 // SPDX-License-Identifier: GPL-2.0-or-later
16 #include <linux/soc/ti/omap1-io.h>
17 #include <linux/soc/ti/omap1-mux.h>
29 static inline void omapbl_send_intensity(int intensity) in omapbl_send_intensity()
34 static inline void omapbl_send_enable(int enable) in omapbl_send_enable() argument
36 omap_writeb(enable, OMAP_PWL_CLK_ENABLE); in omapbl_send_enable()
39 static void omapbl_enable(struct omap_backlight *bl, bool enable) in omapbl_enable() argument
41 if (enable) { in omapbl_enable()
42 omapbl_send_intensity(bl->current_intensity); in omapbl_enable()
51 static int omapbl_suspend(struct device *dev) in omapbl_suspend()
60 static int omapbl_resume(struct device *dev) in omapbl_resume()
65 omapbl_enable(bl, bl->enabled); in omapbl_resume()
70 static void omapbl_set_enabled(struct backlight_device *dev, bool enable) in omapbl_set_enabled() argument
74 omapbl_enable(bl, enable); in omapbl_set_enabled()
75 bl->enabled = enable; in omapbl_set_enabled()
78 static int omapbl_update_status(struct backlight_device *dev) in omapbl_update_status()
81 bool enable; in omapbl_update_status() local
83 if (bl->current_intensity != dev->props.brightness) { in omapbl_update_status()
84 if (bl->enabled) in omapbl_update_status()
85 omapbl_send_intensity(dev->props.brightness); in omapbl_update_status()
86 bl->current_intensity = dev->props.brightness; in omapbl_update_status()
89 enable = !backlight_is_blank(dev); in omapbl_update_status()
91 if (enable != bl->enabled) in omapbl_update_status()
92 omapbl_set_enabled(dev, enable); in omapbl_update_status()
97 static int omapbl_get_intensity(struct backlight_device *dev) in omapbl_get_intensity()
101 return bl->current_intensity; in omapbl_get_intensity()
104 static const struct backlight_ops omapbl_ops = {
109 static int omapbl_probe(struct platform_device *pdev) in omapbl_probe()
114 struct omap_backlight_config *pdata = dev_get_platdata(&pdev->dev); in omapbl_probe()
117 return -ENXIO; in omapbl_probe()
119 bl = devm_kzalloc(&pdev->dev, sizeof(struct omap_backlight), in omapbl_probe()
122 return -ENOMEM; in omapbl_probe()
127 dev = devm_backlight_device_register(&pdev->dev, "omap-bl", &pdev->dev, in omapbl_probe()
132 bl->enabled = false; in omapbl_probe()
133 bl->current_intensity = 0; in omapbl_probe()
135 bl->pdata = pdata; in omapbl_probe()
136 bl->dev = &pdev->dev; in omapbl_probe()
142 dev->props.brightness = pdata->default_intensity; in omapbl_probe()
145 dev_info(&pdev->dev, "OMAP LCD backlight initialised\n"); in omapbl_probe()
150 static SIMPLE_DEV_PM_OPS(omapbl_pm_ops, omapbl_suspend, omapbl_resume);
152 static struct platform_driver omapbl_driver = {
155 .name = "omap-bl",