From patchwork Wed Jan 5 12:26:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Williamson X-Patchwork-Id: 453411 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p05COGjB028199 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 5 Jan 2011 12:24:37 GMT Received: from dlep36.itg.ti.com ([157.170.170.91]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p05COFSm019629 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 5 Jan 2011 06:24:15 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id p05COFfN012252 for ; Wed, 5 Jan 2011 06:24:15 -0600 (CST) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 80AD080639 for ; Wed, 5 Jan 2011 06:24:14 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 9134880626 for ; Wed, 5 Jan 2011 06:24:08 -0600 (CST) Received: from red.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id p05CO8a2016873 for ; Wed, 5 Jan 2011 06:24:08 -0600 (CST) Received: from psmtp.com (na3sys009amx233.postini.com [74.125.149.117]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id p05CO7QG008043 for ; Wed, 5 Jan 2011 06:24:07 -0600 Received: from source ([209.85.212.45]) by na3sys009amx233.postini.com ([74.125.148.10]) with SMTP; Wed, 05 Jan 2011 04:24:07 PST Received: by vws12 with SMTP id 12so6063830vws.4 for ; Wed, 05 Jan 2011 04:24:07 -0800 (PST) Received: by 10.220.203.199 with SMTP id fj7mr2437619vcb.80.1294230246795; Wed, 05 Jan 2011 04:24:06 -0800 (PST) Received: from localhost.localdomain (rrcs-24-39-249-130.nys.biz.rr.com [24.39.249.130]) by mx.google.com with ESMTPS id k39sm4872936vcr.26.2011.01.05.04.24.00 (version=SSLv3 cipher=RC4-MD5); Wed, 05 Jan 2011 04:24:04 -0800 (PST) From: Michael Williamson To: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 1/2 v1] davinci: support disabling modem status interrupts on SOC UARTS Date: Wed, 5 Jan 2011 07:26:31 -0500 Message-Id: <1294230392-29564-1-git-send-email-michael.williamson@criticallink.com> X-Mailer: git-send-email 1.7.0.4 X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:25.77841/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.0750) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] Cc: khilman@deeprootsystems.com, gregkh@suse.de, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 05 Jan 2011 12:24:37 +0000 (UTC) diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h index 8051110..8f7f5e5 100644 --- a/arch/arm/mach-davinci/include/mach/serial.h +++ b/arch/arm/mach-davinci/include/mach/serial.h @@ -49,6 +49,8 @@ struct davinci_uart_config { /* Bit field of UARTs present; bit 0 --> UART1 */ unsigned int enabled_uarts; + /* Bit field of modem status interrupt disables; bit 0 -> UART1 */ + unsigned int disable_msi; }; extern int davinci_serial_init(struct davinci_uart_config *); diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c index 1875740..83d44c0 100644 --- a/arch/arm/mach-davinci/serial.c +++ b/arch/arm/mach-davinci/serial.c @@ -31,6 +31,22 @@ #include #include +static void davinci_serial_out_nomsi(struct uart_port *p, int offset, int value) +{ + int lcr, lcr_off; + + if (offset == UART_IER) { + lcr_off = UART_LCR << p->regshift; + lcr = readb(p->membase + lcr_off); + /* don't override DLM setting, or probing operations */ + if (!(lcr & UART_LCR_DLAB) && p->type != PORT_UNKNOWN) + value &= ~UART_IER_MSI; + } + + offset <<= p->regshift; + writeb(value, p->membase + offset); +} + static inline unsigned int serial_read_reg(struct plat_serial8250_port *up, int offset) { @@ -109,6 +125,9 @@ int __init davinci_serial_init(struct davinci_uart_config *info) if (p->membase && p->type != PORT_AR7) davinci_serial_reset(p); + + if (info->disable_msi & (1 << i)) + p->serial_out = davinci_serial_out_nomsi; } return platform_device_register(soc_info->serial_dev);