Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754829Ab0KSRCn (ORCPT ); Fri, 19 Nov 2010 12:02:43 -0500 Received: from mail-px0-f174.google.com ([209.85.212.174]:38156 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754328Ab0KSRCm (ORCPT ); Fri, 19 Nov 2010 12:02:42 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; b=IElzS3Riz8LwwepSvVJ7ls2GpBJwDmqtF/rTVY0lE5dCGF4hSAcpoyX9Ov8TNTY9b0 HZBydNo3TUgAvyCA71YOxsy8elBATY4jcbxc4CVCrGVCQskk0Ed7tX0OQ0EtLfYSbZQ/ IdtsDNS67E9rqFhpY+N4ZzDrytmSkKgiA8a+4= Date: Fri, 19 Nov 2010 09:02:32 -0800 From: Dmitry Torokhov To: Ben Gardiner Cc: "Nori, Sekhar" , Kevin Hilman , "davinci-linux-open-source@linux.davincidsp.com" , "linux-input@vger.kernel.org" , "Govindarajan, Sriramakrishnan" , Paul Mundt , "linux-kernel@vger.kernel.org" , Alexander Clouter , Chris Cordahi Subject: Re: [PATCH v2 4/4] da850-evm: add baseboard UI expander buttons, switches and LEDs Message-ID: <20101119170232.GB6236@core.coreip.homeip.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1393 Lines: 35 Hi Ben, On Fri, Nov 19, 2010 at 10:40:50AM -0500, Ben Gardiner wrote: > > >> + > >> +static struct gpio_keys_platform_data user_sw_gpio_key_platform_data = { > >> + ? ? .buttons = user_sw_gpio_keys, > >> + ? ? .nbuttons = ARRAY_SIZE(user_sw_gpio_keys), > >> + ? ? .rep = 0, /* disable auto-repeat */ > >> + ? ? .poll_interval = DA850_SW_POLL_MS, > >> +}; > > > > I wonder if we really have create to separate platform data > > for switches and push buttons. If it is only the debounce period > > that is different, it can be handled by initializing that field > > differently. > > I see. Good idea; we can declare an array of gpio_keys_platform_data. > > Note; it is the polling interval which differs, not the debounce interval. Another question is why do you want to poll the same device at different intervals? The processor is already woken up so it makes sense to do as much as possible instead of going to sleep. In your case 200/700 for every 1400ms interval you wake an extra time to poll switches so unless polling switches takes very long time it is better to combine them together (and into one input device, probably). -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/