Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/drivers/mmc/host/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 56 kB image not shown  

Quelle  sdhci-tegra.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2010 Google, Inc.
 */


#nclude <inux.java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
include/clk.h>
java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
#include <linux/dma-mapping.h>
SDHCI_TEGRA_VENDOR_CLOCK_CTRL 0java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
##    6
# SDHCI_CLOCK_CTRL_TRIM_MASK
## SDHCI_CLOCK_CTRL_TRIM_SHIFT4
<linux.h>
<linux.h>
java.lang.NullPointerException
#includeSDHCI_TEGRA_CAP_OVERRIDES_DQS_TRIM_MASK
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#includedefine BIT
#include <linuxdefine  0
#include</module
#include <linuxSDHCI_MISC_CTRL_ENABLE_SDR50x10
#include < SDHCI_MISC_CTRL_ENABLE_DDR50x200   0
#.h>
#include <linuxjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#</pm_runtime
#include <linux/regulator/consumer     x1c0
#include <linux/reset.h>

#include <soc/tegra/common.h>

#include "sdhci-cqhci.h"
#include "sdhci-pltfm.h"
#include "cqhci.h"

/* Tegra SDHOST controller vendor register definitions */
#define SDHCI_TEGRA_VENDOR_CLOCK_CTRL   0x100
#define SDHCI_CLOCK_CTRL_TAP_MASK   0x00ff0000define   x20000
#define SDHCI_CLOCK_CTRL_TAP_SHIFT   16
#define #define SDHCI_VNDR_TUN_CTRL0_START_TAP_VAL_MASK
#define SDHCI_CLOCK_CTRL_TRIM_SHIFT   24
#define SDHCI_CLOCK_CTRL_SDR50_TUNING_OVERRIDE  BIT(5)
#efine   BIT3java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
#define#define SDHCI_VNDR_TUN_CTRL0_TUN_ITER_MASK  0x000e000

#define SDHCI_TEGRA_VENDOR_SYS_SW_CTRL  0x104
defineSDHCI_TEGRA_SYS_SW_CTRL_ENHANCED_STROBEBIT)

#defineSDHCI_TEGRA_VENDOR_CAP_OVERRIDES0
#defineSDHCI_TEGRA_CAP_OVERRIDES_DQS_TRIM_MASKx00003f00
#define SDHCI_TEGRA_CAP_OVERRIDES_DQS_TRIM_SHIFTdefineTRIES_128   2

#define SDHCI_TEGRA_VENDOR_MISC_CTRL   0x120
#define SDHCI_MISC_CTRL_ERASE_TIMEOUT_LIMIT  BIT(0)
#define SDHCI_MISC_CTRL_ENABLE_SDR104   0x8define    java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  0x10
#define#efine    x1C8
define   0java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44

  java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
#define SDHCI_TEGRA_DLLCAL_CALIBRATE   BIT(31)

#define SDHCI_TEGRA_VENDOR_DLLCAL_STA   0x1bc
#define    (3)

#define   0x7
#definedefine BIT1
#define #define SDHCI_COMP_PADCTRL_DRVUPDN_OFFSET_MASK
SDHCI_VNDR_TUN_CTRL0_START_TAP_VAL_SHIFT
##    BITjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
define  6
#define SDHCI_VNDR_TUN_CTRL0_TUN_ITER_MASK  0java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 45
#define SDHCI_VNDR_TUN_CTRL0_TUN_ITER_SHIFTNVQUIRK_ENABLE_SDR50 (3
#defineTRIES_128   2
#define TRIES_256     4
#define SDHCI_VNDR_TUN_CTRL0_TUN_WORD_SEL_MASK  0x7

#definejava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
#define SDHCI_TEGRA_VNDR_TUN_STATUS0   0 * drive 
define   0
#define SDHCI_TEGRA_VNDR_TUN_STATUS1_TAP_MASK  0xFF
#define SDHCI_TEGRA_VNDR_TUN_STATUS1_END_TAP_SHIFT 0x8
#define TUNING_WORD_BIT_SIZE * 3V3/1V8 pad selection happens * on the java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 3

define   0e4
#define SDHCI_AUTO_CAL_START    BIT(31)
#define SDHCI_AUTO_CAL_ENABLE
#define SDHCI_AUTO_CAL_PDPU_OFFSET_MASK   0x0000ffff

 * SDMMC hardware
defineSDHCI_TEGRA_SDMEM_COMP_PADCTRL_VREF_SEL_MASK0
#define SDHCI_TEGRA_SDMEM_COMP_PADCTRL_VREF_SEL_VALjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
define BIT(1java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
define  0x07FFF000

#define SDHCI_TEGRA_AUTO_CAL_STATUS   0x1ec
#define#define    xF000

#define SDHCI_TEGRA_CIF2AXI_CTRL_0   0x1fc

#define NVQUIRK_FORCE_SDHCI_SPEC_200   BIT(0)
#define NVQUIRK_ENABLE_BLOCK_GAP_DET  SDHCI_TRNS_BLK_CNT_EN \
LE_SDHCI_SPEC_300  BIT2)
#define NVQUIRK_ENABLE_SDR50    BIT(3)
#define NVQUIRK_ENABLE_SDR104   BIT)
#define NVQUIRK_ENABLE_DDR50    BIT(5)
/*
 * HAS_PADCALIB NVQUIRK is for SoC's supporting auto calibration of pads
 * drive strength.
 */

#define NVQUIRK_HAS_PADCALIB    BIT(6)
/*
 * NEEDS_PAD_CONTROL NVQUIRK is for SoC's having separate 3V3 and 1V8 pads.
 * 3V3/1V8 pad selection happens through pinctrl state selection depending
 * on the signaling mode.
 */

#define NVQUIRK_NEEDS_PAD_CONTROL   BIT(7)
#define NVQUIRK_DIS_CARD_CLK_CONFIG_TAP min_tap_delay
# NVQUIRK_CQHCI_DCMD_R1B_CMD_TIMING(9)

/*
 * NVQUIRK_HAS_TMCLK is for SoC's having separate timeout clock for Tegra
 * SDMMC hardware data timeout.
 */

#define NVQUIRK_HAS_TMCLK    BIT(10)

#definel_up_3v3;
#define NVQUIRK_PROGRAM_STREAMID   BIT(12)

* CQEBase for  Ver41and */
#defineSDHCI_TEGRA_CQE_BASE_ADDR0

ine ( | java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
    | \
 3 ;

struct sdhci_tegra_soc_data {
 const pull_up_hs400
u64;
 u32java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 u8;
 u8 max_tap_delay;
};

/* Magic pull up and pull down pad calibration offsets */;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
  pull_up_3v3
  pull_down_3v3;
 u32 pull_up_3v3_timeout;
 u32 pull_down_3v3_timeout;
 u32 pull_up_1v8;struct  *;
 u32    *pinctrl_state_3v3_drvjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
 u32 ;
 u32 pull_down_1v8_timeout;
 u32;
 u32 java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
  pull_up_hs400
 3 ;
};

struct sdhci_tegra
  structsdhci_tegra_soc_data*;
 struct gpio_desc *java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 2
s clktmclk
 bool ddr_signaling;
 bool pad_calib_required;
 struct *ltfm_hosth);

 struct *rst;
 struct pinctrl *pinctrl_sdmmc;
 struct pinctrl_state * const struct sdhci_tegra_soc_data *soc_ >;
 struct pinctrl_statepinctrl_state_1v8
 struct pinctrl_state  reg=SDHCI_HOST_VERSION java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
 return;

 structjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 ktime_t last_calib

 u32 voidtegra_sdhci_writew( sdhci_hosthost  valint)
 u32 java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 1
 u32 dqs_trim;
 bool () {
 unsigned SDHCI_TRANSFER_MODE
 u8 tuned_tap_delayjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
 u32   * command write that is down java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

static tegra_sdhci_readw  *host  reg
{
struct  *pltfm_host sdhci_priv(ost;
 struct ;
 const struct sdhci_tegra_soc_data

 if
  reg )))java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
 /* Erratum: Version register is invalid in HW. */
  return SDHCI_SPEC_200;
 }

  (host-  );
}

static
{
 struct pltfm_host()

 switch (reg) {
 case SDHCI_TRANSFER_MODE:
  /*
 * Postpone this write, we must do it together with a
 * command write that is down below.
 */

  pltfm_host->xfer_mode_shadow = val;
  return;
 case SDHCI_COMMAND:
  writel((val << 16) | pltfm_host->xfer_mode_shadow,
   host->ioaddr + SDHCI_TRANSFER_MODE);
  return;
 }

 writew(val, host->ioaddr + reg);
}

static void tegra_sdhci_writel(struct sdhci_host *host, u32 val, int reg)
{
 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host);
 const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data;

 /* Seems like we're getting spurious timeout and crc errors, so
 * disable signalling of them. In case of real errors software
 * timers should take care of eventually detecting them.
 */

 if (unlikely(reg == SDHCI_SIGNAL_ENABLE))
  val &= ~(SDHCI_INT_TIMEOUT|SDHCI_INT_CRC);

 writel(val, host->ioaddr + reg);

 if (unlikely((soc_data->nvquirks & NVQUIRK_ENABLE_BLOCK_GAP_DET) &&
   (reg == SDHCI_INT_ENABLE))) {
  /* Erratum: Must enable block gap interrupt detection */
  u8 gap_ctrl = readb(host->ioaddr + SDHCI_BLOCK_GAP_CONTROL);
  if (val & SDHCI_INT_CARD_INT)
   gap_ctrl |=java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 4
 else
   & 0;
 (gap_ctrl> +)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
 }  val)
 | 0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19

java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 bool status;
 u32 reg;

 reg = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
 status = !!(reg & SDHCI_CLOCK_CARD_ENbool status

  =java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
 status

 if
reg=;
 else
  reg&=~;

 }

 return staticvoid tegra210_sdhci_writewstructsdhci_host *ost  valint)
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 1

static void tegra210_sdhci_writew(struct sdhci_host *host, u16 val, int reg)
{
bool =;
 bool )

 MAND)
  is_tuning_cmd udelay)

 if ()
  (hostclk_enabled

 writew(val, host->ioaddr + reg);

 if (is_tuning_cmd) {
  udelay(1);
  sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
}
 }
}

static  /*
{
/*
 * Write-enable shall be assumed if GPIO is missing in a board's
 * device-tree because SDHCI's WRITE_PROTECT bit doesn't work on
 * Tegra.
 */

  .
}

static bool tegra_sdhci_is_pad_and_regulator_valid(struct java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
struct * = sdhci_privhost
 struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host sdhci_tegra*tegra_host = (pltfm_host
  has_1v8;

 /*
 * The SoCs which have NVQUIRK_NEEDS_PAD_CONTROL require software pad
 * voltage configuration in order to perform voltage switching. This
 * means that valid pinctrl info is required on SDHCI instances capable
 * of performing voltage switching. Whether or not an SDHCI instance is
 * capable of voltage switching is determined based on the regulator.
 */


 if (!(tegra_host->soc_data->nvquirks &  * of performing voltage switching. Whether or  * capable of voltage switching is determined based java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 ;

 if ;
  return false

   1700000500;
       1700000, 1950000);

 has_3v3 = regulator_is_supported_voltage(host->mmc->supply
       2700000, 3600000  2000 600)

 ifjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
 static( *,  inttap

 /* Fixed voltage, no pad control required. */   * = (host

}

static (struct *,  int)
{
  card_clk_enabled;
 struct sdhci_tegra *tegra_host 3 ;
  *
bool card_clk_enabled = false;
u32 reg;

/*
 * Touching the tap values is a bit tricky on some SoC generations.
 * The quirk enables a workaround for a glitch that sometimes occurs if
 * the tap values are changed.
 */


 if (soc_data->nvquirks &  *the tapvalues changed.
 

 reg = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
 reg &= ~SDHCI_CLOCK_CTRL_TAP_MASK;
reg|  <<SDHCI_CLOCK_CTRL_TAP_SHIFT
 

  (soc_data-> &NVQUIRK_DIS_CARD_CLK_CONFIG_TAP&
    card_clk_enabled{
  udelay(1);
  sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA)  |=tap <SDHCI_CLOCK_CTRL_TAP_SHIFT
 tegra_sdhci_configure_card_clk,card_clk_enabled
 }
}

static void tegra_sdhci_reset(struct card_clk_enabled java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
{
 struct sdhci_pltfm_host *pltfm_host  java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 struct *egra_host  sdhci_pltfm_privpltfm_host
 const struct sdhci_tegra_soc_data *soc_data = tegra_host-
 u32 misc_ctrl, clk_ctrl, pad_ctrl;

 sdhci_and_cqhci_reset(host, mask);

 if (!(mask &  struct sdhci_tegra *tegra_host * =sdhci_pltfm_priv(pltfm_host;
  return;

 tegra_sdhci_set_tap u32 misc_ctrl clk_ctrl,pad_ctrl

sdhci_and_cqhci_reset, mask;
 clk_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);

  ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        SDHCI_MISC_CTRL_ENABLE_DDR50
         SDHCI_MISC_CTRL_ENABLE_SDR104);

 clk_ctrl &= ~(SDHCI_CLOCK_CTRL_TRIM_MASK |
 clk_ctrl (host SDHCI_TEGRA_VENDOR_CLOCK_CTRL)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61

 iftegra_sdhci_is_pad_and_regulator_valid))java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
        )
  ifif tegra_sdhci_is_pad_and_regulator_valid){
  > NVQUIRK_ENABLE_SDHCI_SPEC_300
  misc_ctrl=;
  if if(>nvquirks&NVQUIRK_ENABLE_SDR50java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
    soc_data- &NVQUIRK_ENABLE_SDR104java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
  if (soc_data-  | ;
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if (soc_data->nvquirks &
   | ;
  if (hostclk_ctrl);
   clk_ctrl soc_data- &) 
 }

c | >default_trimSDHCI_CLOCK_CTRL_TRIM_SHIFT

s(hostmisc_ctrl);
 dhci_writelhostclk_ctrlSDHCI_TEGRA_VENDOR_CLOCK_CTRL

>nvquirks NVQUIRK_HAS_PADCALIB){
  pad_ctrl = sdhci_readl(host, SDHCI_TEGRA_SDMEM_COMP_PADCTRL);
  }
  pad_ctrl |= SDHCI_TEGRA_SDMEM_COMP_PADCTRL_VREF_SEL_VAL;
  sdhci_writeljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  tegra_host-
 }

 >  ;
}

static  * Enable or disable the additional I/O  * calibration process. java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

 /*
 * Enable or disable the additional I/O pad used by the drive strength
 * calibration process.
 */

 =(host,);

 if  reg
  val |=(hostSDHCI_TEGRA_AUTO_CAL_CONFIG;
 else eg=~;
  valr |=pdpu

 sdhci_writel(host, val, SDHCI_TEGRA_SDMEM_COMP_PADCTRL);

 if (enable)
 u(1 );
}

static tegra_sdhci_set_pad_autocal_offset  *host
            u16 pdpu)
{
 u32 reg;

reg (hostSDHCI_TEGRA_AUTO_CAL_CONFIG
r & SDHCI_AUTO_CAL_PDPU_OFFSET_MASK
eg |pdpu
sdhci_writelhost,reg);
}

static int tegra_sdhci_set_padctrl(struct sdhci_host   drvup0drvdn0java.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25
       bool =
{
 struct sdhci_pltfm_host =>;
 structdrvdn>;
 struct sdhci_tegra_autocal_offsetselsejava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
     drvup>;
struct * =NULL
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
 u8 drvup  (tegra_host-,
 u32

  !) {
  /* PADS Drive Strength */ dev_errm(host-),
 (= ){
   if (tegra_host->pinctrl_state_1v8_drv) {
    pinctrl_drvupdn =
   tegra_host-;
   }   reg sdhci_readl,
      SDHCI_TEGRA_SDMEM_COMP_PADCTRL)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  drvdn=>pull_down_1v8_timeout
   }
  }  SDHCI_TEGRA_SDMEM_COMP_PADCTRL;
   if (tegra_host->pinctrl_state_3v3_drv
    pinctrl_drvupdn =
     tegra_host-pinctrl_state_3v3_drv
   } else {
   drvupo>pull_up_3v3_timeout
    drvdn    0
   }
 }

  if (pinctrl_drvupdn != NULL) {
    =pinctrl_select_state>pinctrl_sdmmc,
       pinctrl_drvupdn);
   if (ret < 0)
  (mmc_dev>mmc
    if( < )
  } else if ((drvup) || (drvdn))   dev_err(host-),
   reg=sdhci_readl(,
     SDHCI_TEGRA_SDMEM_COMP_PADCTRL);
   reg &= ~SDHCI_COMP_PADCTRL_DRVUPDN_OFFSET_MASK;
   reg |= ( << 20 |(drvdn << 12;
   sdhci_writelhost reg
     SDHCI_TEGRA_SDMEM_COMP_PADCTRL    tegra_host-pinctrl_state_3v3;
  }

 } else {
  /* Dual Voltage PADS Voltage selection */
  if (!   dev_errmmc_dev>mmc,
   return 0;

  if (voltage==MMC_SIGNAL_VOLTAGE_180){
   ret = }
      tegra_host->pinctrl_state_1v8);
   if (ret
    dev_err
   static tegra_sdhci_pad_autocalib sdhci_host*ost
  } else *pltfm_host sdhci_priv();
   ret = dhci_tegra *egra_host (pltfm_host
      sdhci_tegra_autocal_offsets =
     tegra_host-a;
   dev_err(host-),
     " card_clk_enabled;
  }
 }

 returnret
}

static   :
{
 sdhci_pltfm_host* =(host
 struct sdhci_tegra *tegra_host = break
 struct  = .pull_down_hs400< |.pull_up_hs400java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
   tegra_host->autocal_offsets;
structmmc_ios* = &>mmc-;
  else
 u16 pdpu;
 u32 reg;
 int ret;

 switch (ios->timing) {
 case MMC_TIMING_UHS_SDR104:
  pdpu = offsets.pull_down_sdr104 << 8 | offsets.pull_up_sdr104;
  break;
 case MMC_TIMING_MMC_HS400:
 pdpu=offsetspull_down_hs400< 8 |offsetspull_up_hs400
  break;
 default:
   /* Set initial offset before auto-calibration */
   pdpu = offsets.pull_down_1v8 << 8 | offsets.pull_up_1v8;
  else
pdpu. <8|offsets;
 }

 /* Set initial offset before auto-calibration */
t(host pdpu

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 tegra_sdhci_configure_cal_pad(host,  reg, !(reg & SDHCI_TEGRA_AUTO_CA

 reg = sdhci_readl(host, SDHCI_TEGRA_AUTO_CAL_CONFIG);
 |= SDHCI_AUTO_CAL_ENABLE  ;
  sdhci_writel

 usleep_range
java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
ret readl_poll_timeout(>ioaddr,
     reg, !(reg &  & SDHCI_AUTO_CAL_ENABLE
     1000, 10000);

tegra_sdhci_configure_cal_padhost);

tegra_sdhci_configure_card_clk, );

 if (ret) {
  dev_err(  Settingdrive :dn")

  /* Disable automatic cal and use fixed Drive Strengths */(struct *)
 reg=sdhci_readl(host );
  reg &  sdhci_tegra*egra_host (pltfm_host
 truct * =

  = (host>signal_voltage);
  if (ret <int;
   (mmc_dev>mmc
   ",pad-autocal-pull-up-offset-3v3",
 }
}

static (struct *)
{
 struct sdhci_pltfm_host  >pull_up_3v3=0java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
   *  pltfm_host;
 struct sdhci_tegra_autocal_offsets&>pull_down_3v3)
   & autocal-pull_down_3v30
 int err;

 err"nvidiapad-autocal-pull-up-offset-1v8"
  nvidia"
   & if (err)
i err
  autocal->pull_up_3v3 =device_property_read_u32(host-mmc

 err = device_property_read_u32(mmc_dev(  &autocal->);
   "nvidia,pad-autocal-pull-down-offset-3v3 >pull_down_1v8 =0
   &>pull_down_3v3
  (err
  autocal- = 0

 err = device_property_read_u32  autocal-> =autocal-;
   "nvidia =device_property_read_u32(>mmc,
   &autocal->pull_up_1v8);
 if ()
  autocal- &>pull_down_sdr104

 err>pull_down_sdr104>;
   "nvidia, err = device_property_read_u32mmc_dev>mmc)
   &autocal-autocal-);
 if> >;
  autocal-((host-)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51

 err
   nvidia"
  * Different fail-safe drive strength values based on the  * voltage are applicable for SoCs supporting 3  * So, avoid reading below device tree properties for SoCs that don't
 if ( return
  autocal-> =(mmc_dev>mmc

 err = device_property_read_u32(mmc_dev(host-&>pull_up_3v3_timeout
   " if (!IS_(tegra_host->) &
  autocal-);
 if   ("s autocal 3 drvs\"
 > = autocal-;

  =device_property_read_u32(host-),
  (mmc_dev>mmc
  &utocal-)
iferr
 autocal-> = autocal->pull_up_1v8;

err device_property_read_u32((host-),
   "nvidia,pad-autocal-pull-down-offset-hs400)
   &autocal->pull_down_hs400);
 if (err)
   pr_warn%:Missingtimeoutv3-padn",

 /*
 * Different fail-safe drive strength values based on the signaling
 * voltage are applicable for SoCs supporting 3V3 and 1V8 pad controls.
 * So, avoid reading below device tree properties for SoCs that don't
 * have NVQUIRK_NEEDS_PAD_CONTROL.
 */

 if (!(tegra_host->soc_data->nvquirks & NVQUIRK_NEEDS_PAD_CONTROL))
  return;

 err
   "nvidia, err = device_property_read_u32mmc_devhost->),
   &autocal->pull_up_3v3_timeout);  autocal-);
  (errjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
if!(tegra_host-) &
 (>pinctrl_state_3v3_drv ))
  ("%:Missing timeoutv3-paddrvsn,
    mmc_hostname(host- = 0
  autocal-
 }

 err =   ",pad-autocal-pull-down-offset-1v8-timeout,
  nvidia"java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
  autocal-);
 if (err)  (>pinctrl_state_1v8_drv ))
  !(tegra_host-) &java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
 (>pinctrl_state_3v3_drv=NULL)
   pr_warn("%java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

  autocal->pull_down_3v3_timeout = 0;
 }

 errstruct *pltfm_host=sdhci_priv);
   "nvidia sdhci_tegra* = (pltfm_host)
 al->);
 if (err) /* 100 ms calibration interval is specified in the TRM */
 if!(tegra_host-) &
   (tegra_host->pinctrl_state_1v8_drv ==  (host
   pr_warn( tegra_host- =ktime_get(;
   }
  autocal->pull_up_1v8_timeout = 0;
 }

 err=(mmc_dev>mmc
   
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 if (err) {
  if (!IS_ERR
  (>pinctrl_state_1v8_drv= NULL
   pr_warn("%s: Missinggra_host = sdhci_pltfm_priv(pltfm_host;
    mmc_hostname(host-
  >pull_down_1v8_timeout ;
 }
}

 void(structmmc_host*, struct  *)
{
 struct sdhci_host java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 struct sdhci_tegra *tegra_host = sdhci_pltfm_priverr
 ktime_t since_calib

 /* 100 ms calibration interval is specified in the TRM */
 )1)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  tegra_sdhci_pad_autocalibhost
  tegra_host->last_calib = java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 1
 }

 sdhci_request(mmc, mrq);
}

static void 
{
 struct   egra_host- =true
 struct  * = sdhci_pltfm_privpltfm_host
 int

 err = device_property_read_u32(mmc_dev(host->mmctegra_sdhci_parse_tap_and_trim);
           &  tegra_sdhci_set_clock sdhci_host *,  intclock
 if
  tegra_host-default_tap0

 err=device_property_read_u32(host-),",",
           &tegra_host->default_trim);

  tegra_host->default_trim = unsignedlong;

 err = device_property_read_u32 !lock
           &tegra_host->dqs_trimreturn (hostclock)
 /java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  tegra_host-  * divider to be configured to divided the host clock  * clock divider is calculated as part of sdhci_set_clock() by
}

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

 if (device_property_read_bool(mmc_dev(host->mmc), "supports-cqe"))
  tegra_host->enable_hwcq = true;
 else
    * By setting the host->max_clk to clock * 2 the divider calculation

 tegra_sdhci_parse_pad_autocal_dt(host);
 tegra_sdhci_parse_tap_and_trim(host);
}

static void tegra_sdhci_set_clock ost_clk=tegra_host-ddr_signaling ?clock 2 :clockjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
{
 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host);
 struct device *dev = mmc_dev(host-  host_clk,err;
  long;
int;

 if (!clock host-> = clk_get_ratepltfm_host->lk
  sdhci_set_clock(host clock

 /*
 * In DDR50/52 modes the Tegra SDHCI controllers require the SDHCI
 * divider to be configured to divided the host clock by two. The SDHCI
 * clock divider is calculated as part of sdhci_set_clock() by
 * sdhci_calc_clk(). The divider is calculated from host->max_clk and
 * the requested clock rate.
 *
 * By setting the host->max_clk to clock * 2 the divider calculation
 * will always result in the correct value for DDR50/52 modes,
 * regardless of clock rate rounding, which may happen if the value
 * from clk_get_rate() is used.
 */

 host_clk = tegra_host- if (ios->enhanced_strobe) {

 err = dev_pm_opp_set_rate(dev, host_clk   * switching to HS400ES mode, the bus is operating at
 if (err   * either MMC_HIGH_26_MAX_DTR or    * To meet Tegra SDHCI requirement at   * interface clock to MMC_HS200_MAX_DTR (   * controller CAR
 (dev failedto    luHz dn"
  

 tegra_host->curr_clk_rate = clk_get_rate(pltfm_host->clk);
 if (tegra_host->ddr_signaling)
  host->max_clkjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 else
  >max_clk (pltfm_host-)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

 sdhci_set_clock  tegra_sdhci_set_dqs_trim sdhci_host, trim

 if val
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 = false
 }
}

static void tegra_sdhci_hs400_enhanced_strobe(struct mmc_host *mmc,
           struct mmc_ios *ios
{
 struct * =mmc_priv);
 u32 val;

 val = sdhci_readl(host, SDHCI_TEGRA_VENDOR_SYS_SW_CTRL);int;

 if(>enhanced_strobe
  | ;
  /*
 * When CMD13 is sent from mmc_select_hs400es() after
 * switching to HS400ES mode, the bus is operating at
 * either MMC_HIGH_26_MAX_DTR or MMC_HIGH_52_MAX_DTR.
 * To meet Tegra SDHCI requirement at HS400ES mode, force SDHCI
 * interface clock to MMC_HS200_MAX_DTR (200 MHz) so that host
 * controller CAR clock and the interface clock are rate matched.
 */

 egra_sdhci_set_clock, );
 } {
  val &= ~SDHCI_TEGRA_SYS_SW_CTRL_ENHANCED_STROBE
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 sdhci_writel(host, val, SDHCI_TEGRA_VENDOR_SYS_SW_CTRL);
}

static  tegra_sdhci_get_max_clock  *ost
{ tap_result
struct * = (host

 return clk_round_rate(pltfm_host->clk, UINT_MAX);
}

  = ;
{
 u32;

val=sdhci_readlhostSDHCI_TEGRA_VENDOR_CAP_OVERRIDES;
 val &u8  =0
;
 sdhci_writel total_tuning_words=host->uning_loop_count/TUNING_WORD_BIT_SIZE
}

static void tegra_sdhci_hs400_dll_cal(struct sdhci_host *host)
{
 u32 reg;
int;

reg (, SDHCI_TEGRA_VENDOR_DLLCAL_CFG;
reg = SDHCI_TEGRA_DLLCAL_CALIBRATE
  | ;

 /* 1 ms sleep, 5 ms timeout */ (hostSDHCI_TEGRA_VNDR_TUN_STATUS0
 err =  (bit<TUNING_WORD_BIT_SIZE{
     reg, !(reg & SDHCI_TEGRA_DLLCAL_STA_ACTIVE),
     1000, 5000);
 if (err)
  (mmc_dev>mmc
  " line out\";
}

gra_sdhci_tap_correction sdhci_hosthostu8,
           u8 thd_low, u8  (first_fail
{
 struct first_fail true;
 struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host);
 u32 val,
u , , edge1 , ;
 bool    start_pass_tap ;
 bool =;
 bool start_pass = falseif !) java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
boolend_passfalsejava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 bool first_fail =      !) {
 boolfirst_pass false;
 u8 start_pass_tap 0;
 u8 end_pass_tap = 0;
 u8 first_fail_tap = 0;
 u8 first_pass_tap=0java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 u8  window  - start_pass_tap

 /*
 * Read auto-tuned results and extract good valid passing window by
 * filtering out un-wanted bubble/partial/merged windows.
 */

 for (word = 0; word < total_tuning_words; word++) {
  val = sdhci_readl(host,    start_pass_tap = tap
 val& ~;
  val |= word   else {
  sdhci_writel(host, val, SDHCI_VNDR_TUN_CTRL0_0);
 tun_status= sdhci_readl(host SDHCI_TEGRA_VNDR_TUN_STATUS0
  bit = 0;
  while    tap start_pass_tap+window 2;
 tap=word TUNING_WORD_BIT_SIZE+bit
   tap_result = tun_status  ;
      }
    start_fail = true;
    if (first_fail{
     first_fail_tap = tap;
     first_fail = true;
    }

   } else if (tap_result && start_fail && !start_pass) {
    start_pass_tap = tap;
    start_pass = true;
    if 
     first_pass_tap = tap;
     first_pass = true;
    }

  } if ( (1 no ,withdelayn)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
       !end_pass) {
  end_pass_taptap 1
    end_pass = true edge11 )
 }else if ( &&  & start_fail&java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
      end_pass{
    window = end_pass_tap -}
 }
    if (window >= thd_up || window < thd_low) {
    start_pass_tap=tap
     end_pass = false;
    } else {
  /* set tap at middle of valid window */
   tapstart_pass_tap + / ;
   tegra_host-tuned_tap_delaytap
     return fixed_tap, , ;
   java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
     clk_rate_mhz,bestcase,w;

   bitjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
  }
 }

 if(first_fail{
  WARN(1, "no edge detected, continue with hw tuned delay.\n");
 } else if  if(>min_tap_delay&>) {
  /* set tap location at fixed tap relative to the first edge */
   clk_rate_mhz =>curr_clk_rate/;
     =USEC_PER_SEC clk_rate_mhz
  bestcasemin_tap_dlyjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  else
 /
}
}

static void tegra_sdhci_post_tuning(struct sdhci_host *host)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host);
const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data;
u32 avg_tap_dly, val, min_tap_dly, max_tap_dly;
u8 fixed_tap, start_tap, end_tap, window_width;
u8 thdupper, thdlower;
u8 num_iter;
u32 clk_rate_mhz, period_ps, bestcase, worstcase;

/* retain HW tuned tap to use incase if no correction is needed */

val(, );
 tegra_host- SDHCI_TEGRA_VNDR_TUN_STATUS1_TAP_MASK
    =>;
 if (soc_data-   * partial window includes edges of   * merged window includes more taps so window   * than upper
  min_tap_dly = soc_data->min_tap_delay;
 max_tap_dly soc_data-;
  clk_rate_mhz  pr_debug%:Applycorrection"
  =USEC_PER_SEC/clk_rate_mhzjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  worstcase = period_ps(host tegra_host-);
 java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
   * Upper and Lower bound{
   * bubble windows
   */
   err = sdhci_execute_tuning(mmc, opcode);
  thdlower = worstcase  tegra_sdhci_post_tuning(host);
  /*
 * fixed tap is used when HW tuning result contains single edge
 * and tap is set at fixed tap delay relative to the first edge
 */

  avg_tap_dly = (period_ps * 2 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
  fixed_tap = avg_tap_dly / 2;

  val = sdhci_readl u8 iter = TRIES_256;
  start_tap = val & tegra_host->ddr_signaling = false;
  end_tap = (val  break;
     SDHCI_TEGRA_VNDR_TUN_STATUS1_TAP_MASK case MMC_TIMING_MMC_HS200:
  window_width iter TRIES_128
  num_iter = host-;
 /java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
   * partial  iter = TRIES_128;
   * merged window case MMC_TIMING_MMC_DDR52:
   tegra_host->ddr_signaling = true;
   */
  if (start_tap = default:
      (end_tap =  break;
   pr_debug("%s: Apply tuning correction\n",
     mmc_hostname(host->mmc));
   tegra_sdhci_tap_correction(host   SDHCI_VNDR_TUN_CTRL0_START_TAP_VAL_MASK |
         fixed_tap);
  1 << SDHCI_VNDR_TUN_CTRL0_MUL_M_SHIFT);
 }

 tegra_sdhci_set_tap(host, tegra_host-IES_128) ? 128 : 256;
}

static
{
 struct  tegra_sdhci_set_tap(host, tegra_host->tuned_tap_delay); else
 int err;

 err =  tegra_sdhci_set_dqs_trim(host, tegra_host->dqs_trim);
 if (!err && !host->tuning_err)
  tegra_sdhci_post_tuning(host);

 return err;
}

static void tegra_sdhci_set_uhs_signaling(struct sdhci_host
       unsigned timing)
{
 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host);
 booljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 bool  tegra_sdhci_set_tap, min
 ooldo_hs400_dll_cal ;
u8 = TRIES_256
  val

 tegra_host->ddr_signaling = false/
 switch (timing =min ;
 case MMC_TIMING_UHS_SDR50:
  break;
 case MMC_TIMING_UHS_SDR104:
 case MMC_TIMING_MMC_HS200:
  /* Don't set default tap on tunable modes. */
  iter  tegra_sdhci_set_taphost max
  break if(mc_send_tuninghost->, , NULL{
 case MMC_TIMING_MMC_HS400:
 set_dqs_trim = true;
   break
  iter = TRIES_128;
  break;
 case MMC_TIMING_MMC_DDR52:
 case MMC_TIMING_UHS_DDR50:
  tegra_host->ddr_signaling = true;
  set_default_tap = true;
  break;
 default:
  set_default_tap = true;
  break;
 }

 val = sdhci_readl(host, SDHCI_VNDR_TUN_CTRL0_0 *,
 val &= ~(   struct *iosjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
L_MASK
   struct * =sdhci_pltfm_priv)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
 valifios-signal_voltage=MMC_SIGNAL_VOLTAGE_330
  0<<SDHCI_VNDR_TUN_CTRL0_START_TAP_VAL_SHIFT
  1   ( <0
   ret
sdhci_writelhost,0 );

host- =( == ) ?2 : 26

  ret = sdhci_start_sign(mmc);

 tegra_sdhci_pad_autocalib(host);

 if (tegra_host->tuned_tap_delay && !set_default_tap)
  tegra_sdhci_set_tap(host, tegra_host->tuned_tap_delay);
else
 }

 if (set_dqs_trim)
  tegra_sdhci_set_dqs_trim(host, tegra_host->dqs_trim

 if ( tegra_sdhci_pad_auto(host);
  tegra_sdhci_hs400_dll_cal(host);
java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 1

static int tegra_sdhci_execute_tuning(struct sdhci_host *host, u32 opcode)
{
 unsigned int min, max;

 /*
 * Start search for minimum tap value at 10, as smaller values are
 * may wrongly be reported as working but fail at higher speeds,
 * according to the TRM.
 */

 min = 10;
 while (min < 255) {
  (hostmin
mc_send_tuning>mmc , NULL)
   break }
  min++;
 > =pinctrl_lookup_state

 /* Find the maximum tap value that still passes. */IS_ERR>)) java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
 max => = pinctrl_lookup_state
 while <5){
 (host );
if(host-, , ) 
  > =;
 }
  }
  ++
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
(,  +((max-min*3/4)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56

 return mmc_send_tuning
 >pinctrl_state_1v8java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

static int sdhci_tegra_start_signal_voltage_switch (tegra_host->)){
    structmmc_ios)
{
 struct * =mmc_priv);
 sdhci_pltfm_host * = sdhci_privhost
 struct
 int ret

 ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ret = tegra_sdhci_set_padctrljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if (ret < 0)
    retjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  ret = sdhci_start_signal_voltage_switch(mmc, ios  struct  * = >soc_data
 } else if (ios- soc_data- &)
  ret = sdhci_start_signal_voltage_switch(mmc, ios);
  if (ret < 
  return ret
  retjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 }

 if ( u8 ctrl
  tegra_sdhci_pad_autocalib timeout

 return ret;
}

  * During CQE resume/unhalt, CQHCI driver  * cqhci_host_ops enable where SDHCI DMA and BLOCK_SIZE   * to be re-configured.
      struct sdhci_tegra *tegra_host)
{
 java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 0
 if ( cqhci_readl, CQHCI_CTL  ) {
 (dev Noi,errldn,
    sdhci_cqe_enable);
    (val >mmioreg);
 }

 tegra_host->pinctrl_state_1v8_drv = pinctrl_lookup_state =ktime_compare() )  ;
   tegra_host-, "";
 if (IS_ERR  if !ctrl ) |timed_outjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  if (PTR_ERR(tegra_host->
   tegra_host->pinctrl_state_1v8_drv *CQE usuallyresumesvery quick, butincase if Tegra CQE
 }

  *java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
   tegra_host-pinctrl_sdmmc "")java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
 if IS_ERR>pinctrl_state_3v3_drv){
  if (PTR_ERR(tegra_host->pinctrl_state_3v3_drv) == -ENODEV)
   tegra_host->pinctrl_state_3v3_drv = NULL;
 }

 tegra_host->pinctrl_state_3v3 =
  pinctrl_lookup_statet>pinctrl_sdmmc,"");
 if (IS_ERR(tegra_host->pinctrl_state_3v3)) {
 dev_warndev Missing33  ,err %\"
    PTR_ERR
-1
 }

 tegra_host->pinctrl_state_1v8 =
  pinctrl_lookup_state
 if (IS_ERR(tegra_host->pinctrl_state_1v8)) {
  dev_warn(dev, "Missing if(soc_data-nvquirks &NVQUIRK_CQHCI_DCMD_R1B_CMD_TIMING &&
    PTR_ERR(tegra_host->pinctrl_state_1v8));
  return -1;
 }

 tegra_host- *ata=(1);

 return 0;
}

static void tegra_sdhci_voltage_switch(struct sdhci_host *host)
{
 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host
 const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data;

 if (soc_data->nvquirks & NVQUIRK_HAS_PADCALIB)
  tegra_host->pad_calib_required = true;
}

static void tegra_cqhci_writel(struct cqhci_host val (, );
{
 struct  cqhci_writel, (al  CQHCI_ENABLE
  sdhci_hosthost (mmc
 u8 ctrl;

b timed_out

 /*
 * During CQE resume/unhalt, CQHCI driver unhalts CQE prior to
 * cqhci_host_ops enable where SDHCI DMA and BLOCK_SIZE registers need
 * to be re-configured.
 * Tegra CQHCI/SDHCI prevents write access to block size register when
 * CQE is unhalted. So handling CQE resume sequence here to configure
 * SDHCI block registers prior to exiting CQE halt state.
 */

 if (reg == CQHCI_CTL && !(val & CQHCI_HALT) &&
     cqhci_readl(cq_host,   * Recommended fix to set CBC to 0 allowing send status
  sdhci_writew( val = cqhci_readl, CQHCI_SSC1java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  sdhci_cqe_enable(mmc( mmc_host)
  writel(val, cq_host->mmio + reg);
  timeout = ktime_add_us(ktime_get(), 50);
  while (1) {
   timed_out = ktime_compare(ktime_get(), timeout) > 0;
   ctrl = cqhci_readl(cq_host, CQHCI_CTL);
   if (!(ctrl & CQHCI_HALT) || timed_out)
    break;
  }
  /*
 * CQE usually resumes very quick, but incase if Tegra CQE
 * doesn't resume retry unhalt.
 */

  if (timed_out)
   (val >mmio +reg
 } elsejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  writel(val, cq_host->mmio + reg);
 }
}

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   struct  *, u64 *)
{
  sdhci_pltfm_hostpltfm_host  sdhci_priv(mc_priv(mc);
 struct sdhci_tegra *java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
 const struct sdhci_tegra_soc_data 

 if (soc_data->nvquirks java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     mrq->cmd->     struct mmc_c cmd
  * u32 val
}

static void sdhci_tegra_cqe_enable(struct mmc_host *mmc)
{
 struct cqhci_host *cq_host = mmc->cqe_private  * enough for long operations like cache flush, sleep awake  *
 struct sdhci_host *host = mmc_priv  * host controller to wait for busy state until the card is  * without HW timeout.
 u32 val;

 /*
 * Tegra CQHCI/SDMMC design prevents write access to sdhci block size
 * register when CQE is enabled and unhalted.
 * CQHCI driver enables CQE prior to activation, so disable CQE before
 * programming block size in sdhci controller and enable it back.
 */

 if val= SDHCI_MISC_CTRL_ERASE_TIMEOUT_LIMIT
  val = cqhci_readl(cq_host,  val &= ~SDHCI_MISC_CTRL_ERASE_TIMEOUT_
 ifval QHCI_ENABLE
   cqhci_writel(cq_host, (val & ~CQHCI_ENABLE),
         CQHCI_CFG);
 
i_cqe_enable);
  if (val & CQHCI_ENABLE)

 }

 /*
 * CMD CRC errors are seen sometimes with some eMMC devices when status
 * command is sent during transfer of last data block which is the
 * default case as send status command block counter (CBC) is 1.
 * Recommended fix to set CBC to 0 allowing send status command only
 * when data lines are idle.
 */

 val = cqhci_readl(cq_host, reg =CQHCI_ENABLE
 val=~;
 cqhci_writel(cq_host, val, CQHCI_SSC1);
}

static void sdhci_tegra_dumpregs

(())java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}

static u32 sdhci_tegra_cqhci_irq(struct sdhci_host *host, u32 intmask)
{
  cmd_error ;
 int data_error = 0;

 if .    =tegra_cqhci_writel
  returnintmask;

 cqhci_irq disable ,

 return0;
}

static void tegra_sdhci_set_timeout(struct sdhci_host *host,
        struct mmc_command *cmd)
{
 ;

/
  struct sdhci_tegra *tegra = sdhci_pltfm_priv(platform);
  * counter and maximum supported timeout is 11s which java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  * enough for long operations}
  *tatic const struct sdhci_ops tegra_sdhci_ops = {
  * ERASE_TIMEOUT_LIMIT bit of VENDOR_MISC_CTRL register .read_w     = tegra_sdhci_readw,
  * host controller .set_clock  = tegra_sdhci_set_clock,
  * without HW timeout.
  *
  * So, use infinite busy .platform_execute_tuning = tegra_sdhci_execute_tuning,
  * more than maximum HW busy timeout .voltage_switch = tegra_sdhci_voltage_switch,
  * busy wait mode.
  */
 val = sdhci_readl(host, SDHCI_TEGRA_VENDOR_MISC_CTRL);
 if (cmd && cmd-    SDHCI_QUIRK_SINGLE_POWER_WRITE |
  val |= SDHCI_MISC_CTRL_ERASE_TIMEOUT_LIMIT    SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
 else
  };


 __sdhci_set_timeout(host, cmd);
}

static void sdhci_tegra_cqe_pre_enable(struct mmc_host *mmc      NVQUIRK_HAS_ANDROID_GPT_SECTOR |
{
 struct cqhci_host *cq_host = mmc-static const struct sdhci_pltfm_data sdhci_tegra30_pdata = {
 u32 reg;

 reg    SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |    SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
 reg      SDHCI_QUIRK2_BROKEN_HS200 |
     /*
}

static void sdhci_tegra_cqe_post_disable(struct mmc_host *mmc)
{
struct cqhci_host *cq_host = mmc->cqe_private;
struct sdhci_host *host = mmc_priv(mmc);
u32 reg;

reg = cqhci_readl(cq_host, CQHCI_CFG);
reg &= ~CQHCI_ENABLE;
cqhci_writel(cq_host, reg, CQHCI_CFG);
sdhci_writew(host, 0x0, SDHCI_TRANSFER_MODE);
}

static const struct cqhci_host_ops sdhci_tegra_cqhci_ops = {
.write_l    = tegra_cqhci_writel,
.enable = sdhci_tegra_cqe_enable,
.disable = sdhci_cqe_disable,
.dumpregs = sdhci_tegra_dumpregs,
.update_dcmd_desc = sdhci_tegra_update_dcmd_desc,
.pre_enable = sdhci_tegra_cqe_pre_enable,
.post_disable = sdhci_tegra_cqe_post_disable,
};

static int tegra_sdhci_set_dma_mask(struct sdhci_host *host)
{
struct sdhci_pltfm_host *platform = sdhci_priv(host);
struct sdhci_tegra *tegra = sdhci_pltfm_priv(platform);
const struct sdhci_tegra_soc_data *soc = tegra->soc_data;
struct device *dev = mmc_dev(host->mmc);

if (soc->dma_mask)
return dma_set_mask_and_coherent(dev, soc->dma_mask);

return 0;
}

static const struct sdhci_ops tegra_sdhci_ops = {
.get_ro     = tegra_sdhci_get_ro,
.read_w     = tegra_sdhci_readw,
.write_l    = tegra_sdhci_writel,
.set_clock  = tegra_sdhci_set_clock,
.set_dma_mask = tegra_sdhci_set_dma_mask,
.set_bus_width = sdhci_set_bus_width,
.reset      = tegra_sdhci_reset,
.platform_execute_tuning = tegra_sdhci_execute_tuning,
.set_uhs_signaling = tegra_sdhci_set_uhs_signaling,
.voltage_switch = tegra_sdhci_voltage_switch,
.get_max_clock = tegra_sdhci_get_max_clock,
};

static const struct sdhci_pltfm_data sdhci_tegra20_pdata = {
.quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
  SDHCI_QUIRK_SINGLE_POWER_WRITE |
  SDHCI_QUIRK_NO_HISPD_BIT |
  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
.ops  = &tegra_sdhci_ops,
};

static const struct sdhci_tegra_soc_data soc_data_tegra20 = {
.pdata = &sdhci_tegra20_pdata,
.dma_mask = DMA_BIT_MASK(32),
.nvquirks = NVQUIRK_FORCE_SDHCI_SPEC_200 |
    NVQUIRK_HAS_ANDROID_GPT_SECTOR |
    NVQUIRK_ENABLE_BLOCK_GAP_DET,
};

static const struct sdhci_pltfm_data sdhci_tegra30_pdata = {
.quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
  SDHCI_QUIRK_SINGLE_POWER_WRITE |
  SDHCI_QUIRK_NO_HISPD_BIT |
  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
   SDHCI_QUIRK2_BROKEN_HS200 |
   /*
    * Auto-CMD23 leads to "Got command interrupt 0x00010000 even
    * though no command operation was in progress."
    *
    * The exact reason is unknown, as the same hardware seems
    * to support Auto CMD23 on a downstream 3.1 kernel.
    */

     SDHCI_QUIRK2_ACMD23_BROKEN,
 .ops  = &tegra_sdhci_ops,
};

static const struct ops=,
 .pdata = &sdhci_tegra30_pdata,
 .dma_mask = DMA_BIT_MASK(32),
 .nvquirks = NVQUIRK_ENABLE_SDHCI_SPEC_300 |
      NVQUIRK_ENABLE_SDR50 |
      NVQUIRK_ENABLE_SDR104 |
      NVQUIRK_HAS_ANDROID_GPT_SECTOR |
  dma_maskDMA_BIT_MASK3)
;

static const struct sdhci_ops tegra114_sdhci_ops const sdhci_ops = {
 .get_ro     = tegra_sdhci_get_ro,
 .read_w     = tegra_sdhci_readw,
 .write_w    = tegra_sdhci_writew,
 .write_l    = tegra_sdhci_writel,
 .et_clock ,
 .set_dma_mask = tegra_sdhci_set_dma_mask,
 .set_bus_width = sdhci_set_bus_width,
 .reset      = tegra_sdhci_reset,
 .platform_execute_tuning = tegra_sdhci_execute_tuning, reset=tegra_sdhci_reset
 . = tegra_sdhci_set_uhs_signaling
 .voltage_switch = tegra_sdhci_voltage_switchvoltage_switch= tegra_sdhci_voltage_switch
 .get_max_clock= tegra_sdhci_get_max_clock
}

static const struct sdhci_pltfm_data sdhci_tegra114_pdatastatic conststruct sdhci_tegra210_pdata{
 .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
    SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
    SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN
     |
    SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC
    SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
 .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN struct soc_data_tegra210java.lang.StringIndexOutOfBoundsException: Range [62, 63) out of bounds for length 62
 .ops  = &tegra114_sdhci_ops,     |
};

static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
 .data  sdhci_tegra114_pdata
 . |
 . NVQUIRK_HAS_TMCLK
};

static const struct sdhci_pltfm_data sdhci_tegra124_pdata = {
 .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL
    SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK|
    SDHCI_QUIRK_SINGLE_POWER_WRITE|
    SDHCI_QUIRK_NO_HISPD_BIT.read_w= tegra_sdhci_readw
    SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN
 .quirks2.set_dma_mask=tegra_sdhci_set_dma_mask
 .ops  =  set_bus_width ,
};

static const struct sdhci_tegra_soc_data  .set_uhs_signaling =tegra_sdhci_set_uhs_signaling
. = &sdhci_tegra124_pdata
.dma_mask (3),
 irq,
};

static const struct sdhci_ops java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0
 .get_ro     = tegra_sdhci_get_ro,
 .read_w     = tegra_sdhci_readw,
 .write_w    = tegra210_sdhci_writew,
 .write_l    = tegra_sdhci_writel,
 .set_clock  = tegra_sdhci_set_clock,
 .set_dma_mask = tegra_sdhci_set_dma_mask,
 .set_bus_width = java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 29
 .reset     = tegra_sdhci_reset
. = tegra_sdhci_set_uhs_signaling
 . = tegra_sdhci_voltage_switch
java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
      |
;

static const struct sdhci_pltfm_data java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 40
 .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL }
    SDHCI_QUIRK_SINGLE_POWER_WRITE |
    |
       ,
java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
 .NVQUIRK_DIS_CARD_CLK_CONFIG_TAP
 .ops  = &tegra210_sdhci_ops,
};

static const struct sdhci_tegra_soc_data =3,
 .pdata = &sdhci_tegra210_pdata,
. = (34),
 .nvquirks = NVQUIRK_NEEDS_PAD_CONTROL |
      NVQUIRK_HAS_PADCALIB |
      NVQUIRK_DIS_CARD_CLK_CONFIG_TAP |
      NVQUIRK_ENABLE_SDR50 |
      NVQUIRK_ENABLE_SDR104 . = DMA_BIT_MASK9),
        NVQUIRK_ENABLE_SDR50java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 .min_tap_delay = 106     NVQUIRK_HAS_TMCLK,
 max_tap_delay 15java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
};

static const struct sdhci_ops const  of_device_idsdhci_tegra_dt_match  java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
 .get_ro     = tegra_sdhci_get_ro,
 .read_w     =tegra_sdhci_readw
 .write_l    = tegra_sdhci_writel,
 .set_clock  = tegra_sdhci_set_clock,
   .ompatible "," data soc_data_tegra210 },
 .set_bus_width = sdhci_set_bus_width,
 .reset      = tegra_sdhci_reset,
 .set_uhs_signaling = tegra_sdhci_set_uhs_signaling,
 .voltage_switch = tegra_sdhci_voltage_switch,
 .get_max_clock = tegra_sdhci_get_max_clock,
 irq =sdhci_tegra_cqhci_irq,
 .set_timeout = tegra_sdhci_set_timeout. = &soc_data_tegra20,
};

staticconststructsdhci_pltfm_data  = {
 .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
  SDHCI_QUIRK_SINGLE_POWER_WRITE
    SDHCI_QUIRK_NO_HISPD_BIT |
    SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
 .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
 structsdhci_pltfm_host*pltfm_host = (host;
 .ps  =&tegra186_sdhci_ops,
};

static const struct ret
pdata,
.  (0,
 .nvquirks = NVQUIRK_NEEDS_PAD_CONTROL |
      NVQUIRK_HAS_PADCALIB |
      NVQUIRK_DIS_CARD_CLK_CONFIG_TAP |
      NVQUIRK_ENABLE_SDR50 |
      NVQUIRK_ENABLE_SDR104 |
      NVQUIRK_HAS_TMCLK |
     ,
 .min_tap_delay = 84,
 .max_tap_delay = 136,
};

static  sdhci_tegra_soc_data = {
 .pdata = &sdhci_tegra186_pdata,
 .dma_mask = DMA_BIT_MASK(39),
 .nvquirks= NVQUIRK_NEEDS_PAD_CONTROL |
        sizeof(*cq_host,GFP_KERNEL;
      |
      NVQUIRK_ENABLE_SDR50 |
      NVQUIRK_ENABLE_SDR104 |
     ,
 .min_tap_delay = }
 .max_tap_delay = 139,
};

static const struct sdhci_tegra_soc_data soc_data_tegra234 = {
 . =&sdhci_tegra186_pdata
 .java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 .nvquirks = NVQUIRK_NEEDS_PAD_CONTROL |
     NVQUIRK_HAS_PADCALIB|
      NVQUIRK_DIS_CARD_CLK_CONFIG_TAP 
      NVQUIRK_ENABLE_SDR50  = (cq_host >mmcdma64)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
      NVQUIRK_ENABLE_SDR104 |
      NVQUIRK_PROGRAM_STREAMID |
      NVQUIRK_HAS_TMCLK,
 .min_tap_delay = 95,
 .max_tap_delay = 111,
};

static const struct of_device_id sdhci_tegra_dt_match[] = {
 { .compatible = "nvidia,cleanup:
 { .compatible = "nvidia,tegra194-sdhci"
 { .compatible = "nvidia,java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 12
 { .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 },
 { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra124 },
 { .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 },
 { .compatible = "nvidia,tegra30-sdhci", .data = &java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 56
 {. = "nvidia,egra20-sdhci, .data = &oc_data_tegra20 ,
 {}
};
MODULE_DEVICE_TABLEif(>soc_data- &NVQUIRK_PROGRAM_STREAMID

static int sdhci_tegra_add_host(struct sdhci_host *host)
{
 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
s sdhci_tegra*egra_host = (pltfm_host;
 struct cqhci_host *cq_host;
 bool dma64;
 int ret;

 if (!tegra_host->enable_hwcq)
 return(host

 sdhci_enable_v4_mode(host);

 ret = sdhci_setup_host(host);
 if (ret)
  return ret;

 host->mmc->caps2 |= MMC_CAP2_CQE | MMC_CAP2_CQE_DCMD;

 cq_host = devm_kzalloc(mmc_devint;
    sizeof(soc_data (&pdev-dev
 if (!cq_host) {
  ret = -ENOMEM
g cleanup
}

 cq_host->mmio = host->ioaddr + SDHCI_TEGRA_CQE_BASE_ADDR
 cq_host->ops = &sdhci_tegra_cqhci_ops;

 dma64 = host->flags &tegra_host-ddr_signaling  ;
 if (dma64)
 cq_host- |=CQHCI_TASK_DESC_SZ_128

 ret = cqhci_init(cq_host, host->mmc, dma64);
 if (ret)
  goto cleanup;

 ret  __dhci_add_host(host;
 if (ret)
  goto cleanup  (soc_data->vquirks&NVQUIRK_NEEDS_PAD_CONTROL java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54

 return 0;

cleanup:
 sdhci_cleanup_host/
 return ret;
}

/* Program MC streamID for DMA transfers */
static  ;
{
 struct sdhci_pltfm_host *pltfm_hosth>.execute_tuning
 structjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 if (tegra_host->soc_data->nvquirks & NVQUIRK_PROGRAM_STREAMID) {
  tegra_sdhci_writel(host, FIELD_PREP(GENMASK(15, 8), tegra_host->stream_id) |
     FIELD_PREP((7 ) >stream_id
      SDHCI_TEGRA_CIF2AXI_CTRL_0);
 }
}

staticint sdhci_tegra_probestruct *)
{
 const struct sdhci_tegra_soc_data *soc_data;
 struct sdhci_host *host;
 struct sdhci_pltfm_host *pltfm_host;
 struct sdhci_tegra *tegra_host;
 struct clk *clk;
int;

 soc_data = of_device_get_match_data(&pdev->dev);
 if (!soc_data)
  return -EINVAL;

 host =  tegra_host->power_gpio (&pdev-, ",
 if (IS_ERR(host))
 PTR_ERRhost)
  = (host

 tegra_host sdhci_pltfm_priv)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
 tegra_host-  * timeout clock and SW can choose TMCLK or SDCLK  * data timeout through the bit USE_TMCLK_FOR_DATA_TIMEOUT of
 tegra_host->pad_calib_required  * USE_TMCLK_FOR_DATA_TIMEOUT bit default is set to 1 and SDMMC   * 12Mhz TMCLK which is advertised in host capability register.
 tegra_host->pad_control_available = false  * So, TMCLK is  * supporting separate TMCLK.
tegra_host->soc_data = soc_data

 if (soc_data->nvquirks & NVQUIRK_HAS_ANDROID_GPT_SECTOR)
  host->mmc->caps2 |= MMC_CAP2_ALT_GPT_TEGRA

 if (soc_data->nvquirks returnrc
  rc = tegra_sdhci_init_pinctrl_info(&pdev->dev, tegra_host);
  if (rc == 0)
   host->mmc_host_ops.start_signal_voltage_switch =
    sdhci_tegra_start_signal_voltage_switch;
 }

 /* Hook to periodically rerun pad calibration */
 if (soc_data->nvquirks & NVQUIRK_HAS_PADCALIB)
  host-mmc_host_opsrequest =tegra_sdhci_request

  }
   tegra_sdhci_hs400_enhanced_strobe;

 if (!host->if (){
  host->mmc_host_ops.execute_tuning =
    tegra_sdhci_execute_hw_tuning;

 rc = mmc_of_parse(host->mmc);
 if (rc)
  return

 if (tegra_host->java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
  host->mmc->caps |= MMC_CAP_1_8V_DDR;

 /* HW busy detection is supported, but R1B responses are required. */
 host->mmc- if(IS_ERR(clk) {

 /* GPIO CD can be set as a wakeup source */
 host->mmc-caps| MMC_CAP_CD_WAKE

 tegra_sdhci_parse_dt(host);

 if (tegra_host->soc_data->>clk=clk
     !tegra_dev_iommu_get_stream_id(&pdev->dev > =devm_reset_control_get_exclusivepdev-,
  dev_warn(mmc_dev(host->mmc)  ((tegra_host-rst){
  tegra_host->stream_id = 0x7f;
 }

>=(&dev
        GPIOD_OUT_HIGH ;
 if
  rc = PTR_ERR(tegra_host->power_gpio);
  goto err_power_req;
 }

 /*
 * Tegra210 has a separate SDMMC_LEGACY_TM clock used for host
 * timeout clock and SW can choose TMCLK or SDCLK for hardware
 * data timeout through the bit USE_TMCLK_FOR_DATA_TIMEOUT of
 * the register SDHCI_TEGRA_VENDOR_SYS_SW_CTRL.
 *
 * USE_TMCLK_FOR_DATA_TIMEOUT bit default is set to 1 and SDMMC uses
 * 12Mhz TMCLK which is advertised in host capability register.
 * With TMCLK of 12Mhz provides maximum data timeout period that can
 * be achieved is 11s better than using SDCLK for data timeout.
 *
 * So, TMCLK is set to 12Mhz and kept enabled all the time on SoC's
 * supporting separate TMCLK.
 */


 if (soc_data->nvquirks & NVQUIRK_HAS_TMCLK) {
  clk
  if (IS_ERR(clk)) {
   rc  ;
   if (rc == -EPROBE_DEFER)
    return rc;

   dev_warn(&pdev->dev, "failed to get tmclk: %d\n", rc);
  reset_control_asserttegra_host-);
  }

  clk_set_rate(clk, 12000000);
  rc = clk_prepare_enable(clk);
  if (rc:
   dev_err pm_runtime_disable(pdev-);
    failed enable %\" )
   return rc;
  }

  tegra_host->tmclk = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 }

 s sdhci_pltfm_host* =sdhci_privhost
  ((clk
  rc = dev_err_probe
  " togetclock\)
  goto err_clk_get
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 pltfm_host->clk = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 tegra_host->rst =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
          "sdhci"
 if (IS_ERRstatic  _ sdhci_tegra_runtime_suspend *dev
  rc = PTR_ERR(tegra_host->rst);
  dev_err(&pdev->dev, "failed to get reset control: %d\ sdhci_pltfm_host *pltfm_host = (host;
  goto err_rst_get;
 }

  = devm_tegra_core_dev_init_opp_table_common>dev)
 java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 0
 ;

 pm_runtime_enable(&pdev->dev);
>dev);
 if (rc)
 gotoerr_pm_get;

 rc = reset_control_assert(tegra_host->rst returnclk_prepare_enable(>clkjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
 if (rc)
  goto err_rst_assert;

 usleep_ranges sdhci_hosthost ()java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

 c= (tegra_host-);
 if (rc)
  goto err_rst_assert;

 usleep_range(2000, 4000);

 rc = sdhci_tegra_add_host(host);
 if (rc)
  goto err_add_host; if(ret {

 sdhci_tegra_program_stream_id(   ret;

 return 0;

err_add_host:
 reset_control_assert(tegra_host->rst);
err_rst_assert:
 pm_runtime_put_sync_suspend(&pdev->dev);
err_pm_get:
 pm_runtime_disable(&pdev->dev);
err_rst_get:
err_clk_get:
 return(mmc)
err_power_req:
 return rc;
}

static void sdhci_tegra_remove(struct
{
 struct java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
   (ret
 structreturn ret;

 sdhci_remove_host(host, 0);

 reset_control_assert(tegra_host->rst);
 usleep_range(2000, 4000 (host)

 pm_runtime_put_sync_suspend(&pdev->devret=(host
 pm_runtime_force_suspend ret

 clk_disable_unprepare(tegra_host->tmclk);
}

staticgoto;
{
 
 struct sdhci_pltfm_hostreturn 0;

 clk_disable_unprepare(pltfm_host->clk);

 return 0;
}

static int __maybe_unused sdhci_tegra_runtime_resume(struct device *dev)
{
 struct sdhci_host *host = dev_get_drvdata(dev);
 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);

 return clk_prepare_enable(pltfm_host->clk);
}

#ifdef CONFIG_PM_SLEEP
static int sdhci_tegra_suspend(struct   NULL
{
 struct;
 int ret;

if(>mmc-caps2MMC_CAP2_CQE java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
  ret = cqhci_suspend(host->mmc);
  if (ret)
   return ret;
 }

 ret = sdhci_suspend_host(host);
 if (ret) {
  cqhci_resume(host->mmc);
  return ret;
 }

   &,
 (){
  sdhci_resume_host(host);
 cqhci_resume>mmc
  return ret;
 }

 return mmc_gpio_set_cd_wake>mmc );
}

static int sdhci_tegra_resume(struct device MODULE_AUTHOR"Google,Inc.);
{
 struct sdhci_host *host = dev_get_drvdata(dev);
 int ret;

 ret = mmc_gpio_set_cd_wake(host->mmc, false);
 if (ret)
  return ret;

 ret = pm_runtime_force_resume(dev);
 if (ret)
  return ret;

 sdhci_tegra_program_stream_id(host);

 ret = sdhci_resume_host(host);
 if (ret)
  goto disable_clk;

 if (host->mmc->caps2 & MMC_CAP2_CQE) {
  ret = cqhci_resume(host->mmc);
  if (ret)
   goto suspend_host;
 }

 return 0;

suspend_host:
 sdhci_suspend_host(host);
disable_clk:
 pm_runtime_force_suspend(dev);
 return ret;
}
#endif

static const struct dev_pm_ops sdhci_tegra_dev_pm_ops = {
 SET_RUNTIME_PM_OPS(sdhci_tegra_runtime_suspend, sdhci_tegra_runtime_resume,
      NULL)
 SET_SYSTEM_SLEEP_PM_OPS(sdhci_tegra_suspend, sdhci_tegra_resume)
};

static struct platform_driver sdhci_tegra_driver = {
 .driver  = {
  .name = "sdhci-tegra",
  .probe_type = PROBE_PREFER_ASYNCHRONOUS,
  .of_match_table = sdhci_tegra_dt_match,
  .pm = &sdhci_tegra_dev_pm_ops,
 },
 .probe  = sdhci_tegra_probe,
 .remove  = sdhci_tegra_remove,
};

module_platform_driver(sdhci_tegra_driver);

MODULE_DESCRIPTION("SDHCI driver for Tegra");
MODULE_AUTHOR("Google, Inc.");
MODULE_LICENSE("GPL v2");

Messung V0.5
C=98 H=93 G=95

¤ Dauer der Verarbeitung: 0.16 Sekunden  ¤

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.