dm: clk: Define clk_get_parent() for clk operations
authorLukasz Majewski <lukma@denx.de>
Mon, 24 Jun 2019 13:50:42 +0000 (15:50 +0200)
committerStefano Babic <sbabic@denx.de>
Fri, 19 Jul 2019 12:50:30 +0000 (14:50 +0200)
commit0c660c2b3263ba1d6e3c0dd43d813ef17b051207
treebe80c91406720ce01e81b70c6692733e14e35e98
parent004c1229414ff4a13dd20f48f9c8c1da98fee878
dm: clk: Define clk_get_parent() for clk operations

This commit adds the clk_get_parent() function, which is responsible
for getting the parent's struct clock pointer.

U-Boot's DM support for getting parent is different (the parent
relationship is in udevice) than the one in Common Clock Framework [CCF]
in Linux. To obtain the pointer to struct clk of parent the
pdev->uclass_priv field is read via dev_get_clk_ptr() wrapper.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
drivers/clk/clk-uclass.c
include/clk.h