[RFC PATCH 1/5] gemini: convert to basic-mmio-gpio

Anton Vorontsov cbouatmailru at gmail.com
Tue Apr 12 10:37:14 EDT 2011


On Mon, Apr 11, 2011 at 12:48:18PM +0100, Jamie Iles wrote:
> The basic-mmio-gpio driver is capable of supporting this controller so
> convert the platform to use it for basic GPIO support.
> 
> Cc: Hans Ulli Kroll <ulli.kroll at googlemail.com>
> Signed-off-by: Jamie Iles <jamie at jamieiles.com>
> ---
[...]
> +#define GPIO_RES(__name, __addr) \
> +	{ \
> +		.start = (__addr), \
> +		.end = (__addr) + 0x3, \
> +		.flags = IORESOURCE_MEM, \
> +		.name = #__name, \
> +	}

Btw, how about moving this (repetitive) macro into basic_mmio_gpio.h?

Assuming, that there could be IRQ resources later, making
something like BGPIO_MEM_RES(name, addr, sz)?

Or, even better, some generic shorthand macro in linux/ioport.h?

#define IORES(__type, __name, __addr, __size)	\
	{					\
		.start = (__addr), 		\
		.end = (__addr) + (__size),	\
		.flags = IORESOURCE_##__type, 	\
		.name = #__name, 		\
	}

Would translate to

IORES(MEM, set, GEMINI_GPIO_BASE(i) + GPIO_DATA_SET), 3),
vs.
GPIO_RES(set, GEMINI_GPIO_BASE(i) + GPIO_DATA_SET),

Thanks,

-- 
Anton Vorontsov
Email: cbouatmailru at gmail.com



More information about the linux-arm-kernel mailing list