File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1078,7 +1078,7 @@ static int bcm_iproc_i2c_unreg_slave(struct i2c_client *slave)
1078
1078
if (!iproc_i2c -> slave )
1079
1079
return - EINVAL ;
1080
1080
1081
- iproc_i2c -> slave = NULL ;
1081
+ disable_irq ( iproc_i2c -> irq ) ;
1082
1082
1083
1083
/* disable all slave interrupts */
1084
1084
tmp = iproc_i2c_rd_reg (iproc_i2c , IE_OFFSET );
@@ -1091,6 +1091,17 @@ static int bcm_iproc_i2c_unreg_slave(struct i2c_client *slave)
1091
1091
tmp &= ~BIT (S_CFG_EN_NIC_SMB_ADDR3_SHIFT );
1092
1092
iproc_i2c_wr_reg (iproc_i2c , S_CFG_SMBUS_ADDR_OFFSET , tmp );
1093
1093
1094
+ /* flush TX/RX FIFOs */
1095
+ tmp = (BIT (S_FIFO_RX_FLUSH_SHIFT ) | BIT (S_FIFO_TX_FLUSH_SHIFT ));
1096
+ iproc_i2c_wr_reg (iproc_i2c , S_FIFO_CTRL_OFFSET , tmp );
1097
+
1098
+ /* clear all pending slave interrupts */
1099
+ iproc_i2c_wr_reg (iproc_i2c , IS_OFFSET , ISR_MASK_SLAVE );
1100
+
1101
+ iproc_i2c -> slave = NULL ;
1102
+
1103
+ enable_irq (iproc_i2c -> irq );
1104
+
1094
1105
return 0 ;
1095
1106
}
1096
1107
You can’t perform that action at this time.
0 commit comments