xref: /freebsd/share/man/man9/backlight.9 (revision 18054d0220cfc8df9c9568c437bd6fbb59d53c3c)
1.\" Copyright (c) 2020 Emmanuel Vadot <manu@freebsd.org>
2.\"
3.\" Redistribution and use in source and binary forms, with or without
4.\" modification, are permitted provided that the following conditions
5.\" are met:
6.\" 1. Redistributions of source code must retain the above copyright
7.\"    notice, this list of conditions and the following disclaimer.
8.\" 2. Redistributions in binary form must reproduce the above copyright
9.\"    notice, this list of conditions and the following disclaimer in the
10.\"    documentation and/or other materials provided with the distribution.
11.\"
12.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
14.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
15.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
16.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
18.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22.\"
23.\" $FreeBSD$
24.\"
25.Dd October 2, 2020
26.Dt BACKLIGHT 9
27.Os
28.Sh NAME
29.Nm backlight ,
30.Nm backlight_register ,
31.Nm backlight_destroy ,
32.Nm BACKLIGHT_GET_STATUS ,
33.Nm BACKLIGHT_SET_STATUS
34.Nd BACKLIGHT methods
35.Sh SYNOPSIS
36.Cd "device backlight"
37.In "backlight_if.h"
38.In "sys/sys/backlight.h"
39.Ft int
40.Fn BACKLIGHT_GET_STATUS "device_t bus" "struct backlight_props *props"
41.Ft int
42.Fn BACKLIGHT_SET_STATUS "device_t bus" "struct backlight_props *props"
43.Ft struct cdev *
44.Fn backlight_register "const char *name" "device_t dev"
45.Ft int
46.Fn backlight_destroy "struct cdev *cdev"
47.Sh DESCRIPTION
48The backlight driver provides a generic way for handling a panel backlight.
49.Pp
50Drivers for backlight system register themselves globally using the
51.Fn backlight_register
52function.
53They must define two methods,
54.Fn BACKLIGHT_GET_STATUS
55which is used to query the current brightness level and
56.Fn BACKLIGHT_SET_STATUS
57which is used to update it.
58.Sh INTERFACE
59.Bl -tag -width indent
60.It Fn BACKLIGHT_GET_STATUS "device_t bus" "struct backlight_props *props"
61Driver fills the current brightless level and the optional supported levels.
62.It Fn BACKLIGHT_SET_STATUS "device_t bus" "struct backlight_props *props"
63Driver update the backlight level based on the brightness member of the props
64struct.
65.El
66.Sh FILES
67.Bl -tag -width "/dev/backlight/*"
68.It Pa /dev/backlight/*
69.El
70.Sh HISTORY
71The
72.Nm backlight
73interface first appear in
74.Fx 13.0 .
75The
76.Nm backlight
77driver and manual page was written by
78.An Emmanuel Vadot Aq Mt manu@FreeBSD.org .
79