From patchwork Mon Sep 17 17:22:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 1468511 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 B97FFDF2D8 for ; Mon, 17 Sep 2012 17:21:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756246Ab2IQRUy (ORCPT ); Mon, 17 Sep 2012 13:20:54 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:39717 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754289Ab2IQRUw (ORCPT ); Mon, 17 Sep 2012 13:20:52 -0400 Received: by yhmm54 with SMTP id m54so1567309yhm.19 for ; Mon, 17 Sep 2012 10:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=HUk+qi9zB/Mw4bAle9SUbzvVKCuYUsrytsY66z56H1c=; b=JbdyD8a8SVjHjxmsGK/U4DVp6uoCbtv6Q+7dzm8nQjaJUD9Fsg/yUW6R8ZTx2663S2 LZs/Pwcxk3nZmVAvaVXG2iPHzq/4VL0H9H8zYV4EJkyWVeC4qb9pWRtYKyE8Ln92CTTV OLXGo6Jic9bX+wP8afCr1GtKwgTNCIfIjYa1QESWhlLeWQsBdPeD5swDWYOTRIPnwlTT sZZ/k4f6PFCpKpldnHnBxT48w2ENOryvYgJbXhUlWC206DRq14+MSzFSJMB/fbw2LQ+5 4H92NTdh0ucbA55Bt8UBXoVBzR0kGz2uuh4NkqDlk9qb/XjED/Js3KdjviIoVZlFe5L5 5JPg== Received: by 10.236.136.39 with SMTP id v27mr12333477yhi.96.1347902451541; Mon, 17 Sep 2012 10:20:51 -0700 (PDT) Received: from beef.ohporter.com (cpe-24-166-64-7.neo.res.rr.com. [24.166.64.7]) by mx.google.com with ESMTPS id c64sm14914329yhj.17.2012.09.17.10.20.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 10:20:50 -0700 (PDT) From: Matt Porter To: Linux OMAP List , Linux SPI Devel List , Grant Likely , Tony Lindgren Cc: Linux Kernel Mailing List , Linux ARM Kernel List , AnilKumar Subject: [PATCH v2 1/2] spi: omap2-mcspi: add pinctrl support Date: Mon, 17 Sep 2012 13:22:17 -0400 Message-Id: <1347902538-21208-2-git-send-email-mporter@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1347902538-21208-1-git-send-email-mporter@ti.com> References: <1347902538-21208-1-git-send-email-mporter@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Adds pinctrl support to support OMAP platforms that boot from DT and rely on pinctrl support to set pinmuxes. Signed-off-by: Matt Porter Acked-by: Tony Lindgren Acked-by: Shubhrajyoti D --- drivers/spi/spi-omap2-mcspi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index b2fb141..9502566 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -38,6 +38,8 @@ #include #include #include +#include +#include #include @@ -1124,6 +1126,7 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev) static int bus_num = 1; struct device_node *node = pdev->dev.of_node; const struct of_device_id *match; + struct pinctrl *pinctrl; master = spi_alloc_master(&pdev->dev, sizeof *mcspi); if (master == NULL) { @@ -1219,6 +1222,11 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev) if (status < 0) goto dma_chnl_free; + pinctrl = devm_pinctrl_get_select_default(&pdev->dev); + if (IS_ERR(pinctrl)) + dev_warn(&pdev->dev, + "pins are not configured from the driver\n"); + pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT); pm_runtime_enable(&pdev->dev);