From patchwork Fri Sep 7 17:59:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 1424671 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A86A23FC85 for ; Fri, 7 Sep 2012 17:59:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753247Ab2IGR7n (ORCPT ); Fri, 7 Sep 2012 13:59:43 -0400 Received: from mho-04-ewr.mailhop.org ([204.13.248.74]:18714 "EHLO mho-02-ewr.mailhop.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752530Ab2IGR7m (ORCPT ); Fri, 7 Sep 2012 13:59:42 -0400 Received: from c-98-234-237-12.hsd1.ca.comcast.net ([98.234.237.12] helo=localhost.localdomain) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1TA2qD-000NrW-Rj; Fri, 07 Sep 2012 17:59:42 +0000 Received: from Mutt by mutt-smtp-wrapper.pl 1.2 (www.zdo.com/articles/mutt-smtp-wrapper.shtml) 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: U2FsdGVkX19G67tOMh/apVcXDPDp03tl Date: Fri, 7 Sep 2012 10:59:40 -0700 From: Tony Lindgren To: Greg KH Cc: linux-serial@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] serial: omap: Request pins using pinctrl framework Message-ID: <20120907175939.GE1303@atomide.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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. Signed-off-by: Tony Lindgren --- Note that this has only so far been tested with the legacy non-devicetree boot as devicetree boot now has a regression issue with omap-serial. -- 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 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -40,6 +40,7 @@ #include #include #include +#include #include @@ -108,6 +109,7 @@ struct uart_omap_port { u32 latency; u32 calc_latency; struct work_struct qos_work; + struct pinctrl *pins; }; #define to_uart_omap_port(p) ((container_of((p), struct uart_omap_port, port))) @@ -1371,6 +1373,13 @@ static int __devinit serial_omap_probe(struct platform_device *pdev) goto err_port_line; } + up->pins = devm_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,