Closed giuliomoro closed 5 years ago
These could help:
//#include <linux/irqnr.h>
//extern struct irq_desc *irq_to_desc(unsigned int irq);
//desc->irq_data
// irqd_irq_masked(&desc->irq_data)
//kernel/irq/internals.h,
//void mask_irq(struct irq_desc *desc)
//void unmask_irq(struct irq_desc *desc)
Otherwise, just (unsafely?) memmap and write to the set register (as it's currently done from core/PRU.cpp
).
so, the IRQ channels are declared in dtb-rebuilder/src/arm/am33xx.dtsi
:
mcasp0: mcasp@48038000 {
compatible = "ti,am33xx-mcasp-audio";
ti,hwmods = "mcasp0";
reg = <0x48038000 0x2000>,
<0x46000000 0x400000>;
reg-names = "mpu", "dat";
interrupts = <80>, <81>;
interrupt-names = "tx", "rx";
status = "disabled";
dmas = <&edma 8 2>,
<&edma 9 2>;
dma-names = "tx", "rx";
};
The driver sound/soc/davinci/davinci-mcasp.c
retrieves the interrupt numbers from the device tree:
calling platform_get_irq_byname(pdev, "rx");
and platform_get_irq_byname(pdev, "tx");
and does not complain if such irq names are not declared ( in fact the documentation says that they are optional).
I think the correct solution would therefore be to remove the interrupt-names
property, so that the driver will not be able to retrieve the interrupt numbers and thus it will not unmask those interrupts. However, I cannot find docs on how to delete properties from device-tree overlays (it should be possible from a device tree with, e.g.: /delete-property/interrupt-names;
), so my second best option is to add
interrupt-names = "dummytx", "dummyrx";
in the dtbo. This is tested and works ok.
@LBDonovan @henrix do you see anything wrong with the above?
Side note: the driver itself simply toggles the interrupt mask bits (calling mcasp_set_bits()
, which in turn does a raw write), instead of calling any of the specific kernel functions mentioned above. Maybe it assumes that it will be the only driver to toggle those very bits?
Aa suggested by @henrix: