1 /* 2 * MiniPC panel-specific definitions 3 * 4 * Copyright (C) Xiangfu Liu <xiangfu@sharism.cc> 5 * Copyright (C) 2015 Paul Boddie <paul@boddie.org.uk> 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License as 9 * published by the Free Software Foundation; either version 2 of 10 * the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 20 * MA 02111-1307 USA 21 */ 22 23 #ifndef __MINIPC_CLAA070VC01_H__ 24 #define __MINIPC_CLAA070VC01_H__ 25 26 #define __lcd_set_backlight_level(n) \ 27 do { \ 28 __gpio_as_pwm(); \ 29 REG_PWM_DUT(0) = n; \ 30 REG_PWM_PER(0) = 7; \ 31 REG_PWM_CTR(0) = 0xc1; \ 32 } while (0) 33 34 #define __lcd_close_backlight() \ 35 do { \ 36 __gpio_as_output(GPIO_PWM0);\ 37 __gpio_clear_pin(GPIO_PWM0);\ 38 } while (0) 39 40 #define __lcd_display_pin_init() \ 41 do { \ 42 __gpio_as_output(GPIO_DISP_OFF_N); \ 43 __lcd_set_backlight_level(8); \ 44 } while (0) 45 46 #define __lcd_display_on() \ 47 do { \ 48 __gpio_set_pin(GPIO_DISP_OFF_N); \ 49 __lcd_set_backlight_level(8); \ 50 } while (0) 51 52 #define __lcd_display_off() \ 53 do { \ 54 __lcd_close_backlight(); \ 55 __gpio_clear_pin(GPIO_DISP_OFF_N); \ 56 } while (0) 57 58 #endif /* __MINIPC_CLAA070VC01_H__ */