From patchwork Mon Jul 6 10:24:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 34220 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n66AQLMv010375 for ; Mon, 6 Jul 2009 10:26:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757603AbZGFKZa (ORCPT ); Mon, 6 Jul 2009 06:25:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752771AbZGFKZJ (ORCPT ); Mon, 6 Jul 2009 06:25:09 -0400 Received: from d1.icnet.pl ([212.160.220.21]:48652 "EHLO d1.icnet.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751457AbZGFKZH (ORCPT ); Mon, 6 Jul 2009 06:25:07 -0400 Received: from 87-205-12-81.ip.netia.com.pl ([87.205.12.81] helo=acer.intranet) by d1.icnet.pl with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1MNlNl-0006vi-UN; Mon, 06 Jul 2009 12:25:10 +0200 To: Jonathan McDowell Subject: [PATCH v3] OMAP1: AMS_DELTA: add modem support Cc: Tony Lindgren , "linux-omap@vger.kernel.org" , "linux-serial@vger.kernel.org" , "linux-arm-kernel@lists.arm.linux.org.uk" , "linux-kernel@vger.kernel.org" Content-Disposition: inline From: Janusz Krzysztofik Organization: Tele-Info-System, Poznan, PL Date: Mon, 6 Jul 2009 12:24:27 +0200 MIME-Version: 1.0 Message-Id: <200907061224.29292.jkrzyszt@tis.icnet.pl> X-SA-Exim-Scanned: No (on d1.icnet); SAEximRunCond expanded to false Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org This patch adds support for modem device found on Amstrad E3 (Delta) board. Based on earlier patch by Jonathan McDowell, available at http://the.earth.li/pub/e3/2.6.19/ams-delta-modem.patch. Modified after Ladislav Michl's arch/arm/mach-omap1/board-voiceblue.c. This version, unlike v2, is dependent on 8250 driver changes getting accepted upstream: Refer: http://patchwork.kernel.org/patch/31884/ Signed-off-by: Janusz Krzysztofik Acked-By: Jonathan McDowell --- Registering the modem platform device from a separate arch_initcall (and not from init_machine() callback) preserves serial console port at ttyS0. OMAP mux pin set up just for case if Amstrad bootloader is ever replaced. Warning: could cause compilation break if 8250 patch is not integrated first -- 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 --- linux-2.6.31-rc1/arch/arm/mach-omap1/board-ams-delta.c.orig 2009-07-04 16:39:37.000000000 +0200 +++ linux-2.6.31-rc1/arch/arm/mach-omap1/board-ams-delta.c 2009-07-05 13:41:08.000000000 +0200 @@ -15,8 +15,11 @@ #include #include #include +#include #include +#include +#include #include #include #include @@ -235,6 +238,41 @@ static void __init ams_delta_init(void) platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); } +static struct plat_serial8250_port ams_delta_modem_ports[] = { + { + .membase = (void *) AMS_DELTA_MODEM_VIRT, + .mapbase = AMS_DELTA_MODEM_PHYS, + .irq = -EINVAL, /* changed later */ + .flags = UPF_BOOT_AUTOCONF, + .irqflags = IRQF_TRIGGER_RISING, + .iotype = UPIO_MEM, + .regshift = 1, + .uartclk = BASE_BAUD * 16, + }, + { }, +}; + +static struct platform_device ams_delta_modem_device = { + .name = "serial8250", + .id = PLAT8250_DEV_PLATFORM1, + .dev = { + .platform_data = ams_delta_modem_ports, + }, +}; + +static int __init ams_delta_modem_init(void) +{ + omap_cfg_reg(M14_1510_GPIO2); + ams_delta_modem_ports[0].irq = gpio_to_irq(2); + + ams_delta_latch2_write( + AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC, + AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC); + + return platform_device_register(&ams_delta_modem_device); +} +arch_initcall(ams_delta_modem_init); + static void __init ams_delta_map_io(void) { omap1_map_common_io();