guowenxue
2020-01-09 f2ad9b27bbaec2adafdbf499eee750830a762d9d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*********************************************************************************
 *      Copyright:  (C) 2017 LingYun IoT Studio <www.iot-yun.com>
 *                  All rights reserved.
 *
 *       Filename:  platdev_led.h
 *    Description:  This is the LED platform device head file
 *                 
 *        Version:  1.0.0(10/27/2011~)
 *         Author:  Guo Wenxue <guowenxue@gmail.com>
 *      ChangeLog:  1, Release initial version on "10/27/2011 11:39:10 AM"
 *                 
 ********************************************************************************/
 
#ifndef  _PLATDEV_LED_H_
#define  _PLATDEV_LED_H_
 
#include <linux/platform_device.h>
#include <linux/version.h>
 
#include <mach/regs-gpio.h>
 
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
#include <mach/hardware.h>
#include <mach/gpio.h>
#include <asm/irq.h>
#else 
#include <asm-arm/irq.h>
#include <asm/arch/gpio.h>
#include <asm/arch/hardware.h>
#endif
 
 
 
#define ENPULLUP                    1
#define DISPULLUP                   0
 
#define HIGHLEVEL                   1
#define LOWLEVEL                    0
 
#define INPUT                       1
#define OUTPUT                      0
 
#define OFF                         0
#define ON                          1
 
#define ENABLE                      1
#define DISABLE                     0
 
/*  LED hardware informtation structure*/
struct s3c_led_info
{
    unsigned char           num;              /* The LED number  */
    unsigned int            gpio;             /* Which GPIO the LED used */  
    unsigned char           active_level;     /* The GPIO pin level(HIGHLEVEL or LOWLEVEL) to turn on or off  */
    unsigned char           status;           /* Current LED status: OFF/ON */
    unsigned char           blink;            /* Blink or not */           
};
 
/*  The LED platform device private data structure */
struct s3c_led_platform_data
{
    struct s3c_led_info    *leds;
    int                     nleds;
};
 
 
#endif   /* ----- #ifndef _PLATDEV_LED_H_  ----- */