diff options
| author | Roman Yeryomin <roman@advem.lv> | 2013-05-17 20:40:24 +0300 |
|---|---|---|
| committer | Roman Yeryomin <roman@advem.lv> | 2013-05-26 00:48:34 +0300 |
| commit | 7e810011201bf926cba09ec07424893e4cd8ce67 (patch) | |
| tree | 202fc7a42607e366848ca59c7a61a8f9fa2712ca /target/linux/realtek/files/drivers/serial/gpio_8972d.h | |
| parent | a45894b5a0f65585440d98bf71ef3e919c84cb5f (diff) | |
Move to rsdk 3.2.4. Compiles cleanly.
Signed-off-by: Roman Yeryomin <roman@advem.lv>
Diffstat (limited to 'target/linux/realtek/files/drivers/serial/gpio_8972d.h')
| -rw-r--r-- | target/linux/realtek/files/drivers/serial/gpio_8972d.h | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/target/linux/realtek/files/drivers/serial/gpio_8972d.h b/target/linux/realtek/files/drivers/serial/gpio_8972d.h new file mode 100644 index 000000000..92ddfc86b --- /dev/null +++ b/target/linux/realtek/files/drivers/serial/gpio_8972d.h @@ -0,0 +1,93 @@ +/* +* Copyright c Realtek Semiconductor Corporation, 2009 +* All rights reserved. +* +* Program : GPIO Header File +* Abstract : +* Author : +* +*/ + + +#ifndef __GPIO_8972D_H__ +#define __GPIO_8972D_H__ + +/* For 8954C V100 EV Board */ +#if defined (CONFIG_RTK_VOIP_GPIO_8972D_V100) +#include "gpio_8972d_v100.h" +#endif + +#ifdef CONFIG_RTK_VOIP_DRIVERS_PCM89xxD + +/******** GPIO define ********/ + +/* define GPIO port */ +enum GPIO_PORT +{ + GPIO_PORT_A = 0, + GPIO_PORT_B, + GPIO_PORT_C, + GPIO_PORT_D, + GPIO_PORT_E, + GPIO_PORT_F, + GPIO_PORT_G, + GPIO_PORT_H, + GPIO_PORT_MAX, + GPIO_PORT_UNDEF, +}; + +/* define GPIO control pin */ +enum GPIO_CONTROL +{ + GPIO_CONT_GPIO = 0, + GPIO_CONT_PERI = 0x1, +}; + +/* define GPIO direction */ +enum GPIO_DIRECTION +{ + GPIO_DIR_IN = 0, + GPIO_DIR_OUT =1, +}; + +/* define GPIO Interrupt Type */ +enum GPIO_INTERRUPT_TYPE +{ + GPIO_INT_DISABLE = 0, + GPIO_INT_FALLING_EDGE, + GPIO_INT_RISING_EDGE, + GPIO_INT_BOTH_EDGE, +}; + +/*************** Define RTL8954C Family GPIO Register Set ************************/ +#define GPABCDCNR 0xB8003500 + +#define GPABCDDIR 0xB8003508 +#define GPABCDDATA 0xB800350C +#define GPABCDISR 0xB8003510 +#define GPABIMR 0xB8003514 +#define GPCDIMR 0xB8003518 +#define GPEFGHCNR 0xB800351C + +#define GPEFGHDIR 0xB8003524 +#define GPEFGHDATA 0xB8003528 +#define GPEFGHISR 0xB800352C +#define GPEFIMR 0xB8003530 +#define GPGHIMR 0xB8003534 +/**************************************************************************/ +/* Register access macro (REG*()).*/ +#define REG32(reg) (*((volatile uint32 *)(reg))) +#define REG16(reg) (*((volatile uint16 *)(reg))) +#define REG8(reg) (*((volatile uint8 *)(reg))) + +/********************* Function Prototype in gpio.c ***********************/ +int32 _rtl8972D_initGpioPin(uint32 gpioId, enum GPIO_CONTROL dedicate, + enum GPIO_DIRECTION, + enum GPIO_INTERRUPT_TYPE interruptEnable ); +int32 _rtl8972D_getGpioDataBit( uint32 gpioId, uint32* pData ); +int32 _rtl8972D_setGpioDataBit( uint32 gpioId, uint32 data ); + +#endif /* CONFIG_RTK_VOIP_DRIVERS_PCM89xxD */ + +#endif /* __GPIO_8972D_H__ */ + |
