Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756171Ab0LRNUc (ORCPT ); Sat, 18 Dec 2010 08:20:32 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:34082 "EHLO opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751983Ab0LRNUb (ORCPT ); Sat, 18 Dec 2010 08:20:31 -0500 Date: Sat, 18 Dec 2010 13:20:29 +0000 From: Mark Brown To: "Rafael J. Wysocki" Cc: Rabin Vincent , stern@rowland.harvard.edu, linux-pm@lists.linux-foundation.org, linux-i2c@vger.kernel.org, LKML Subject: Re: platform/i2c busses: pm runtime and system sleep Message-ID: <20101218132029.GA22273@opensource.wolfsonmicro.com> References: <201012180001.25263.rjw@sisk.pl> <20101218010454.GA2430@opensource.wolfsonmicro.com> <201012181354.58077.rjw@sisk.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012181354.58077.rjw@sisk.pl> X-Cookie: There is a 20% chance of tomorrow. User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1451 Lines: 28 On Sat, Dec 18, 2010 at 01:54:57PM +0100, Rafael J. Wysocki wrote: > On Saturday, December 18, 2010, Mark Brown wrote: > > SPI and platform (the first two buses I looked at) both seem to have > > legacy suspend operations too? Clearly the bus would need to provide an > > op to invoke the legacy call but the logic which prioritises the pm_ops > > over the legacy operation is generic. > Well, the problem with that is the driver would need to tell the generic call > what the legacy routine is and there's no, er, generic way to do that. > In the i2c case, for example, there is struct i2c_driver that contains the > ->suspend() and ->resume() pointers, so the bus type driver _knows_ how to > get there, but the PM core doesn't have this information. Sure, but this could be readily accomplished by providing bus legacy_suspend() and legacy_resume() operations that the generic code could use to do the actual call. This would save them all implmeneting essentially the same decision making code for all the various different PM operations - the only bit that differs between buses is going to be the actual process for calling the legacy API. Like I say, I'm not sure if it's actually worth it. -- 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/