linux/drivers/mmc/core/sdio.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  linux/drivers/mmc/sdio.c
 *
 *  Copyright 2006-2007 Pierre Ossman
 */

#include <linux/err.h>
#include <linux/pm_runtime.h>
#include <linux/sysfs.h>

#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/sdio.h>
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h>

#include "core.h"
#include "card.h"
#include "host.h"
#include "bus.h"
#include "quirks.h"
#include "sd.h"
#include "sdio_bus.h"
#include "mmc_ops.h"
#include "sd_ops.h"
#include "sdio_ops.h"
#include "sdio_cis.h"

MMC_DEV_ATTR();
MMC_DEV_ATTR();
MMC_DEV_ATTR();
MMC_DEV_ATTR();
MMC_DEV_ATTR();

#define sdio_info_attr(num)

sdio_info_attr();
sdio_info_attr();
sdio_info_attr();
sdio_info_attr();

static struct attribute *sdio_std_attrs[] =;
ATTRIBUTE_GROUPS();

static const struct device_type sdio_type =;

static int sdio_read_fbr(struct sdio_func *func)
{}

static int sdio_init_func(struct mmc_card *card, unsigned int fn)
{}

static int sdio_read_cccr(struct mmc_card *card, u32 ocr)
{}

static int sdio_enable_wide(struct mmc_card *card)
{}

/*
 * If desired, disconnect the pull-up resistor on CD/DAT[3] (pin 1)
 * of the card. This may be required on certain setups of boards,
 * controllers and embedded sdio device which do not need the card's
 * pull-up. As a result, card detection is disabled and power is saved.
 */
static int sdio_disable_cd(struct mmc_card *card)
{}

/*
 * Devices that remain active during a system suspend are
 * put back into 1-bit mode.
 */
static int sdio_disable_wide(struct mmc_card *card)
{}

static int sdio_disable_4bit_bus(struct mmc_card *card)
{}


static int sdio_enable_4bit_bus(struct mmc_card *card)
{}


/*
 * Test if the card supports high-speed mode and, if so, switch to it.
 */
static int mmc_sdio_switch_hs(struct mmc_card *card, int enable)
{}

/*
 * Enable SDIO/combo card's high-speed mode. Return 0/1 if [not]supported.
 */
static int sdio_enable_hs(struct mmc_card *card)
{}

static unsigned mmc_sdio_get_max_clock(struct mmc_card *card)
{}

static unsigned char host_drive_to_sdio_drive(int host_strength)
{}

static void sdio_select_driver_type(struct mmc_card *card)
{}


static int sdio_set_bus_speed_mode(struct mmc_card *card)
{}

/*
 * UHS-I specific initialization procedure
 */
static int mmc_sdio_init_uhs_card(struct mmc_card *card)
{}

static int mmc_sdio_pre_init(struct mmc_host *host, u32 ocr,
			     struct mmc_card *card)
{}

/*
 * Handle the detection and initialisation of a card.
 *
 * In the case of a resume, "oldcard" will contain the card
 * we're trying to reinitialise.
 */
static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
			      struct mmc_card *oldcard)
{}

static int mmc_sdio_reinit_card(struct mmc_host *host)
{}

/*
 * Host is being removed. Free up the current card.
 */
static void mmc_sdio_remove(struct mmc_host *host)
{}

/*
 * Card detection - card is alive.
 */
static int mmc_sdio_alive(struct mmc_host *host)
{}

/*
 * Card detection callback from host.
 */
static void mmc_sdio_detect(struct mmc_host *host)
{}

/*
 * SDIO pre_suspend.  We need to suspend all functions separately.
 * Therefore all registered functions must have drivers with suspend
 * and resume methods.  Failing that we simply remove the whole card.
 */
static int mmc_sdio_pre_suspend(struct mmc_host *host)
{}

/*
 * SDIO suspend.  Suspend all functions separately.
 */
static int mmc_sdio_suspend(struct mmc_host *host)
{}

static int mmc_sdio_resume(struct mmc_host *host)
{}

static int mmc_sdio_runtime_suspend(struct mmc_host *host)
{}

static int mmc_sdio_runtime_resume(struct mmc_host *host)
{}

/*
 * SDIO HW reset
 *
 * Returns 0 if the HW reset was executed synchronously, returns 1 if the HW
 * reset was asynchronously scheduled, else a negative error code.
 */
static int mmc_sdio_hw_reset(struct mmc_host *host)
{}

static int mmc_sdio_sw_reset(struct mmc_host *host)
{}

static const struct mmc_bus_ops mmc_sdio_ops =;


/*
 * Starting point for SDIO card init.
 */
int mmc_attach_sdio(struct mmc_host *host)
{}