Root/target/linux/ubicom32/files/arch/ubicom32/include/asm/ubicom32bl.h

1/*
2 * arch/ubicom32/include/asm/ubicom32bl.h
3 * Ubicom32 architecture backlight driver platform data definitions.
4 *
5 * (C) Copyright 2009, Ubicom, Inc.
6 *
7 * This file is part of the Ubicom32 Linux Kernel Port.
8 *
9 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
10 * it and/or modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation, either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
15 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
16 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with the Ubicom32 Linux Kernel Port. If not,
21 * see <http://www.gnu.org/licenses/>.
22 *
23 * Ubicom32 implementation derived from (with many thanks):
24 * arch/m68knommu
25 * arch/blackfin
26 * arch/parisc
27 */
28#ifndef _ASM_UBICOM32_UBICOM32_BL_H
29#define _ASM_UBICOM32_UBICOM32_BL_H
30
31/*
32 * Different backlight control mechanisms
33 */
34enum ubicom32bl_pwm_types {
35    /*
36     * PWM controlled backlight
37     */
38    UBICOM32BL_TYPE_PWM,
39
40    /*
41     * HRT based PWM backlight
42     */
43    UBICOM32BL_TYPE_PWM_HRT,
44
45    /*
46     * No dimming, just on or off
47     */
48    UBICOM32BL_TYPE_BINARY,
49};
50
51struct ubicom32bl_platform_data {
52    /*
53     * Default intensity of the backlight 0-255
54     */
55    u8_t default_intensity;
56
57    /*
58     * TRUE if the backlight sense is active low. (inverted)
59     * FALSE if the backlight sense is active high.
60     */
61    bool invert;
62
63    /*
64     * Type of the backlight
65     */
66    enum ubicom32bl_pwm_types type;
67
68    /*
69     * GPIO of the backlight if UBICOM32BL_TYPE_PWM_HRT, UBICOM32BL_TYPE_BINARY
70     */
71    unsigned gpio;
72
73    /*
74     * PWM channel and parameters of the backlight if UBICOM32BL_TYPE_PWM
75     * pre_scaler: sets the rate at which the PWM timer is clocked. (clk_core / 2^pre_scaler)
76     * period: sets the period of the timer in timer cycles
77     * The duty cycle will be directly proportional to the brightness setting.
78     */
79    u32_t pwm_channel;
80    u8_t pwm_prescale;
81    u16_t pwm_period;
82};
83
84#endif /* _ASM_UBICOM32_UBICOM32_BL_H */
85

Archive Download this file



interactive