/*********************************************************************************
|
* 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_ ----- */
|