@@ -69,8 +69,10 @@ static void mt6397_irq_sync_unlock(struct irq_data *data)
6969{
7070 struct mt6397_chip * mt6397 = irq_data_get_irq_chip_data (data );
7171
72- regmap_write (mt6397 -> regmap , MT6397_INT_CON0 , mt6397 -> irq_masks_cur [0 ]);
73- regmap_write (mt6397 -> regmap , MT6397_INT_CON1 , mt6397 -> irq_masks_cur [1 ]);
72+ regmap_write (mt6397 -> regmap , mt6397 -> int_con [0 ],
73+ mt6397 -> irq_masks_cur [0 ]);
74+ regmap_write (mt6397 -> regmap , mt6397 -> int_con [1 ],
75+ mt6397 -> irq_masks_cur [1 ]);
7476
7577 mutex_unlock (& mt6397 -> irqlock );
7678}
@@ -147,8 +149,8 @@ static irqreturn_t mt6397_irq_thread(int irq, void *data)
147149{
148150 struct mt6397_chip * mt6397 = data ;
149151
150- mt6397_irq_handle_reg (mt6397 , MT6397_INT_STATUS0 , 0 );
151- mt6397_irq_handle_reg (mt6397 , MT6397_INT_STATUS1 , 16 );
152+ mt6397_irq_handle_reg (mt6397 , mt6397 -> int_status [ 0 ] , 0 );
153+ mt6397_irq_handle_reg (mt6397 , mt6397 -> int_status [ 1 ] , 16 );
152154
153155 return IRQ_HANDLED ;
154156}
@@ -177,8 +179,8 @@ static int mt6397_irq_init(struct mt6397_chip *mt6397)
177179 mutex_init (& mt6397 -> irqlock );
178180
179181 /* Mask all interrupt sources */
180- regmap_write (mt6397 -> regmap , MT6397_INT_CON0 , 0x0 );
181- regmap_write (mt6397 -> regmap , MT6397_INT_CON1 , 0x0 );
182+ regmap_write (mt6397 -> regmap , mt6397 -> int_con [ 0 ] , 0x0 );
183+ regmap_write (mt6397 -> regmap , mt6397 -> int_con [ 1 ] , 0x0 );
182184
183185 mt6397 -> irq_domain = irq_domain_add_linear (mt6397 -> dev -> of_node ,
184186 MT6397_IRQ_NR , & mt6397_irq_domain_ops , mt6397 );
@@ -203,8 +205,8 @@ static int mt6397_irq_suspend(struct device *dev)
203205{
204206 struct mt6397_chip * chip = dev_get_drvdata (dev );
205207
206- regmap_write (chip -> regmap , MT6397_INT_CON0 , chip -> wake_mask [0 ]);
207- regmap_write (chip -> regmap , MT6397_INT_CON1 , chip -> wake_mask [1 ]);
208+ regmap_write (chip -> regmap , chip -> int_con [ 0 ] , chip -> wake_mask [0 ]);
209+ regmap_write (chip -> regmap , chip -> int_con [ 1 ] , chip -> wake_mask [1 ]);
208210
209211 enable_irq_wake (chip -> irq );
210212
@@ -215,8 +217,8 @@ static int mt6397_irq_resume(struct device *dev)
215217{
216218 struct mt6397_chip * chip = dev_get_drvdata (dev );
217219
218- regmap_write (chip -> regmap , MT6397_INT_CON0 , chip -> irq_masks_cur [0 ]);
219- regmap_write (chip -> regmap , MT6397_INT_CON1 , chip -> irq_masks_cur [1 ]);
220+ regmap_write (chip -> regmap , chip -> int_con [ 0 ] , chip -> irq_masks_cur [0 ]);
221+ regmap_write (chip -> regmap , chip -> int_con [ 1 ] , chip -> irq_masks_cur [1 ]);
220222
221223 disable_irq_wake (chip -> irq );
222224
@@ -237,6 +239,11 @@ static int mt6397_probe(struct platform_device *pdev)
237239 return - ENOMEM ;
238240
239241 mt6397 -> dev = & pdev -> dev ;
242+ mt6397 -> int_con [0 ] = MT6397_INT_CON0 ;
243+ mt6397 -> int_con [1 ] = MT6397_INT_CON1 ;
244+ mt6397 -> int_status [0 ] = MT6397_INT_STATUS0 ;
245+ mt6397 -> int_status [1 ] = MT6397_INT_STATUS1 ;
246+
240247 /*
241248 * mt6397 MFD is child device of soc pmic wrapper.
242249 * Regmap is set from its parent.
0 commit comments