Lines Matching +full:bl +full:- +full:name
1 // SPDX-License-Identifier: GPL-2.0-only
4 * Pandora uses TWL4030 PWM0 -> TPS61161 combo for control backlight.
33 #define MAX_USER_VALUE (MAX_VALUE - MIN_VALUE)
40 static int pandora_backlight_update_status(struct backlight_device *bl) in pandora_backlight_update_status() argument
42 int brightness = bl->props.brightness; in pandora_backlight_update_status()
43 struct pandora_private *priv = bl_get_data(bl); 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()
97 priv->old_state = 0; in pandora_backlight_update_status()
99 priv->old_state = PANDORABL_WAS_OFF; in pandora_backlight_update_status()
112 struct backlight_device *bl; in pandora_backlight_probe() local
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()
127 if (IS_ERR(bl)) { in pandora_backlight_probe()
128 dev_err(&pdev->dev, "failed to register backlight\n"); in pandora_backlight_probe()
129 return PTR_ERR(bl); in pandora_backlight_probe()
132 platform_set_drvdata(pdev, bl); 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()
139 backlight_update_status(bl); in pandora_backlight_probe()
152 .name = "pandora-backlight",
162 MODULE_ALIAS("platform:pandora-backlight");