writel_relaxed(0, dcrtc->base + LCD_SPU_IRQ_ENA);
+ of_node_put(dcrtc->crtc.port);
+
kfree(dcrtc);
}
}
int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
- struct resource *res, int irq, const struct armada_variant *variant)
+ struct resource *res, int irq, const struct armada_variant *variant,
+ struct device_node *port)
{
struct armada_private *priv = drm->dev_private;
struct armada_crtc *dcrtc;
priv->dcrtc[dcrtc->num] = dcrtc;
+ dcrtc->crtc.port = port;
drm_crtc_init(drm, &dcrtc->crtc, &armada_crtc_funcs);
drm_crtc_helper_add(&dcrtc->crtc, &armada_crtc_helper_funcs);
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
int irq = platform_get_irq(pdev, 0);
const struct armada_variant *variant;
+ struct device_node *port = NULL;
if (irq < 0)
return irq;
variant = (const struct armada_variant *)id->driver_data;
} else {
const struct of_device_id *match;
+ struct device_node *np, *parent = dev->of_node;
match = of_match_device(dev->driver->of_match_table, dev);
if (!match)
return -ENXIO;
+ np = of_get_child_by_name(parent, "ports");
+ if (np)
+ parent = np;
+ port = of_get_child_by_name(parent, "port");
+ of_node_put(np);
+ if (!port) {
+ dev_err(dev, "no port node found in %s\n",
+ parent->full_name);
+ return -ENXIO;
+ }
+
variant = match->data;
}
- return armada_drm_crtc_create(drm, dev, res, irq, variant);
+ return armada_drm_crtc_create(drm, dev, res, irq, variant, port);
}
static void
};
#define drm_to_armada_crtc(c) container_of(c, struct armada_crtc, crtc)
+struct device_node;
int armada_drm_crtc_create(struct drm_device *, struct device *,
- struct resource *, int, const struct armada_variant *);
+ struct resource *, int, const struct armada_variant *,
+ struct device_node *);
void armada_drm_crtc_gamma_set(struct drm_crtc *, u16, u16, u16, int);
void armada_drm_crtc_gamma_get(struct drm_crtc *, u16 *, u16 *, u16 *, int);
void armada_drm_crtc_disable_irq(struct armada_crtc *, u32);