Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mmc/mmc_helpers.h
- This file was copied from sys/dev/mmc/mmc_fdt_helpers.h.
Show All 17 Lines | |||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE | ||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | ||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | ||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
* | |||||
* $FreeBSD$ | |||||
*/ | */ | ||||
#ifndef _MMC_FDT_HELPERS_H_ | #ifndef _MMC_HELPERS_H_ | ||||
#define _MMC_FDT_HELPERS_H_ | #define _MMC_HELPERS_H_ | ||||
#include <dev/gpio/gpiobusvar.h> | #include <dev/gpio/gpiobusvar.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 { | struct mmc_helper { | ||||
device_t dev; | device_t dev; | ||||
gpio_pin_t wp_pin; | gpio_pin_t wp_pin; | ||||
gpio_pin_t cd_pin; | gpio_pin_t cd_pin; | ||||
void * cd_ihandler; | void * cd_ihandler; | ||||
struct resource * cd_ires; | struct resource * cd_ires; | ||||
int cd_irid; | int cd_irid; | ||||
void (*cd_handler)(device_t, bool); | void (*cd_handler)(device_t, bool); | ||||
struct timeout_task cd_delayed_task; | struct timeout_task cd_delayed_task; | ||||
Show All 13 Lines | |||||
#ifdef EXT_RESOURCES | #ifdef EXT_RESOURCES | ||||
regulator_t vmmc_supply; | regulator_t vmmc_supply; | ||||
regulator_t vqmmc_supply; | regulator_t vqmmc_supply; | ||||
#endif | #endif | ||||
device_t mmc_pwrseq; | device_t mmc_pwrseq; | ||||
}; | }; | ||||
typedef void (*mmc_fdt_cd_handler)(device_t dev, bool present); | int mmc_parse(device_t dev, struct mmc_helper *helper, | ||||
struct mmc_host *host); | |||||
int mmc_fdt_parse(device_t dev, phandle_t node, struct mmc_fdt_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); | |||||
void mmc_fdt_gpio_teardown(struct mmc_fdt_helper *helper); | |||||
bool mmc_fdt_gpio_get_present(struct mmc_fdt_helper *helper); | |||||
bool mmc_fdt_gpio_get_readonly(struct mmc_fdt_helper *helper); | |||||
void mmc_fdt_set_power(struct mmc_fdt_helper *helper, enum mmc_power_mode power_mode); | |||||
#endif | #endif |