summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-whistler-panel.c
diff options
context:
space:
mode:
authorTom Cherry <tcherry@nvidia.com>2010-12-02 15:02:18 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:46:20 -0800
commited6f88fb42f4acacc266c5b90c965e3bcaf10511 (patch)
treefb70b613db3965e9ad4de3f7ee3d8224bbb837ab /arch/arm/mach-tegra/board-whistler-panel.c
parente75cdf310ffd4666f0f17ce1e157d05d18de599d (diff)
Initial whistler backlight support
Original-Change-Id: I6ec5ec582470feb389a988ae6b48f08b04fc6402 Reviewed-on: http://git-master/r/12349 Tested-by: Thomas Cherry <tcherry@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: R830e8b7be3a97869bdba9fe43fd1db0950c52f2a
Diffstat (limited to 'arch/arm/mach-tegra/board-whistler-panel.c')
-rw-r--r--arch/arm/mach-tegra/board-whistler-panel.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-whistler-panel.c b/arch/arm/mach-tegra/board-whistler-panel.c
index 90acf239ecfd..86539ec94b18 100644
--- a/arch/arm/mach-tegra/board-whistler-panel.c
+++ b/arch/arm/mach-tegra/board-whistler-panel.c
@@ -36,6 +36,54 @@
#include "gpio-names.h"
#include "board.h"
+#define whistler_bl_enb TEGRA_GPIO_PW1
+
+static int whistler_backlight_init(struct device *dev) {
+ int ret;
+
+ ret = gpio_request(whistler_bl_enb, "backlight_enb");
+ if (ret < 0)
+ return ret;
+
+ ret = gpio_direction_output(whistler_bl_enb, 1);
+ if (ret < 0)
+ gpio_free(whistler_bl_enb);
+ else
+ tegra_gpio_enable(whistler_bl_enb);
+
+ return ret;
+};
+
+static void whistler_backlight_exit(struct device *dev) {
+ gpio_set_value(whistler_bl_enb, 0);
+ gpio_free(whistler_bl_enb);
+ tegra_gpio_disable(whistler_bl_enb);
+}
+
+static int whistler_backlight_notify(struct device *unused, int brightness)
+{
+ gpio_set_value(whistler_bl_enb, !!brightness);
+ return brightness;
+}
+
+static struct platform_pwm_backlight_data whistler_backlight_data = {
+ .pwm_id = 2,
+ .max_brightness = 255,
+ .dft_brightness = 224,
+ .pwm_period_ns = 5000000,
+ .init = whistler_backlight_init,
+ .exit = whistler_backlight_exit,
+ .notify = whistler_backlight_notify,
+};
+
+static struct platform_device whistler_backlight_device = {
+ .name = "pwm-backlight",
+ .id = -1,
+ .dev = {
+ .platform_data = &whistler_backlight_data,
+ },
+};
+
static struct resource whistler_disp1_resources[] = {
{
.name = "irq",
@@ -155,6 +203,8 @@ static struct platform_device whistler_nvmap_device = {
static struct platform_device *whistler_gfx_devices[] __initdata = {
&whistler_nvmap_device,
&tegra_grhost_device,
+ &tegra_pwfm2_device,
+ &whistler_backlight_device,
};
int __init whistler_panel_init(void)