Loading Documentation/devicetree/bindings/media/video/msm-fd.txt +5 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ Optional properties: - clock-rates: should specify clock rates in Hz to each clocks property defined. If we want to have different operating clock frequencies we can define rate levels. They should be defined in incremental order. Example: Loading @@ -48,5 +50,7 @@ Example: <&clock_mmss clk_fd_ahb_clk>; clock-names = "fd_core_clk", "fd_core_uar_clk", "fd_axi_clk", "fd_ahb_clk"; clock-rates = <400000000 400000000 333000000 80000000>; clock-rates = <60000000 60000000 75000000 40000000>, <200000000 200000000 150000000 40000000>, <400000000 400000000 333000000 80000000>; }; drivers/media/platform/msm/camera_v2/fd/msm_fd_hw.c +20 −4 Original line number Diff line number Diff line Loading @@ -565,6 +565,7 @@ int msm_fd_hw_get_clocks(struct msm_fd_device *fd) { const char *clk_name; size_t cnt; int clk_rates; int i; int ret; Loading @@ -574,6 +575,7 @@ int msm_fd_hw_get_clocks(struct msm_fd_device *fd) return -EINVAL; } clk_rates = 0; for (i = 0; i < cnt; i++) { ret = of_property_read_string_index(fd->dev->of_node, "clock-names", i, &clk_name); Loading @@ -592,13 +594,27 @@ int msm_fd_hw_get_clocks(struct msm_fd_device *fd) } fd->clk_num = cnt; ret = of_property_read_u32_array(fd->dev->of_node, "clock-rates", fd->clk_rates[0], fd->clk_num); if (ret < 0) { cnt = 0; for (clk_rates = 0; clk_rates < MSM_FD_MAX_CLK_RATES; clk_rates++) { for (i = 0; i < fd->clk_num; i++) { ret = of_property_read_u32_index(fd->dev->of_node, "clock-rates", cnt++, &fd->clk_rates[clk_rates][i]); if (ret < 0) break; dev_dbg(fd->dev, "Clock rate idx %d idx %d value %d\n", clk_rates, i, fd->clk_rates[clk_rates][i]); } if (ret < 0) break; } fd->clk_rates_num = clk_rates; if (fd->clk_rates_num == 0) { ret = -ENOENT; dev_err(fd->dev, "Can not get clock rates\n"); goto error; } fd->clk_rates_num = 1; return 0; error: Loading Loading
Documentation/devicetree/bindings/media/video/msm-fd.txt +5 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ Optional properties: - clock-rates: should specify clock rates in Hz to each clocks property defined. If we want to have different operating clock frequencies we can define rate levels. They should be defined in incremental order. Example: Loading @@ -48,5 +50,7 @@ Example: <&clock_mmss clk_fd_ahb_clk>; clock-names = "fd_core_clk", "fd_core_uar_clk", "fd_axi_clk", "fd_ahb_clk"; clock-rates = <400000000 400000000 333000000 80000000>; clock-rates = <60000000 60000000 75000000 40000000>, <200000000 200000000 150000000 40000000>, <400000000 400000000 333000000 80000000>; };
drivers/media/platform/msm/camera_v2/fd/msm_fd_hw.c +20 −4 Original line number Diff line number Diff line Loading @@ -565,6 +565,7 @@ int msm_fd_hw_get_clocks(struct msm_fd_device *fd) { const char *clk_name; size_t cnt; int clk_rates; int i; int ret; Loading @@ -574,6 +575,7 @@ int msm_fd_hw_get_clocks(struct msm_fd_device *fd) return -EINVAL; } clk_rates = 0; for (i = 0; i < cnt; i++) { ret = of_property_read_string_index(fd->dev->of_node, "clock-names", i, &clk_name); Loading @@ -592,13 +594,27 @@ int msm_fd_hw_get_clocks(struct msm_fd_device *fd) } fd->clk_num = cnt; ret = of_property_read_u32_array(fd->dev->of_node, "clock-rates", fd->clk_rates[0], fd->clk_num); if (ret < 0) { cnt = 0; for (clk_rates = 0; clk_rates < MSM_FD_MAX_CLK_RATES; clk_rates++) { for (i = 0; i < fd->clk_num; i++) { ret = of_property_read_u32_index(fd->dev->of_node, "clock-rates", cnt++, &fd->clk_rates[clk_rates][i]); if (ret < 0) break; dev_dbg(fd->dev, "Clock rate idx %d idx %d value %d\n", clk_rates, i, fd->clk_rates[clk_rates][i]); } if (ret < 0) break; } fd->clk_rates_num = clk_rates; if (fd->clk_rates_num == 0) { ret = -ENOENT; dev_err(fd->dev, "Can not get clock rates\n"); goto error; } fd->clk_rates_num = 1; return 0; error: Loading