summaryrefslogtreecommitdiff
path: root/drivers/video/backlight
diff options
context:
space:
mode:
authorKevin Huang <kevinh@nvidia.com>2011-09-13 16:26:40 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:49:42 -0800
commit0dc39eee30a6620559e8d23c0a13cf19a6b4993c (patch)
treea7ef79a2df0437f270f2942609d3cfff44a071af /drivers/video/backlight
parent9c7c743333950e20831436401727900861b642be (diff)
video: backlight: tegra: Add check_fb hook.
Bug 873860 Reviewed-on: http://git-master/r/52135 Reviewed-by: Kevin Huang (Eng-SW) <kevinh@nvidia.com> Tested-by: Kevin Huang (Eng-SW) <kevinh@nvidia.com> Reviewed-by: Robert Morell <rmorell@nvidia.com> (cherry picked from commit 92ec78210ee1526dc2c35b7775674105aa6f729b) Change-Id: If8b1f7af86574af2158609742bc8e18a2585ad36 Reviewed-on: http://git-master/r/61607 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Rc3d4771e2f1c7250e7f8eacedfd7dad1790441b5
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r--drivers/video/backlight/tegra_pwm_bl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/video/backlight/tegra_pwm_bl.c b/drivers/video/backlight/tegra_pwm_bl.c
index f2202d81ca30..4be691c54d3a 100644
--- a/drivers/video/backlight/tegra_pwm_bl.c
+++ b/drivers/video/backlight/tegra_pwm_bl.c
@@ -27,6 +27,7 @@ struct tegra_pwm_bl_data {
int which_dc;
int (*notify)(struct device *, int brightness);
struct tegra_dc_pwm_params params;
+ int (*check_fb)(struct device *dev, struct fb_info *info);
};
static int tegra_pwm_backlight_update_status(struct backlight_device *bl)
@@ -71,9 +72,17 @@ static int tegra_pwm_backlight_get_brightness(struct backlight_device *bl)
return bl->props.brightness;
}
+static int tegra_pwm_backlight_check_fb(struct backlight_device *bl,
+ struct fb_info *info)
+{
+ struct tegra_pwm_bl_data *tbl = dev_get_drvdata(&bl->dev);
+ return !tbl->check_fb || tbl->check_fb(tbl->dev, info);
+}
+
static const struct backlight_ops tegra_pwm_backlight_ops = {
.update_status = tegra_pwm_backlight_update_status,
.get_brightness = tegra_pwm_backlight_get_brightness,
+ .check_fb = tegra_pwm_backlight_check_fb,
};
static int tegra_pwm_backlight_probe(struct platform_device *pdev)
@@ -100,6 +109,7 @@ static int tegra_pwm_backlight_probe(struct platform_device *pdev)
tbl->dev = &pdev->dev;
tbl->which_dc = data->which_dc;
tbl->notify = data->notify;
+ 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;