Merge tag 'libnvdimm-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm...
[linux-block.git] / drivers / mmc / core / bus.h
CommitLineData
d2912cb1 1/* SPDX-License-Identifier: GPL-2.0-only */
4101c16a
PO
2/*
3 * linux/drivers/mmc/core/bus.h
4 *
5 * Copyright (C) 2003 Russell King, All Rights Reserved.
6 * Copyright 2007 Pierre Ossman
4101c16a
PO
7 */
8#ifndef _MMC_CORE_BUS_H
9#define _MMC_CORE_BUS_H
10
4facdde1 11#include <linux/device.h>
f5d8a5fe 12#include <linux/sysfs.h>
4facdde1 13
066185d6
UH
14struct mmc_host;
15struct mmc_card;
066185d6 16
51ec92e2
PO
17#define MMC_DEV_ATTR(name, fmt, args...) \
18static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf) \
19{ \
265cdc90 20 struct mmc_card *card = mmc_dev_to_card(dev); \
f5d8a5fe 21 return sysfs_emit(buf, fmt, args); \
51ec92e2
PO
22} \
23static DEVICE_ATTR(name, S_IRUGO, mmc_##name##_show, NULL)
24
25struct mmc_card *mmc_alloc_card(struct mmc_host *host,
26 struct device_type *type);
4101c16a
PO
27int mmc_add_card(struct mmc_card *card);
28void mmc_remove_card(struct mmc_card *card);
29
30int mmc_register_bus(void);
31void mmc_unregister_bus(void);
32
4facdde1
UH
33struct mmc_driver {
34 struct device_driver drv;
35 int (*probe)(struct mmc_card *card);
36 void (*remove)(struct mmc_card *card);
37 void (*shutdown)(struct mmc_card *card);
38};
4101c16a 39
4facdde1
UH
40int mmc_register_driver(struct mmc_driver *drv);
41void mmc_unregister_driver(struct mmc_driver *drv);
42
43#endif