From patchwork Thu Sep 6 18:58:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 1417331 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 10D18DFFCF for ; Thu, 6 Sep 2012 18:58:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933089Ab2IFS6e (ORCPT ); Thu, 6 Sep 2012 14:58:34 -0400 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:51205 "EHLO mho-01-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933001Ab2IFS6d (ORCPT ); Thu, 6 Sep 2012 14:58:33 -0400 Received: from c-98-234-237-12.hsd1.ca.comcast.net ([98.234.237.12] helo=muffinssi.local) by mho-01-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1T9hHd-0001Cc-6t; Thu, 06 Sep 2012 18:58:33 +0000 X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 98.234.237.12 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/0i09wZ7AdEEv7n0sGBGBZ Subject: [PATCH 5/5] omap-serial: Request pins using pinctrl framework To: linux-arm-kernel@lists.infradead.org From: Tony Lindgren Cc: Greg Kroah-Hartman , linux-omap@vger.kernel.org, linux-serial@vger.kernel.org Date: Thu, 06 Sep 2012 11:58:32 -0700 Message-ID: <20120906185832.1172.31013.stgit@muffinssi.local> In-Reply-To: <20120906185615.1172.23588.stgit@muffinssi.local> References: <20120906185615.1172.23588.stgit@muffinssi.local> User-Agent: StGit/0.16-2-g0d85 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Request pins using pinctrl framework. Only show a warning on error as some boards set the pins in the bootloader even if CONFIG_PINCTRL is enabled. Cc: linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/include/plat/omap-serial.h | 1 + drivers/tty/serial/omap-serial.c | 10 ++++++++++ 2 files changed, 11 insertions(+) -- 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/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h index 1a52725..0f4de14 100644 --- a/arch/arm/plat-omap/include/plat/omap-serial.h +++ b/arch/arm/plat-omap/include/plat/omap-serial.h @@ -106,6 +106,7 @@ struct uart_omap_port { struct uart_port port; struct uart_omap_dma uart_dma; struct platform_device *pdev; + struct pinctrl *pins; unsigned char ier; unsigned char lcr; diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index d3cda0c..068e88c 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -1492,6 +1493,13 @@ static int serial_omap_probe(struct platform_device *pdev) goto err_port_line; } + up->pins = pinctrl_get_select_default(&pdev->dev); + if (IS_ERR(up->pins)) { + dev_warn(&pdev->dev, "did not get pins for uart%i error: %li\n", + up->port.line, PTR_ERR(up->pins)); + up->pins = NULL; + } + sprintf(up->name, "OMAP UART%d", up->port.line); up->port.mapbase = mem->start; up->port.membase = devm_ioremap(&pdev->dev, mem->start, @@ -1570,6 +1578,8 @@ static int serial_omap_remove(struct platform_device *dev) pm_runtime_disable(&up->pdev->dev); uart_remove_one_port(&serial_omap_reg, &up->port); pm_qos_remove_request(&up->pm_qos_request); + if (up->pins) + pinctrl_put(up->pins); } platform_set_drvdata(dev, NULL);