From 96ce587e8b915afeac38e5f547ba95803c1780f2 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Wed, 18 Feb 2009 02:08:25 +0000 Subject: nouveau: Add in-kernel backlight control support Several nvidia-based systems don't support backlight control via the standard ACPI control mechanisms. Instead, it's necessary for the driver to modify the backlight control registers directly. This patch adds support for determining whether the registers appear to be in use, and if so registers a kernel backlight device to control them. The backlight can then be controlled via existing userspace tools. Signed-off-by: Matthew Garrett Signed-off-by: Ben Skeggs --- shared-core/nouveau_state.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'shared-core/nouveau_state.c') diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index 0b6002ce..c9f43295 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -363,6 +363,11 @@ nouveau_card_init(struct drm_device *dev) ret = nouveau_dma_channel_init(dev); if (ret) return ret; + ret = nouveau_backlight_init(dev); + if (ret) + DRM_ERROR("Error code %d when trying to register backlight\n", + ret); + dev_priv->init_state = NOUVEAU_CARD_INIT_DONE; return 0; } @@ -375,6 +380,8 @@ static void nouveau_card_takedown(struct drm_device *dev) DRM_DEBUG("prev state = %d\n", dev_priv->init_state); if (dev_priv->init_state != NOUVEAU_CARD_INIT_DOWN) { + nouveau_backlight_exit(dev); + nouveau_dma_channel_takedown(dev); engine->fifo.takedown(dev); -- cgit v1.2.3