| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/drivers/mmc/core/core.h |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2003 Russell King, All Rights Reserved. |
|---|
| 5 | 6 | * Copyright 2007 Pierre Ossman |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 9 | | - * published by the Free Software Foundation. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | #ifndef _MMC_CORE_CORE_H |
|---|
| 12 | 9 | #define _MMC_CORE_CORE_H |
|---|
| .. | .. |
|---|
| 20 | 17 | |
|---|
| 21 | 18 | #define MMC_CMD_RETRIES 3 |
|---|
| 22 | 19 | |
|---|
| 23 | | -static const unsigned freqs[] = { 400000, 300000, 200000, 100000 }; |
|---|
| 20 | +static const unsigned int freqs[] = { 400000, 300000, 200000, 100000 }; |
|---|
| 24 | 21 | |
|---|
| 25 | 22 | struct mmc_bus_ops { |
|---|
| 26 | 23 | void (*remove)(struct mmc_host *); |
|---|
| .. | .. |
|---|
| 35 | 32 | int (*hw_reset)(struct mmc_host *); |
|---|
| 36 | 33 | int (*sw_reset)(struct mmc_host *); |
|---|
| 37 | 34 | bool (*cache_enabled)(struct mmc_host *); |
|---|
| 35 | + |
|---|
| 36 | + ANDROID_VENDOR_DATA_ARRAY(1, 2); |
|---|
| 38 | 37 | }; |
|---|
| 39 | 38 | |
|---|
| 40 | 39 | void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops); |
|---|
| .. | .. |
|---|
| 46 | 45 | void mmc_init_erase(struct mmc_card *card); |
|---|
| 47 | 46 | |
|---|
| 48 | 47 | void mmc_set_chip_select(struct mmc_host *host, int mode); |
|---|
| 49 | | -void mmc_set_clock(struct mmc_host *host, unsigned int hz); |
|---|
| 48 | +extern void mmc_set_clock(struct mmc_host *host, unsigned int hz); |
|---|
| 50 | 49 | void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode); |
|---|
| 51 | 50 | void mmc_set_bus_width(struct mmc_host *host, unsigned int width); |
|---|
| 52 | 51 | u32 mmc_select_voltage(struct mmc_host *host, u32 ocr); |
|---|
| .. | .. |
|---|
| 62 | 61 | void mmc_power_off(struct mmc_host *host); |
|---|
| 63 | 62 | void mmc_power_cycle(struct mmc_host *host, u32 ocr); |
|---|
| 64 | 63 | void mmc_set_initial_state(struct mmc_host *host); |
|---|
| 64 | +u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max); |
|---|
| 65 | 65 | |
|---|
| 66 | 66 | static inline void mmc_delay(unsigned int ms) |
|---|
| 67 | 67 | { |
|---|
| .. | .. |
|---|
| 73 | 73 | |
|---|
| 74 | 74 | void mmc_rescan(struct work_struct *work); |
|---|
| 75 | 75 | void mmc_start_host(struct mmc_host *host); |
|---|
| 76 | +void __mmc_stop_host(struct mmc_host *host); |
|---|
| 76 | 77 | void mmc_stop_host(struct mmc_host *host); |
|---|
| 77 | 78 | |
|---|
| 79 | +void _mmc_detect_change(struct mmc_host *host, unsigned long delay, |
|---|
| 80 | + bool cd_irq); |
|---|
| 78 | 81 | int _mmc_detect_card_removed(struct mmc_host *host); |
|---|
| 79 | 82 | int mmc_detect_card_removed(struct mmc_host *host); |
|---|
| 80 | 83 | |
|---|
| 81 | 84 | int mmc_attach_mmc(struct mmc_host *host); |
|---|
| 82 | 85 | int mmc_attach_sd(struct mmc_host *host); |
|---|
| 83 | 86 | int mmc_attach_sdio(struct mmc_host *host); |
|---|
| 84 | | - |
|---|
| 85 | | -int sdio_reset_comm(struct mmc_card *card); |
|---|
| 86 | 87 | |
|---|
| 87 | 88 | /* Module parameters */ |
|---|
| 88 | 89 | extern bool use_spi_crc; |
|---|
| .. | .. |
|---|
| 97 | 98 | int mmc_execute_tuning(struct mmc_card *card); |
|---|
| 98 | 99 | int mmc_hs200_to_hs400(struct mmc_card *card); |
|---|
| 99 | 100 | int mmc_hs400_to_hs200(struct mmc_card *card); |
|---|
| 100 | | - |
|---|
| 101 | | -#ifdef CONFIG_PM_SLEEP |
|---|
| 102 | | -void mmc_register_pm_notifier(struct mmc_host *host); |
|---|
| 103 | | -void mmc_unregister_pm_notifier(struct mmc_host *host); |
|---|
| 104 | | -#else |
|---|
| 105 | | -static inline void mmc_register_pm_notifier(struct mmc_host *host) { } |
|---|
| 106 | | -static inline void mmc_unregister_pm_notifier(struct mmc_host *host) { } |
|---|
| 107 | | -#endif |
|---|
| 108 | 101 | |
|---|
| 109 | 102 | void mmc_wait_for_req_done(struct mmc_host *host, struct mmc_request *mrq); |
|---|
| 110 | 103 | bool mmc_is_req_done(struct mmc_host *host, struct mmc_request *mrq); |
|---|
| .. | .. |
|---|
| 123 | 116 | unsigned int mmc_calc_max_discard(struct mmc_card *card); |
|---|
| 124 | 117 | |
|---|
| 125 | 118 | int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); |
|---|
| 126 | | -int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount, |
|---|
| 127 | | - bool is_rel_write); |
|---|
| 128 | 119 | |
|---|
| 129 | 120 | int __mmc_claim_host(struct mmc_host *host, struct mmc_ctx *ctx, |
|---|
| 130 | 121 | atomic_t *abort); |
|---|