162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (C) 2014 Linaro Ltd 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Author: Ulf Hansson <ulf.hansson@linaro.org> 662306a36Sopenharmony_ci */ 762306a36Sopenharmony_ci#ifndef _MMC_CORE_PWRSEQ_H 862306a36Sopenharmony_ci#define _MMC_CORE_PWRSEQ_H 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#include <linux/types.h> 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_cistruct mmc_host; 1362306a36Sopenharmony_cistruct device; 1462306a36Sopenharmony_cistruct module; 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_cistruct mmc_pwrseq_ops { 1762306a36Sopenharmony_ci void (*pre_power_on)(struct mmc_host *host); 1862306a36Sopenharmony_ci void (*post_power_on)(struct mmc_host *host); 1962306a36Sopenharmony_ci void (*power_off)(struct mmc_host *host); 2062306a36Sopenharmony_ci void (*reset)(struct mmc_host *host); 2162306a36Sopenharmony_ci}; 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_cistruct mmc_pwrseq { 2462306a36Sopenharmony_ci const struct mmc_pwrseq_ops *ops; 2562306a36Sopenharmony_ci struct device *dev; 2662306a36Sopenharmony_ci struct list_head pwrseq_node; 2762306a36Sopenharmony_ci struct module *owner; 2862306a36Sopenharmony_ci}; 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci#ifdef CONFIG_OF 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ciint mmc_pwrseq_register(struct mmc_pwrseq *pwrseq); 3362306a36Sopenharmony_civoid mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq); 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ciint mmc_pwrseq_alloc(struct mmc_host *host); 3662306a36Sopenharmony_civoid mmc_pwrseq_pre_power_on(struct mmc_host *host); 3762306a36Sopenharmony_civoid mmc_pwrseq_post_power_on(struct mmc_host *host); 3862306a36Sopenharmony_civoid mmc_pwrseq_power_off(struct mmc_host *host); 3962306a36Sopenharmony_civoid mmc_pwrseq_reset(struct mmc_host *host); 4062306a36Sopenharmony_civoid mmc_pwrseq_free(struct mmc_host *host); 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_ci#else 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_cistatic inline int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq) 4562306a36Sopenharmony_ci{ 4662306a36Sopenharmony_ci return -ENOSYS; 4762306a36Sopenharmony_ci} 4862306a36Sopenharmony_cistatic inline void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq) {} 4962306a36Sopenharmony_cistatic inline int mmc_pwrseq_alloc(struct mmc_host *host) { return 0; } 5062306a36Sopenharmony_cistatic inline void mmc_pwrseq_pre_power_on(struct mmc_host *host) {} 5162306a36Sopenharmony_cistatic inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {} 5262306a36Sopenharmony_cistatic inline void mmc_pwrseq_power_off(struct mmc_host *host) {} 5362306a36Sopenharmony_cistatic inline void mmc_pwrseq_reset(struct mmc_host *host) {} 5462306a36Sopenharmony_cistatic inline void mmc_pwrseq_free(struct mmc_host *host) {} 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ci#endif 5762306a36Sopenharmony_ci 5862306a36Sopenharmony_ci#endif 59