mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 06:08:08 +00:00
adds gpiodev support to ifxmips
SVN-Revision: 11405
This commit is contained in:
parent
2fdfd541da
commit
b3331b3d03
@ -52,13 +52,16 @@ CONFIG_DEVPORT=y
|
|||||||
# CONFIG_DM9000 is not set
|
# CONFIG_DM9000 is not set
|
||||||
CONFIG_DMA_NEED_PCI_MAP_STATE=y
|
CONFIG_DMA_NEED_PCI_MAP_STATE=y
|
||||||
CONFIG_DMA_NONCOHERENT=y
|
CONFIG_DMA_NONCOHERENT=y
|
||||||
|
# CONFIG_E1000E_ENABLED is not set
|
||||||
CONFIG_EARLY_PRINTK=y
|
CONFIG_EARLY_PRINTK=y
|
||||||
CONFIG_FS_POSIX_ACL=y
|
CONFIG_FS_POSIX_ACL=y
|
||||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||||
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
|
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
|
||||||
CONFIG_GENERIC_CMOS_UPDATE=y
|
CONFIG_GENERIC_CMOS_UPDATE=y
|
||||||
CONFIG_GENERIC_FIND_NEXT_BIT=y
|
CONFIG_GENERIC_FIND_NEXT_BIT=y
|
||||||
|
CONFIG_GENERIC_GPIO=y
|
||||||
# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
|
# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
|
||||||
|
CONFIG_GPIO_DEVICE=y
|
||||||
CONFIG_HAS_DMA=y
|
CONFIG_HAS_DMA=y
|
||||||
CONFIG_HAS_IOMEM=y
|
CONFIG_HAS_IOMEM=y
|
||||||
CONFIG_HAS_IOPORT=y
|
CONFIG_HAS_IOPORT=y
|
||||||
@ -90,6 +93,7 @@ CONFIG_INITRAMFS_SOURCE=""
|
|||||||
CONFIG_IRQ_CPU=y
|
CONFIG_IRQ_CPU=y
|
||||||
CONFIG_KALLSYMS=y
|
CONFIG_KALLSYMS=y
|
||||||
# CONFIG_LEDS_ALIX is not set
|
# CONFIG_LEDS_ALIX is not set
|
||||||
|
# CONFIG_LEDS_GPIO is not set
|
||||||
# CONFIG_LEMOTE_FULONG is not set
|
# CONFIG_LEMOTE_FULONG is not set
|
||||||
CONFIG_LZO_COMPRESS=m
|
CONFIG_LZO_COMPRESS=m
|
||||||
CONFIG_LZO_DECOMPRESS=m
|
CONFIG_LZO_DECOMPRESS=m
|
||||||
@ -200,6 +204,7 @@ CONFIG_SLABINFO=y
|
|||||||
# CONFIG_SPARSEMEM_STATIC is not set
|
# CONFIG_SPARSEMEM_STATIC is not set
|
||||||
# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
|
# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
|
||||||
CONFIG_SSB_POSSIBLE=y
|
CONFIG_SSB_POSSIBLE=y
|
||||||
|
CONFIG_SWAP_IO_SPACE=y
|
||||||
CONFIG_SYSVIPC_SYSCTL=y
|
CONFIG_SYSVIPC_SYSCTL=y
|
||||||
CONFIG_SYS_HAS_CPU_MIPS32_R1=y
|
CONFIG_SYS_HAS_CPU_MIPS32_R1=y
|
||||||
CONFIG_SYS_HAS_EARLY_PRINTK=y
|
CONFIG_SYS_HAS_EARLY_PRINTK=y
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/ifxmips/ifxmips.h>
|
#include <asm/ifxmips/ifxmips.h>
|
||||||
|
|
||||||
#define MAX_IFXMIPS_DEVS 5
|
#define MAX_IFXMIPS_DEVS 6
|
||||||
|
|
||||||
#define BOARD_DANUBE "Danube"
|
#define BOARD_DANUBE "Danube"
|
||||||
#define BOARD_DANUBE_CHIPID 0x10129083
|
#define BOARD_DANUBE_CHIPID 0x10129083
|
||||||
@ -96,6 +96,26 @@ static struct platform_device ifxmips_mtd[] =
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef CONFIG_GPIO_DEVICE
|
||||||
|
static struct resource ifxmips_gpio_dev_resources[] = {
|
||||||
|
{
|
||||||
|
.name = "gpio",
|
||||||
|
.flags = 0,
|
||||||
|
.start = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12),
|
||||||
|
.end = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device ifxmips_gpio_dev[] = {
|
||||||
|
{
|
||||||
|
.name = "GPIODEV",
|
||||||
|
.id = -1,
|
||||||
|
.num_resources = ARRAY_SIZE(ifxmips_gpio_dev_resources),
|
||||||
|
.resource = ifxmips_gpio_dev_resources,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
get_system_type (void)
|
get_system_type (void)
|
||||||
{
|
{
|
||||||
@ -119,18 +139,18 @@ int __init ifxmips_init_devices(void)
|
|||||||
* Currently we support 3 chips
|
* Currently we support 3 chips
|
||||||
* 1.) Danube
|
* 1.) Danube
|
||||||
* 2.) Twinpass (Danube without dsl phy)
|
* 2.) Twinpass (Danube without dsl phy)
|
||||||
* 3.) KDbg74 (used for debuging)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int dev = 0;
|
int dev = 0;
|
||||||
|
|
||||||
/* the following devices are generic for all targets */
|
/* the following devices are generic for all targets */
|
||||||
|
|
||||||
ifxmips_devs[dev++] = ifxmips_led;
|
ifxmips_devs[dev++] = ifxmips_led;
|
||||||
ifxmips_devs[dev++] = ifxmips_gpio;
|
ifxmips_devs[dev++] = ifxmips_gpio;
|
||||||
ifxmips_devs[dev++] = ifxmips_mii;
|
ifxmips_devs[dev++] = ifxmips_mii;
|
||||||
ifxmips_devs[dev++] = ifxmips_mtd;
|
ifxmips_devs[dev++] = ifxmips_mtd;
|
||||||
|
#ifdef CONFIG_GPIO_DEVICE
|
||||||
|
ifxmips_devs[dev++] = ifxmips_gpio_dev;
|
||||||
|
#endif
|
||||||
return platform_add_devices(ifxmips_devs, dev);
|
return platform_add_devices(ifxmips_devs, dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#define _IFXMIPS_GPIO_H_
|
#define _IFXMIPS_GPIO_H_
|
||||||
|
|
||||||
#include <asm/ifxmips/ifxmips.h>
|
#include <asm/ifxmips/ifxmips.h>
|
||||||
|
#include <asm/ifxmips/ifxmips_gpio.h>
|
||||||
|
|
||||||
static inline int gpio_direction_input(unsigned gpio) {
|
static inline int gpio_direction_input(unsigned gpio) {
|
||||||
ifxmips_port_set_dir_in(0, gpio);
|
ifxmips_port_set_dir_in(0, gpio);
|
||||||
|
Loading…
Reference in New Issue
Block a user