Skip to content

Commit

Permalink
mmc: arasan: Add pinctrl support to the driver
Browse files Browse the repository at this point in the history
Driver should be able to handle optional pinctrl setting.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
  • Loading branch information
Michal Simek committed Feb 14, 2017
1 parent 0f2e8c8 commit 3feb3b1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions drivers/mmc/host/sdhci-of-arasan.c
Expand Up @@ -28,6 +28,7 @@
#include <linux/phy/phy.h>
#include <linux/mmc/mmc.h>
#include <linux/soc/xilinx/zynqmp/tap_delays.h>
#include <linux/pinctrl/consumer.h>
#include <linux/regmap.h>
#include "sdhci-pltfm.h"
#include <linux/of.h>
Expand Down Expand Up @@ -107,6 +108,8 @@ struct sdhci_arasan_data {
struct clk *sdcardclk;

struct regmap *soc_ctl_base;
struct pinctrl *pinctrl;
struct pinctrl_state *pins_default;
const struct sdhci_arasan_soc_ctl_map *soc_ctl_map;
unsigned int quirks; /* Arasan deviations from spec */

Expand Down Expand Up @@ -902,6 +905,20 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
}
}

sdhci_arasan->pinctrl = devm_pinctrl_get(&pdev->dev);
if (!IS_ERR(sdhci_arasan->pinctrl)) {
sdhci_arasan->pins_default = pinctrl_lookup_state(
sdhci_arasan->pinctrl,
PINCTRL_STATE_DEFAULT);
if (IS_ERR(sdhci_arasan->pins_default)) {
dev_err(&pdev->dev, "Missing default pinctrl config\n");
return IS_ERR(sdhci_arasan->pins_default);
}

pinctrl_select_state(sdhci_arasan->pinctrl,
sdhci_arasan->pins_default);
}

sdhci_arasan->phy = ERR_PTR(-ENODEV);
if (of_device_is_compatible(pdev->dev.of_node,
"arasan,sdhci-5.1")) {
Expand Down

0 comments on commit 3feb3b1

Please sign in to comment.