From patchwork Mon Aug 6 14:18:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1279541 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 126BADF288 for ; Mon, 6 Aug 2012 14:22:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756521Ab2HFOWq (ORCPT ); Mon, 6 Aug 2012 10:22:46 -0400 Received: from na3sys009aog119.obsmtp.com ([74.125.149.246]:38645 "EHLO na3sys009aog119.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756474Ab2HFOWp (ORCPT ); Mon, 6 Aug 2012 10:22:45 -0400 Received: from mail-lpp01m010-f53.google.com ([209.85.215.53]) (using TLSv1) by na3sys009aob119.postini.com ([74.125.148.12]) with SMTP ID DSNKUB/TNBfEHv+iYzviccYTdzamwePStm2M@postini.com; Mon, 06 Aug 2012 07:22:45 PDT Received: by lahc1 with SMTP id c1so592847lah.40 for ; Mon, 06 Aug 2012 07:22:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=Axknjxj6borhH5WrW5Men5EMfs5dbMGx+Yqxfbdl/fs=; b=CIg7FqceGfNyk3xm3IGjiF1OP1pR7Kj5EcTm8kGDxE1bIiCMPDrOKZGFc3BHYrBC7B jRub5skCYVQK4lz/QOD0ARZukSjVZe+HK860Hhwg9qosRC6Xrpl7hJjIRBLOzqKBjH+M cEc7xhOaqNbLcfohfdwUW22b1AaiXx/IxWVT1zSNVxRJqQk9V1glx1bMO5/joT1HBMfS g52u1gMbA/bmYeRrYiZfH9LF/Azn6RwgsETP64D58kJ1tD9EohZd4f5Fj/E2mpfU/bE+ zdc1KQwyD9cQtkl0FpvuNSXaH+v8TjCoAO4oh2cal1S9bCEo8/mVQTBA4gisUWCA7+iR UxZA== Received: by 10.112.40.231 with SMTP id a7mr4741070lbl.67.1344262962441; Mon, 06 Aug 2012 07:22:42 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id gv8sm17287311lab.14.2012.08.06.07.22.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 07:22:41 -0700 (PDT) From: Felipe Balbi To: Shubhrajyoti Datta Cc: Linux OMAP Mailing List , Linux ARM Kernel Mailing List , w.sang@pengutronix.de, Felipe Balbi Subject: [PATCH 4/4] i2c: omap: switch over to autosuspend API Date: Mon, 6 Aug 2012 17:18:57 +0300 Message-Id: <1344262737-6662-5-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.12.rc0 In-Reply-To: <1344262737-6662-1-git-send-email-balbi@ti.com> References: <1344262737-6662-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQkqMZPF8v3jTLtterbsq/x3ZtdeSTlI3NKg+Ap4YQbfrNxcj3/iwjAgB4S9GjvL0S8nw7Zz Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org this helps us reduce unnecessary pm transitions in case we have another i2c message been started soon. Signed-off-by: Felipe Balbi --- drivers/i2c/busses/i2c-omap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 60928f2..22efaba 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -645,7 +645,8 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) omap_i2c_wait_for_bb(dev); out: - pm_runtime_put(dev->dev); + pm_runtime_mark_last_busy(dev->dev); + pm_runtime_put_autosuspend(dev->dev); return r; } @@ -1113,6 +1114,9 @@ omap_i2c_probe(struct platform_device *pdev) dev->regs = (u8 *)reg_map_ip_v1; pm_runtime_enable(dev->dev); + pm_runtime_set_autosuspend_delay(dev->dev, 1000); + pm_runtime_use_autosuspend(dev->dev); + r = pm_runtime_get_sync(dev->dev); if (IS_ERR_VALUE(r)) goto err_free_mem; @@ -1189,7 +1193,7 @@ omap_i2c_probe(struct platform_device *pdev) of_i2c_register_devices(adap); - pm_runtime_put(dev->dev); + pm_runtime_put_autosuspend(dev->dev); return 0;