mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
clk: Modify xlate() method for livetree
Update the xlate() method to use ofnode_phandle_args instead of the fdtdec variant. This will allow drivers to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -87,7 +87,7 @@ int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int at91_clk_of_xlate(struct clk *clk, struct fdtdec_phandle_args *args)
|
int at91_clk_of_xlate(struct clk *clk, struct ofnode_phandle_args *args)
|
||||||
{
|
{
|
||||||
int periph;
|
int periph;
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@ struct pmc_platdata {
|
|||||||
int at91_pmc_core_probe(struct udevice *dev);
|
int at91_pmc_core_probe(struct udevice *dev);
|
||||||
int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name);
|
int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name);
|
||||||
|
|
||||||
int at91_clk_of_xlate(struct clk *clk, struct fdtdec_phandle_args *args);
|
int at91_clk_of_xlate(struct clk *clk, struct ofnode_phandle_args *args);
|
||||||
int at91_clk_probe(struct udevice *dev);
|
int at91_clk_probe(struct udevice *dev);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -38,7 +38,7 @@ int clk_get_by_index_platdata(struct udevice *dev, int index,
|
|||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
static int clk_of_xlate_default(struct clk *clk,
|
static int clk_of_xlate_default(struct clk *clk,
|
||||||
struct fdtdec_phandle_args *args)
|
struct ofnode_phandle_args *args)
|
||||||
{
|
{
|
||||||
debug("%s(clk=%p)\n", __func__, clk);
|
debug("%s(clk=%p)\n", __func__, clk);
|
||||||
|
|
||||||
@@ -86,9 +86,10 @@ int clk_get_by_index(struct udevice *dev, int index, struct clk *clk)
|
|||||||
ops = clk_dev_ops(dev_clk);
|
ops = clk_dev_ops(dev_clk);
|
||||||
|
|
||||||
if (ops->of_xlate)
|
if (ops->of_xlate)
|
||||||
ret = ops->of_xlate(clk, &args);
|
ret = ops->of_xlate(clk, (struct ofnode_phandle_args *)&args);
|
||||||
else
|
else
|
||||||
ret = clk_of_xlate_default(clk, &args);
|
ret = clk_of_xlate_default(clk,
|
||||||
|
(struct ofnode_phandle_args *)&args);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
debug("of_xlate() failed: %d\n", ret);
|
debug("of_xlate() failed: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
@@ -252,8 +252,7 @@ static int stm32_clk_probe(struct udevice *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int stm32_clk_of_xlate(struct clk *clk,
|
static int stm32_clk_of_xlate(struct clk *clk, struct ofnode_phandle_args *args)
|
||||||
struct fdtdec_phandle_args *args)
|
|
||||||
{
|
{
|
||||||
debug("%s(clk=%p)\n", __func__, clk);
|
debug("%s(clk=%p)\n", __func__, clk);
|
||||||
|
|
||||||
|
@@ -12,7 +12,8 @@
|
|||||||
/* See clk.h for background documentation. */
|
/* See clk.h for background documentation. */
|
||||||
|
|
||||||
#include <clk.h>
|
#include <clk.h>
|
||||||
#include <fdtdec.h>
|
|
||||||
|
struct ofnode_phandle_args;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct clk_ops - The functions that a clock driver must implement.
|
* struct clk_ops - The functions that a clock driver must implement.
|
||||||
@@ -37,7 +38,7 @@ struct clk_ops {
|
|||||||
* @return 0 if OK, or a negative error code.
|
* @return 0 if OK, or a negative error code.
|
||||||
*/
|
*/
|
||||||
int (*of_xlate)(struct clk *clock,
|
int (*of_xlate)(struct clk *clock,
|
||||||
struct fdtdec_phandle_args *args);
|
struct ofnode_phandle_args *args);
|
||||||
/**
|
/**
|
||||||
* request - Request a translated clock.
|
* request - Request a translated clock.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user