mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
regmap: Add no_status support
This patch adds support for devices which don't support readback of individual interrupt statuses, we report all interrupts as firing and hope the consumers do the right thing. -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmQRx7wACgkQJNaLcl1U h9D/Nwf+LDKUehiKE+mAaNum7sLGMiemhcBGZp+sCeFpoFq/K5eq3LA+/M+Av3Zj l92xCxytRX7duHuPgMq+EBOuX4vz5whso11Oz4zRsIicyz7yWn2o2ZkiNsX1Y3lT 5TKVLjK1Kmj8lFGbEr/qJyWGrrhZ1HHdsUDz6H0zAri2x+gqU2eL8SsHNTeJjK1/ 18BBZX1xvaICcBqcKUKNzBGDJyowS0/ILHp4zpY3Jjw5gsO9QSQjG7SVmvaNapO8 D60r+v96RQTc+t+dlOb7mbwZBz0VOo5HiMhTieWSfgQ2Bo2nbAkR+X2vpbI3la0U 6Od7pBU5U26C536Y2K9AEhSUa19Kjw== =EIv8 -----END PGP SIGNATURE----- Merge tag 'regmap-no-status' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into gpio/for-next regmap: Add no_status support This patch adds support for devices which don't support readback of individual interrupt statuses, we report all interrupts as firing and hope the consumers do the right thing.
This commit is contained in:
commit
ae5ae35467
|
|
@ -433,7 +433,10 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
|
|||
* possible in order to reduce the I/O overheads.
|
||||
*/
|
||||
|
||||
if (chip->num_main_regs) {
|
||||
if (chip->no_status) {
|
||||
/* no status register so default to all active */
|
||||
memset32(data->status_buf, GENMASK(31, 0), chip->num_regs);
|
||||
} else if (chip->num_main_regs) {
|
||||
unsigned int max_main_bits;
|
||||
unsigned long size;
|
||||
|
||||
|
|
@ -949,12 +952,17 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
|
|||
continue;
|
||||
|
||||
/* Ack masked but set interrupts */
|
||||
reg = d->get_irq_reg(d, d->chip->status_base, i);
|
||||
ret = regmap_read(map, reg, &d->status_buf[i]);
|
||||
if (ret != 0) {
|
||||
dev_err(map->dev, "Failed to read IRQ status: %d\n",
|
||||
ret);
|
||||
goto err_alloc;
|
||||
if (d->chip->no_status) {
|
||||
/* no status register so default to all active */
|
||||
d->status_buf[i] = GENMASK(31, 0);
|
||||
} else {
|
||||
reg = d->get_irq_reg(d, d->chip->status_base, i);
|
||||
ret = regmap_read(map, reg, &d->status_buf[i]);
|
||||
if (ret != 0) {
|
||||
dev_err(map->dev, "Failed to read IRQ status: %d\n",
|
||||
ret);
|
||||
goto err_alloc;
|
||||
}
|
||||
}
|
||||
|
||||
if (chip->status_invert)
|
||||
|
|
|
|||
|
|
@ -1567,6 +1567,7 @@ struct regmap_irq_chip_data;
|
|||
* the need for a @sub_reg_offsets table.
|
||||
* @status_invert: Inverted status register: cleared bits are active interrupts.
|
||||
* @runtime_pm: Hold a runtime PM lock on the device when accessing it.
|
||||
* @no_status: No status register: all interrupts assumed generated by device.
|
||||
*
|
||||
* @num_regs: Number of registers in each control bank.
|
||||
* @irqs: Descriptors for individual IRQs. Interrupt numbers are
|
||||
|
|
@ -1631,6 +1632,7 @@ struct regmap_irq_chip {
|
|||
unsigned int clear_on_unmask:1;
|
||||
unsigned int not_fixed_stride:1;
|
||||
unsigned int status_invert:1;
|
||||
unsigned int no_status:1;
|
||||
|
||||
int num_regs;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user