Re: [PATCH] generic driver for rotary encoders on GPIOs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 26, 2009 at 10:18:40PM -0500, hartleys wrote:
> +static struct rotary_encoder_platform_data my_rotary_encoder_info = {
> +	.steps = 24,
> +	.gpio_a = GPIO_ROTARY_A,
> +	.gpio_b = GPIO_ROTARY_B,
> +	.inverted_a = 0,
> +	.inverted_b = 0,
> +};
> +
> +static struct platform_device rotary_encoder_device = {
> +	.name		= "rotary-encoder",
> +	.id		= 0,
> +	.num_resources	= ARRAY_SIZE(rotary_encoder_resources),
> +	.resource	= rotary_encoder_resources,
> +	.dev		= {
> +		.platform_data = &my_rotary_encoder_info,
> +	}
> +};
> +
> 
> IRQ_GPIO appears to be only defined for mach-imx and mach-pxa.
> 
> Why not just use the platform_data information to get the irq for the
> gpio at runtime with gpio_to_irq()?

Yes, true. But wouldn't be using the resources only and irq_to_gpio() be
the even cleaner solution?

> +#include <linux/rotary-encoder.h>
> 
> This file is missing in the patch.

Will be added in the next version.

Thanks,
Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux