1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
20 #ifndef __DRV_TYPES_SDIO_H__
21 #define __DRV_TYPES_SDIO_H__
23 /* SDIO Header Files */
25 #include <linux/mmc/sdio_func.h>
26 #include <linux/mmc/sdio_ids.h>
27 #include <linux/mmc/host.h>
28 #include <linux/mmc/card.h>
30 #ifdef CONFIG_PLATFORM_SPRD
31 #include <linux/gpio.h>
32 #include <custom_gpio.h>
33 #endif /* CONFIG_PLATFORM_SPRD */
42 #include <sdcardddk.h>
46 typedef struct sdio_data {
51 u32 block_transfer_len;
54 struct sdio_func *func;
55 _thread_hdl_ sys_sdio_irq_thd;
60 PDEVICE_OBJECT pphysdevobj;
61 PDEVICE_OBJECT pfuncdevobj;
62 PDEVICE_OBJECT pnextdevobj;
63 SDBUS_INTERFACE_STANDARD sdbusinft;
68 SD_DEVICE_HANDLE hDevice;
70 SD_CARD_INTERFACE card_intf;
71 BOOLEAN enableIsarWithStatus;
72 WCHAR active_path[MAX_ACTIVE_REG_PATH];
73 SD_HOST_BLOCK_CAPABILITY sd_host_blk_cap;
75 } SDIO_DATA, *PSDIO_DATA;
77 #define dvobj_to_sdio_func(d) ((d)->intf_data.func)
79 #define RTW_SDIO_ADDR_CMD52_BIT (1<<17)
80 #define RTW_SDIO_ADDR_CMD52_GEN(a) (a | RTW_SDIO_ADDR_CMD52_BIT)
81 #define RTW_SDIO_ADDR_CMD52_CLR(a) (a&~RTW_SDIO_ADDR_CMD52_BIT)
82 #define RTW_SDIO_ADDR_CMD52_CHK(a) (a&RTW_SDIO_ADDR_CMD52_BIT ? 1 : 0)
84 #define RTW_SDIO_ADDR_F0_BIT (1<<18)
85 #define RTW_SDIO_ADDR_F0_GEN(a) (a | RTW_SDIO_ADDR_F0_BIT)
86 #define RTW_SDIO_ADDR_F0_CLR(a) (a&~RTW_SDIO_ADDR_F0_BIT)
87 #define RTW_SDIO_ADDR_F0_CHK(a) (a&RTW_SDIO_ADDR_F0_BIT ? 1 : 0)
89 #define RTW_SDIO_CLK_40M 40000000