Commit dfe1d3a2 authored by Stephen Boyd's avatar Stephen Boyd
Browse files

Merge branches 'clk-bulk-optional', 'clk-kirkwood', 'clk-socfpga' and 'clk-docs' into clk-next

 - Add a clk_bulk_get_optional() API (with devm too)
 - Support for Marvell 98DX1135 SoCs

* clk-bulk-optional:
  clk: Document some devm_clk_bulk*() APIs
  clk: Add devm_clk_bulk_get_optional() function
  clk: Add clk_bulk_get_optional() function

* clk-kirkwood:
  clk: kirkwood: Add support for MV98DX1135
  dt-bindings: clock: mvebu: Add compatible string for 98dx1135 core clock

* clk-socfpga:
  clk: socfpga: stratix10: fix divider entry for the emac clocks
  clk: socfpga: stratix10: add additional clocks needed for the NAND IP

* clk-docs:
  clk: Grammar missing "and", Spelling s/statisfied/satisfied/
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ Required properties:
	"marvell,dove-core-clock" - for Dove SoC core clocks
	"marvell,kirkwood-core-clock" - for Kirkwood SoC (except mv88f6180)
	"marvell,mv88f6180-core-clock" - for Kirkwood MV88f6180 SoC
	"marvell,mv98dx1135-core-clock" - for Kirkwood 98dx1135 SoC
	"marvell,mv88f5181-core-clock" - for Orion MV88F5181 SoC
	"marvell,mv88f5182-core-clock" - for Orion MV88F5182 SoC
	"marvell,mv88f5281-core-clock" - for Orion MV88F5281 SoC
+4 −0
Original line number Diff line number Diff line
@@ -244,6 +244,10 @@ CLOCK
  devm_clk_get()
  devm_clk_get_optional()
  devm_clk_put()
  devm_clk_bulk_get()
  devm_clk_bulk_get_all()
  devm_clk_bulk_get_optional()
  devm_get_clk_from_childl()
  devm_clk_hw_register()
  devm_of_clk_add_hw_provider()
  devm_clk_hw_register_clkdev()
+20 −3
Original line number Diff line number Diff line
@@ -75,8 +75,8 @@ void clk_bulk_put(int num_clks, struct clk_bulk_data *clks)
}
EXPORT_SYMBOL_GPL(clk_bulk_put);

int __must_check clk_bulk_get(struct device *dev, int num_clks,
			      struct clk_bulk_data *clks)
static int __clk_bulk_get(struct device *dev, int num_clks,
			  struct clk_bulk_data *clks, bool optional)
{
	int ret;
	int i;
@@ -88,10 +88,14 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks,
		clks[i].clk = clk_get(dev, clks[i].id);
		if (IS_ERR(clks[i].clk)) {
			ret = PTR_ERR(clks[i].clk);
			clks[i].clk = NULL;

			if (ret == -ENOENT && optional)
				continue;

			if (ret != -EPROBE_DEFER)
				dev_err(dev, "Failed to get clk '%s': %d\n",
					clks[i].id, ret);
			clks[i].clk = NULL;
			goto err;
		}
	}
@@ -103,8 +107,21 @@ err:

	return ret;
}

int __must_check clk_bulk_get(struct device *dev, int num_clks,
			      struct clk_bulk_data *clks)
{
	return __clk_bulk_get(dev, num_clks, clks, false);
}
EXPORT_SYMBOL(clk_bulk_get);

int __must_check clk_bulk_get_optional(struct device *dev, int num_clks,
				       struct clk_bulk_data *clks)
{
	return __clk_bulk_get(dev, num_clks, clks, true);
}
EXPORT_SYMBOL_GPL(clk_bulk_get_optional);

void clk_bulk_put_all(int num_clks, struct clk_bulk_data *clks)
{
	if (IS_ERR_OR_NULL(clks))
+19 −3
Original line number Diff line number Diff line
@@ -52,8 +52,8 @@ static void devm_clk_bulk_release(struct device *dev, void *res)
	clk_bulk_put(devres->num_clks, devres->clks);
}

int __must_check devm_clk_bulk_get(struct device *dev, int num_clks,
		      struct clk_bulk_data *clks)
static int __devm_clk_bulk_get(struct device *dev, int num_clks,
			       struct clk_bulk_data *clks, bool optional)
{
	struct clk_bulk_devres *devres;
	int ret;
@@ -63,6 +63,9 @@ int __must_check devm_clk_bulk_get(struct device *dev, int num_clks,
	if (!devres)
		return -ENOMEM;

	if (optional)
		ret = clk_bulk_get_optional(dev, num_clks, clks);
	else
		ret = clk_bulk_get(dev, num_clks, clks);
	if (!ret) {
		devres->clks = clks;
@@ -74,8 +77,21 @@ int __must_check devm_clk_bulk_get(struct device *dev, int num_clks,

	return ret;
}

int __must_check devm_clk_bulk_get(struct device *dev, int num_clks,
		      struct clk_bulk_data *clks)
{
	return __devm_clk_bulk_get(dev, num_clks, clks, false);
}
EXPORT_SYMBOL_GPL(devm_clk_bulk_get);

int __must_check devm_clk_bulk_get_optional(struct device *dev, int num_clks,
		      struct clk_bulk_data *clks)
{
	return __devm_clk_bulk_get(dev, num_clks, clks, true);
}
EXPORT_SYMBOL_GPL(devm_clk_bulk_get_optional);

int __must_check devm_clk_bulk_get_all(struct device *dev,
				       struct clk_bulk_data **clks)
{
+2 −2
Original line number Diff line number Diff line
@@ -2194,7 +2194,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
EXPORT_SYMBOL_GPL(clk_set_rate);

/**
 * clk_set_rate_exclusive - specify a new rate get exclusive control
 * clk_set_rate_exclusive - specify a new rate and get exclusive control
 * @clk: the clk whose rate is being changed
 * @rate: the new rate for clk
 *
@@ -2202,7 +2202,7 @@ EXPORT_SYMBOL_GPL(clk_set_rate);
 * within a critical section
 *
 * This can be used initially to ensure that at least 1 consumer is
 * statisfied when several consumers are competing for exclusivity over the
 * satisfied when several consumers are competing for exclusivity over the
 * same clock provider.
 *
 * The exclusivity is not applied if setting the rate failed.
Loading