[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1342179194-728-2-git-send-email-siglesias@igalia.com>
Date: Fri, 13 Jul 2012 13:33:14 +0200
From: Samuel Iglesias Gonsálvez
<siglesias@...lia.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Samuel Iglesias Gonsálvez
<siglesias@...lia.com>, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] 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: Samuel Iglesias Gonsálvez <siglesias@...lia.com>
---
drivers/staging/ipack/devices/ipoctal.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/staging/ipack/devices/ipoctal.c b/drivers/staging/ipack/devices/ipoctal.c
index a1aae40..fd0e301 100644
--- a/drivers/staging/ipack/devices/ipoctal.c
+++ b/drivers/staging/ipack/devices/ipoctal.c
@@ -411,6 +411,20 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
for (i = 0; i < NR_CHANNELS ; i++) {
ipoctal_write_io_reg(ipoctal, &ipoctal->chan_regs[i].u.w.cr,
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++) {
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists