All pastes #482866 Raw Edit

ARM Assembler

public c v1 · immutable
·published 2007-05-11 13:25 UTC
rendered paste body
/* * HTC CPLD on the magician * * 7 32-bit aligned 8-bit registers (bus_shift 2) * 3x 8-bit output, 1x 4-bit irq, 3x 8-bit input * */static struct htc_cpld_platform_data magician_cpld_platform_data = {	.bus_shift	= 2,	.output_gpio_registers = { /* 3 8-bit outputs */		.start	= 0,		.bits	= 8,		.num	= 3,	},	.irq_base	= MAGICIAN_CPLD_IRQ_BASE,	.irq_registers = { /* 1 4-bit irq register */		.start	= 3,		.bits	= 4,		.num	= 1,	},	.input_gpio_registers = { /* 3 8-bit inputs, only sparsely used */		.start	= 4,		.bits	= 8,		.num	= 3,	},};static struct resource magician_cpld_resources[] = {	[0] = {		.start	= PXA_CS3_PHYS,		.end	= PXA_CS3_PHYS + 0x1000,		.flags	= IORESOURCE_MEM,	},	[1] = {		.start	= gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),		.end	= gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),		.flags	= IORESOURCE_IRQ,	},};struct platform_device magician_cpld = {	.name		= "magician-cpld",	.dev = {		.platform_data = &magician_cpld_platform_data,	},	.id		= 0,	.num_resources	= ARRAY_SIZE(magician_cpld_resources),	.resource	= magician_cpld_resources,};EXPORT_SYMBOL(magician_cpld);/* * HTC CPLD on the apache * * 3 16-bit aligned 16-bit registers (bus_shift 1) * 1x 8-bit input + 8-bit irq, 2x 16-bit output * */static struct htc_cpld_platform_data magician_cpld_platform_data = {	.bus_shift	= 1,	.input_gpio_registers = { /* 1 8-bit input */		.start = 0,		.bits = 8,		.num = 1,	},	.irq_base	= HTCAPACHE_CPLD_IRQ_BASE,	.irq_registers = { /* 1 8-bit irq register */		.start	= 0,		.shift	= 8,		.bits	= 8,		.num	= 1,	},	.output_gpio_registers = { /* 3 8-bit outputs */		.start = 0,		.bits = 8,		.num = 3,	},};static struct resource htcapache_cpld_resources[] = {	[0] = {		.start	= PXA_CS2_PHYS + 0x02000000,		.end	= PXA_CS2_PHYS + 0x02001000,		.flags	= IORESOURCE_MEM,	},	[1] = {		.start	= gpio_to_irq(GPIO_NR_HTCAPACHE_EGPIO_IRQ),		.end	= gpio_to_irq(GPIO_NR_HTCAPACHE_EGPIO_IRQ),		.flags	= IORESOURCE_IRQ,	},};struct platform_device htcapache_cpld = {	.name		= "htcapache-cpld",	.dev = {		.platform_data = &htcapache_cpld_platform_data,	},	.id		= 0,	.num_resources	= ARRAY_SIZE(htcapache_cpld_resources),	.resource	= htcapache_cpld_resources,};EXPORT_SYMBOL(htcapache_cpld);