From: John Jacques <john.jacq...@lsi.com>

The MTC status registers are not cleared by a reset.  So, clear them
during driver initialization.

Signed-off-by: John Jacques <john.jacq...@lsi.com>
---
 drivers/misc/lsi-mtc.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/lsi-mtc.c b/drivers/misc/lsi-mtc.c
index ebbdac8..8e1ae77 100644
--- a/drivers/misc/lsi-mtc.c
+++ b/drivers/misc/lsi-mtc.c
@@ -2731,6 +2731,7 @@ mtc_dev_ioctl(struct file *filp, unsigned int cmd, 
unsigned long arg)
                {
                        struct ncp_axis_mtc_MTC_CONFIG0_REG_ADDR_r_t cfg0 = { 0 
};
                        int start_stop;
+
                        if (copy_from_user
                            ((void *)&start_stop, (void *)arg, sizeof(int))) {
                                printk(KERN_DEBUG "MTC Error ioctl\n");
@@ -2740,6 +2741,10 @@ mtc_dev_ioctl(struct file *filp, unsigned int cmd, 
unsigned long arg)
                        if ((start_stop != 0) && (start_stop != 1))
                                return -EINVAL;
 
+                       /* clear interrupt status before hit start */
+                       if (start_stop == 1)
+                               dev->regs->int_status = 0x7f;
+
                        cfg0 =
                            *((struct ncp_axis_mtc_MTC_CONFIG0_REG_ADDR_r_t *)
                              &(dev->regs->config0));
@@ -3080,6 +3085,8 @@ static long _mtc_config(struct mtc_device *dev, struct 
lsi_mtc_cfg_t *pMTCCfg)
               dev->regs->config1, dev->regs->execute);
 
 #endif
-       /* test */
+       /* clear ecc interrupt status */
+       dev->regs->ecc_int_status = 0xf;
+
        return 0;
 }
-- 
1.7.9.5

-- 
_______________________________________________
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto

Reply via email to