summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2019-10-13 10:56:32 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2019-10-13 10:56:32 +0000
commit10609ad5816eeeb8eb701a5d5834894b2492dcb3 (patch)
treef30951088914e1c2c4d599aa85cb108e75d2d2d6 /sys/dev
parentae64efb8865ada9c354eae5a6c73eeace68227b8 (diff)
Move ws_get_param/ws_set_param into wsdisplay code.
ok deraadt@, jsg@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpithinkpad.c5
-rw-r--r--sys/dev/acpi/acpitoshiba.c5
-rw-r--r--sys/dev/acpi/acpivout.c6
-rw-r--r--sys/dev/pci/drm/i915/i915_drv.c3
-rw-r--r--sys/dev/pci/vga_pci.c11
-rw-r--r--sys/dev/wscons/wsdisplay.c10
-rw-r--r--sys/dev/wscons/wsdisplayvar.h6
7 files changed, 21 insertions, 25 deletions
diff --git a/sys/dev/acpi/acpithinkpad.c b/sys/dev/acpi/acpithinkpad.c
index 31c29a3bcae..66826562848 100644
--- a/sys/dev/acpi/acpithinkpad.c
+++ b/sys/dev/acpi/acpithinkpad.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpithinkpad.c,v 1.65 2019/10/12 16:35:36 kettenis Exp $ */
+/* $OpenBSD: acpithinkpad.c,v 1.66 2019/10/13 10:56:31 kettenis Exp $ */
/*
* Copyright (c) 2008 joshua stein <jcs@openbsd.org>
*
@@ -24,6 +24,7 @@
#include <dev/acpi/amltypes.h>
#include <dev/acpi/dsdt.h>
#include <dev/wscons/wsconsio.h>
+#include <dev/wscons/wsdisplayvar.h>
#include <machine/apmvar.h>
@@ -176,8 +177,6 @@ int thinkpad_get_brightness(struct acpithinkpad_softc *);
int thinkpad_set_brightness(void *, int);
int thinkpad_get_param(struct wsdisplay_param *);
int thinkpad_set_param(struct wsdisplay_param *);
-extern int (*ws_get_param)(struct wsdisplay_param *);
-extern int (*ws_set_param)(struct wsdisplay_param *);
void thinkpad_sensor_attach(struct acpithinkpad_softc *sc);
void thinkpad_sensor_refresh(void *);
diff --git a/sys/dev/acpi/acpitoshiba.c b/sys/dev/acpi/acpitoshiba.c
index d070d98bcdc..aeaa9b5b1f0 100644
--- a/sys/dev/acpi/acpitoshiba.c
+++ b/sys/dev/acpi/acpitoshiba.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpitoshiba.c,v 1.11 2018/07/01 19:40:49 mlarkin Exp $ */
+/* $OpenBSD: acpitoshiba.c,v 1.12 2019/10/13 10:56:31 kettenis Exp $ */
/*-
* Copyright (c) 2003 Hiroyuki Aizu <aizu@navi.org>
* All rights reserved.
@@ -35,6 +35,7 @@
#include <machine/apmvar.h>
#include <dev/wscons/wsconsio.h>
+#include <dev/wscons/wsdisplayvar.h>
/*
* Toshiba HCI interface definitions
@@ -107,8 +108,6 @@ int toshiba_fn_key_video_output(struct acpitoshiba_softc *);
/* wconsole hook functions */
int acpitoshiba_get_param(struct wsdisplay_param *);
int acpitoshiba_set_param(struct wsdisplay_param *);
-extern int (*ws_get_param)(struct wsdisplay_param *);
-extern int (*ws_set_param)(struct wsdisplay_param *);
int get_param_brightness(struct wsdisplay_param *);
int set_param_brightness(struct wsdisplay_param *);
diff --git a/sys/dev/acpi/acpivout.c b/sys/dev/acpi/acpivout.c
index 9ec8d5a569a..0157f6bdfb6 100644
--- a/sys/dev/acpi/acpivout.c
+++ b/sys/dev/acpi/acpivout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpivout.c,v 1.12 2016/03/29 17:52:04 kettenis Exp $ */
+/* $OpenBSD: acpivout.c,v 1.13 2019/10/13 10:56:31 kettenis Exp $ */
/*
* Copyright (c) 2009 Paul Irofti <pirofti@openbsd.org>
*
@@ -28,6 +28,7 @@
#include <dev/acpi/dsdt.h>
#include <dev/wscons/wsconsio.h>
+#include <dev/wscons/wsdisplayvar.h>
int acpivout_match(struct device *, void *, void *);
void acpivout_attach(struct device *, struct device *, void *);
@@ -72,9 +73,6 @@ void acpivout_get_bcl(struct acpivout_softc *);
int acpivout_get_param(struct wsdisplay_param *);
int acpivout_set_param(struct wsdisplay_param *);
-extern int (*ws_get_param)(struct wsdisplay_param *);
-extern int (*ws_set_param)(struct wsdisplay_param *);
-
struct cfattach acpivout_ca = {
sizeof(struct acpivout_softc), acpivout_match, acpivout_attach
};
diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c
index 817a8565977..1651132afad 100644
--- a/sys/dev/pci/drm/i915/i915_drv.c
+++ b/sys/dev/pci/drm/i915/i915_drv.c
@@ -3202,9 +3202,6 @@ struct wsdisplay_accessops inteldrm_accessops = {
.burn_screen = inteldrm_burner
};
-extern int (*ws_get_param)(struct wsdisplay_param *);
-extern int (*ws_set_param)(struct wsdisplay_param *);
-
int
inteldrm_wsioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
{
diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c
index af5d4871995..14694cbd00e 100644
--- a/sys/dev/pci/vga_pci.c
+++ b/sys/dev/pci/vga_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vga_pci.c,v 1.87 2015/10/29 07:47:03 kettenis Exp $ */
+/* $OpenBSD: vga_pci.c,v 1.88 2019/10/13 10:56:31 kettenis Exp $ */
/* $NetBSD: vga_pci.c,v 1.3 1998/06/08 06:55:58 thorpej Exp $ */
/*
@@ -103,15 +103,6 @@ void vga_save_state(struct vga_pci_softc *);
void vga_restore_state(struct vga_pci_softc *);
#endif
-/*
- * Function pointers for wsconsctl parameter handling.
- * XXX These should be per-softc, but right now we only attach
- * XXX a single vga@pci instance, so this will do.
- */
-int (*ws_get_param)(struct wsdisplay_param *);
-int (*ws_set_param)(struct wsdisplay_param *);
-
-
struct cfattach vga_pci_ca = {
sizeof(struct vga_pci_softc), vga_pci_match, vga_pci_attach,
NULL, vga_pci_activate
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c
index afd95309f29..a4c9e737be3 100644
--- a/sys/dev/wscons/wsdisplay.c
+++ b/sys/dev/wscons/wsdisplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplay.c,v 1.133 2019/07/01 19:38:40 kn Exp $ */
+/* $OpenBSD: wsdisplay.c,v 1.134 2019/10/13 10:56:31 kettenis Exp $ */
/* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */
/*
@@ -245,6 +245,14 @@ struct consdev wsdisplay_cons = {
wsdisplay_pollc, NULL, NODEV, CN_LOWPRI
};
+/*
+ * Function pointers for wsconsctl parameter handling.
+ * These are used for firmware-provided display brightness control.
+ */
+int (*ws_get_param)(struct wsdisplay_param *);
+int (*ws_set_param)(struct wsdisplay_param *);
+
+
#ifndef WSDISPLAY_DEFAULTSCREENS
#define WSDISPLAY_DEFAULTSCREENS 1
#endif
diff --git a/sys/dev/wscons/wsdisplayvar.h b/sys/dev/wscons/wsdisplayvar.h
index b967299a207..ee36ac26a08 100644
--- a/sys/dev/wscons/wsdisplayvar.h
+++ b/sys/dev/wscons/wsdisplayvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplayvar.h,v 1.33 2019/07/01 19:38:40 kn Exp $ */
+/* $OpenBSD: wsdisplayvar.h,v 1.34 2019/10/13 10:56:31 kettenis Exp $ */
/* $NetBSD: wsdisplayvar.h,v 1.30 2005/02/04 02:10:49 perry Exp $ */
/*
@@ -240,6 +240,10 @@ void wsdisplay_resume(void);
const struct wsscreen_descr *
wsdisplay_screentype_pick(const struct wsscreen_list *, const char *);
+struct wsdisplay_param;
+extern int (*ws_get_param)(struct wsdisplay_param *);
+extern int (*ws_set_param)(struct wsdisplay_param *);
+
/*
* for use by wskbd
*/