Lines Matching +full:pwm +full:- +full:backlight

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Backlight driver for Pandora handheld.
4 * Pandora uses TWL4030 PWM0 -> TPS61161 combo for control backlight.
15 #include <linux/backlight.h>
33 #define MAX_USER_VALUE (MAX_VALUE - MIN_VALUE)
42 int brightness = bl->props.brightness; in pandora_backlight_update_status()
46 if (bl->props.power != FB_BLANK_UNBLANK) in pandora_backlight_update_status()
48 if (bl->props.state & BL_CORE_FBBLANK) in pandora_backlight_update_status()
50 if (bl->props.state & BL_CORE_SUSPENDED) in pandora_backlight_update_status()
57 if (priv->old_state == PANDORABL_WAS_OFF) in pandora_backlight_update_status()
70 if (priv->old_state == PANDORABL_WAS_OFF) { in pandora_backlight_update_status()
72 * set PWM duty cycle to max. TPS61161 seems to use this in pandora_backlight_update_status()
73 * to calibrate it's PWM sensitivity when it starts. in pandora_backlight_update_status()
87 * it often triggers unintentionally and disabes PWM control, in pandora_backlight_update_status()
97 priv->old_state = 0; in pandora_backlight_update_status()
99 priv->old_state = PANDORABL_WAS_OFF; in pandora_backlight_update_status()
116 priv = devm_kmalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in pandora_backlight_probe()
118 dev_err(&pdev->dev, "failed to allocate driver private data\n"); in pandora_backlight_probe()
119 return -ENOMEM; in pandora_backlight_probe()
125 bl = devm_backlight_device_register(&pdev->dev, pdev->name, &pdev->dev, in pandora_backlight_probe()
128 dev_err(&pdev->dev, "failed to register backlight\n"); in pandora_backlight_probe()
137 priv->old_state = PANDORABL_WAS_OFF; in pandora_backlight_probe()
138 bl->props.brightness = MAX_USER_VALUE; in pandora_backlight_probe()
141 /* enable PWM function in pin mux */ in pandora_backlight_probe()
152 .name = "pandora-backlight",
160 MODULE_DESCRIPTION("Pandora Backlight Driver");
162 MODULE_ALIAS("platform:pandora-backlight");