From 66526df8bc7977cde11d1f6d0696de8494f2688f Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Thu, 26 May 2011 12:06:10 +0200 Subject: [PATCH] serial seems to work, but produces no output on headphone jack --- hs_cons.c | 5 ++--- omap-hs-serial.c | 14 +++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/hs_cons.c b/hs_cons.c index 7983db4..8ca5b80 100644 --- a/hs_cons.c +++ b/hs_cons.c @@ -44,9 +44,8 @@ static int __init headphone_cons_init(void) if (hs_switch < 0) return -EINVAL; - printk(KERN_INFO "headset_uart_switch: %d\n", hs_switch); + printk(KERN_INFO "headset_uart_switch: %d, value: %d\n", hs_switch, gpio_get_value(hs_switch)); - printk(KERN_INFO "value: %d\n", gpio_get_value(hs_switch)); if (!gpio_get_value(hs_switch)) return -ENODEV; @@ -59,7 +58,7 @@ static int __init headphone_cons_init(void) /* route kernel uart out headset jack */ gpio_direction_output(hs_switch, 0); - printk(KERN_INFO "value: %d\n", gpio_get_value(hs_switch)); + printk(KERN_INFO "headset_uart_switch: %d, value: %d\n", hs_switch, gpio_get_value(hs_switch)); //add_preferred_console("ttyS", 2, "115200"); return 0; diff --git a/omap-hs-serial.c b/omap-hs-serial.c index 8d2fbad..8e44e87 100644 --- a/omap-hs-serial.c +++ b/omap-hs-serial.c @@ -1060,7 +1060,7 @@ serial_omap_type(struct uart_port *port) { struct uart_omap_port *up = (struct uart_omap_port *)port; - DPRINTK("serial_omap_type+%d\n", up->pdev->id); + DPRINTK("serial_omap_hs_type+%d\n", up->pdev->id); return up->name; } @@ -1232,7 +1232,7 @@ static struct uart_driver serial_omap_reg = { .driver_name = "OMAP-HS-SERIAL", .dev_name = "ttyS", .major = TTY_MAJOR, - .minor = 64, + .minor = 128, .nr = 4, .cons = OMAP_CONSOLE, }; @@ -1454,7 +1454,9 @@ static int serial_omap_probe(struct platform_device *pdev) struct uart_omap_port *up; struct resource *mem, *irq; int ret = -ENOSPC; +#if 0 char str[7]; +#endif if (!pdata) { dev_err(&pdev->dev, "no platform data?\n"); @@ -1488,7 +1490,7 @@ static int serial_omap_probe(struct platform_device *pdev) ret = -ENOMEM; goto do_release_region; } - sprintf(up->name, "OMAP UART%d", pdev->id); + sprintf(up->name, "OMAP HS UART%d", pdev->id); up->pdev = pdev; up->port.dev = &pdev->dev; @@ -1549,10 +1551,13 @@ static int serial_omap_probe(struct platform_device *pdev) up->uart_dma.tx_dma_channel = 0xFF; up->uart_dma.rx_dma_channel = 0xFF; } +#if 0 if (console_detect(str)) printk("Invalid console paramter. UART Library Init Failed!\n"); +#endif up->use_console = 0; fcr[pdev->id - 1] = 0; +#if 0 if (!strcmp(str, "ttyS0")) up->use_console = 1; else if (!strcmp(str, "ttyS1")) @@ -1564,6 +1569,8 @@ static int serial_omap_probe(struct platform_device *pdev) else printk(KERN_INFO "!!!!!!!! Unable to recongnize Console UART........\n"); +#endif + up->use_console = 1; ui[pdev->id - 1] = up; serial_omap_add_console_port(up); serial_omap_clear_fifos(up); @@ -1616,6 +1623,7 @@ int my_serial_omap_init(void) { int ret; + printk(KERN_INFO "registering omap-hs-uart...\n"); wake_lock_init(&omap_serial_wakelock, WAKE_LOCK_SUSPEND, "omap_hs_serial"); omap_serial_workqueue = create_singlethread_workqueue("omap_hs_serial"); -- 2.39.5