57 lines
1.5 KiB
C
57 lines
1.5 KiB
C
|
/* linux/arch/mips/include/mach-loongson/gsc3280/gpio.h
|
||
|
*
|
||
|
* Copyright (c) 2012 Loongson Co., Ltd.
|
||
|
*
|
||
|
* GSC3280 - GPIO lib support <ansonn.wang@gmail.com>
|
||
|
*
|
||
|
* This program is free software; you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License version 2 as
|
||
|
* published by the Free Software Foundation.
|
||
|
*/
|
||
|
|
||
|
#ifndef __ASM_ARCH_GPIO_H
|
||
|
#define __ASM_ARCH_GPIO_H __FILE__
|
||
|
|
||
|
//
|
||
|
|
||
|
#define gpio_get_value __gpio_get_value
|
||
|
#define gpio_set_value __gpio_set_value
|
||
|
#define gpio_cansleep __gpio_cansleep
|
||
|
#define gpio_to_irq __gpio_to_irq
|
||
|
|
||
|
/* Practically, GPIO banks are the configurable gpio banks */
|
||
|
|
||
|
/* GPIO bank sizes */
|
||
|
#define GSC3280_GPIO_A_NR (32)
|
||
|
#define GSC3280_GPIO_B_NR (32)
|
||
|
#define GSC3280_GPIO_C_NR (24)
|
||
|
|
||
|
/* GPIO bank numbers */
|
||
|
|
||
|
#define GSC3280_GPIO_NEXT(__gpio) \
|
||
|
((__gpio##_START) + (__gpio##_NR))
|
||
|
|
||
|
enum gsc3280_gpio_number {
|
||
|
GSC3280_GPIO_A_START = 0,
|
||
|
GSC3280_GPIO_B_START = GSC3280_GPIO_NEXT(GSC3280_GPIO_A),
|
||
|
GSC3280_GPIO_C_START = GSC3280_GPIO_NEXT(GSC3280_GPIO_B),
|
||
|
};
|
||
|
|
||
|
/* GSC3280 GPIO number definitions */
|
||
|
#define GSC3280_GPA(_nr) (GSC3280_GPIO_A_START + (_nr))
|
||
|
#define GSC3280_GPB(_nr) (GSC3280_GPIO_B_START + (_nr))
|
||
|
#define GSC3280_GPC(_nr) (GSC3280_GPIO_C_START + (_nr))
|
||
|
|
||
|
|
||
|
/* the end of the GSC3280 specific gpios */
|
||
|
#define GSC3280_GPIO_END (GSC3280_GPC(GSC3280_GPIO_C_NR) + 1)
|
||
|
|
||
|
#undef ARCH_NR_GPIOS
|
||
|
#define ARCH_NR_GPIOS GSC3280_GPIO_END
|
||
|
|
||
|
#include <asm-generic/gpio.h>
|
||
|
|
||
|
#endif /* __ASM_ARCH_GPIO_H */
|
||
|
|
||
|
|