[PATCH 1/1] GTA01 - silence the console when GSM is enabled

Mike (mwester) mwester at dls.net
Fri Aug 8 06:15:43 CEST 2008


This patch is split out from the original GSM flow-control
patch.  It affects only the GTA01.  The patch has been
re-written to use a callback, and modeled after the callback
code added to the same routines by Andy Green.

Mike (mwester)

------------------------------------------------------------
commit e9afa0c0bd0b43cc9b70045bb26cc2e16b83273f
Author: Mike Westerhof <mwester at dls.net>
Date:   Mon Jul 7 00:20:23 2008 -0500

    silence-serial-console-gta01.patch

    This patch ensures that no console data will go the UART while
    the GSM mux is switched to the GSM.  This is necessary despite
    the code that disables the console due to the fact that the
    console resumes before the neo1973_pm_gsm driver, and consoles
    always resume in the "on" state.

    Signed-off-by: Mike Westerhof <mwester at dls.net>

diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
index 178c9f7..05773f2 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
@@ -31,6 +31,7 @@
 #include <asm/arch/regs-gpioj.h>
 #endif

+extern void s3c24xx_serial_console_set_silence(int silence);
 extern void s3c24xx_serial_register_resume_dependency(struct resume_dependency *
                                             resume_dependency, int uart_index);

@@ -105,6 +106,7 @@ static ssize_t gsm_write(struct device *dev, struct device_attribute *attr,
                                         "disconnecting serial console\n");

                                console_stop(gta01_gsm.con);
+                               s3c24xx_serial_console_set_silence(1);
                        }

                        if (gta01_gsm.gpio_ngsm_en)
@@ -144,6 +146,7 @@ static ssize_t gsm_write(struct device *dev, struct device_attribute *attr,
                                s3c2410_gpio_setpin(gta01_gsm.gpio_ngsm_en, 1);

                        if (gta01_gsm.con) {
+                               s3c24xx_serial_console_set_silence(0);
                                console_start(gta01_gsm.con);

                                dev_info(dev, "powered down GSM, thus enabling "
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 5652905..2a388cf 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -1780,6 +1780,13 @@ module_exit(s3c24xx_serial_modexit);
 #ifdef CONFIG_SERIAL_S3C2410_CONSOLE

 static struct uart_port *cons_uart;
+static int cons_silenced;
+
+void s3c24xx_serial_console_set_silence(int silenced)
+{
+       cons_silenced = silenced;
+}
+EXPORT_SYMBOL(s3c24xx_serial_console_set_silence);

 static int
 s3c24xx_serial_console_txrdy(struct uart_port *port, unsigned int ufcon)
@@ -1806,6 +1813,9 @@ s3c24xx_serial_console_putchar(struct uart_port *port, int ch)
        unsigned int ufcon = rd_regl(cons_uart, S3C2410_UFCON);
        unsigned int umcon = rd_regl(cons_uart, S3C2410_UMCON);

+       if (cons_silenced)
+               return;
+
        /* If auto HW flow control enabled, temporarily turn it off */
        if (umcon & S3C2410_UMCOM_AFC)
                wr_regl(port, S3C2410_UMCON, (umcon & !S3C2410_UMCOM_AFC));




More information about the openmoko-kernel mailing list