summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/backlight/tegra_pwm_bl.c12
-rw-r--r--drivers/video/tegra/dc/dc.c5
2 files changed, 11 insertions, 6 deletions
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 */