~ubuntu-branches/ubuntu/karmic/linux-mvl-dove/karmic-proposed

« back to all changes in this revision

Viewing changes to drivers/usb/serial/spcp8x5.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Bader
  • Date: 2010-03-10 22:24:12 UTC
  • mto: (15.1.2 karmic-security)
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20100310222412-k86m3r53jw0je7x1
Tags: upstream-2.6.31
ImportĀ upstreamĀ versionĀ 2.6.31

Show diffs side-by-side

added added

removed removed

Lines of Context:
299
299
        wait_queue_head_t       delta_msr_wait;
300
300
        u8                      line_control;
301
301
        u8                      line_status;
 
302
        u8                      termios_initialized;
302
303
};
303
304
 
304
305
/* desc : when device plug in,this function would be called.
497
498
                dev_dbg(&port->dev, "usb_unlink_urb(read_urb) = %d\n", result);
498
499
}
499
500
 
500
 
static void spcp8x5_init_termios(struct tty_struct *tty)
501
 
{
502
 
        /* for the 1st time call this function */
503
 
        *(tty->termios) = tty_std_termios;
504
 
        tty->termios->c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL;
505
 
        tty->termios->c_ispeed = 115200;
506
 
        tty->termios->c_ospeed = 115200;
507
 
}
508
 
 
509
501
/* set the serial param for transfer. we should check if we really need to
510
502
 * transfer. if we set flow control we should do this too. */
511
503
static void spcp8x5_set_termios(struct tty_struct *tty,
522
514
        int i;
523
515
        u8 control;
524
516
 
 
517
        /* for the 1st time call this function */
 
518
        spin_lock_irqsave(&priv->lock, flags);
 
519
        if (!priv->termios_initialized) {
 
520
                *(tty->termios) = tty_std_termios;
 
521
                tty->termios->c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL;
 
522
                tty->termios->c_ispeed = 115200;
 
523
                tty->termios->c_ospeed = 115200;
 
524
                priv->termios_initialized = 1;
 
525
        }
 
526
        spin_unlock_irqrestore(&priv->lock, flags);
525
527
 
526
528
        /* check that they really want us to change something */
527
529
        if (!tty_termios_hw_change(tty->termios, old_termios))
1009
1011
        .carrier_raised         = spcp8x5_carrier_raised,
1010
1012
        .write                  = spcp8x5_write,
1011
1013
        .set_termios            = spcp8x5_set_termios,
1012
 
        .init_termios           = spcp8x5_init_termios,
1013
1014
        .ioctl                  = spcp8x5_ioctl,
1014
1015
        .tiocmget               = spcp8x5_tiocmget,
1015
1016
        .tiocmset               = spcp8x5_tiocmset,