Skip to content

Commit

Permalink
mmc: tegra: Parse default trim and tap from dt
Browse files Browse the repository at this point in the history
Parse the default inbound and outbound sampling trimmer values from
the device tree.

Signed-off-by: Aapo Vienamo <avienamo@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Aapo Vienamo authored and Ulf Hansson committed Oct 8, 2018
1 parent d4501d8 commit 85c0da1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions drivers/mmc/host/sdhci-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ struct sdhci_tegra {
struct pinctrl_state *pinctrl_state_1v8;

struct sdhci_tegra_autocal_offsets autocal_offsets;

u32 default_tap;
u32 default_trim;
};

static u16 tegra_sdhci_readw(struct sdhci_host *host, int reg)
Expand Down Expand Up @@ -461,6 +464,23 @@ static void tegra_sdhci_parse_pad_autocal_dt(struct sdhci_host *host)
autocal->pull_down_hs400 = autocal->pull_down_1v8;
}

static void tegra_sdhci_parse_default_tap_and_trim(struct sdhci_host *host)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host);
int err;

err = device_property_read_u32(host->mmc->parent, "nvidia,default-tap",
&tegra_host->default_tap);
if (err)
tegra_host->default_tap = 0;

err = device_property_read_u32(host->mmc->parent, "nvidia,default-trim",
&tegra_host->default_trim);
if (err)
tegra_host->default_trim = 0;
}

static void tegra_sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
Expand Down Expand Up @@ -881,6 +901,8 @@ static int sdhci_tegra_probe(struct platform_device *pdev)

tegra_sdhci_parse_pad_autocal_dt(host);

tegra_sdhci_parse_default_tap_and_trim(host);

tegra_host->power_gpio = devm_gpiod_get_optional(&pdev->dev, "power",
GPIOD_OUT_HIGH);
if (IS_ERR(tegra_host->power_gpio)) {
Expand Down

0 comments on commit 85c0da1

Please sign in to comment.