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

Commit 042e2e9c authored by Stephen Boyd's avatar Stephen Boyd
Browse files

Merge tag 'tegra-for-4.15-clk-2' of...

Merge tag 'tegra-for-4.15-clk-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into clk-next

Pull tegra clk drivers updates from Thierry Reding:

This contains cleanups and minor fixes for the Tegra clock driver.

* tag 'tegra-for-4.15-clk-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  clk: tegra: Use readl_relaxed_poll_timeout_atomic() in tegra210_clock_init()
  clk: tegra: dfll: Fix drvdata overwriting issue
  clk: tegra: Fix cclk_lp divisor register
  clk: tegra: Bump SCLK clock rate to 216 MHz
  clk: tegra: Use common definition of APBDMA clock gate
  clk: tegra: Correct parent of the APBDMA clock
  clk: tegra: Add AHB DMA clock entry
  clk: tegra: Mark APB clock as critical
  clk: tegra: Make tegra_clk_pll_params __ro_after_init
  clk: tegra: Fix sor1_out clock implementation
  clk: tegra: Use tegra_clk_register_periph_data()
  clk: tegra: Add peripheral clock registration helper
  clk: tegra: Check BPMP response return code
  dt-bindings: clock: tegra: Add sor1_out clock
  firmware: tegra: Propagate error code to caller
parents 6705fc94 22ef01a2
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ struct tegra_bpmp_clk_message {
	struct {
		void *data;
		size_t size;
		int ret;
	} rx;
};

@@ -64,6 +65,7 @@ static int tegra_bpmp_clk_transfer(struct tegra_bpmp *bpmp,
	struct mrq_clk_request request;
	struct tegra_bpmp_message msg;
	void *req = &request;
	int err;

	memset(&request, 0, sizeof(request));
	request.cmd_and_id = (clk->cmd << 24) | clk->id;
@@ -84,7 +86,13 @@ static int tegra_bpmp_clk_transfer(struct tegra_bpmp *bpmp,
	msg.rx.data = clk->rx.data;
	msg.rx.size = clk->rx.size;

	return tegra_bpmp_transfer(bpmp, &msg);
	err = tegra_bpmp_transfer(bpmp, &msg);
	if (err < 0)
		return err;
	else if (msg.rx.ret < 0)
		return -EINVAL;

	return 0;
}

static int tegra_bpmp_clk_prepare(struct clk_hw *hw)
@@ -414,11 +422,8 @@ static int tegra_bpmp_probe_clocks(struct tegra_bpmp *bpmp,
		struct tegra_bpmp_clk_info *info = &clocks[count];

		err = tegra_bpmp_clk_get_info(bpmp, id, info);
		if (err < 0) {
			dev_err(bpmp->dev, "failed to query clock %u: %d\n",
				id, err);
		if (err < 0)
			continue;
		}

		if (info->num_parents >= U8_MAX) {
			dev_err(bpmp->dev,
+5 −5
Original line number Diff line number Diff line
@@ -1728,10 +1728,10 @@ EXPORT_SYMBOL(tegra_dfll_register);
 * @pdev: DFLL platform_device *
 *
 * Unbind this driver from the DFLL hardware device represented by
 * @pdev. The DFLL must be disabled for this to succeed. Returns 0
 * upon success or -EBUSY if the DFLL is still active.
 * @pdev. The DFLL must be disabled for this to succeed. Returns a
 * soc pointer upon success or -EBUSY if the DFLL is still active.
 */
int tegra_dfll_unregister(struct platform_device *pdev)
struct tegra_dfll_soc_data *tegra_dfll_unregister(struct platform_device *pdev)
{
	struct tegra_dfll *td = platform_get_drvdata(pdev);

@@ -1739,7 +1739,7 @@ int tegra_dfll_unregister(struct platform_device *pdev)
	if (td->mode != DFLL_DISABLED) {
		dev_err(&pdev->dev,
			"must disable DFLL before removing driver\n");
		return -EBUSY;
		return ERR_PTR(-EBUSY);
	}

	debugfs_remove_recursive(td->debugfs_dir);
@@ -1753,6 +1753,6 @@ int tegra_dfll_unregister(struct platform_device *pdev)

	reset_control_assert(td->dvco_rst);

	return 0;
	return td->soc;
}
EXPORT_SYMBOL(tegra_dfll_unregister);
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ struct tegra_dfll_soc_data {

int tegra_dfll_register(struct platform_device *pdev,
			struct tegra_dfll_soc_data *soc);
int tegra_dfll_unregister(struct platform_device *pdev);
struct tegra_dfll_soc_data *tegra_dfll_unregister(struct platform_device *pdev);
int tegra_dfll_runtime_suspend(struct device *dev);
int tegra_dfll_runtime_resume(struct device *dev);

+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ enum clk_id {
	tegra_clk_amx,
	tegra_clk_amx1,
	tegra_clk_apb2ape,
	tegra_clk_ahbdma,
	tegra_clk_apbdma,
	tegra_clk_apbif,
	tegra_clk_ape,
+8 −0
Original line number Diff line number Diff line
@@ -203,3 +203,11 @@ struct clk *tegra_clk_register_periph_nodiv(const char *name,
	return _tegra_clk_register_periph(name, parent_names, num_parents,
			periph, clk_base, offset, CLK_SET_RATE_PARENT);
}

struct clk *tegra_clk_register_periph_data(void __iomem *clk_base,
					   struct tegra_periph_init_data *init)
{
	return _tegra_clk_register_periph(init->name, init->p.parent_names,
					  init->num_parents, &init->periph,
					  clk_base, init->offset, init->flags);
}
Loading