|  | @@ -163,3 +163,69 @@ static struct platform_device at91sam9261_mmc_device = {
 | 
	
		
			
				|  |  |  				.platform_data		= &mmc_data,
 | 
	
		
			
				|  |  |  	},
 | 
	
		
			
				|  |  |  	.resource	= mmc_resources,
 | 
	
		
			
				|  |  | +	.num_resources	= ARRAY_SIZE(mmc_resources),
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	if (!data)
 | 
	
		
			
				|  |  | +		return;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if (data->slot[0].bus_width) {
 | 
	
		
			
				|  |  | +		/* input/irq */
 | 
	
		
			
				|  |  | +		if (gpio_is_valid(data->slot[0].detect_pin)) {
 | 
	
		
			
				|  |  | +			at91_set_gpio_input(data->slot[0].detect_pin, 1);
 | 
	
		
			
				|  |  | +			at91_set_deglitch(data->slot[0].detect_pin, 1);
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		if (gpio_is_valid(data->slot[0].wp_pin))
 | 
	
		
			
				|  |  | +			at91_set_gpio_input(data->slot[0].wp_pin, 1);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		/* CLK */
 | 
	
		
			
				|  |  | +		at91_set_B_periph(AT91_PIN_PA2, 0);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		/* CMD */
 | 
	
		
			
				|  |  | +		at91_set_B_periph(AT91_PIN_PA1, 1);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		/* DAT0, maybe DAT1..DAT3 */
 | 
	
		
			
				|  |  | +		at91_set_B_periph(AT91_PIN_PA0, 1);
 | 
	
		
			
				|  |  | +		if (data->slot[0].bus_width == 4) {
 | 
	
		
			
				|  |  | +			at91_set_B_periph(AT91_PIN_PA4, 1);
 | 
	
		
			
				|  |  | +			at91_set_B_periph(AT91_PIN_PA5, 1);
 | 
	
		
			
				|  |  | +			at91_set_B_periph(AT91_PIN_PA6, 1);
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		mmc_data = *data;
 | 
	
		
			
				|  |  | +		platform_device_register(&at91sam9261_mmc_device);
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +#else
 | 
	
		
			
				|  |  | +void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
 | 
	
		
			
				|  |  | +#endif
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* --------------------------------------------------------------------
 | 
	
		
			
				|  |  | + *  NAND / SmartMedia
 | 
	
		
			
				|  |  | + * -------------------------------------------------------------------- */
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#if defined(CONFIG_MTD_NAND_ATMEL) || defined(CONFIG_MTD_NAND_ATMEL_MODULE)
 | 
	
		
			
				|  |  | +static struct atmel_nand_data nand_data;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define NAND_BASE	AT91_CHIPSELECT_3
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct resource nand_resources[] = {
 | 
	
		
			
				|  |  | +	{
 | 
	
		
			
				|  |  | +		.start	= NAND_BASE,
 | 
	
		
			
				|  |  | +		.end	= NAND_BASE + SZ_256M - 1,
 | 
	
		
			
				|  |  | +		.flags	= IORESOURCE_MEM,
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static struct platform_device atmel_nand_device = {
 | 
	
		
			
				|  |  | +	.name		= "atmel_nand",
 | 
	
		
			
				|  |  | +	.id		= -1,
 | 
	
		
			
				|  |  | +	.dev		= {
 | 
	
		
			
				|  |  | +				.platform_data	= &nand_data,
 | 
	
		
			
				|  |  | +	},
 | 
	
		
			
				|  |  | +	.resource	= nand_resources,
 | 
	
		
			
				|  |  | +	.num_resources	= ARRAY_SIZE(nand_resources),
 | 
	
		
			
				|  |  | +};
 |