summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2020-01-26 23:05:47 +0000
committerpatrick <patrick@openbsd.org>2020-01-26 23:05:47 +0000
commit543b388eb8a95833d91b43583ae798a55ee5d624 (patch)
treed49ade2c8ed5bfcb363129be7327d21d05bba9af
parentThe enable-gpios property is an optional property, so don't error out if (diff)
downloadwireguard-openbsd-543b388eb8a95833d91b43583ae798a55ee5d624.tar.xz
wireguard-openbsd-543b388eb8a95833d91b43583ae798a55ee5d624.zip
Set the default brightness level upon attach.
-rw-r--r--sys/dev/fdt/pwmbl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/fdt/pwmbl.c b/sys/dev/fdt/pwmbl.c
index db9dde295c1..277a5917258 100644
--- a/sys/dev/fdt/pwmbl.c
+++ b/sys/dev/fdt/pwmbl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pwmbl.c,v 1.2 2020/01/26 23:04:41 patrick Exp $ */
+/* $OpenBSD: pwmbl.c,v 1.3 2020/01/26 23:05:47 patrick Exp $ */
/*
* Copyright (c) 2019 Krystian Lewandowski
* Copyright (c) 2019 Mark Kettenis <kettenis@openbsd.org>
@@ -112,6 +112,8 @@ pwmbl_attach(struct device *parent, struct device *self, void *aux)
sc->sc_def_level = OF_getpropint(faa->fa_node,
"default-brightness-level", sc->sc_max_level);
+ pwmbl_set_brightness(sc, sc->sc_def_level);
+
sc_pwmbl = sc;
ws_get_param = pwmbl_get_param;
ws_set_param = pwmbl_set_param;