142542f5fSchristos/***************************************************************************
242542f5fSchristos
342542f5fSchristos Copyright 2014 Intel Corporation.  All Rights Reserved.
442542f5fSchristos
542542f5fSchristos Permission is hereby granted, free of charge, to any person obtaining a
642542f5fSchristos copy of this software and associated documentation files (the
742542f5fSchristos "Software"), to deal in the Software without restriction, including
842542f5fSchristos without limitation the rights to use, copy, modify, merge, publish,
942542f5fSchristos distribute, sub license, and/or sell copies of the Software, and to
1042542f5fSchristos permit persons to whom the Software is furnished to do so, subject to
1142542f5fSchristos the following conditions:
1242542f5fSchristos
1342542f5fSchristos The above copyright notice and this permission notice (including the
1442542f5fSchristos next paragraph) shall be included in all copies or substantial portions
1542542f5fSchristos of the Software.
1642542f5fSchristos
1742542f5fSchristos THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1842542f5fSchristos OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1942542f5fSchristos MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
2042542f5fSchristos IN NO EVENT SHALL INTEL, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
2142542f5fSchristos DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2242542f5fSchristos OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
2342542f5fSchristos THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2442542f5fSchristos
2542542f5fSchristos **************************************************************************/
2642542f5fSchristos
2742542f5fSchristos#ifndef BACKLIGHT_H
2842542f5fSchristos#define BACKLIGHT_H
2942542f5fSchristos
3042542f5fSchristosenum backlight_type {
3142542f5fSchristos	BL_NONE = -1,
3242542f5fSchristos	BL_PLATFORM,
3342542f5fSchristos	BL_FIRMWARE,
3442542f5fSchristos	BL_RAW,
3542542f5fSchristos	BL_NAMED,
3642542f5fSchristos};
3742542f5fSchristos
3842542f5fSchristosstruct backlight {
3942542f5fSchristos	char *iface;
4042542f5fSchristos	enum backlight_type type;
4142542f5fSchristos	int max;
4213496ba1Ssnj	int has_power;
4342542f5fSchristos	int pid, fd;
4442542f5fSchristos};
4542542f5fSchristos
46fe8aea9eSmrgint backlight_exists(const char *iface);
4742542f5fSchristos
4842542f5fSchristosvoid backlight_init(struct backlight *backlight);
4942542f5fSchristosint backlight_open(struct backlight *backlight, char *iface);
5042542f5fSchristosint backlight_set(struct backlight *backlight, int level);
5142542f5fSchristosint backlight_get(struct backlight *backlight);
5213496ba1Ssnjint backlight_on(struct backlight *b);
5313496ba1Ssnjint backlight_off(struct backlight *b);
5442542f5fSchristosvoid backlight_disable(struct backlight *backlight);
5542542f5fSchristosvoid backlight_close(struct backlight *backlight);
5642542f5fSchristos
5742542f5fSchristosstruct pci_device;
5842542f5fSchristoschar *backlight_find_for_device(struct pci_device *pci);
5942542f5fSchristos
6042542f5fSchristos#endif /* BACKLIGHT_H */
61