Re: [PATCH 2/6] irqchip/irq-pruss-intc: Add a PRUSS irqchip driver for PRUSS interrupts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/16/19 12:21 PM, Suman Anna wrote:
+static int pruss_intc_probe(struct platform_device *pdev)
+{
+    static const char * const irq_names[] = {
+                "host0", "host1", "host2", "host3",
+                "host4", "host5", "host6", "host7", };
+    struct device *dev = &pdev->dev;
+    struct pruss_intc *intc;
+    struct resource *res;
+    struct irq_chip *irqchip;
+    int i, irq;
+
+    intc = devm_kzalloc(dev, sizeof(*intc), GFP_KERNEL);
+    if (!intc)
+        return -ENOMEM;
+    platform_set_drvdata(pdev, intc);
+
+    res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+    intc->base = devm_ioremap_resource(dev, res);
+    if (IS_ERR(intc->base)) {
+        dev_err(dev, "failed to parse and map intc memory resource\n");
+        return PTR_ERR(intc->base);
+    }
+
+    dev_dbg(dev, "intc memory: pa %pa size 0x%zx va %pK\n", &res->start,
+        (size_t)resource_size(res), intc->base);
+
+    mutex_init(&intc->lock);
+
+    pruss_intc_init(intc);
+
+    irqchip = devm_kzalloc(dev, sizeof(*irqchip), GFP_KERNEL);
+    if (!irqchip)
+        return -ENOMEM;
+
+    irqchip->irq_ack = pruss_intc_irq_ack;
+    irqchip->irq_mask = pruss_intc_irq_mask;
+    irqchip->irq_unmask = pruss_intc_irq_unmask;
+    irqchip->irq_retrigger = pruss_intc_irq_retrigger;
+    irqchip->irq_request_resources = pruss_intc_irq_reqres;
+    irqchip->irq_release_resources = pruss_intc_irq_relres;
+    irqchip->name = dev_name(dev);

Should we also set `irqchip->parent_device = dev;` here?

I tried it and had to add pm runtime stuff as well, otherwise
requesting irqs would fail.

I haven't seen any during my local testing. What sort of failure are you
seeing?

The clocking for the overall PRUSS module will be handled in either the
ti-sysc driver for OMAP SoCs or in the pruss platform driver.

I was getting -EACCESS bubbling up from rpm_resume() in drivers/base/
power/runtime.c. It was probably a mix of how I set up the device tree
and the dummy PRUSS bus driver I made.

I'm sure it will be fine with a proper PRUSS platform driver.



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux