Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mmc/mmc_fdt_helpers.h
- This file was copied to sys/dev/mmc/mmc_helpers.h.
Show All 31 Lines | |||||
#include <dev/gpio/gpiobusvar.h> | #include <dev/gpio/gpiobusvar.h> | ||||
#include <dev/ofw/ofw_bus.h> | #include <dev/ofw/ofw_bus.h> | ||||
#ifdef EXT_RESOURCES | #ifdef EXT_RESOURCES | ||||
#include <dev/extres/regulator/regulator.h> | #include <dev/extres/regulator/regulator.h> | ||||
#endif | #endif | ||||
struct mmc_fdt_helper { | #include <dev/mmc/mmc_helpers.h> | ||||
device_t dev; | |||||
gpio_pin_t wp_pin; | |||||
gpio_pin_t cd_pin; | |||||
void * cd_ihandler; | |||||
struct resource * cd_ires; | |||||
int cd_irid; | |||||
void (*cd_handler)(device_t, bool); | |||||
struct timeout_task cd_delayed_task; | |||||
bool cd_disabled; | |||||
bool wp_disabled; | |||||
bool cd_present; | |||||
uint32_t props; | |||||
#define MMC_PROP_BROKEN_CD (1 << 0) | |||||
#define MMC_PROP_NON_REMOVABLE (1 << 1) | |||||
#define MMC_PROP_WP_INVERTED (1 << 2) | |||||
#define MMC_PROP_CD_INVERTED (1 << 3) | |||||
#define MMC_PROP_DISABLE_WP (1 << 4) | |||||
#define MMC_PROP_NO_SDIO (1 << 5) | |||||
#define MMC_PROP_NO_SD (1 << 6) | |||||
#define MMC_PROP_NO_MMC (1 << 7) | |||||
#ifdef EXT_RESOURCES | #define mmc_fdt_helper mmc_helper /* For backwards compatibility */ | ||||
regulator_t vmmc_supply; | |||||
regulator_t vqmmc_supply; | |||||
#endif | |||||
device_t mmc_pwrseq; | |||||
}; | |||||
typedef void (*mmc_fdt_cd_handler)(device_t dev, bool present); | typedef void (*mmc_fdt_cd_handler)(device_t dev, bool present); | ||||
int mmc_fdt_parse(device_t dev, phandle_t node, struct mmc_fdt_helper *helper, struct mmc_host *host); | int mmc_fdt_parse(device_t dev, phandle_t node, struct mmc_helper *helper, struct mmc_host *host); | ||||
int mmc_fdt_gpio_setup(device_t dev, phandle_t node, struct mmc_fdt_helper *helper, mmc_fdt_cd_handler handler); | int mmc_fdt_gpio_setup(device_t dev, phandle_t node, struct mmc_helper *helper, mmc_fdt_cd_handler handler); | ||||
void mmc_fdt_gpio_teardown(struct mmc_fdt_helper *helper); | void mmc_fdt_gpio_teardown(struct mmc_helper *helper); | ||||
bool mmc_fdt_gpio_get_present(struct mmc_fdt_helper *helper); | bool mmc_fdt_gpio_get_present(struct mmc_helper *helper); | ||||
bool mmc_fdt_gpio_get_readonly(struct mmc_fdt_helper *helper); | bool mmc_fdt_gpio_get_readonly(struct mmc_helper *helper); | ||||
void mmc_fdt_set_power(struct mmc_fdt_helper *helper, enum mmc_power_mode power_mode); | void mmc_fdt_set_power(struct mmc_helper *helper, enum mmc_power_mode power_mode); | ||||
#endif | #endif |