Lines Matching refs:ofdev

31 	u32 (*get_clock)(struct platform_device *ofdev, const char *clock_name,
33 void (*put_clock)(struct platform_device *ofdev);
42 static u32 mpc52xx_can_get_clock(struct platform_device *ofdev, in mpc52xx_can_get_clock() argument
66 freq = mpc5xxx_get_bus_frequency(&ofdev->dev); in mpc52xx_can_get_clock()
76 dev_err(&ofdev->dev, "can't get clock node!\n"); in mpc52xx_can_get_clock()
82 dev_err(&ofdev->dev, "can't map clock node!\n"); in mpc52xx_can_get_clock()
99 static u32 mpc52xx_can_get_clock(struct platform_device *ofdev, in mpc52xx_can_get_clock() argument
107 static u32 mpc512x_can_get_clock(struct platform_device *ofdev, in mpc512x_can_get_clock() argument
126 np = ofdev->dev.of_node; in mpc512x_can_get_clock()
129 dev_dbg(&ofdev->dev, "device tree specs: clk src[%s] div[%d]\n", in mpc512x_can_get_clock()
156 dev_dbg(&ofdev->dev, "got a clk source spec[%d]\n", clk_from); in mpc512x_can_get_clock()
162 dev_dbg(&ofdev->dev, "no clk source spec, trying SYS\n"); in mpc512x_can_get_clock()
163 clk_in = devm_clk_get(&ofdev->dev, "sys"); in mpc512x_can_get_clock()
173 dev_dbg(&ofdev->dev, in mpc512x_can_get_clock()
180 dev_dbg(&ofdev->dev, "no clk source spec, trying REF\n"); in mpc512x_can_get_clock()
181 clk_in = devm_clk_get(&ofdev->dev, "ref"); in mpc512x_can_get_clock()
186 dev_dbg(&ofdev->dev, in mpc512x_can_get_clock()
198 clk_can = devm_clk_get(&ofdev->dev, "ips"); in mpc512x_can_get_clock()
201 priv = netdev_priv(dev_get_drvdata(&ofdev->dev)); in mpc512x_can_get_clock()
205 dev_dbg(&ofdev->dev, "clk from IPS, clksrc[%d] freq[%lu]\n", in mpc512x_can_get_clock()
210 clk_can = devm_clk_get(&ofdev->dev, "mclk"); in mpc512x_can_get_clock()
213 priv = netdev_priv(dev_get_drvdata(&ofdev->dev)); in mpc512x_can_get_clock()
216 clk_in = devm_clk_get(&ofdev->dev, "sys"); in mpc512x_can_get_clock()
218 clk_in = devm_clk_get(&ofdev->dev, "ref"); in mpc512x_can_get_clock()
227 dev_dbg(&ofdev->dev, "clk from MCLK, clksrc[%d] freq[%lu]\n", in mpc512x_can_get_clock()
237 clk_ipg = devm_clk_get(&ofdev->dev, "ipg"); in mpc512x_can_get_clock()
242 priv = netdev_priv(dev_get_drvdata(&ofdev->dev)); in mpc512x_can_get_clock()
249 dev_err(&ofdev->dev, "invalid clock source specification\n"); in mpc512x_can_get_clock()
254 dev_err(&ofdev->dev, "cannot acquire or setup bitrate clock source\n"); in mpc512x_can_get_clock()
259 dev_err(&ofdev->dev, "cannot acquire or setup register clock\n"); in mpc512x_can_get_clock()
264 static void mpc512x_can_put_clock(struct platform_device *ofdev) in mpc512x_can_put_clock() argument
268 priv = netdev_priv(dev_get_drvdata(&ofdev->dev)); in mpc512x_can_put_clock()
273 static u32 mpc512x_can_get_clock(struct platform_device *ofdev, in mpc512x_can_get_clock() argument
282 static int mpc5xxx_can_probe(struct platform_device *ofdev) in mpc5xxx_can_probe() argument
285 struct device_node *np = ofdev->dev.of_node; in mpc5xxx_can_probe()
293 data = of_device_get_match_data(&ofdev->dev); in mpc5xxx_can_probe()
299 return dev_err_probe(&ofdev->dev, err, "couldn't ioremap\n"); in mpc5xxx_can_probe()
303 dev_err(&ofdev->dev, "no irq found\n"); in mpc5xxx_can_probe()
311 platform_set_drvdata(ofdev, dev); in mpc5xxx_can_probe()
312 SET_NETDEV_DEV(dev, &ofdev->dev); in mpc5xxx_can_probe()
321 priv->can.clock.freq = data->get_clock(ofdev, clock_name, in mpc5xxx_can_probe()
324 dev_err(&ofdev->dev, "couldn't get MSCAN clock properties\n"); in mpc5xxx_can_probe()
330 dev_err(&ofdev->dev, "registering %s failed (err=%d)\n", in mpc5xxx_can_probe()
335 dev_info(&ofdev->dev, "MSCAN at 0x%p, irq %d, clock %d Hz\n", in mpc5xxx_can_probe()
342 data->put_clock(ofdev); in mpc5xxx_can_probe()
352 static void mpc5xxx_can_remove(struct platform_device *ofdev) in mpc5xxx_can_remove() argument
356 struct net_device *dev = platform_get_drvdata(ofdev); in mpc5xxx_can_remove()
359 match = of_match_device(mpc5xxx_can_table, &ofdev->dev); in mpc5xxx_can_remove()
364 data->put_clock(ofdev); in mpc5xxx_can_remove()
372 static int mpc5xxx_can_suspend(struct platform_device *ofdev, pm_message_t state) in mpc5xxx_can_suspend() argument
374 struct net_device *dev = platform_get_drvdata(ofdev); in mpc5xxx_can_suspend()
383 static int mpc5xxx_can_resume(struct platform_device *ofdev) in mpc5xxx_can_resume() argument
385 struct net_device *dev = platform_get_drvdata(ofdev); in mpc5xxx_can_resume()