Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da65f773 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "clk: clock-generic: Support parsing ext clocks from dt"

parents 96d21048 de271a4b
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -557,3 +557,28 @@ snoc_msmbus_clk: snoc_msmbus_clk {
	qcom,parent = <&snoc_clk>;
	qcom,config-rate = <100000000>;
};

*****************************************************************************

"qcom,ext-clk"

A logical entity representing a clock defined outside of the current clock controller.
A clock controller can only manage ordering dependencies within itself. Having an
ext_clk whose parent is the actual external clock allows us to initialize the
necessary clock data structures with the assumption that the missing dependency will
be filled in later. During __handoff() this clock type will call clk_get() to fix the
dependency.

Required Properties:
- compatible:		Must be "qcom,ext-clk"

Optional Properties:
- qcom,clock-names:	String argument for clk_get().

Recommended Properties:
- qcom,parent:		See "General Optional Properties"

gcc_xo: gcc_xo {
	compatible = "qcom,ext-clk";
	qcom,clock-names = "xo";
};
+22 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/io.h>
#include <linux/clk/msm-clk-provider.h>
#include <linux/clk/msm-clock-generic.h>
#include <soc/qcom/msm-clock-controller.h>

/* ==================== Mux clock ==================== */

@@ -591,6 +592,27 @@ struct clk_ops clk_ops_ext = {
	.get_parent = ext_get_parent,
};

static void *ext_clk_dt_parser(struct device *dev, struct device_node *np)
{
	struct ext_clk *ext;
	const char *str;
	int rc;

	ext = devm_kzalloc(dev, sizeof(*ext), GFP_KERNEL);
	if (!ext) {
		dev_err(dev, "memory allocation failure\n");
		return ERR_PTR(-ENOMEM);
	}

	ext->dev = dev;
	rc = of_property_read_string(np, "qcom,clock-names", &str);
	if (!rc)
		ext->clk_id = (void *)str;

	ext->c.ops = &clk_ops_ext;
	return msmclk_generic_clk_init(dev, np, &ext->c);
}
MSMCLK_PARSER(ext_clk_dt_parser, "qcom,ext-clk", 0);

/* ==================== Mux_div clock ==================== */