/* * 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. * * Copyright (C) 2010 John Crispin */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "devices.h" /* gpio */ static struct resource ltq_gpio_resource[] = { { .name = "gpio0", .start = LTQ_GPIO0_BASE_ADDR, .end = LTQ_GPIO0_BASE_ADDR + LTQ_GPIO_SIZE - 1, .flags = IORESOURCE_MEM, }, { .name = "gpio1", .start = LTQ_GPIO1_BASE_ADDR, .end = LTQ_GPIO1_BASE_ADDR + LTQ_GPIO_SIZE - 1, .flags = IORESOURCE_MEM, }, { .name = "gpio2", .start = LTQ_GPIO2_BASE_ADDR, .end = LTQ_GPIO2_BASE_ADDR + LTQ_GPIO_SIZE - 1, .flags = IORESOURCE_MEM, } }; void __init ltq_register_gpio(void) { platform_device_register_simple("ltq_gpio", 0, <q_gpio_resource[0], 1); platform_device_register_simple("ltq_gpio", 1, <q_gpio_resource[1], 1); /* AR9 and VR9 have an extra gpio block */ if (ltq_is_ar9() || ltq_is_vr9()) { platform_device_register_simple("ltq_gpio", 2, <q_gpio_resource[2], 1); } } /* serial to parallel conversion */ static struct resource ltq_stp_resource = { .name = "stp", .start = LTQ_STP_BASE_ADDR, .end = LTQ_STP_BASE_ADDR + LTQ_STP_SIZE - 1, .flags = IORESOURCE_MEM, }; void __init ltq_register_gpio_stp(void) { platform_device_register_simple("ltq_stp", 0, <q_stp_resource, 1); } /* asc ports - amazon se has its own serial mapping */ static struct resource ltq_ase_asc_resources[] = { { .name = "asc0", .start = LTQ_ASC1_BASE_ADDR, .end = LTQ_ASC1_BASE_ADDR + LTQ_ASC_SIZE - 1, .flags = IORESOURCE_MEM, }, IRQ_RES(tx, LTQ_ASC_ASE_TIR), IRQ_RES(rx, LTQ_ASC_ASE_RIR), IRQ_RES(err, LTQ_ASC_ASE_EIR), }; void __init ltq_register_ase_asc(void) { platform_device_register_simple("ltq_asc", 0, ltq_ase_asc_resources, ARRAY_SIZE(ltq_ase_asc_resources)); }