[PATCH 15/16] backlight: remove pandora_bl
From: H. Nikolaus Schaller
Date: Sat Jul 11 2026 - 02:04:18 EST
Retire the platform specific pandora backlight driver since
it can now be replaced by twl_pm and device tree.
Signed-off-by: H. Nikolaus Schaller <hns@xxxxxxxxxxxxx>
---
drivers/video/backlight/Kconfig | 7 --
drivers/video/backlight/Makefile | 1 -
drivers/video/backlight/pandora_bl.c | 159 ---------------------------
3 files changed, 167 deletions(-)
delete mode 100644 drivers/video/backlight/pandora_bl.c
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index 7aa1c4b21111f..a250b3edc152c 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -451,13 +451,6 @@ config BACKLIGHT_MP3309C
To compile this driver as a module, choose M here: the module will
be called mp3309c.
-config BACKLIGHT_PANDORA
- tristate "Backlight driver for Pandora console"
- depends on TWL4030_CORE
- help
- If you have a Pandora console, say Y to enable the
- backlight driver.
-
config BACKLIGHT_SKY81452
tristate "Backlight driver for SKY81452"
depends on MFD_SKY81452
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index 21c8313cfb121..f97ab8ba85807 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -52,7 +52,6 @@ obj-$(CONFIG_BACKLIGHT_MAX8925) += max8925_bl.o
obj-$(CONFIG_BACKLIGHT_MP3309C) += mp3309c.o
obj-$(CONFIG_BACKLIGHT_MT6370) += mt6370-backlight.o
obj-$(CONFIG_BACKLIGHT_OMAP1) += omap1_bl.o
-obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o
obj-$(CONFIG_BACKLIGHT_PWM) += pwm_bl.o
obj-$(CONFIG_BACKLIGHT_QCOM_WLED) += qcom-wled.o
obj-$(CONFIG_BACKLIGHT_RT4831) += rt4831-backlight.o
diff --git a/drivers/video/backlight/pandora_bl.c b/drivers/video/backlight/pandora_bl.c
deleted file mode 100644
index 8a63ded0fa90f..0000000000000
--- a/drivers/video/backlight/pandora_bl.c
+++ /dev/null
@@ -1,159 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Backlight driver for Pandora handheld.
- * Pandora uses TWL4030 PWM0 -> TPS61161 combo for control backlight.
- * Based on pwm_bl.c
- *
- * Copyright 2009,2012 Gražvydas Ignotas <notasas@xxxxxxxxx>
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/backlight.h>
-#include <linux/mfd/twl.h>
-#include <linux/err.h>
-
-#define TWL_PWM0_ON 0x00
-#define TWL_PWM0_OFF 0x01
-
-#define TWL_INTBR_GPBR1 0x0c
-#define TWL_INTBR_PMBR1 0x0d
-
-#define TWL_PMBR1_PWM0_MUXMASK 0x0c
-#define TWL_PMBR1_PWM0 0x04
-#define PWM0_CLK_ENABLE BIT(0)
-#define PWM0_ENABLE BIT(2)
-
-/* range accepted by hardware */
-#define MIN_VALUE 9
-#define MAX_VALUE 63
-#define MAX_USER_VALUE (MAX_VALUE - MIN_VALUE)
-
-struct pandora_private {
- unsigned old_state;
-#define PANDORABL_WAS_OFF 1
-};
-
-static int pandora_backlight_update_status(struct backlight_device *bl)
-{
- int brightness = bl->props.brightness;
- struct pandora_private *priv = bl_get_data(bl);
- u8 r;
-
- if (bl->props.power != BACKLIGHT_POWER_ON)
- brightness = 0;
- if (bl->props.state & BL_CORE_FBBLANK)
- brightness = 0;
- if (bl->props.state & BL_CORE_SUSPENDED)
- brightness = 0;
-
- if ((unsigned int)brightness > MAX_USER_VALUE)
- brightness = MAX_USER_VALUE;
-
- if (brightness == 0) {
- if (priv->old_state == PANDORABL_WAS_OFF)
- goto done;
-
- /* first disable PWM0 output, then clock */
- twl_i2c_read_u8(TWL4030_MODULE_INTBR, &r, TWL_INTBR_GPBR1);
- r &= ~PWM0_ENABLE;
- twl_i2c_write_u8(TWL4030_MODULE_INTBR, r, TWL_INTBR_GPBR1);
- r &= ~PWM0_CLK_ENABLE;
- twl_i2c_write_u8(TWL4030_MODULE_INTBR, r, TWL_INTBR_GPBR1);
-
- goto done;
- }
-
- if (priv->old_state == PANDORABL_WAS_OFF) {
- /*
- * set PWM duty cycle to max. TPS61161 seems to use this
- * to calibrate it's PWM sensitivity when it starts.
- */
- twl_i2c_write_u8(TWL_MODULE_PWM, MAX_VALUE, TWL_PWM0_OFF);
-
- /* first enable clock, then PWM0 out */
- twl_i2c_read_u8(TWL4030_MODULE_INTBR, &r, TWL_INTBR_GPBR1);
- r &= ~PWM0_ENABLE;
- r |= PWM0_CLK_ENABLE;
- twl_i2c_write_u8(TWL4030_MODULE_INTBR, r, TWL_INTBR_GPBR1);
- r |= PWM0_ENABLE;
- twl_i2c_write_u8(TWL4030_MODULE_INTBR, r, TWL_INTBR_GPBR1);
-
- /*
- * TI made it very easy to enable digital control, so easy that
- * it often triggers unintentionally and disabes PWM control,
- * so wait until 1 wire mode detection window ends.
- */
- usleep_range(2000, 10000);
- }
-
- twl_i2c_write_u8(TWL_MODULE_PWM, MIN_VALUE + brightness, TWL_PWM0_OFF);
-
-done:
- if (brightness != 0)
- priv->old_state = 0;
- else
- priv->old_state = PANDORABL_WAS_OFF;
-
- return 0;
-}
-
-static const struct backlight_ops pandora_backlight_ops = {
- .options = BL_CORE_SUSPENDRESUME,
- .update_status = pandora_backlight_update_status,
-};
-
-static int pandora_backlight_probe(struct platform_device *pdev)
-{
- struct backlight_properties props;
- struct backlight_device *bl;
- struct pandora_private *priv;
- u8 r;
-
- priv = devm_kmalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
- if (!priv)
- return -ENOMEM;
-
- memset(&props, 0, sizeof(props));
- props.max_brightness = MAX_USER_VALUE;
- props.type = BACKLIGHT_RAW;
- bl = devm_backlight_device_register(&pdev->dev, pdev->name, &pdev->dev,
- priv, &pandora_backlight_ops, &props);
- if (IS_ERR(bl)) {
- dev_err(&pdev->dev, "failed to register backlight\n");
- return PTR_ERR(bl);
- }
-
- platform_set_drvdata(pdev, bl);
-
- /* 64 cycle period, ON position 0 */
- twl_i2c_write_u8(TWL_MODULE_PWM, 0x80, TWL_PWM0_ON);
-
- priv->old_state = PANDORABL_WAS_OFF;
- bl->props.brightness = MAX_USER_VALUE;
- backlight_update_status(bl);
-
- /* enable PWM function in pin mux */
- twl_i2c_read_u8(TWL4030_MODULE_INTBR, &r, TWL_INTBR_PMBR1);
- r &= ~TWL_PMBR1_PWM0_MUXMASK;
- r |= TWL_PMBR1_PWM0;
- twl_i2c_write_u8(TWL4030_MODULE_INTBR, r, TWL_INTBR_PMBR1);
-
- return 0;
-}
-
-static struct platform_driver pandora_backlight_driver = {
- .driver = {
- .name = "pandora-backlight",
- },
- .probe = pandora_backlight_probe,
-};
-
-module_platform_driver(pandora_backlight_driver);
-
-MODULE_AUTHOR("Gražvydas Ignotas <notasas@xxxxxxxxx>");
-MODULE_DESCRIPTION("Pandora Backlight Driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:pandora-backlight");
--
2.50.1 (Apple Git-155)