From 37682e548818bcd292d781a90f36da1da582bd2d Mon Sep 17 00:00:00 2001 From: sato Date: Fri, 5 Jan 2001 09:09:48 +0000 Subject: [PATCH] - print debug message for WSDISPLAYIO_GETPARAM/WSDISPLAYIO_SETPARAM when boot verbose mode. for debuging LCD control and/or keyboard cmds. --- sys/arch/hpcmips/dev/bivideo.c | 19 +++++++++++++++-- sys/arch/hpcmips/dev/mq200.c | 37 +++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/sys/arch/hpcmips/dev/bivideo.c b/sys/arch/hpcmips/dev/bivideo.c index f28c7f99726e..50969225f053 100644 --- a/sys/arch/hpcmips/dev/bivideo.c +++ b/sys/arch/hpcmips/dev/bivideo.c @@ -1,4 +1,4 @@ -/* $NetBSD: bivideo.c,v 1.13 2000/12/03 13:43:40 takemura Exp $ */ +/* $NetBSD: bivideo.c,v 1.14 2001/01/05 09:09:48 sato Exp $ */ /*- * Copyright (c) 1999 @@ -37,7 +37,7 @@ static const char _copyright[] __attribute__ ((unused)) = "Copyright (c) 1999 Shin Takemura. All rights reserved."; static const char _rcsid[] __attribute__ ((unused)) = - "$Id: bivideo.c,v 1.13 2000/12/03 13:43:40 takemura Exp $"; + "$Id: bivideo.c,v 1.14 2001/01/05 09:09:48 sato Exp $"; #include #include @@ -47,6 +47,7 @@ static const char _rcsid[] __attribute__ ((unused)) = #include #include #include +#include #include @@ -67,6 +68,8 @@ static const char _rcsid[] __attribute__ ((unused)) = #include #include +#define VPRINTF(arg) do { if (bootverbose) printf arg; } while(0); + /* * global variables */ @@ -376,9 +379,15 @@ bivideo_ioctl(v, cmd, data, flag, p) dispparam->max = 1; dispparam->curval = (sc->sc_powerstate & PWRSTAT_BACKLIGHT) ? 1 : 0; + VPRINTF(("bivideo_ioctl: GETPARAM:BACKLIGHT:%d\n", + dispparam->curval)); break; case WSDISPLAYIO_PARAM_CONTRAST: + VPRINTF(("bivideo_ioctl: GETPARAM:CONTRAST\n")); + return (EINVAL); case WSDISPLAYIO_PARAM_BRIGHTNESS: + VPRINTF(("bivideo_ioctl: GETPARAM:BRIGHTNESS\n")); + return (EINVAL); default: return (EINVAL); } @@ -396,9 +405,15 @@ bivideo_ioctl(v, cmd, data, flag, p) else sc->sc_powerstate |= PWRSTAT_BACKLIGHT; bivideo_update_powerstate(sc, PWRSTAT_BACKLIGHT); + VPRINTF(("bivideo_ioctl: SETPARAM:BACKLIGHT:%d\n", + (sc->sc_powerstate & PWRSTAT_BACKLIGHT)?1:0)); break; case WSDISPLAYIO_PARAM_CONTRAST: + VPRINTF(("bivideo_ioctl: SETPARAM:CONTRAST\n")); + return (EINVAL); case WSDISPLAYIO_PARAM_BRIGHTNESS: + VPRINTF(("mq200_ioctl: SETPARAM:BRIGHTNESS\n")); + return (EINVAL); default: return (EINVAL); } diff --git a/sys/arch/hpcmips/dev/mq200.c b/sys/arch/hpcmips/dev/mq200.c index 253f85f5ec33..bbb70877eb88 100644 --- a/sys/arch/hpcmips/dev/mq200.c +++ b/sys/arch/hpcmips/dev/mq200.c @@ -1,4 +1,4 @@ -/* $NetBSD: mq200.c,v 1.5 2000/12/21 03:27:15 sato Exp $ */ +/* $NetBSD: mq200.c,v 1.6 2001/01/05 09:09:48 sato Exp $ */ /*- * Copyright (c) 2000 Takemura Shin @@ -358,6 +358,7 @@ mq200_ioctl(v, cmd, data, flag, p) struct hpcfb_fbconf *fbconf; struct hpcfb_dspconf *dspconf; struct wsdisplay_cmap *cmap; + struct wsdisplay_param *dispparam; switch (cmd) { case WSDISPLAYIO_GETCMAP: @@ -388,6 +389,40 @@ mq200_ioctl(v, cmd, data, flag, p) */ return (EINVAL); + case WSDISPLAYIO_GETPARAM: + dispparam = (struct wsdisplay_param*)data; + switch (dispparam->param) { + case WSDISPLAYIO_PARAM_BACKLIGHT: + VPRINTF(("mq200_ioctl: GETPARAM:BACKLIGHT\n")); + return (EINVAL); + case WSDISPLAYIO_PARAM_CONTRAST: + VPRINTF(("mq200_ioctl: GETPARAM:CONTRAST\n")); + return (EINVAL); + case WSDISPLAYIO_PARAM_BRIGHTNESS: + VPRINTF(("mq200_ioctl: GETPARAM:BRIGHTNESS\n")); + return (EINVAL); + default: + return (EINVAL); + } + return (0); + + case WSDISPLAYIO_SETPARAM: + dispparam = (struct wsdisplay_param*)data; + switch (dispparam->param) { + case WSDISPLAYIO_PARAM_BACKLIGHT: + VPRINTF(("mq200_ioctl: GETPARAM:BACKLIGHT\n")); + return (EINVAL); + case WSDISPLAYIO_PARAM_CONTRAST: + VPRINTF(("mq200_ioctl: GETPARAM:CONTRAST\n")); + return (EINVAL); + case WSDISPLAYIO_PARAM_BRIGHTNESS: + VPRINTF(("mq200_ioctl: GETPARAM:BRIGHTNESS\n")); + return (EINVAL); + default: + return (EINVAL); + } + return (0); + case HPCFBIO_GCONF: fbconf = (struct hpcfb_fbconf *)data; if (fbconf->hf_conf_index != 0 &&