mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* regmap-irq.c: correct way to unmask interrupt in driver?
@ 2025-03-13 13:28 Dzmitry Sankouski
  0 siblings, 0 replies; only message in thread
From: Dzmitry Sankouski @ 2025-03-13 13:28 UTC (permalink / raw)
  To: broonie; +Cc: linux-kernel

My device interrupts is described with `struct regmap_irq_chip` and
`struct regmap_irq` [1]. After driver probe, all interrupts is masked by
`regmap_add_irq_chip_fwnode` function.

I tried to unmask by writing INT_A_ENABLE_L_REG, and interrupt is unmasked
and fired, but it is NOT cleared, i.e. INT_A_CLEAR_L_REG is not written. It
happens, because `regmap_irq_thread` still thinks that interrupt is masked.

What is a correct way to unmask?

[1]: device interrupts declarations:

```
static const struct regmap_irq p9320_irqs_a[] = {
	{ .mask = IRQA_H_TRX_DATA_RECEIVED_MASK, .reg_offset = 1 },
	{ .mask = IRQA_H_TX_OCP_MASK, .reg_offset = 1 },
	{ .mask = IRQA_H_TX_MODE_RX_NOT_DET_MASK, .reg_offset = 1 },
	{ .mask = IRQA_H_TX_FOD_MASK, .reg_offset = 1 },
	{ .mask = IRQA_H_TX_CON_DISCON_MASK, .reg_offset = 1 },
	{ .mask = IRQA_H_AC_MISSING_DET_MASK, .reg_offset = 1 },
	{ .mask = IRQA_H_ADT_RECEIVED_MASK, .reg_offset = 1 },
	{ .mask = IRQA_H_ADT_SENT_MASK, .reg_offset = 1 },
	{ .mask = IRQA_L_STAT_VOUT_MASK },
	{ .mask = IRQA_L_STAT_VRECT_MASK },
	{ .mask = IRQA_L_OP_MODE_MASK },
	{ .mask = IRQA_L_OVER_VOL_MASK },
	{ .mask = IRQA_L_OVER_CURR_MASK },
	{ .mask = IRQA_L_OVER_TEMP_MASK },
	{ .mask = IRQA_L_TXCONFLICT_MASK },
	{ .mask = IRQA_L_RESERVED0_MASK },
};

static struct regmap_irq_chip idt_p9320_charger_irq_a_chip = {
	.name			= "wpc-irq-a",
	.status_base		= INT_A_L_REG,
	.unmask_base		= INT_A_ENABLE_L_REG,
	.ack_base		= INT_A_CLEAR_L_REG,
	.handle_pre_irq	=	mfc_wpc_irq_thread,
	.handle_post_irq	= mfc_wpc_post_irq_thread,
	.num_regs		= 2,
	.irqs			= p9320_irqs_a,
	.num_irqs		= ARRAY_SIZE(p9320_irqs_a),
};
```

best regards, Dzmitry

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-03-13 13:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-13 13:28 regmap-irq.c: correct way to unmask interrupt in driver? Dzmitry Sankouski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®