From: Ben Skeggs Date: Wed, 3 Nov 2010 23:56:12 +0000 (+1000) Subject: drm/nouveau: don't expose backlight control when available through ACPI X-Git-Tag: v2.6.37-rc3~8^2~3^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5bead799d3f8f1500c4b59301b8a2732a92f559f;p=profile%2Fivi%2Fkernel-x86-ivi.git drm/nouveau: don't expose backlight control when available through ACPI Avoid confusing userspace by not publishing backlight controls if ACPI equivalents are available. Reported-by: Aaron Sowry Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c index 406228f..b14c811 100644 --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c @@ -31,6 +31,7 @@ */ #include +#include #include "drmP.h" #include "nouveau_drv.h" @@ -136,6 +137,14 @@ int nouveau_backlight_init(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; +#ifdef CONFIG_ACPI + if (acpi_video_backlight_support()) { + NV_INFO(dev, "ACPI backlight interface available, " + "not registering our own\n"); + return 0; + } +#endif + switch (dev_priv->card_type) { case NV_40: return nouveau_nv40_backlight_init(dev);