From patchwork Wed May 6 13:07:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pascal Huerst X-Patchwork-Id: 6349511 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D11E2BEEE1 for ; Wed, 6 May 2015 13:07:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CBCEE202FF for ; Wed, 6 May 2015 13:07:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9CD2C202EB for ; Wed, 6 May 2015 13:07:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751036AbbEFNHR (ORCPT ); Wed, 6 May 2015 09:07:17 -0400 Received: from mail-wg0-f50.google.com ([74.125.82.50]:36124 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbbEFNHP (ORCPT ); Wed, 6 May 2015 09:07:15 -0400 Received: by wgiu9 with SMTP id u9so10925089wgi.3; Wed, 06 May 2015 06:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=/katW+YqH7GdNf9UCS9NT4M1mx1mAb9uGPnBpRCqYOk=; b=G2MBQbXyAJagv6A/1wy9VDiaFglP3E36VMmIn5mmXE6TN9SikK8F7EI3G/h6TAWu5X gV3f0BU8MpzlFsIoxEcO843Vk4JUF0LYJm/zmPiu1HzXoH9bbUdedGgPI86osvaAKTka 4N2ZY7OUbjjPrviWk15xzua70Oq5UU+LYngFeuOcKuuMJTC4bdI+u1k2iqt19xNcYCHJ CV37rJzZT1+fkrjuPj7haImVW6aK9lWT601ld/xcPG4+4fXgTHUoUh1qNQghqtDRzFOJ 9ZjiwlzbdguCU3csgrIYXT7cPpyY3rrDjced7lOU0OHIxkUrFCxRbgeybj1vB0D3ND8J axYg== X-Received: by 10.180.93.36 with SMTP id cr4mr4775783wib.61.1430917634385; Wed, 06 May 2015 06:07:14 -0700 (PDT) Received: from localhost.localdomain.localdomain ([212.91.255.186]) by mx.google.com with ESMTPSA id ex5sm2142607wib.2.2015.05.06.06.07.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 May 2015 06:07:13 -0700 (PDT) From: pascal.huerst@gmail.com To: wsa@the-dreams.de Cc: tony@atomide.com, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, nsekhar@ti.com, Pascal Huerst Subject: [PATCH v4] i2c: omap: Add calls for pinctrl state select Date: Wed, 6 May 2015 15:07:04 +0200 Message-Id: <1430917624-18164-1-git-send-email-pascal.huerst@gmail.com> X-Mailer: git-send-email 2.1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Pascal Huerst This adds calls to pinctrl subsystem in order to switch pin states on suspend/resume if you provide a "sleep" state in DT. If no "sleep" state is provided in the DT, these calls turn to NOPs, so we don't need error checking here. Signed-off-by: Pascal Huerst Reviewed-by: Sekhar Nori --- drivers/i2c/busses/i2c-omap.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 0e89419..8261941 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -38,6 +38,7 @@ #include #include #include +#include /* I2C controller revisions */ #define OMAP_I2C_OMAP1_REV_2 0x20 @@ -1423,6 +1424,8 @@ static int omap_i2c_runtime_suspend(struct device *dev) omap_i2c_read_reg(_dev, OMAP_I2C_STAT_REG); } + pinctrl_pm_select_sleep_state(dev); + return 0; } @@ -1431,6 +1434,8 @@ static int omap_i2c_runtime_resume(struct device *dev) struct platform_device *pdev = to_platform_device(dev); struct omap_i2c_dev *_dev = platform_get_drvdata(pdev); + pinctrl_pm_select_default_state(dev); + if (!_dev->regs) return 0;