blob: 965e2b511c5633a3f8f3d57d727517eb346472e1 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#ifndef __LIBRA_SDIOIF_H__
15#define __LIBRA_SDIOIF_H__
16
17/*
18 * Header for SDIO Card Interface Functions
19 */
20#include <linux/kthread.h>
21#include <linux/mmc/card.h>
22#include <linux/mmc/host.h>
23#include <linux/mmc/sdio_func.h>
24
25/*
26 * Common Defines
27 */
28#define LIBRA_MAN_ID 0x70
29#define LIBRA_REV_1_0_CARD_ID 0x0
30
31#define VOLANS_MAN_ID 0x70
32#define VOLANS_REV_1_0_CARD_ID 0x0
33#define VOLANS_REV_2_0_CARD_ID 0x2881
34
35typedef int (suspend_handler_t)(struct sdio_func *);
36typedef void (resume_handler_t)(struct sdio_func *);
37
38int libra_sdio_configure(sdio_irq_handler_t libra_sdio_rxhandler,
39 void (*func_drv_fn)(int *status),
40 u32 funcdrv_timeout, u32 blksize);
41void libra_sdio_deconfigure(struct sdio_func *func);
42struct sdio_func *libra_getsdio_funcdev(void);
43void libra_sdio_setprivdata(struct sdio_func *sdio_func_dev,
44 void *padapter);
45void *libra_sdio_getprivdata(struct sdio_func *sdio_func_dev);
46void libra_claim_host(struct sdio_func *sdio_func_dev,
47 pid_t *curr_claimed, pid_t current_pid,
48 atomic_t *claim_count);
49void libra_release_host(struct sdio_func *sdio_func_dev,
50 pid_t *curr_claimed, pid_t current_pid,
51 atomic_t *claim_count);
52void libra_sdiocmd52(struct sdio_func *sdio_func_dev,
53 u32 addr, u8 *b, int write, int *err_ret);
54u8 libra_sdio_readsb(struct sdio_func *func, void *dst,
55 unsigned int addr, int count);
56int libra_sdio_memcpy_fromio(struct sdio_func *func,
57 void *dst, unsigned int addr, int count);
58int libra_sdio_writesb(struct sdio_func *func,
59 unsigned int addr, void *src, int count);
60int libra_sdio_memcpy_toio(struct sdio_func *func,
61 unsigned int addr, void *src, int count);
62int libra_sdio_enable_polling(void);
63
64int libra_sdio_configure_suspend_resume(
65 suspend_handler_t *libra_sdio_suspend_hdlr,
66 resume_handler_t *libra_sdio_resume_hdlr);
67
68int libra_detect_card_change(void);
69
70void libra_sdio_set_clock(struct sdio_func *func, unsigned int clk_freq);
71void libra_sdio_get_card_id(struct sdio_func *func, unsigned short *card_id);
72void libra_sdio_release_irq(struct sdio_func *func);
73int libra_enable_sdio_irq(struct sdio_func *func, u8 enable);
74void libra_sdio_disable_func(struct sdio_func *func);
75int libra_disable_sdio_irq_capability(struct sdio_func *func, u8 disable);
76
77#endif /* __LIBRA_SDIOIF_H__ */