Linux Audio

Check our new training course

Loading...
v6.8
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 * Copyright (C) 2014 Linaro Ltd
 4 *
 5 * Author: Ulf Hansson <ulf.hansson@linaro.org>
 
 
 6 */
 7#ifndef _MMC_CORE_PWRSEQ_H
 8#define _MMC_CORE_PWRSEQ_H
 9
10#include <linux/types.h>
11
12struct mmc_host;
13struct device;
14struct module;
15
16struct mmc_pwrseq_ops {
17	void (*pre_power_on)(struct mmc_host *host);
18	void (*post_power_on)(struct mmc_host *host);
19	void (*power_off)(struct mmc_host *host);
20	void (*reset)(struct mmc_host *host);
21};
22
23struct mmc_pwrseq {
24	const struct mmc_pwrseq_ops *ops;
25	struct device *dev;
26	struct list_head pwrseq_node;
27	struct module *owner;
28};
29
30#ifdef CONFIG_OF
31
32int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq);
33void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq);
34
35int mmc_pwrseq_alloc(struct mmc_host *host);
36void mmc_pwrseq_pre_power_on(struct mmc_host *host);
37void mmc_pwrseq_post_power_on(struct mmc_host *host);
38void mmc_pwrseq_power_off(struct mmc_host *host);
39void mmc_pwrseq_reset(struct mmc_host *host);
40void mmc_pwrseq_free(struct mmc_host *host);
41
42#else
43
44static inline int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq)
45{
46	return -ENOSYS;
47}
48static inline void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq) {}
49static inline int mmc_pwrseq_alloc(struct mmc_host *host) { return 0; }
50static inline void mmc_pwrseq_pre_power_on(struct mmc_host *host) {}
51static inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {}
52static inline void mmc_pwrseq_power_off(struct mmc_host *host) {}
53static inline void mmc_pwrseq_reset(struct mmc_host *host) {}
54static inline void mmc_pwrseq_free(struct mmc_host *host) {}
55
56#endif
57
58#endif
v4.10.11
 
 1/*
 2 * Copyright (C) 2014 Linaro Ltd
 3 *
 4 * Author: Ulf Hansson <ulf.hansson@linaro.org>
 5 *
 6 * License terms: GNU General Public License (GPL) version 2
 7 */
 8#ifndef _MMC_CORE_PWRSEQ_H
 9#define _MMC_CORE_PWRSEQ_H
10
11#include <linux/mmc/host.h>
 
 
 
 
12
13struct mmc_pwrseq_ops {
14	void (*pre_power_on)(struct mmc_host *host);
15	void (*post_power_on)(struct mmc_host *host);
16	void (*power_off)(struct mmc_host *host);
 
17};
18
19struct mmc_pwrseq {
20	const struct mmc_pwrseq_ops *ops;
21	struct device *dev;
22	struct list_head pwrseq_node;
23	struct module *owner;
24};
25
26#ifdef CONFIG_OF
27
28int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq);
29void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq);
30
31int mmc_pwrseq_alloc(struct mmc_host *host);
32void mmc_pwrseq_pre_power_on(struct mmc_host *host);
33void mmc_pwrseq_post_power_on(struct mmc_host *host);
34void mmc_pwrseq_power_off(struct mmc_host *host);
 
35void mmc_pwrseq_free(struct mmc_host *host);
36
37#else
38
39static inline int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq)
40{
41	return -ENOSYS;
42}
43static inline void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq) {}
44static inline int mmc_pwrseq_alloc(struct mmc_host *host) { return 0; }
45static inline void mmc_pwrseq_pre_power_on(struct mmc_host *host) {}
46static inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {}
47static inline void mmc_pwrseq_power_off(struct mmc_host *host) {}
 
48static inline void mmc_pwrseq_free(struct mmc_host *host) {}
49
50#endif
51
52#endif