提交 4eed84a8 编写于 作者: S Samuel Iglesias Gonsálvez 提交者: Greg Kroah-Hartman

Staging: ipack/devices/ipoctal: initialize the device in probe function

Initialize the device when registering it. Sometimes the user access to it
and the device is in an unknown state, so it could fail.
Signed-off-by: NSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 1337b07e
...@@ -411,6 +411,20 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, ...@@ -411,6 +411,20 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
for (i = 0; i < NR_CHANNELS ; i++) { for (i = 0; i < NR_CHANNELS ; i++) {
ipoctal_write_io_reg(ipoctal, &ipoctal->chan_regs[i].u.w.cr, ipoctal_write_io_reg(ipoctal, &ipoctal->chan_regs[i].u.w.cr,
CR_DISABLE_RX | CR_DISABLE_TX); CR_DISABLE_RX | CR_DISABLE_TX);
ipoctal_write_cr_cmd(ipoctal, &ipoctal->chan_regs[i].u.w.cr,
CR_CMD_RESET_RX);
ipoctal_write_cr_cmd(ipoctal, &ipoctal->chan_regs[i].u.w.cr,
CR_CMD_RESET_TX);
ipoctal_write_io_reg(ipoctal,
&ipoctal->chan_regs[i].u.w.mr,
MR1_CHRL_8_BITS | MR1_ERROR_CHAR |
MR1_RxINT_RxRDY); /* mr1 */
ipoctal_write_io_reg(ipoctal,
&ipoctal->chan_regs[i].u.w.mr,
0); /* mr2 */
ipoctal_write_io_reg(ipoctal,
&ipoctal->chan_regs[i].u.w.csr,
TX_CLK_9600 | RX_CLK_9600);
} }
for (i = 0; i < IP_OCTAL_NB_BLOCKS; i++) { for (i = 0; i < IP_OCTAL_NB_BLOCKS; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册