diff options
author | Kevin Huang <kevinh@nvidia.com> | 2011-09-13 16:26:40 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2012-03-23 17:31:55 -0700 |
commit | f11eb7e1999cbf778581c84e3874a4057d955019 (patch) | |
tree | 591584f2a78f6e64140b5c9c05a42e0626a58466 /drivers/video/backlight | |
parent | 3e62d4feb604a5f91abc2666d34cd821733637dc (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.c | 10 |
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; |