|
@@ -26,6 +26,7 @@
|
|
#include <linux/mtd/partitions.h>
|
|
#include <linux/mtd/partitions.h>
|
|
#include <linux/input.h>
|
|
#include <linux/input.h>
|
|
#include <linux/gpio_keys.h>
|
|
#include <linux/gpio_keys.h>
|
|
|
|
+#include <linux/pwm.h>
|
|
#include <linux/pwm_backlight.h>
|
|
#include <linux/pwm_backlight.h>
|
|
#include <linux/smc91x.h>
|
|
#include <linux/smc91x.h>
|
|
#include <linux/i2c/pxa-i2c.h>
|
|
#include <linux/i2c/pxa-i2c.h>
|
|
@@ -248,11 +249,14 @@ static struct platform_device mst_flash_device[2] = {
|
|
};
|
|
};
|
|
|
|
|
|
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
|
|
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
|
|
|
|
+static struct pwm_lookup mainstone_pwm_lookup[] = {
|
|
|
|
+ PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight.0", NULL, 78770,
|
|
|
|
+ PWM_POLARITY_NORMAL),
|
|
|
|
+};
|
|
|
|
+
|
|
static struct platform_pwm_backlight_data mainstone_backlight_data = {
|
|
static struct platform_pwm_backlight_data mainstone_backlight_data = {
|
|
- .pwm_id = 0,
|
|
|
|
.max_brightness = 1023,
|
|
.max_brightness = 1023,
|
|
.dft_brightness = 1023,
|
|
.dft_brightness = 1023,
|
|
- .pwm_period_ns = 78770,
|
|
|
|
.enable_gpio = -1,
|
|
.enable_gpio = -1,
|
|
};
|
|
};
|
|
|
|
|
|
@@ -266,9 +270,16 @@ static struct platform_device mainstone_backlight_device = {
|
|
|
|
|
|
static void __init mainstone_backlight_register(void)
|
|
static void __init mainstone_backlight_register(void)
|
|
{
|
|
{
|
|
- int ret = platform_device_register(&mainstone_backlight_device);
|
|
|
|
- if (ret)
|
|
|
|
|
|
+ int ret;
|
|
|
|
+
|
|
|
|
+ pwm_add_table(mainstone_pwm_lookup, ARRAY_SIZE(mainstone_pwm_lookup));
|
|
|
|
+
|
|
|
|
+ ret = platform_device_register(&mainstone_backlight_device);
|
|
|
|
+ if (ret) {
|
|
printk(KERN_ERR "mainstone: failed to register backlight device: %d\n", ret);
|
|
printk(KERN_ERR "mainstone: failed to register backlight device: %d\n", ret);
|
|
|
|
+ pwm_remove_table(mainstone_pwm_lookup,
|
|
|
|
+ ARRAY_SIZE(mainstone_pwm_lookup));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
#else
|
|
#else
|
|
#define mainstone_backlight_register() do { } while (0)
|
|
#define mainstone_backlight_register() do { } while (0)
|