The driver used to pick some arbitrary bogus I/O addr that was way up in the weeds, and it also reported a bogus IRQ value of zero. This fixes both issues. Signed-off-by: Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx> --- ltdrv.c | 17 +++++++++-------- v8250.c | 4 ++-- v8250.h | 2 ++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ltdrv.c b/ltdrv.c index 20ca240..21011a3 100644 --- a/ltdrv.c +++ b/ltdrv.c @@ -78,16 +78,11 @@ struct vuart_host_ops lt_uart_ops = { .sleep = NULL }; -static unsigned int init_vport(struct _ltmodem *ltdev) +static unsigned int init_vport(struct vuart_config *conf, struct _ltmodem *ltdev) { - struct vuart_config conf = { - .type = VUART_GENERIC, - .flags = VPF_INTERRUPT - }; - ltdev->host.ops = <_uart_ops; - return serial_v8250_register_port(&conf, <dev->host); + return serial_v8250_register_port(conf, <dev->host); } @@ -212,6 +207,12 @@ static void init_core(struct martian_metrics *mconf) struct _ltmodem *ltmodem_add (struct martian_metrics *metrics, int *error) { struct _ltmodem *dev = <modem; + struct vuart_config vconf = { + .type = VUART_GENERIC, + .flags = VPF_INTERRUPT, + .irq = metrics->irq, + .iobase = metrics->CommAddress + }; int ret; dev->irq = metrics->irq; @@ -236,7 +237,7 @@ struct _ltmodem *ltmodem_add (struct martian_metrics *metrics, int *error) INIT_DELAYED_WORK(&dev->work, work_func); init_core(metrics); //, dev); - dev->line = init_vport(dev); + dev->line = init_vport(&vconf, dev); pr_info("ltmodem: added device %x:%x, base=0x%x, comm=0x%x, irq=%d\n", metrics->vendor, metrics->device, diff --git a/v8250.c b/v8250.c index 77422a1..b422ad1 100644 --- a/v8250.c +++ b/v8250.c @@ -832,9 +832,9 @@ int serial_v8250_register_port(struct vuart_config *conf, struct vuart_host *hos uart->vtype = conf->type; uart->port.iotype = UPIO_PORT; - uart->port.iobase = 0xf0000000; /* imaginary ioport */ + uart->port.iobase = conf->iobase; uart->port.membase = 0; - uart->port.irq = 0; + uart->port.irq = conf->irq; uart->port.mapbase = 0; uart->port.uartclk = 921600 * 16; uart->port.regshift = 0; diff --git a/v8250.h b/v8250.h index cd22237..3d3ae11 100644 --- a/v8250.h +++ b/v8250.h @@ -1,6 +1,8 @@ struct vuart_config { unsigned int type; unsigned int flags; + unsigned int irq; + unsigned int iobase; }; struct vuart_host; -- 1.6.5.2