summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-tegra/board-enterprise-panel.c1
-rw-r--r--arch/arm/mach-tegra/board-whistler-panel.c1
-rw-r--r--arch/arm/mach-tegra/include/mach/dc.h1
-rw-r--r--drivers/video/backlight/tegra_pwm_bl.c12
-rw-r--r--drivers/video/tegra/dc/dc.c5
-rw-r--r--include/linux/tegra_pwm_bl.h1
6 files changed, 11 insertions, 10 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-panel.c b/arch/arm/mach-tegra/board-enterprise-panel.c
index 9561e5ad0406..837635bf0731 100644
--- a/arch/arm/mach-tegra/board-enterprise-panel.c
+++ b/arch/arm/mach-tegra/board-enterprise-panel.c
@@ -190,7 +190,6 @@ static struct platform_tegra_pwm_backlight_data enterprise_disp1_backlight_data
.which_dc = 0,
.which_pwm = TEGRA_PWM_PM1,
.gpio_conf_to_sfio = TEGRA_GPIO_PW1,
- .switch_to_sfio = &tegra_gpio_disable,
.max_brightness = 255,
.dft_brightness = 224,
.notify = enterprise_backlight_notify,
diff --git a/arch/arm/mach-tegra/board-whistler-panel.c b/arch/arm/mach-tegra/board-whistler-panel.c
index df8b2859e81c..430c094f6182 100644
--- a/arch/arm/mach-tegra/board-whistler-panel.c
+++ b/arch/arm/mach-tegra/board-whistler-panel.c
@@ -59,7 +59,6 @@ static struct platform_tegra_pwm_backlight_data whistler_disp1_backlight_data =
.max_brightness = 256,
.dft_brightness = 77,
.gpio_conf_to_sfio = TEGRA_GPIO_PW1,
- .switch_to_sfio = &tegra_gpio_disable,
.period = 0x1F,
.clk_div = 3,
.clk_select = 2,
diff --git a/arch/arm/mach-tegra/include/mach/dc.h b/arch/arm/mach-tegra/include/mach/dc.h
index 6c3154f4b8d2..97f02ce6e95d 100644
--- a/arch/arm/mach-tegra/include/mach/dc.h
+++ b/arch/arm/mach-tegra/include/mach/dc.h
@@ -555,7 +555,6 @@ unsigned tegra_dc_get_out_max_pixclock(const struct tegra_dc *dc);
struct tegra_dc_pwm_params {
int which_pwm;
- void (*switch_to_sfio)(int);
int gpio_conf_to_sfio;
unsigned int period;
unsigned int clk_div;
diff --git a/drivers/video/backlight/tegra_pwm_bl.c b/drivers/video/backlight/tegra_pwm_bl.c
index 4be691c54d3a..a9a429e5c837 100644
--- a/drivers/video/backlight/tegra_pwm_bl.c
+++ b/drivers/video/backlight/tegra_pwm_bl.c
@@ -20,6 +20,7 @@
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/tegra_pwm_bl.h>
+#include <linux/gpio.h>
#include <mach/dc.h>
struct tegra_pwm_bl_data {
@@ -112,11 +113,17 @@ static int tegra_pwm_backlight_probe(struct platform_device *pdev)
tbl->check_fb = data->check_fb;
tbl->params.which_pwm = data->which_pwm;
tbl->params.gpio_conf_to_sfio = data->gpio_conf_to_sfio;
- tbl->params.switch_to_sfio = data->switch_to_sfio;
tbl->params.period = data->period;
tbl->params.clk_div = data->clk_div;
tbl->params.clk_select = data->clk_select;
+ /* If backlight pin is sfio, request for it */
+ if (gpio_is_valid(tbl->params.gpio_conf_to_sfio)) {
+ ret = gpio_request(tbl->params.gpio_conf_to_sfio, "disp_bl");
+ if (ret)
+ dev_err(&pdev->dev, "backlight gpio request failed\n");
+ }
+
memset(&props, 0, sizeof(struct backlight_properties));
props.type = BACKLIGHT_RAW;
props.max_brightness = data->max_brightness;
@@ -129,6 +136,9 @@ static int tegra_pwm_backlight_probe(struct platform_device *pdev)
}
bl->props.brightness = data->dft_brightness;
+
+ if (gpio_is_valid(tbl->params.gpio_conf_to_sfio))
+ gpio_free(tbl->params.gpio_conf_to_sfio);
backlight_update_status(bl);
platform_set_drvdata(pdev, bl);
diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c
index 887beb830a3e..583ea4e64a66 100644
--- a/drivers/video/tegra/dc/dc.c
+++ b/drivers/video/tegra/dc/dc.c
@@ -618,11 +618,6 @@ tegra_dc_config_pwm(struct tegra_dc *dc, struct tegra_dc_pwm_params *cfg)
cmd_state = tegra_dc_readl(dc, DC_CMD_STATE_ACCESS);
tegra_dc_writel(dc, (cmd_state | (1 << 2)), DC_CMD_STATE_ACCESS);
- if (cfg->switch_to_sfio && cfg->gpio_conf_to_sfio)
- cfg->switch_to_sfio(cfg->gpio_conf_to_sfio);
- else
- dev_err(&dc->ndev->dev, "Error: Need gpio_conf_to_sfio\n");
-
switch (cfg->which_pwm) {
case TEGRA_PWM_PM0:
/* Select the LM0 on PM0 */
diff --git a/include/linux/tegra_pwm_bl.h b/include/linux/tegra_pwm_bl.h
index 71a81f2eda88..3ed5e8a3c0a9 100644
--- a/include/linux/tegra_pwm_bl.h
+++ b/include/linux/tegra_pwm_bl.h
@@ -17,7 +17,6 @@
struct platform_tegra_pwm_backlight_data {
int which_dc;
int which_pwm;
- void (*switch_to_sfio)(int);
int gpio_conf_to_sfio;
unsigned int dft_brightness;
unsigned int max_brightness;