2 * include/linux/mmc/sdio_func.h
4 * Copyright 2007 Pierre Ossman
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version.
12 #ifndef MMC_SDIO_FUNC_H
13 #define MMC_SDIO_FUNC_H
18 * SDIO function CIS tuple (unknown to the core)
20 struct sdio_func_tuple {
21 struct sdio_func_tuple *next;
24 unsigned char data[0];
28 * SDIO function devices
31 struct mmc_card *card; /* the card this device belongs to */
32 struct device dev; /* the device */
33 unsigned int num; /* function number */
35 unsigned char class; /* standard interface class */
36 unsigned short vendor; /* vendor id */
37 unsigned short device; /* device id */
39 unsigned short blksize; /* maximum block size */
41 unsigned int state; /* function state */
42 #define SDIO_STATE_PRESENT (1<<0) /* present in sysfs */
44 struct sdio_func_tuple *tuples;
47 #define sdio_func_present(f) ((f)->state & SDIO_STATE_PRESENT)
49 #define sdio_func_set_present(f) ((f)->state |= SDIO_STATE_PRESENT)
51 #define sdio_func_id(f) ((f)->dev.bus_id)
53 #define sdio_get_drvdata(f) dev_get_drvdata(&(f)->dev)
54 #define sdio_set_drvdata(f,d) dev_set_drvdata(&(f)->dev, d)
57 * SDIO function device driver
62 int (*probe)(struct sdio_func *);
63 void (*remove)(struct sdio_func *);
65 struct device_driver drv;
68 extern int sdio_register_driver(struct sdio_driver *);
69 extern void sdio_unregister_driver(struct sdio_driver *);
74 extern void sdio_claim_host(struct sdio_func *func);
75 extern void sdio_release_host(struct sdio_func *func);
77 extern int sdio_enable_func(struct sdio_func *func);
78 extern int sdio_disable_func(struct sdio_func *func);
80 extern unsigned char sdio_readb(struct sdio_func *func,
81 unsigned int addr, int *err_ret);
83 extern void sdio_writeb(struct sdio_func *func, unsigned char b,
84 unsigned int addr, int *err_ret);