linux/drivers/mmc/core/host.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 *  linux/drivers/mmc/core/host.c
 *
 *  Copyright (C) 2003 Russell King, All Rights Reserved.
 *  Copyright (C) 2007-2008 Pierre Ossman
 *  Copyright (C) 2010 Linus Walleij
 *
 *  MMC host class device management
 */

#include <linux/device.h>
#include <linux/err.h>
#include <linux/idr.h>
#include <linux/of.h>
#include <linux/pagemap.h>
#include <linux/pm_wakeup.h>
#include <linux/export.h>
#include <linux/leds.h>
#include <linux/slab.h>

#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
#include <linux/mmc/slot-gpio.h>

#include "core.h"
#include "crypto.h"
#include "host.h"
#include "slot-gpio.h"
#include "pwrseq.h"
#include "sdio_ops.h"

#define cls_dev_to_mmc_host(d)

static DEFINE_IDA(mmc_host_ida);

#ifdef CONFIG_PM_SLEEP
static int mmc_host_class_prepare(struct device *dev)
{}

static void mmc_host_class_complete(struct device *dev)
{}

static const struct dev_pm_ops mmc_host_class_dev_pm_ops =;

#define MMC_HOST_CLASS_DEV_PM_OPS
#else
#define MMC_HOST_CLASS_DEV_PM_OPS
#endif

static void mmc_host_classdev_release(struct device *dev)
{}

static int mmc_host_classdev_shutdown(struct device *dev)
{}

static const struct class mmc_host_class =;

int mmc_register_host_class(void)
{}

void mmc_unregister_host_class(void)
{}

/**
 * mmc_retune_enable() - enter a transfer mode that requires retuning
 * @host: host which should retune now
 */
void mmc_retune_enable(struct mmc_host *host)
{}

/*
 * Pause re-tuning for a small set of operations.  The pause begins after the
 * next command.
 */
void mmc_retune_pause(struct mmc_host *host)
{}
EXPORT_SYMBOL();

void mmc_retune_unpause(struct mmc_host *host)
{}
EXPORT_SYMBOL();

/**
 * mmc_retune_disable() - exit a transfer mode that requires retuning
 * @host: host which should not retune anymore
 *
 * It is not meant for temporarily preventing retuning!
 */
void mmc_retune_disable(struct mmc_host *host)
{}

void mmc_retune_timer_stop(struct mmc_host *host)
{}
EXPORT_SYMBOL();

void mmc_retune_hold(struct mmc_host *host)
{}

void mmc_retune_release(struct mmc_host *host)
{}
EXPORT_SYMBOL();

int mmc_retune(struct mmc_host *host)
{}

static void mmc_retune_timer(struct timer_list *t)
{}

static void mmc_of_parse_timing_phase(struct device *dev, const char *prop,
				      struct mmc_clk_phase *phase)
{}

void
mmc_of_parse_clk_phase(struct device *dev, struct mmc_clk_phase_map *map)
{}
EXPORT_SYMBOL();

/**
 * mmc_of_parse() - parse host's device properties
 * @host: host whose properties should be parsed.
 *
 * To keep the rest of the MMC subsystem unaware of whether DT has been
 * used to instantiate and configure this host instance or not, we
 * parse the properties and set respective generic mmc-host flags and
 * parameters.
 */
int mmc_of_parse(struct mmc_host *host)
{}

EXPORT_SYMBOL();

/**
 * mmc_of_parse_voltage - return mask of supported voltages
 * @host: host whose properties should be parsed.
 * @mask: mask of voltages available for MMC/SD/SDIO
 *
 * Parse the "voltage-ranges" property, returning zero if it is not
 * found, negative errno if the voltage-range specification is invalid,
 * or one if the voltage-range is specified and successfully parsed.
 */
int mmc_of_parse_voltage(struct mmc_host *host, u32 *mask)
{}
EXPORT_SYMBOL();

/**
 * mmc_first_nonreserved_index() - get the first index that is not reserved
 */
static int mmc_first_nonreserved_index(void)
{}

/**
 *	mmc_alloc_host - initialise the per-host structure.
 *	@extra: sizeof private data structure
 *	@dev: pointer to host device model structure
 *
 *	Initialise the per-host structure.
 */
struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
{}

EXPORT_SYMBOL();

static void devm_mmc_host_release(struct device *dev, void *res)
{}

struct mmc_host *devm_mmc_alloc_host(struct device *dev, int extra)
{}
EXPORT_SYMBOL();

static int mmc_validate_host_caps(struct mmc_host *host)
{}

/**
 *	mmc_add_host - initialise host hardware
 *	@host: mmc host
 *
 *	Register the host with the driver model. The host must be
 *	prepared to start servicing requests before this function
 *	completes.
 */
int mmc_add_host(struct mmc_host *host)
{}

EXPORT_SYMBOL();

/**
 *	mmc_remove_host - remove host hardware
 *	@host: mmc host
 *
 *	Unregister and remove all cards associated with this host,
 *	and power down the MMC bus. No new requests will be issued
 *	after this function has returned.
 */
void mmc_remove_host(struct mmc_host *host)
{}

EXPORT_SYMBOL();

/**
 *	mmc_free_host - free the host structure
 *	@host: mmc host
 *
 *	Free the host once all references to it have been dropped.
 */
void mmc_free_host(struct mmc_host *host)
{}

EXPORT_SYMBOL();