From 0b01ca69e073c3e140f6e819be62665ad6d513ae Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Wed, 19 Oct 2016 18:19:57 +0200 Subject: nwztools/plattools: add adc test Change-Id: Ic3ef964e8b5cc7b8ca3f02f141e9e4436a4d41db --- utils/nwztools/plattools/nwz_fb.h | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 utils/nwztools/plattools/nwz_fb.h (limited to 'utils/nwztools/plattools/nwz_fb.h') diff --git a/utils/nwztools/plattools/nwz_fb.h b/utils/nwztools/plattools/nwz_fb.h new file mode 100644 index 0000000000..c857c5eb8a --- /dev/null +++ b/utils/nwztools/plattools/nwz_fb.h @@ -0,0 +1,56 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2016 Amaury Pouly + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef __NWZ_FB_H__ +#define __NWZ_FB_H__ + +#define NWZ_FB_LCD_DEV "/dev/fb/0" +#define NWZ_FB_TV_DEV "/dev/fb/1" + +#define NWZ_FB_TYPE 'N' + +/* How backlight works: + * + * The brightness interface is a bit strange. There 6 levels: 0 throught 5. + * Level 0 means backlight off. When changing brightness, one sets level to the + * target brightness. The driver is gradually change the brightness to reach the + * target level. The step parameters control how many hardware steps will be done. + * For example, setting step to 1 will brutally change the level in one step. + * Setting step to 2 will change brightness in two steps: one intermediate and + * finally the target one. The more steps, the more gradual the transition. The + * period parameters controls the speed to changes between steps. Using this + * interface, one can achieve fade in/out at various speeds. */ +#define NWZ_FB_BL_MIN_LEVEL 0 +#define NWZ_FB_BL_MAX_LEVEL 5 +#define NWZ_FB_BL_MIN_STEP 1 +#define NWZ_FB_BL_MAX_STEP 100 +#define NWZ_FB_BL_MIN_PERIOD 10 + +struct nwz_fb_brightness +{ + int level; /* brightness level: 0-5 */ + int step; /* number of hardware steps to do when changing: 1-100 */ + int period; /* period in ms between steps when changing: >=10 */ +}; + +#define NWZ_FB_SET_BRIGHTNESS _IOW(NWZ_FB_TYPE, 0x07, struct nwz_fb_brightness) +#define NWZ_FB_GET_BRIGHTNESS _IOR(NWZ_FB_TYPE, 0x08, struct nwz_fb_brightness) + +#endif /* __NWZ_FB_H__ */ -- cgit v1.2.3