Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/backlight.9
- This file was added.
.\" Copyright (c) 2020 Emmanuel Vadot <manu@freebsd.org> | |||||||||
.\" | |||||||||
.\" Redistribution and use in source and binary forms, with or without | |||||||||
.\" modification, are permitted provided that the following conditions | |||||||||
.\" are met: | |||||||||
.\" 1. Redistributions of source code must retain the above copyright | |||||||||
.\" notice, this list of conditions and the following disclaimer. | |||||||||
.\" 2. Redistributions in binary form must reproduce the above copyright | |||||||||
.\" notice, this list of conditions and the following disclaimer in the | |||||||||
.\" documentation and/or other materials provided with the distribution. | |||||||||
.\" | |||||||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR | |||||||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||||||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, | |||||||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |||||||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |||||||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||||||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |||||||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||||||
.\" | |||||||||
.\" $FreeBSD$ | |||||||||
.\" | |||||||||
.Dd September 30, 2020 | |||||||||
manu: Meh, date isn't good, I'll change it when I commit this anyway :P | |||||||||
.Dt BACKLIGHT 9 | |||||||||
.Os | |||||||||
.Sh NAME | |||||||||
.Nm backlight , | |||||||||
.Nm backlight_register , | |||||||||
.Nm backlight_destroy , | |||||||||
.Nm BACKLIGHT_GET_STATUS , | |||||||||
.Nm BACKLIGHT_SET_STATUS , | |||||||||
.Nd BACKLIGHT methods | |||||||||
.Sh SYNOPSIS | |||||||||
.Cd "device backlight" | |||||||||
.In "backlight_if.h" | |||||||||
.In "sys/sys/backlight.h" | |||||||||
.Ft int | |||||||||
.Fn BACKLIGHT_GET_STATUS "device_t bus" "struct backlight_props *props" | |||||||||
.Ft int | |||||||||
.Fn BACKLIGHT_SET_STATUS "device_t bus" "struct backlight_props *props" | |||||||||
.Ft struct cdev * | |||||||||
.Fn backlight_register "const char *name" "device_t dev" | |||||||||
.Ft int | |||||||||
.Fn backlight_destroy "struct cdev *cdev" | |||||||||
.Sh DESCRIPTION | |||||||||
The backlight driver provides a generic way for handling a panel backlight. | |||||||||
.Pp | |||||||||
Not Done Inline ActionsIt could work for not just panels, but also keyboards (e.g. D21746).. That would work much better if we expose metadata, so userspace could tell which of the backlightN is a display and which is a keyboard. val_packett.cool: It could work for not just panels, but also keyboards (e.g. D21746)..
That would work much… | |||||||||
Done Inline ActionsI'm not sure about the metadata yet but for a case like that there is the name used for the dev alias, so you would have a /dev/backlight/keyboard0 or something like that. manu: I'm not sure about the metadata yet but for a case like that there is the name used for the dev… | |||||||||
Not Done Inline ActionsAliases are only okay for manual ad-hoc configurations. I'd like to eventually add support for this in the UPower daemon, which would have to enumerate the devs like for (file in /dev/backlight): metadata = ioctl(give_me_meta, file) if (metadata & IS_DISPLAY): new Display(file) if (metadata & IS_KEYBOARD): new Keyboard(file) In general anything exposed by the kernel should be enumerable and inspectable, writing userspace software is really frustrating when the kernel isn't being helpful. val_packett.cool: Aliases are only okay for manual ad-hoc configurations. I'd like to eventually add support for… | |||||||||
Drivers for backlight system register themselves globally using the | |||||||||
.Fn backlight_register | |||||||||
function. | |||||||||
They must define two methods, | |||||||||
.Fn BACKLIGHT_GET_STATUS | |||||||||
which is used to query the current brightness level and | |||||||||
.Fn BACKLIGHT_SET_STATUS | |||||||||
which is used to update it. | |||||||||
.Sh INTERFACE | |||||||||
.Bl -tag -width indent | |||||||||
.It Fn BACKLIGHT_GET_STATUS "device_t bus" "struct backlight_props *props" | |||||||||
Driver fills the current brightless level and the optional supported levels. | |||||||||
.It Fn BACKLIGHT_SET_STATUS "device_t bus" "struct backlight_props *props" | |||||||||
Driver update the backlight level based on the brightness member of the props | |||||||||
struct. | |||||||||
.El | |||||||||
.Sh FILES | |||||||||
.Bl -tag -width ".Pa /dev/backlight/*" | |||||||||
.It Pa /dev/backlight/* | |||||||||
Not Done Inline Actions
You can drop .Pa from here. 0mp: You can drop .Pa from here. | |||||||||
.Sh HISTORY | |||||||||
The | |||||||||
.Nm backlight | |||||||||
interface first appear in | |||||||||
.Fx 13.0 . | |||||||||
The | |||||||||
.Nm backlight | |||||||||
driver and manual page was written by | |||||||||
.An Emmanuel Vadot Aq Mt manu@FreeBSD.org . |
Meh, date isn't good, I'll change it when I commit this anyway :P