示例#1
0
文件: mach-all5002.c 项目: 7LK/McWRT
static void __init all5002_init(void)
{
	rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
	rt305x_register_spi(all5002_spi_slave_info,
			    ARRAY_SIZE(all5002_spi_slave_info));
	rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_NONE;
	rt305x_register_ethernet();
	rt305x_register_wifi();
	rt305x_register_wdt();
	rt305x_register_usb();
}
示例#2
0
static void __init rt_g32b_init(void)
{
	rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
	rt305x_register_spi(rt_g32b_spi_slave_info,
			    ARRAY_SIZE(rt_g32b_spi_slave_info));

	rt305x_register_ethernet();
	ramips_register_gpio_buttons(-1, RT_G32B_BUTTONS_POLL_INTERVAL,
				     ARRAY_SIZE(rt_g32b_gpio_buttons),
				     rt_g32b_gpio_buttons);
	rt305x_register_wifi();
	rt305x_register_wdt();
}
示例#3
0
static void __init dir615h1_init(void)
{
	rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
	rt305x_register_spi(dir615h1_spi_slave_info,
			    ARRAY_SIZE(dir615h1_spi_slave_info));
	rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
	rt305x_register_ethernet();
	ramips_register_gpio_leds(-1, ARRAY_SIZE(dir_615_h1_leds_gpio),
				  dir_615_h1_leds_gpio);
	ramips_register_gpio_buttons(-1, DIR_615_H1_KEYS_POLL_INTERVAL,
				     ARRAY_SIZE(dir_615_h1_gpio_buttons),
				     dir_615_h1_gpio_buttons);
	rt305x_register_wifi();
	rt305x_register_wdt();
}
示例#4
0
static void __init all0256n_init(void)
{
	rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
	rt305x_register_spi(all0256n_spi_slave_info,
			    ARRAY_SIZE(all0256n_spi_slave_info));
	rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_NONE;
	rt305x_register_ethernet();
	ramips_register_gpio_leds(-1, ARRAY_SIZE(all0256n_leds_gpio),
				  all0256n_leds_gpio);
	ramips_register_gpio_buttons(-1, ALL0256N_KEYS_POLL_INTERVAL,
				     ARRAY_SIZE(all0256n_gpio_buttons),
				     all0256n_gpio_buttons);
	rt305x_register_wifi();
	rt305x_register_wdt();
}
示例#5
0
static void __init wl_330n3g_init(void)
{
	rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
	rt305x_register_spi(wl_330n3g_spi_slave_info,
			    ARRAY_SIZE(wl_330n3g_spi_slave_info));
	rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_WLLLL;
	rt305x_register_ethernet();
	ramips_register_gpio_leds(-1, ARRAY_SIZE(wl_330n3g_leds_gpio),
				  wl_330n3g_leds_gpio);
	ramips_register_gpio_buttons(-1, WL_330N3G_KEYS_POLL_INTERVAL,
				     ARRAY_SIZE(wl_330n3g_gpio_buttons),
				     wl_330n3g_gpio_buttons);
	rt305x_register_wifi();
	rt305x_register_usb();
	rt305x_register_wdt();
}
示例#6
0
static void __init nw718_init(void)
{
	rt305x_gpio_init(RT305X_GPIO_MODE_I2C |
			 RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);

	rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
	rt305x_register_ethernet();
	ramips_register_gpio_leds(-1, ARRAY_SIZE(nw718_leds_gpio),
				  nw718_leds_gpio);
	ramips_register_gpio_buttons(-1, NW718_KEYS_POLL_INTERVAL,
				     ARRAY_SIZE(nw718_gpio_buttons),
				     nw718_gpio_buttons);
	rt305x_register_wifi();
	rt305x_register_wdt();
	rt305x_register_spi(nw718_spi_info, ARRAY_SIZE(nw718_spi_info));
	rt305x_register_usb();
}
示例#7
0
static int __init carambola_register_gpiodev(void)
{
       static struct resource res = {
               .start = 0xFFFFFFFF,
       };
       struct platform_device *pdev;

       pdev = platform_device_register_simple("GPIODEV", 0, &res, 1);
       if (!pdev) {
               printk(KERN_ERR "carambole: GPIODEV init failed\n");
               return -ENODEV;
       }

       return 0;
}

static struct i2c_gpio_platform_data carambola_i2c_gpio_data = {
	.sda_pin        = 1,
	.scl_pin        = 2,
};

static struct platform_device carambola_i2c_gpio = {
	.name           = "i2c-gpio",
	.id             = 0,
	.dev     = {
		.platform_data  = &carambola_i2c_gpio_data,
	},
};

static struct platform_device *carambola_devices[] __initdata = {
        &carambola_i2c_gpio
};

static struct spi_board_info carambola_spi_info[] = {
	{
		.bus_num	= 0,
		.chip_select	= 0,
		.max_speed_hz	= 0,
		.modalias	= "spidev",
	}
};

static void __init carambola_init(void)
{
	//what you add here means rest of pins will be reserved for other purposes instead of gpios

	//rt305x_gpio_init((RT305X_GPIO_MODE_GPIO_UARTF << RT305X_GPIO_MODE_UART0_SHIFT) |		//use uartf gpios, i2c and spi
	//			RT305X_GPIO_MODE_I2C | RT305X_GPIO_MODE_SPI);

	rt305x_gpio_init((RT305X_GPIO_MODE_GPIO_UARTF << RT305X_GPIO_MODE_UART0_SHIFT) |
				RT305X_GPIO_MODE_I2C);


	carambola_register_gpiodev();
	platform_add_devices(carambola_devices, ARRAY_SIZE(carambola_devices));
	rt305x_register_flash(0, &carambola_flash_data);
	rt305x_register_spi(spiflash_spi_slave_info, ARRAY_SIZE(spiflash_spi_slave_info));

	rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_WLLLL;
	rt305x_register_ethernet();
	rt305x_register_wifi();
	rt305x_register_wdt();
	//rt305x_register_spi(carambola_spi_info, ARRAY_SIZE(carambola_spi_info));


	rt305x_register_usb();
}