Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hpcsh/dev/hd64461 Propagate WSDISPLAYIO_PARAM_BACKL...



details:   https://anonhg.NetBSD.org/src/rev/c23a9e8e5db3
branches:  trunk
changeset: 574455:c23a9e8e5db3
user:      uwe <uwe%NetBSD.org@localhost>
date:      Mon Feb 28 18:04:54 2005 +0000

description:
Propagate WSDISPLAYIO_PARAM_BACKLIGHT to config hooks.

diffstat:

 sys/arch/hpcsh/dev/hd64461/hd64461video.c |  23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diffs (57 lines):

diff -r ee703a635b33 -r c23a9e8e5db3 sys/arch/hpcsh/dev/hd64461/hd64461video.c
--- a/sys/arch/hpcsh/dev/hd64461/hd64461video.c Mon Feb 28 17:47:50 2005 +0000
+++ b/sys/arch/hpcsh/dev/hd64461/hd64461video.c Mon Feb 28 18:04:54 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hd64461video.c,v 1.28 2004/12/12 21:03:06 abs Exp $    */
+/*     $NetBSD: hd64461video.c,v 1.29 2005/02/28 18:04:54 uwe Exp $    */
 
 /*-
  * Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hd64461video.c,v 1.28 2004/12/12 21:03:06 abs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hd64461video.c,v 1.29 2005/02/28 18:04:54 uwe Exp $");
 
 #include "debug_hpcsh.h"
 // #define HD64461VIDEO_HWACCEL
@@ -445,6 +445,11 @@
                dispparam = (struct wsdisplay_param *)data;
                dispparam->min = 0;
                switch (dispparam->param) {
+               case WSDISPLAYIO_PARAM_BACKLIGHT:
+                       id = CONFIG_HOOK_POWER_LCDLIGHT;
+                       idmax = -1;
+                       dispparam->max = ~0;
+                       break;
                case WSDISPLAYIO_PARAM_BRIGHTNESS:
                        id = CONFIG_HOOK_BRIGHTNESS;
                        idmax = CONFIG_HOOK_BRIGHTNESS_MAX;
@@ -456,16 +461,22 @@
                default:
                        return (EINVAL);
                }
-               error = config_hook_call(CONFIG_HOOK_GET, idmax,
-                                        &dispparam->max);
-               if (error)
-                       return (error);
+
+               if (idmax >= 0) {
+                       error = config_hook_call(CONFIG_HOOK_GET, idmax,
+                                                &dispparam->max);
+                       if (error)
+                               return (error);
+               }
                return config_hook_call(CONFIG_HOOK_GET, id,
                                        &dispparam->curval);
 
        case WSDISPLAYIO_SETPARAM:
                dispparam = (struct wsdisplay_param *)data;
                switch (dispparam->param) {
+               case WSDISPLAYIO_PARAM_BACKLIGHT:
+                       id = CONFIG_HOOK_POWER_LCDLIGHT;
+                       break;
                case WSDISPLAYIO_PARAM_BRIGHTNESS:
                        id = CONFIG_HOOK_BRIGHTNESS;
                        break;



Home | Main Index | Thread Index | Old Index