From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Hilman Subject: Re: [PATCH 2/7] OMAP2+: mux: Enable wakeup for wakeup enable requested pads Date: Tue, 08 Mar 2011 10:31:26 -0800 Message-ID: <87k4g9qxa9.fsf@ti.com> References: <1299064343-28534-1-git-send-email-govindraj.raja@ti.com> <87lj0u8mrf.fsf@ti.com> <87tyfi49cs.fsf@ti.com> <20110308172625.GE26463@atomide.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from na3sys009aog105.obsmtp.com ([74.125.149.75]:59821 "EHLO na3sys009aog105.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753439Ab1CHSb3 (ORCPT ); Tue, 8 Mar 2011 13:31:29 -0500 In-Reply-To: <20110308172625.GE26463@atomide.com> (Tony Lindgren's message of "Tue, 8 Mar 2011 09:26:25 -0800") Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Tony Lindgren Cc: Govindraj , "Govindraj.R" , linux-omap@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Benoit Cousson , Paul Walmsley , Rajendra Nayak Tony Lindgren writes: > * Govindraj [110308 03:43]: >> >> I am not sure whether now we can control read/writes to pad_mux from any driver >> interface and I think we have to go through mux framework for any >> read/writes to mux. > > Sure, the drivers should not mess with those registers directly. > >> with this I cant control pad wake up capabilities with sysfs as done >> earlier in serial.c >> now control to read/write to pad is outside scope of the driver >> interface as omap_hwmod_mux >> is the one that takes decision for driver with mux values provided >> during omap_hwmod_mux_init. > > The sysfs interface to control this should still be from the drivers. > Sounds like we need some way to set the wakeup flags before pm_runtime_put > is called. Exactly. Driver's can currently check device_may_wakeup(dev) to determine if they *should* set wakeup flags, but currently, we don't have a clean way to pass the info down to core code. One possible option (albeit hacky) is for the omap_hwmod_mux code to check device_may_wakeup() itself, and set the bits accordingly. This means drivers don't have to do anything, but drivers also loose control of enabling/disabling wakeups. I think what we need are two omap_device-level APIs for wakeups. One for enable/disable of wakeups (both module-level and IO-ring, the driver should not care about the difference between the two): int omap_device_[enable|disable](struct platform_device *pdev); bool omap_device_wakeup_occured(struct platform_device *pdev); As OMAP-specific APIs, both of these should of course be called through pdata function pointers. Kevin