1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/drivers/mmc/core/bus.h
5 * Copyright (C) 2003 Russell King, All Rights Reserved.
6 * Copyright 2007 Pierre Ossman
8 #ifndef _MMC_CORE_BUS_H
9 #define _MMC_CORE_BUS_H
11 #include <linux/device.h>
12 #include <linux/sysfs.h>
17 #define MMC_DEV_ATTR(name, fmt, args...) \
18 static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf) \
20 struct mmc_card *card = mmc_dev_to_card(dev); \
21 return sysfs_emit(buf, fmt, args); \
23 static DEVICE_ATTR(name, S_IRUGO, mmc_##name##_show, NULL)
25 struct mmc_card *mmc_alloc_card(struct mmc_host *host,
26 struct device_type *type);
27 int mmc_add_card(struct mmc_card *card);
28 void mmc_remove_card(struct mmc_card *card);
30 int mmc_register_bus(void);
31 void mmc_unregister_bus(void);
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);
40 int mmc_register_driver(struct mmc_driver *drv);
41 void mmc_unregister_driver(struct mmc_driver *drv);