mirror of
https://github.com/u-boot/u-boot.git
synced 2025-01-27 05:03:28 +08:00
clk: imx: pllv3: register PLLV3 GENERIC and USB as 2 different clocks
Better to register the 2 clock as 2 different drivers because they work slightly differently depending on power_bit and powerup_set bits coming on next patches. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
This commit is contained in:
parent
e403316634
commit
16faa599e6
@ -13,7 +13,8 @@
|
|||||||
#include <clk.h>
|
#include <clk.h>
|
||||||
#include "clk.h"
|
#include "clk.h"
|
||||||
|
|
||||||
#define UBOOT_DM_CLK_IMX_PLLV3 "imx_clk_pllv3"
|
#define UBOOT_DM_CLK_IMX_PLLV3_GENERIC "imx_clk_pllv3_generic"
|
||||||
|
#define UBOOT_DM_CLK_IMX_PLLV3_USB "imx_clk_pllv3_usb"
|
||||||
|
|
||||||
struct clk_pllv3 {
|
struct clk_pllv3 {
|
||||||
struct clk clk;
|
struct clk clk;
|
||||||
@ -24,7 +25,7 @@ struct clk_pllv3 {
|
|||||||
|
|
||||||
#define to_clk_pllv3(_clk) container_of(_clk, struct clk_pllv3, clk)
|
#define to_clk_pllv3(_clk) container_of(_clk, struct clk_pllv3, clk)
|
||||||
|
|
||||||
static ulong clk_pllv3_get_rate(struct clk *clk)
|
static ulong clk_pllv3_generic_get_rate(struct clk *clk)
|
||||||
{
|
{
|
||||||
struct clk_pllv3 *pll = to_clk_pllv3(dev_get_clk_ptr(clk->dev));
|
struct clk_pllv3 *pll = to_clk_pllv3(dev_get_clk_ptr(clk->dev));
|
||||||
unsigned long parent_rate = clk_get_parent_rate(clk);
|
unsigned long parent_rate = clk_get_parent_rate(clk);
|
||||||
@ -35,7 +36,7 @@ static ulong clk_pllv3_get_rate(struct clk *clk)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct clk_ops clk_pllv3_generic_ops = {
|
static const struct clk_ops clk_pllv3_generic_ops = {
|
||||||
.get_rate = clk_pllv3_get_rate,
|
.get_rate = clk_pllv3_generic_get_rate,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
|
struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
|
||||||
@ -53,8 +54,10 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case IMX_PLLV3_GENERIC:
|
case IMX_PLLV3_GENERIC:
|
||||||
|
drv_name = UBOOT_DM_CLK_IMX_PLLV3_GENERIC;
|
||||||
|
break;
|
||||||
case IMX_PLLV3_USB:
|
case IMX_PLLV3_USB:
|
||||||
drv_name = UBOOT_DM_CLK_IMX_PLLV3;
|
drv_name = UBOOT_DM_CLK_IMX_PLLV3_USB;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
kfree(pll);
|
kfree(pll);
|
||||||
@ -75,7 +78,14 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
U_BOOT_DRIVER(clk_pllv3_generic) = {
|
U_BOOT_DRIVER(clk_pllv3_generic) = {
|
||||||
.name = UBOOT_DM_CLK_IMX_PLLV3,
|
.name = UBOOT_DM_CLK_IMX_PLLV3_GENERIC,
|
||||||
|
.id = UCLASS_CLK,
|
||||||
|
.ops = &clk_pllv3_generic_ops,
|
||||||
|
.flags = DM_FLAG_PRE_RELOC,
|
||||||
|
};
|
||||||
|
|
||||||
|
U_BOOT_DRIVER(clk_pllv3_usb) = {
|
||||||
|
.name = UBOOT_DM_CLK_IMX_PLLV3_USB,
|
||||||
.id = UCLASS_CLK,
|
.id = UCLASS_CLK,
|
||||||
.ops = &clk_pllv3_generic_ops,
|
.ops = &clk_pllv3_generic_ops,
|
||||||
.flags = DM_FLAG_PRE_RELOC,
|
.flags = DM_FLAG_PRE_RELOC,
|
||||||
|
Loading…
Reference in New Issue
Block a user