| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 | /* * arch/arm/mach-at91/at91sam9260_devices.c * *  Copyright (C) 2006 Atmel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * */#include <asm/mach/arch.h>#include <asm/mach/map.h>#include <linux/dma-mapping.h>#include <linux/gpio.h>#include <linux/platform_device.h>#include <linux/i2c-gpio.h>#include <linux/platform_data/at91_adc.h>#include <mach/cpu.h>#include <mach/at91sam9260.h>#include <mach/at91sam9260_matrix.h>#include <mach/at91_matrix.h>#include <mach/at91sam9_smc.h>#include <mach/at91_adc.h>#include "board.h"#include "generic.h"/* -------------------------------------------------------------------- *  USB Host * -------------------------------------------------------------------- */#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)static u64 ohci_dmamask = DMA_BIT_MASK(32);static struct at91_usbh_data usbh_data;static struct resource usbh_resources[] = {	[0] = {		.start	= AT91SAM9260_UHP_BASE,		.end	= AT91SAM9260_UHP_BASE + SZ_1M - 1,		.flags	= IORESOURCE_MEM,	},	[1] = {		.start	= NR_IRQS_LEGACY + AT91SAM9260_ID_UHP,		.end	= NR_IRQS_LEGACY + AT91SAM9260_ID_UHP,		.flags	= IORESOURCE_IRQ,	},};static struct platform_device at91_usbh_device = {	.name		= "at91_ohci",	.id		= -1,	.dev		= {				.dma_mask		= &ohci_dmamask,				.coherent_dma_mask	= DMA_BIT_MASK(32),				.platform_data		= &usbh_data,	},	.resource	= usbh_resources,	.num_resources	= ARRAY_SIZE(usbh_resources),};void __init at91_add_device_usbh(struct at91_usbh_data *data){	int i;	if (!data)		return;	/* Enable overcurrent notification */	for (i = 0; i < data->ports; i++) {		if (gpio_is_valid(data->overcurrent_pin[i]))			at91_set_gpio_input(data->overcurrent_pin[i], 1);	}	usbh_data = *data;	platform_device_register(&at91_usbh_device);}#elsevoid __init at91_add_device_usbh(struct at91_usbh_data *data) {}#endif/* -------------------------------------------------------------------- *  USB Device (Gadget) * -------------------------------------------------------------------- */#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)static struct at91_udc_data udc_data;static struct resource udc_resources[] = {	[0] = {		.start	= AT91SAM9260_BASE_UDP,		.end	= AT91SAM9260_BASE_UDP + SZ_16K - 1,		.flags	= IORESOURCE_MEM,	},	[1] = {		.start	= NR_IRQS_LEGACY + AT91SAM9260_ID_UDP,		.end	= NR_IRQS_LEGACY + AT91SAM9260_ID_UDP,		.flags	= IORESOURCE_IRQ,	},};static struct platform_device at91_udc_device = {	.name		= "at91_udc",	.id		= -1,	.dev		= {				.platform_data		= &udc_data,	},	.resource	= udc_resources,	.num_resources	= ARRAY_SIZE(udc_resources),};void __init at91_add_device_udc(struct at91_udc_data *data){	if (!data)		return;	if (gpio_is_valid(data->vbus_pin)) {		at91_set_gpio_input(data->vbus_pin, 0);		at91_set_deglitch(data->vbus_pin, 1);	}	/* Pullup pin is handled internally by USB device peripheral */	udc_data = *data;	platform_device_register(&at91_udc_device);}#elsevoid __init at91_add_device_udc(struct at91_udc_data *data) {}#endif/* -------------------------------------------------------------------- *  Ethernet * -------------------------------------------------------------------- */#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)static u64 eth_dmamask = DMA_BIT_MASK(32);static struct macb_platform_data eth_data;
 |