diff options
author | Alan Cox <alan@linux.intel.com> | 2011-07-05 15:38:40 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-07-05 08:20:40 -0700 |
commit | 6a7afe3acc4bfa54b1433b7f6b5b467ec05ee15b (patch) | |
tree | 86e369afb6494bf0819e5869c0b1acd64a96051b /drivers/staging/gma500/backlight.c | |
parent | 92367fe1bca91efa7f689127ba45080d4303d609 (diff) | |
download | op-kernel-dev-6a7afe3acc4bfa54b1433b7f6b5b467ec05ee15b.zip op-kernel-dev-6a7afe3acc4bfa54b1433b7f6b5b467ec05ee15b.tar.gz |
gma500: continue abstracting platform specific code
Next obvious target - backlight support
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/gma500/backlight.c')
-rw-r--r-- | drivers/staging/gma500/backlight.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/staging/gma500/backlight.c b/drivers/staging/gma500/backlight.c new file mode 100644 index 0000000..47681c9 --- /dev/null +++ b/drivers/staging/gma500/backlight.c @@ -0,0 +1,46 @@ +/* + * GMA500 Backlight Interface + * + * Copyright (c) 2009-2011, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * + * Authors: Eric Knopp + * + */ + +#include "psb_drv.h" +#include "psb_intel_reg.h" +#include "psb_intel_drv.h" +#include "psb_intel_bios.h" +#include "psb_powermgmt.h" + +int gma_backlight_init(struct drm_device *dev) +{ +#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE + struct drm_psb_private *dev_priv = dev->dev_private; + return dev_priv->ops->backlight_init(dev); +#endif +} + +void gma_backlight_exit(struct drm_device *dev) +{ +#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE + struct drm_psb_private *dev_priv = dev->dev_private; + dev_priv->backlight_device->props.brightness = 0; + backlight_update_status(dev_priv->backlight_device); + if (dev_priv->backlight_device) + backlight_device_unregister(dev_priv->backlight_device); +#endif +} |