Lines Matching refs:pdev

90 static int imx_weim_gpr_setup(struct platform_device *pdev)
92 struct device_node *np = pdev->dev.of_node;
109 dev_dbg(&pdev->dev, "failed to find weim-cs-gpr\n");
135 dev_err(&pdev->dev, "Invalid 'ranges' configuration\n");
206 static int weim_parse_dt(struct platform_device *pdev)
208 const struct imx_weim_devtype *devtype = device_get_match_data(&pdev->dev);
216 ret = imx_weim_gpr_setup(pdev);
221 priv = dev_get_drvdata(&pdev->dev);
224 if (of_property_read_bool(pdev->dev.of_node, "fsl,burst-clk-enable")) {
229 if (of_property_read_bool(pdev->dev.of_node,
234 dev_err(&pdev->dev,
242 dev_err(&pdev->dev, "burst clk mode not supported.\n");
247 for_each_available_child_of_node(pdev->dev.of_node, child) {
248 ret = weim_timing_setup(&pdev->dev, child, devtype);
250 dev_warn(&pdev->dev, "%pOF set timing failed.\n",
257 ret = of_platform_default_populate(pdev->dev.of_node,
258 NULL, &pdev->dev);
260 dev_err(&pdev->dev, "%pOF fail to create devices.\n",
261 pdev->dev.of_node);
265 static int weim_probe(struct platform_device *pdev)
272 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
277 base = devm_platform_ioremap_resource(pdev, 0);
282 dev_set_drvdata(&pdev->dev, priv);
285 clk = devm_clk_get(&pdev->dev, NULL);
294 ret = weim_parse_dt(pdev);
298 dev_info(&pdev->dev, "Driver registered.\n");
310 struct platform_device *pdev;
321 pdev = of_find_device_by_node(rd->dn->parent);
322 if (!pdev) {
329 if (weim_timing_setup(&pdev->dev, rd->dn, devtype))
330 dev_warn(&pdev->dev,
340 if (!of_platform_device_create(rd->dn, NULL, &pdev->dev)) {
341 dev_err(&pdev->dev,
348 platform_device_put(pdev);
359 pdev = of_find_device_by_node(rd->dn);
360 if (!pdev) {
366 of_platform_device_destroy(&pdev->dev, NULL);
367 platform_device_put(pdev);