This is a snapshot of the mmc module taken as of msm-4.14 commit <9fa809c70c96>. This change contains the MMC driver's changes for merging from kernel version msm-4.14 to msm-4.19. Change-Id: I89fa8d5681d18290bbaf8b500f2e7f4a8aebbd89 Signed-off-by: Bao D. Nguyen <nguyenb@codeaurora.org>
47 lines
1.3 KiB
C
47 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
|
|
*/
|
|
|
|
#ifndef __MMC_RING_BUFFER__
|
|
#define __MMC_RING_BUFFER__
|
|
|
|
#include <linux/mmc/card.h>
|
|
#include <linux/smp.h>
|
|
|
|
#include "core.h"
|
|
|
|
#define MMC_TRACE_RBUF_SZ_ORDER 2 /* 2^2 pages */
|
|
#define MMC_TRACE_RBUF_SZ (PAGE_SIZE * (1 << MMC_TRACE_RBUF_SZ_ORDER))
|
|
#define MMC_TRACE_EVENT_SZ 256
|
|
#define MMC_TRACE_RBUF_NUM_EVENTS (MMC_TRACE_RBUF_SZ / MMC_TRACE_EVENT_SZ)
|
|
|
|
struct mmc_host;
|
|
struct mmc_trace_buffer {
|
|
int wr_idx;
|
|
bool stop_tracing;
|
|
spinlock_t trace_lock;
|
|
char *data;
|
|
};
|
|
|
|
#ifdef CONFIG_MMC_RING_BUFFER
|
|
void mmc_stop_tracing(struct mmc_host *mmc);
|
|
void mmc_trace_write(struct mmc_host *mmc, const char *fmt, ...);
|
|
void mmc_trace_init(struct mmc_host *mmc);
|
|
void mmc_trace_free(struct mmc_host *mmc);
|
|
void mmc_dump_trace_buffer(struct mmc_host *mmc, struct seq_file *s);
|
|
#else
|
|
static inline void mmc_stop_tracing(struct mmc_host *mmc) {}
|
|
static inline void mmc_trace_write(struct mmc_host *mmc,
|
|
const char *fmt, ...) {}
|
|
static inline void mmc_trace_init(struct mmc_host *mmc) {}
|
|
static inline void mmc_trace_free(struct mmc_host *mmc) {}
|
|
static inline void mmc_dump_trace_buffer(struct mmc_host *mmc,
|
|
struct seq_file *s) {}
|
|
#endif
|
|
|
|
#define MMC_TRACE(mmc, fmt, ...) \
|
|
mmc_trace_write(mmc, fmt, ##__VA_ARGS__)
|
|
|
|
#endif /* __MMC_RING_BUFFER__ */
|