这篇教程C++ uart_set_options函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中uart_set_options函数的典型用法代码示例。如果您正苦于以下问题:C++ uart_set_options函数的具体用法?C++ uart_set_options怎么用?C++ uart_set_options使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了uart_set_options函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: netx_console_setupstatic int __initnetx_console_setup(struct console *co, char *options){ struct netx_port *sport; int baud = 9600; int bits = 8; int parity = 'n'; int flow = 'n'; /* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have * console support. */ if (co->index == -1 || co->index >= ARRAY_SIZE(netx_ports)) co->index = 0; sport = &netx_ports[co->index]; if (options) { uart_parse_options(options, &baud, &parity, &bits, &flow); } else { /* if the UART is enabled, assume it has been correctly setup * by the bootloader and get the options */ if (readl(sport->port.membase + UART_CR) & CR_UART_EN) { netx_console_get_options(&sport->port, &baud, &parity, &bits, &flow); } } return uart_set_options(&sport->port, co, baud, parity, bits, flow);}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:33,
示例2: bfin_serial_console_setupstatic int __initbfin_serial_console_setup(struct console *co, char *options){ struct bfin_serial_port *uart; int baud = 57600; int bits = 8; int parity = 'n';# ifdef CONFIG_SERIAL_BFIN_CTSRTS int flow = 'r';# else int flow = 'n';# endif /* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have * console support. */ if (co->index == -1 || co->index >= nr_active_ports) co->index = 0; uart = &bfin_serial_ports[co->index]; if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); else bfin_serial_console_get_options(uart, &baud, &parity, &bits); return uart_set_options(&uart->port, co, baud, parity, bits, flow);}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:29,
示例3: uart00_console_setupstatic int __init uart00_console_setup(struct console *co, char *options){ struct uart_port *port; int baud = 38400; int bits = 8; int parity = 'n'; int flow= 'n';#ifdef CONFIG_ARCH_CAMELOT /* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have * console support. */ port = &uart00_ports[0]; co->index = 0;#else return -ENODEV;#endif if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); else uart00_console_get_options(port, &baud, &parity, &bits); return uart_set_options(port, co, baud, parity, bits, flow);}
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:27,
示例4: pl011_console_setupstatic int __init pl011_console_setup(struct console *co, char *options){ struct uart_amba_port *uap; int baud = 38400; int bits = 8; int parity = 'n'; int flow = 'n'; int ret; /* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have * console support. */ if (co->index >= UART_NR) co->index = 0; uap = amba_ports[co->index]; uap->port.uartclk = clk_get_rate(uap->clk); if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); else pl011_console_get_options(uap, &baud, &parity, &bits); return uart_set_options(&uap->port, co, baud, parity, bits, flow);}
开发者ID:earthGavinLee,项目名称:hg556a_source,代码行数:27,
示例5: parrot5_serial_console_setupstatic int __init parrot5_serial_console_setup(struct console *co, char *options){ struct uart_parrot5_port *up; int baud = 115200; int bits = 8; int parity = 'n'; int flow = 'n'; /* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have * console support. */ if ((co->index < 0) || (co->index >= UART_NR)) { co->index = 0; } up = &p5_ports[co->index]; if (up->port.membase == NULL) return -ENODEV; up->console_active = 1; parrot5_serial_clk_enable(co->index); if (options) { uart_parse_options(options, &baud, &parity, &bits, &flow); } else { parrot5_serial_console_get_options(&up->port, &baud, &parity, &bits); } return uart_set_options(&up->port, co, baud, parity, bits, flow);}
开发者ID:khenam,项目名称:ardrone-kernel,代码行数:34,
示例6: apbuart_console_setupstatic int __init apbuart_console_setup(struct console *co, char *options){ struct uart_port *port; int baud = 38400; int bits = 8; int parity = 'n'; int flow = 'n'; pr_debug("apbuart_console_setup co=%p, co->index=%i, options=%s/n", co, co->index, options); if (co->index >= grlib_apbuart_port_nr) co->index = 0; port = &grlib_apbuart_ports[co->index]; spin_lock_init(&port->lock); if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); else apbuart_console_get_options(port, &baud, &parity, &bits); return uart_set_options(port, co, baud, parity, bits, flow);}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:25,
示例7: sa1100_console_setupstatic int __initsa1100_console_setup(struct console *co, char *options){ struct sa1100_port *sport; int baud = 9600; int bits = 8; int parity = 'n'; int flow = 'n'; /* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have * console support. */ if (co->index == -1 || co->index >= NR_PORTS) co->index = 0; sport = &sa1100_ports[co->index]; if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); else sa1100_console_get_options(sport, &baud, &parity, &bits); return uart_set_options(&sport->port, co, baud, parity, bits, flow);}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:25,
示例8: serial_ambarella_console_setupstatic int __init serial_ambarella_console_setup(struct console *co, char *options){ struct uart_port *port; int baud = 115200; int bits = 8; int parity = 'n'; int flow = 'n'; if (co->index < 0 || co->index >= ambarella_uart_ports.total_port_num) co->index = 0; port = (struct uart_port *)( ambarella_uart_ports.amba_port[co->index].port);#if !defined(CONFIG_PLAT_AMBARELLA_BOSS) ambarella_uart_ports.amba_port[co->index].set_pll();#endif port->uartclk = ambarella_uart_ports.amba_port[co->index].get_pll(); port->ops = &serial_ambarella_pops; port->private_data = &(ambarella_uart_ports.amba_port[co->index]); port->line = co->index; if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); return uart_set_options(port, co, baud, parity, bits, flow);}
开发者ID:WayWingsDev,项目名称:gopro-linux,代码行数:26,
示例9: at91_console_setupstatic int __init at91_console_setup(struct console *co, char *options){ struct uart_port *port; int baud = 115200; int bits = 8; int parity = 'n'; int flow = 'n'; /* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have * console support. */ port = uart_get_console(at91_ports, AT91_NR_UART, co); /* * Enable the serial console, in-case bootloader did not do it. */ at91_sys_write(AT91_PMC_PCER, 1 << port->irq); /* enable clock */ UART_PUT_IDR(port, -1); /* disable interrupts */ UART_PUT_CR(port, AT91_US_RSTSTA | AT91_US_RSTRX); UART_PUT_CR(port, AT91_US_TXEN | AT91_US_RXEN); if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); else at91_console_get_options(port, &baud, &parity, &bits); return uart_set_options(port, co, baud, parity, bits, flow);}
开发者ID:ena30,项目名称:snake-os,代码行数:30,
示例10: sbd_console_setupstatic int __init sbd_console_setup(struct console *co, char *options){ int chip = co->index / DUART_MAX_SIDE; int side = co->index % DUART_MAX_SIDE; struct sbd_port *sport = &sbd_duarts[chip].sport[side]; struct uart_port *uport = &sport->port; int baud = 115200; int bits = 8; int parity = 'n'; int flow = 'n'; int ret; if (!sport->duart) return -ENXIO; ret = sbd_map_port(uport); if (ret) return ret; sbd_init_port(sport); if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); return uart_set_options(uport, co, baud, parity, bits, flow);}
开发者ID:rrowicki,项目名称:Chrono_Kernel-1,代码行数:25,
示例11: serial8250_console_setupstatic int __init serial8250_console_setup(struct console *co, char *options){ struct uart_port *port; int baud = 9600; int bits = 8; int parity = 'n'; int flow = 'n'; /* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have * console support. */ if (co->index >= UART_NR) co->index = 0; port = &serial8250_ports[co->index].port; /* * Temporary fix. */ spin_lock_init(&port->lock); if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); return uart_set_options(port, co, baud, parity, bits, flow);}
开发者ID:gnensis,项目名称:linux-2.6.15,代码行数:27,
示例12: asc_console_setupstatic int asc_console_setup(struct console *co, char *options){ struct asc_port *ascport; int baud = 115200; int bits = 8; int parity = 'n'; int flow = 'n'; if (co->index >= ASC_MAX_PORTS) return -ENODEV; ascport = &asc_ports[co->index]; /* * This driver does not support early console initialization * (use ARM early printk support instead), so we only expect * this to be called during the uart port registration when the * driver gets probed and the port should be mapped at that point. */ if (ascport->port.mapbase == 0 || ascport->port.membase == NULL) return -ENXIO; if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); return uart_set_options(&ascport->port, co, baud, parity, bits, flow);}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:27,
示例13: apbuart_console_setupstatic int __init apbuart_console_setup(struct console *co, char *options){ struct uart_port *port; int baud = 38400; int bits = 8; int parity = 'n'; int flow = 'n'; pr_debug("apbuart_console_setup co=%p, co->index=%i, options=%s/n", co, co->index, options); /* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have * console support. */ if (co->index >= grlib_apbuart_port_nr) co->index = 0; port = &grlib_apbuart_ports[co->index]; spin_lock_init(&port->lock); if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); else apbuart_console_get_options(port, &baud, &parity, &bits); return uart_set_options(port, co, baud, parity, bits, flow);}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:30,
示例14: dz_console_setupstatic int __init dz_console_setup(struct console *co, char *options){ struct dz_port *dport = &dz_ports[CONSOLE_LINE]; int baud = 9600; int bits = 8; int parity = 'n'; int flow = 'n'; int ret; unsigned short mask, tmp; if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); dz_reset(dport); ret = uart_set_options(&dport->port, co, baud, parity, bits, flow); if (ret == 0) { mask = 1 << dport->port.line; tmp = dz_in(dport, DZ_TCR); /* read the TX flag */ if (!(tmp & mask)) { tmp |= mask; /* set the TX flag */ dz_out(dport, DZ_TCR, tmp); } } return ret;}
开发者ID:OpenHMR,项目名称:Open-HMR600,代码行数:27,
示例15: auart_console_setupstatic int __initauart_console_setup(struct console *co, char *options){ struct mxs_auart_port *s; int baud = 9600; int bits = 8; int parity = 'n'; int flow = 'n'; int ret; /* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have * console support. */ if (co->index == -1 || co->index >= ARRAY_SIZE(auart_port)) co->index = 0; s = auart_port[co->index]; if (!s) return -ENODEV; clk_enable(s->clk); if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); else auart_console_get_options(&s->port, &baud, &parity, &bits); ret = uart_set_options(&s->port, co, baud, parity, bits, flow); clk_disable(s->clk); return ret;}
开发者ID:maikelwever,项目名称:android_kernel_htc_msm8660-caf,代码行数:34,
示例16: ulite_console_setupstatic int ulite_console_setup(struct console *co, char *options){ struct uart_port *port; int baud = 9600; int bits = 8; int parity = 'n'; int flow = 'n'; if (co->index < 0 || co->index >= ULITE_NR_UARTS) return -EINVAL; port = &ulite_ports[co->index]; /* Has the device been initialized yet? */ if (!port->mapbase) { pr_debug("console on ttyUL%i not present/n", co->index); return -ENODEV; } /* not initialized yet? */ if (!port->membase) { if (ulite_request_port(port)) return -ENODEV; } if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); return uart_set_options(port, co, baud, parity, bits, flow);}
开发者ID:vucan,项目名称:linux,代码行数:30,
示例17: sirfsoc_uart_console_setupstatic int __initsirfsoc_uart_console_setup(struct console *co, char *options){ unsigned int baud = 115200; unsigned int bits = 8; unsigned int parity = 'n'; unsigned int flow = 'n'; struct uart_port *port = &sirfsoc_uart_ports[co->index].port; struct sirfsoc_uart_port *sirfport = to_sirfport(port); struct sirfsoc_register *ureg = &sirfport->uart_reg->uart_reg; if (co->index < 0 || co->index >= SIRFSOC_UART_NR) return -EINVAL; if (!port->mapbase) return -ENODEV; /* enable usp in mode1 register */ if (sirfport->uart_reg->uart_type == SIRF_USP_UART) wr_regl(port, ureg->sirfsoc_mode1, SIRFSOC_USP_EN | SIRFSOC_USP_ENDIAN_CTRL_LSBF); if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); port->cons = co; /* default console tx/rx transfer using io mode */ sirfport->rx_dma_chan = NULL; sirfport->tx_dma_chan = NULL; return uart_set_options(port, co, baud, parity, bits, flow);}
开发者ID:19Dan01,项目名称:linux,代码行数:29,
示例18: sw_console_setupstatic int __init sw_console_setup(struct console *co, char *options){ struct uart_port *port = NULL; struct sw_uart_port *sw_uport; int baud = 115200; int bits = 8; int parity = 'n'; int flow = 'n'; if (unlikely(co->index >= SUNXI_UART_NUM || co->index < 0)) return -ENXIO; port = sw_console_get_port(co); if (port == NULL) return -ENODEV; sw_uport = UART_TO_SPORT(port); if (!port->iobase && !port->membase) return -ENODEV; if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); SERIAL_MSG("console setup baud %d parity %c bits %d, flow %c/n", baud, parity, bits, flow); return uart_set_options(port, co, baud, parity, bits, flow);}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:26,
示例19: cpm_uart_console_setup/* * Setup console. Be careful is called early ! */static int __init cpm_uart_console_setup(struct console *co, char *options){ struct uart_port *port; struct uart_cpm_port *pinfo; int baud = 38400; int bits = 8; int parity = 'n'; int flow = 'n'; int ret; port = (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; pinfo = (struct uart_cpm_port *)port; pinfo->flags |= FLAG_CONSOLE; if (options) { uart_parse_options(options, &baud, &parity, &bits, &flow); } else { bd_t *bd = (bd_t *) __res; if (bd->bi_baudrate) baud = bd->bi_baudrate; else baud = 9600; } /* * Setup any port IO, connect any baud rate generators, * etc. This is expected to be handled by board * dependant code */ if (pinfo->set_lineif) pinfo->set_lineif(pinfo); if (IS_SMC(pinfo)) { pinfo->smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX); pinfo->smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); } else { pinfo->sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX); pinfo->sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT); } ret = cpm_uart_allocbuf(pinfo, 1); if (ret) return ret; cpm_uart_initbd(pinfo); if (IS_SMC(pinfo)) cpm_uart_init_smc(pinfo); else cpm_uart_init_scc(pinfo); uart_set_options(port, co, baud, parity, bits, flow); return 0;}
开发者ID:ena30,项目名称:snake-os,代码行数:62,
示例20: genode_console_setupstatic int __initgenode_console_setup(struct console *co, char *options) { struct uart_port *up; if (co->index >= 1 + MAX_PORTS) co->index = 0; up = &genode_serial_port[co->index].port; if (!up) return -ENODEV; return uart_set_options(up, co, 115200, 'n', 8, 'n');}
开发者ID:OhMeadhbh,项目名称:genode,代码行数:12,
示例21: pmz_console_setup/* * Setup the serial console */static int __init pmz_console_setup(struct console *co, char *options){ struct uart_pmac_port *uap; struct uart_port *port; int baud = 38400; int bits = 8; int parity = 'n'; int flow = 'n'; unsigned long pwr_delay; /* * XServe's default to 57600 bps */ if (machine_is_compatible("RackMac1,1") || machine_is_compatible("RackMac1,2") || machine_is_compatible("MacRISC4")) baud = 57600; /* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have * console support. */ if (co->index >= pmz_ports_count) co->index = 0; uap = &pmz_ports[co->index]; if (uap->node == NULL) return -ENODEV; port = &uap->port; /* * Mark port as beeing a console */ uap->flags |= PMACZILOG_FLAG_IS_CONS; /* * Temporary fix for uart layer who didn't setup the spinlock yet */ spin_lock_init(&port->lock); /* * Enable the hardware */ pwr_delay = __pmz_startup(uap); if (pwr_delay) mdelay(pwr_delay); if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); return uart_set_options(port, co, baud, parity, bits, flow);}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:55,
示例22: uart_clps711x_console_setupstatic int uart_clps711x_console_setup(struct console *co, char *options){ int baud = 38400, bits = 8, parity = 'n', flow = 'n'; struct clps711x_port *s = (struct clps711x_port *)co->data; struct uart_port *port = &s->port[(co->index > 0) ? co->index : 0]; if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); else uart_clps711x_console_get_options(port, &baud, &parity, &bits); return uart_set_options(port, co, baud, parity, bits, flow);}
开发者ID:AdrianHuang,项目名称:linux-3.8.13,代码行数:13,
示例23: msm_hsl_console_setupstatic int __init msm_hsl_console_setup(struct console *co, char *options){ struct uart_port *port; int baud, flow, bits, parity; int ret; if (unlikely(co->index >= UART_NR || co->index < 0)) return -ENXIO; port = get_port_from_line(co->index); if (unlikely(!port->membase)) return -ENXIO; port->cons = co; pm_runtime_get_noresume(port->dev);#ifndef CONFIG_PM_RUNTIME msm_hsl_init_clock(port);#endif pm_runtime_resume(port->dev); if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); bits = 8; parity = 'n'; flow = 'n'; msm_hsl_write(port, UARTDM_MR2_BITS_PER_CHAR_8 | STOP_BIT_ONE, UARTDM_MR2_ADDR); /* 8N1 */ if (baud < 300 || baud > 115200) baud = 115200; msm_hsl_set_baud_rate(port, baud); ret = uart_set_options(port, co, baud, parity, bits, flow); msm_hsl_reset(port); /* Enable transmitter */ msm_hsl_write(port, CR_PROTECTION_EN, UARTDM_CR_ADDR); msm_hsl_write(port, UARTDM_CR_TX_EN_BMSK, UARTDM_CR_ADDR); printk(KERN_INFO "msm_serial_hsl: console setup on port #%d/n", port->line); console_uart_port = port; b_terminal_onoff = 0; return ret;}
开发者ID:victor2002,项目名称:a770k_kernel,代码行数:50,
示例24: tct_console_setupstatic int __init tct_console_setup(struct console *co, char *options){ struct uart_port *port = &tctuart_ports[co->index]; int baud = 115200; int bits = 8; int parity = 'n'; int flow = 'n'; if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); return uart_set_options(port, co, baud, parity, bits, flow);}
开发者ID:meriororen,项目名称:linux-2.6,代码行数:14,
示例25: dz_console_setupstatic int __init dz_console_setup(struct console *co, char *options){ struct dz_port *dport = &dz_ports[co->index]; int baud = 9600; int bits = 8; int parity = 'n'; int flow = 'n'; if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); dz_reset(dport); return uart_set_options(&dport->port, co, baud, parity, bits, flow);}
开发者ID:ivucica,项目名称:linux,代码行数:15,
示例26: sc26xx_console_setupstatic int __init sc26xx_console_setup(struct console *con, char *options){ struct uart_port *port = sc26xx_port; int baud = 9600; int bits = 8; int parity = 'n'; int flow = 'n'; if (port->type != PORT_SC26XX) return -1; printk(KERN_INFO "Console: ttySC%d (SC26XX)/n", con->index); if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); return uart_set_options(port, con, baud, parity, bits, flow);}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:17,
注:本文中的uart_set_options函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ uart_setreg函数代码示例 C++ uart_send函数代码示例 |