]> Git Repo - u-boot.git/blobdiff - arch/arm/mach-ipq40xx/clock-ipq4019.c
Merge tag 'dm-pull-14dec20' of git://git.denx.de/u-boot-dm into next
[u-boot.git] / arch / arm / mach-ipq40xx / clock-ipq4019.c
index 83a688e6257020f14699ab97f9b3a0fe61387fa8..c1d5c4ecdd81b8085ab8b53d623ab19c0329e095 100644 (file)
@@ -2,14 +2,14 @@
 /*
  * Clock drivers for Qualcomm IPQ40xx
  *
- * Copyright (c) 2019 Sartura Ltd.
+ * Copyright (c) 2020 Sartura Ltd.
  *
  * Author: Robert Marko <[email protected]>
  *
  */
 
-#include <common.h>
 #include <clk-uclass.h>
+#include <common.h>
 #include <dm.h>
 #include <errno.h>
 
@@ -24,10 +24,9 @@ ulong msm_set_rate(struct clk *clk, ulong rate)
        switch (clk->id) {
        case GCC_BLSP1_UART1_APPS_CLK: /*UART1*/
                /* This clock is already initialized by SBL1 */
-               return 0; 
-               break;
-       default:
                return 0;
+       default:
+               return -EINVAL;
        }
 }
 
@@ -35,7 +34,7 @@ static int msm_clk_probe(struct udevice *dev)
 {
        struct msm_clk_priv *priv = dev_get_priv(dev);
 
-       priv->base = devfdt_get_addr(dev);
+       priv->base = dev_read_addr(dev);
        if (priv->base == FDT_ADDR_T_NONE)
                return -EINVAL;
 
@@ -47,8 +46,31 @@ static ulong msm_clk_set_rate(struct clk *clk, ulong rate)
        return msm_set_rate(clk, rate);
 }
 
+static int msm_enable(struct clk *clk)
+{
+       switch (clk->id) {
+       case GCC_BLSP1_QUP1_SPI_APPS_CLK: /*SPI1*/
+               /* This clock is already initialized by SBL1 */
+               return 0;
+       case GCC_PRNG_AHB_CLK: /*PRNG*/
+               /* This clock is already initialized by SBL1 */
+               return 0;
+       case GCC_USB3_MASTER_CLK:
+       case GCC_USB3_SLEEP_CLK:
+       case GCC_USB3_MOCK_UTMI_CLK:
+       case GCC_USB2_MASTER_CLK:
+       case GCC_USB2_SLEEP_CLK:
+       case GCC_USB2_MOCK_UTMI_CLK:
+               /* These clocks is already initialized by SBL1 */
+               return 0;
+       default:
+               return -EINVAL;
+       }
+}
+
 static struct clk_ops msm_clk_ops = {
        .set_rate = msm_clk_set_rate,
+       .enable = msm_enable,
 };
 
 static const struct udevice_id msm_clk_ids[] = {
@@ -61,6 +83,6 @@ U_BOOT_DRIVER(clk_msm) = {
        .id             = UCLASS_CLK,
        .of_match       = msm_clk_ids,
        .ops            = &msm_clk_ops,
-       .priv_auto_alloc_size = sizeof(struct msm_clk_priv),
+       .priv_auto      = sizeof(struct msm_clk_priv),
        .probe          = msm_clk_probe,
 };
This page took 0.027324 seconds and 4 git commands to generate.