Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: meson: remove ao input bypass clocks

During probe, bypass clocks (i.e. ao-in-xtal) are made from device-tree
inputs to provide input clocks which can be access through global name.
The cons of this method are the duplicated clocks, means more string
comparison.

Specify parent directly with device-tree clock name.

Function to regiter bypass clocks is removed.

Input parameters from meson aoclk data structure are deprecated and then
deleted since all aoclk files are migrated.

Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>

authored by

Alexandre Mergnat and committed by
Jerome Brunet
072a043f b90ec1e3

-46
-1
drivers/clk/meson/Kconfig
··· 33 33 config COMMON_CLK_MESON_AO_CLKC 34 34 tristate 35 35 select COMMON_CLK_MESON_REGMAP 36 - select COMMON_CLK_MESON_INPUT 37 36 select RESET_CONTROLLER 38 37 39 38 config COMMON_CLK_MESON_EE_CLKC
-37
drivers/clk/meson/meson-aoclk.c
··· 17 17 #include <linux/slab.h> 18 18 #include "meson-aoclk.h" 19 19 20 - #include "clk-input.h" 21 - 22 20 static int meson_aoclk_do_reset(struct reset_controller_dev *rcdev, 23 21 unsigned long id) 24 22 { ··· 30 32 static const struct reset_control_ops meson_aoclk_reset_ops = { 31 33 .reset = meson_aoclk_do_reset, 32 34 }; 33 - 34 - static int meson_aoclkc_register_inputs(struct device *dev, 35 - struct meson_aoclk_data *data) 36 - { 37 - struct clk_hw *hw; 38 - char *str; 39 - int i; 40 - 41 - for (i = 0; i < data->num_inputs; i++) { 42 - const struct meson_aoclk_input *in = &data->inputs[i]; 43 - 44 - str = kasprintf(GFP_KERNEL, "%s%s", data->input_prefix, 45 - in->name); 46 - if (!str) 47 - return -ENOMEM; 48 - 49 - hw = meson_clk_hw_register_input(dev, in->name, str, 0); 50 - kfree(str); 51 - 52 - if (IS_ERR(hw)) { 53 - if (!in->required && PTR_ERR(hw) == -ENOENT) 54 - continue; 55 - else if (PTR_ERR(hw) != -EPROBE_DEFER) 56 - dev_err(dev, "failed to register input %s\n", 57 - in->name); 58 - return PTR_ERR(hw); 59 - } 60 - } 61 - 62 - return 0; 63 - } 64 35 65 36 int meson_aoclkc_probe(struct platform_device *pdev) 66 37 { ··· 52 85 dev_err(dev, "failed to get regmap\n"); 53 86 return PTR_ERR(regmap); 54 87 } 55 - 56 - ret = meson_aoclkc_register_inputs(dev, data); 57 - if (ret) 58 - return ret; 59 88 60 89 /* Reset Controller */ 61 90 rstc->data = data;
-8
drivers/clk/meson/meson-aoclk.h
··· 18 18 19 19 #include "clk-regmap.h" 20 20 21 - struct meson_aoclk_input { 22 - const char *name; 23 - bool required; 24 - }; 25 - 26 21 struct meson_aoclk_data { 27 22 const unsigned int reset_reg; 28 23 const int num_reset; 29 24 const unsigned int *reset; 30 25 const int num_clks; 31 26 struct clk_regmap **clks; 32 - const int num_inputs; 33 - const struct meson_aoclk_input *inputs; 34 - const char *input_prefix; 35 27 const struct clk_hw_onecell_data *hw_data; 36 28 }; 37 29