Lines Matching defs:ofdev

29 	u32 (*get_clock)(struct platform_device *ofdev, const char *clock_name,
31 void (*put_clock)(struct platform_device *ofdev);
40 static u32 mpc52xx_can_get_clock(struct platform_device *ofdev,
64 freq = mpc5xxx_get_bus_frequency(ofdev->dev.of_node);
74 dev_err(&ofdev->dev, "can't get clock node!\n");
80 dev_err(&ofdev->dev, "can't map clock node!\n");
97 static u32 mpc52xx_can_get_clock(struct platform_device *ofdev,
105 static u32 mpc512x_can_get_clock(struct platform_device *ofdev,
124 np = ofdev->dev.of_node;
127 dev_dbg(&ofdev->dev, "device tree specs: clk src[%s] div[%d]\n",
154 dev_dbg(&ofdev->dev, "got a clk source spec[%d]\n", clk_from);
160 dev_dbg(&ofdev->dev, "no clk source spec, trying SYS\n");
161 clk_in = devm_clk_get(&ofdev->dev, "sys");
171 dev_dbg(&ofdev->dev,
178 dev_dbg(&ofdev->dev, "no clk source spec, trying REF\n");
179 clk_in = devm_clk_get(&ofdev->dev, "ref");
184 dev_dbg(&ofdev->dev,
196 clk_can = devm_clk_get(&ofdev->dev, "ips");
199 priv = netdev_priv(dev_get_drvdata(&ofdev->dev));
203 dev_dbg(&ofdev->dev, "clk from IPS, clksrc[%d] freq[%lu]\n",
208 clk_can = devm_clk_get(&ofdev->dev, "mclk");
211 priv = netdev_priv(dev_get_drvdata(&ofdev->dev));
214 clk_in = devm_clk_get(&ofdev->dev, "sys");
216 clk_in = devm_clk_get(&ofdev->dev, "ref");
225 dev_dbg(&ofdev->dev, "clk from MCLK, clksrc[%d] freq[%lu]\n",
235 clk_ipg = devm_clk_get(&ofdev->dev, "ipg");
240 priv = netdev_priv(dev_get_drvdata(&ofdev->dev));
247 dev_err(&ofdev->dev, "invalid clock source specification\n");
252 dev_err(&ofdev->dev, "cannot acquire or setup bitrate clock source\n");
257 dev_err(&ofdev->dev, "cannot acquire or setup register clock\n");
262 static void mpc512x_can_put_clock(struct platform_device *ofdev)
266 priv = netdev_priv(dev_get_drvdata(&ofdev->dev));
271 static u32 mpc512x_can_get_clock(struct platform_device *ofdev,
280 static int mpc5xxx_can_probe(struct platform_device *ofdev)
284 struct device_node *np = ofdev->dev.of_node;
292 match = of_match_device(mpc5xxx_can_table, &ofdev->dev);
299 dev_err(&ofdev->dev, "couldn't ioremap\n");
305 dev_err(&ofdev->dev, "no irq found\n");
313 platform_set_drvdata(ofdev, dev);
314 SET_NETDEV_DEV(dev, &ofdev->dev);
324 priv->can.clock.freq = data->get_clock(ofdev, clock_name,
327 dev_err(&ofdev->dev, "couldn't get MSCAN clock properties\n");
333 dev_err(&ofdev->dev, "registering %s failed (err=%d)\n",
338 dev_info(&ofdev->dev, "MSCAN at 0x%p, irq %d, clock %d Hz\n",
345 data->put_clock(ofdev);
355 static int mpc5xxx_can_remove(struct platform_device *ofdev)
359 struct net_device *dev = platform_get_drvdata(ofdev);
362 match = of_match_device(mpc5xxx_can_table, &ofdev->dev);
367 data->put_clock(ofdev);
377 static int mpc5xxx_can_suspend(struct platform_device *ofdev, pm_message_t state)
379 struct net_device *dev = platform_get_drvdata(ofdev);
388 static int mpc5xxx_can_resume(struct platform_device *ofdev)
390 struct net_device *dev = platform_get_drvdata(ofdev);