1428d7b3dSmrg/***************************************************************************
2428d7b3dSmrg
3428d7b3dSmrg Copyright 2014 Intel Corporation.  All Rights Reserved.
4428d7b3dSmrg
5428d7b3dSmrg Permission is hereby granted, free of charge, to any person obtaining a
6428d7b3dSmrg copy of this software and associated documentation files (the
7428d7b3dSmrg "Software"), to deal in the Software without restriction, including
8428d7b3dSmrg without limitation the rights to use, copy, modify, merge, publish,
9428d7b3dSmrg distribute, sub license, and/or sell copies of the Software, and to
10428d7b3dSmrg permit persons to whom the Software is furnished to do so, subject to
11428d7b3dSmrg the following conditions:
12428d7b3dSmrg
13428d7b3dSmrg The above copyright notice and this permission notice (including the
14428d7b3dSmrg next paragraph) shall be included in all copies or substantial portions
15428d7b3dSmrg of the Software.
16428d7b3dSmrg
17428d7b3dSmrg THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18428d7b3dSmrg OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19428d7b3dSmrg MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20428d7b3dSmrg IN NO EVENT SHALL INTEL, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
21428d7b3dSmrg DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22428d7b3dSmrg OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
23428d7b3dSmrg THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24428d7b3dSmrg
25428d7b3dSmrg **************************************************************************/
26428d7b3dSmrg
27428d7b3dSmrg#ifndef BACKLIGHT_H
28428d7b3dSmrg#define BACKLIGHT_H
29428d7b3dSmrg
30428d7b3dSmrgenum backlight_type {
31428d7b3dSmrg	BL_NONE = -1,
32428d7b3dSmrg	BL_PLATFORM,
33428d7b3dSmrg	BL_FIRMWARE,
34428d7b3dSmrg	BL_RAW,
35428d7b3dSmrg	BL_NAMED,
36428d7b3dSmrg};
37428d7b3dSmrg
38428d7b3dSmrgstruct backlight {
39428d7b3dSmrg	char *iface;
40428d7b3dSmrg	enum backlight_type type;
41428d7b3dSmrg	int max;
42428d7b3dSmrg	int has_power;
43428d7b3dSmrg	int pid, fd;
44428d7b3dSmrg};
45428d7b3dSmrg
46428d7b3dSmrgenum backlight_type backlight_exists(const char *iface);
47428d7b3dSmrg
48428d7b3dSmrgvoid backlight_init(struct backlight *backlight);
49428d7b3dSmrgint backlight_open(struct backlight *backlight, char *iface);
50428d7b3dSmrgint backlight_set(struct backlight *backlight, int level);
51428d7b3dSmrgint backlight_get(struct backlight *backlight);
52428d7b3dSmrgint backlight_on(struct backlight *b);
53428d7b3dSmrgint backlight_off(struct backlight *b);
54428d7b3dSmrgvoid backlight_disable(struct backlight *backlight);
55428d7b3dSmrgvoid backlight_close(struct backlight *backlight);
56428d7b3dSmrg
57428d7b3dSmrgstruct pci_device;
58428d7b3dSmrgchar *backlight_find_for_device(struct pci_device *pci);
59428d7b3dSmrg
60428d7b3dSmrg#endif /* BACKLIGHT_H */
61