Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Commit

Permalink
clk: sunxi: sun9i-mmc: Implement reset callback for reset controls
Browse files Browse the repository at this point in the history
commit 61d2f2a upstream.

Our MMC host driver now issues a reset, instead of just deasserting
the reset control, since commit c34eda6 ("mmc: sunxi: Reset the
device at probe time"). The sun9i-mmc clock driver does not support
this, and will fail, which results in MMC not probing.

This patch implements the reset callback by asserting the reset control,
then deasserting it after a small delay.

Fixes: 7a6fca8 ("clk: sunxi: Add driver for A80 MMC config clocks/resets")
Signed-off-by: Chen-Yu Tsai <[email protected]>
Acked-by: Philipp Zabel <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Signed-off-by: Michael Turquette <[email protected]>
Link: lkml.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
wens authored and gregkh committed Dec 29, 2017
1 parent 18276e9 commit 2635a64
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/clk/sunxi/clk-sun9i-mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/of.h>
#include <linux/of_device.h>
Expand Down Expand Up @@ -83,9 +84,20 @@ static int sun9i_mmc_reset_deassert(struct reset_controller_dev *rcdev,
return 0;
}

static int sun9i_mmc_reset_reset(struct reset_controller_dev *rcdev,
unsigned long id)
{
sun9i_mmc_reset_assert(rcdev, id);
udelay(10);
sun9i_mmc_reset_deassert(rcdev, id);

return 0;
}

static const struct reset_control_ops sun9i_mmc_reset_ops = {
.assert = sun9i_mmc_reset_assert,
.deassert = sun9i_mmc_reset_deassert,
.reset = sun9i_mmc_reset_reset,
};

static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev)
Expand Down

0 comments on commit 2635a64

Please sign in to comment.