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.
14 #include <linux/backlight.h>
32 #define MAX_USER_VALUE (MAX_VALUE - MIN_VALUE)
41 int brightness = bl->props.brightness; in pandora_backlight_update_status()
45 if (bl->props.power != BACKLIGHT_POWER_ON) in pandora_backlight_update_status()
47 if (bl->props.state & BL_CORE_FBBLANK) in pandora_backlight_update_status()
49 if (bl->props.state & BL_CORE_SUSPENDED) in pandora_backlight_update_status()
56 if (priv->old_state == PANDORABL_WAS_OFF) in pandora_backlight_update_status()
69 if (priv->old_state == PANDORABL_WAS_OFF) { in pandora_backlight_update_status()
71 * set PWM duty cycle to max. TPS61161 seems to use this in pandora_backlight_update_status()
72 * to calibrate it's PWM sensitivity when it starts. in pandora_backlight_update_status()
86 * it often triggers unintentionally and disabes PWM control, in pandora_backlight_update_status()
96 priv->old_state = 0; in pandora_backlight_update_status()
98 priv->old_state = PANDORABL_WAS_OFF; in pandora_backlight_update_status()
115 priv = devm_kmalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in pandora_backlight_probe()
117 return -ENOMEM; in pandora_backlight_probe()
122 bl = devm_backlight_device_register(&pdev->dev, pdev->name, &pdev->dev, in pandora_backlight_probe()
125 dev_err(&pdev->dev, "failed to register backlight\n"); in pandora_backlight_probe()
134 priv->old_state = PANDORABL_WAS_OFF; in pandora_backlight_probe()
135 bl->props.brightness = MAX_USER_VALUE; in pandora_backlight_probe()
138 /* enable PWM function in pin mux */ in pandora_backlight_probe()
149 .name = "pandora-backlight",
157 MODULE_DESCRIPTION("Pandora Backlight Driver");
159 MODULE_ALIAS("platform:pandora-backlight");