ARM: pxa: magician: Add missing regulator for PWM backlight
authorPetr Cvek <petr.cvek@tul.cz>
Mon, 28 Sep 2015 21:40:57 +0000 (23:40 +0200)
committerRobert Jarzmik <robert.jarzmik@free.fr>
Wed, 14 Oct 2015 21:07:00 +0000 (23:07 +0200)
Add a fake regulator, which is required for the correct initialization
of the PWM backlight driver.

Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
Acked-by: Philipp Zabel <philipp.zabel@gmail.com>
[ added a missing include for fixed regulator ]
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
arch/arm/mach-pxa/magician.c

index c32d760f81003fbf02dfe018f0dba1c63c7ac113..d77f95ddd198cfd4b40142c2d3d4fc48e660812a 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/regulator/driver.h>
+#include <linux/regulator/fixed.h>
 #include <linux/regulator/gpio-regulator.h>
 #include <linux/regulator/machine.h>
 #include <linux/usb/gpio_vbus.h>
@@ -346,6 +347,15 @@ static struct pwm_lookup magician_pwm_lookup[] = {
                   PWM_POLARITY_NORMAL),
 };
 
+ /*
+ * fixed regulator for pwm_backlight
+ */
+
+static struct regulator_consumer_supply pwm_backlight_supply[] = {
+       REGULATOR_SUPPLY("power", "pwm_backlight"),
+};
+
+
 static struct gpio magician_bl_gpios[] = {
        { EGPIO_MAGICIAN_BL_POWER,      GPIOF_DIR_OUT, "Backlight power" },
        { EGPIO_MAGICIAN_BL_POWER2,     GPIOF_DIR_OUT, "Backlight power 2" },
@@ -867,6 +877,9 @@ static void __init magician_init(void)
                        lcd_select ? &samsung_info : &toppoly_info);
        } else
                pr_err("LCD detection: CPLD mapping failed\n");
+
+       regulator_register_always_on(0, "power", pwm_backlight_supply,
+               ARRAY_SIZE(pwm_backlight_supply), 5000000);
 }
 
 MACHINE_START(MAGICIAN, "HTC Magician")