Re: [PATCH] ARM: OMAP: Add support for dynamic GPIO switch update

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

 



On Mon, Dec 15, 2008 at 03:44:05PM +0200, Jani Nikula wrote:
> That's a nice idea, but gpio_sw_irq_handler() actually supports having 0
> debounce timeouts, i.e. no settling time. Of course, I could use -1 for
> "don't update". However, the semantics above is exactly the same as in
> add_board_switches() for the update case. I'm not sure if it would be a
> good idea to deviate from this - what do you think? 

makes sense to me. But then again, if the uses does something like:

static struct omap_gpio_switch *cfg;

static int __init blabla_probe(struct platform_device *dev)
{
	cfg = kmalloc(sizeof(cfg), GFP_KERNEL));

	cfg->notify = my_notify;

	omap_update_gpio_swtich(cfg);

	return 0;
};

that means that if cfg->debounce_rising was different than 0, it'll get
overwritten to 0, right ? So, at least, you should put a big note for
users to initialize all necessary fields. Or, again, you only change if
cfg-><whatever> is different than 0 (or NULL), but that could a problem
when you really wanna change cfg->debounce_rising from, say, 100 to 0.
That wouldn't happen :-p

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

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux