From patchwork Fri Dec 3 00:45:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 376381 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB30jbpT006500 for ; Fri, 3 Dec 2010 00:45:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932218Ab0LCApj (ORCPT ); Thu, 2 Dec 2010 19:45:39 -0500 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:19840 "EHLO mho-01-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932080Ab0LCApi (ORCPT ); Thu, 2 Dec 2010 19:45:38 -0500 Received: from c-24-130-172-179.hsd1.ca.comcast.net ([24.130.172.179] helo=baageli.muru.com) by mho-01-ewr.mailhop.org with esmtpa (Exim 4.68) (envelope-from ) id 1POJmM-0005VP-2o; Fri, 03 Dec 2010 00:45:38 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 24.130.172.179 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18iSKUmAg/cZiDAFcuSPg6q Subject: [PATCH 6/6] omap2+: Initialize serial ports for wake-up events for n8x0 To: linux-arm-kernel@lists.infradead.org From: Tony Lindgren Cc: linux-omap@vger.kernel.org Date: Thu, 02 Dec 2010 16:45:31 -0800 Message-ID: <20101203004531.31687.55661.stgit@baageli.muru.com> In-Reply-To: <20101203004040.31687.9476.stgit@baageli.muru.com> References: <20101203004040.31687.9476.stgit@baageli.muru.com> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Dec 2010 00:45:40 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index d022301..e3429b4 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -754,8 +755,68 @@ static struct omap_board_mux board_mux[] __initdata = { OMAP2420_MUX(EAC_AC_DOUT, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT), { .reg_offset = OMAP_MUX_TERMINATOR }, }; + +static struct omap_device_pad serial0_pads[] __initdata = { + { .name = "uart1_rx.uart1_rx", .enable = OMAP_MUX_MODE0 }, + { .name = "uart1_tx.uart1_tx", .enable = OMAP_MUX_MODE0 }, +}; + +static struct omap_device_pad n800_serial1_pads[] __initdata = { + { .name = "uart2_rx.uart2_rx", .enable = OMAP_MUX_MODE7, }, + { + .name = "uart2_tx.uart2_tx", + .enable = OMAP_PULL_ENA | OMAP_MUX_MODE7, + }, +}; + +static struct omap_device_pad n810_serial1_pads[] __initdata = { + { .name = "uart2_rx.uart2_rx", .enable = OMAP_MUX_MODE0, }, + { .name = "uart2_tx.uart2_tx", .enable = OMAP_MUX_MODE0, }, +}; + +static struct omap_device_pad serial2_pads[] __initdata = { + { + .name = "uart3_rx_irrx.uart3_rx_irrx", + .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP, + .enable = OMAP_MUX_MODE0, + .idle = OMAP_MUX_MODE3 /* Mux as GPIO for idle */ + }, + { .name = "uart3_tx_irtx.uart3_tx_irtx", .enable = OMAP_MUX_MODE0, }, +}; + +static struct omap_device_board_data serial0_data = { + .id = 0, + .pads = serial0_pads, + .pads_cnt = ARRAY_SIZE(serial0_pads), +}; + +static struct omap_device_board_data serial1_data = { + .id = 1, +}; + +static struct omap_device_board_data serial2_data = { + .id = 2, + .pads = serial2_pads, + .pads_cnt = ARRAY_SIZE(serial2_pads), +}; + +static inline void board_serial_init(int is_n800) +{ + if (is_n800) { + serial1_data.pads = n800_serial1_pads; + serial1_data.pads_cnt = ARRAY_SIZE(n800_serial1_pads); + } else { + serial1_data.pads = n810_serial1_pads; + serial1_data.pads_cnt = ARRAY_SIZE(n810_serial1_pads); + } + omap_serial_init_port(&serial0_data); + omap_serial_init_port(&serial1_data); + omap_serial_init_port(&serial2_data); +} #else -#define board_mux NULL +static inline void board_serial_init(void) + omap_serial_init(); +} #endif static void __init n8x0_init_machine(void) @@ -772,8 +833,7 @@ static void __init n8x0_init_machine(void) if (machine_is_nokia_n810()) i2c_register_board_info(2, n810_i2c_board_info_2, ARRAY_SIZE(n810_i2c_board_info_2)); - - omap_serial_init(); + board_serial_init(machine_is_nokia_n800()); n8x0_onenand_init(); n8x0_mmc_init(); n8x0_usb_init();