Re: [PATCH] input: joystick: Adding Austria Microsystem AS5011 joystick driver (second version)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Fabien Marteau
Date: Friday, December 31, 2010 - 4:38 am

Hi Trilok,


If gpio_get_value() sleep, I need it to avoid race condition.


I had no warning for CamelCases name.


It's for interruptions name, if several as5011 joystick I set a number different for each joystick :

	scnprintf(plat_dat->button_irq_name,
		  SIZE_NAME,
		  "as5011_%d_button",
		  plat_dat->num);

It's required for i2c register reading. To read register as5011 chip use this i2c frames :
	S Addr Rd [A] Register_addr [A] [Data] NA P
Wich is not conform to i2c protocol, i2c protocol require a repeated start to do that :
	S Addr Wr [A] Register_addr [A] S Addr Rd [Data] NA P

Then protocol mangling capability is required to avoid repeated start.



Yes, but on my platform, requesting gpio are specific. And I have to configure irq edge on initialization :
static int as5011_init_gpio(void)
{
	int ret;

	ret = mxc_gpio_setup_multiple_pins(as5011_pins0,
					   ARRAY_SIZE(as5011_pins0),
					   "AS5011_0");
	if (ret < 0) {
		goto as5011_gpio_setup_error;
	}
	set_irq_type(AS5011_INT_IRQ, IRQ_TYPE_EDGE_FALLING);
	set_irq_type(AS5011_BUTTON_IRQ, IRQ_TYPE_EDGE_BOTH);
	return ret;

	mxc_gpio_release_multiple_pins(as5011_pins0, ARRAY_SIZE(as5011_pins0));
as5011_gpio_setup_error:
	return ret;
}


Thanks for the review.

--- Fabien Marteau
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] input: joystick: Adding Austria Microsystem ..., Fabien Marteau, (Fri Dec 31, 4:38 am)
Re: [PATCH] input: joystick: Adding Austria Microsystem ..., Dmitry Torokhov, (Sun Jan 2, 12:41 am)
Re: [PATCH] input: joystick: Adding Austria Microsystem ..., Dmitry Torokhov, (Sun Jan 2, 12:58 am)