Lines Matching refs:pcdev
62 static int amba_get_enable_pclk(struct amba_device *pcdev) in amba_get_enable_pclk() argument
66 pcdev->pclk = clk_get(&pcdev->dev, "apb_pclk"); in amba_get_enable_pclk()
67 if (IS_ERR(pcdev->pclk)) in amba_get_enable_pclk()
68 return PTR_ERR(pcdev->pclk); in amba_get_enable_pclk()
70 ret = clk_prepare_enable(pcdev->pclk); in amba_get_enable_pclk()
72 clk_put(pcdev->pclk); in amba_get_enable_pclk()
77 static void amba_put_disable_pclk(struct amba_device *pcdev) in amba_put_disable_pclk() argument
79 clk_disable_unprepare(pcdev->pclk); in amba_put_disable_pclk()
80 clk_put(pcdev->pclk); in amba_put_disable_pclk()
209 struct amba_device *pcdev = to_amba_device(dev); in amba_match() local
212 mutex_lock(&pcdev->periphid_lock); in amba_match()
213 if (!pcdev->periphid) { in amba_match()
214 int ret = amba_read_periphid(pcdev); in amba_match()
223 mutex_unlock(&pcdev->periphid_lock); in amba_match()
229 mutex_unlock(&pcdev->periphid_lock); in amba_match()
232 if (pcdev->driver_override) in amba_match()
233 return !strcmp(pcdev->driver_override, drv->name); in amba_match()
235 return amba_lookup(pcdrv->id_table, pcdev) != NULL; in amba_match()
240 struct amba_device *pcdev = to_amba_device(dev); in amba_uevent() local
243 retval = add_uevent_var(env, "AMBA_ID=%08x", pcdev->periphid); in amba_uevent()
247 retval = add_uevent_var(env, "MODALIAS=amba:d%08X", pcdev->periphid); in amba_uevent()
279 struct amba_device *pcdev = to_amba_device(dev); in amba_probe() local
281 const struct amba_id *id = amba_lookup(pcdrv->id_table, pcdev); in amba_probe()
285 ret = of_amba_device_decode_irq(pcdev); in amba_probe()
297 ret = amba_get_enable_pclk(pcdev); in amba_probe()
307 ret = pcdrv->probe(pcdev, id); in amba_probe()
315 amba_put_disable_pclk(pcdev); in amba_probe()
324 struct amba_device *pcdev = to_amba_device(dev); in amba_remove() local
329 drv->remove(pcdev); in amba_remove()
337 amba_put_disable_pclk(pcdev); in amba_remove()
391 struct amba_device *pcdev = to_amba_device(dev); in amba_pm_runtime_suspend() local
396 clk_disable(pcdev->pclk); in amba_pm_runtime_suspend()
398 clk_disable_unprepare(pcdev->pclk); in amba_pm_runtime_suspend()
406 struct amba_device *pcdev = to_amba_device(dev); in amba_pm_runtime_resume() local
411 ret = clk_enable(pcdev->pclk); in amba_pm_runtime_resume()
413 ret = clk_prepare_enable(pcdev->pclk); in amba_pm_runtime_resume()