blob: 08be83a8c23205f730f6dd6936f2c7f375802899 [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
Pavan Kumar8832b232012-03-05 19:32:29 +053038int libra_enable_sdio_irq_in_chip(struct sdio_func *func, u8 enable);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070039int libra_sdio_configure(sdio_irq_handler_t libra_sdio_rxhandler,
40 void (*func_drv_fn)(int *status),
41 u32 funcdrv_timeout, u32 blksize);
42void libra_sdio_deconfigure(struct sdio_func *func);
43struct sdio_func *libra_getsdio_funcdev(void);
44void libra_sdio_setprivdata(struct sdio_func *sdio_func_dev,
45 void *padapter);
46void *libra_sdio_getprivdata(struct sdio_func *sdio_func_dev);
47void libra_claim_host(struct sdio_func *sdio_func_dev,
48 pid_t *curr_claimed, pid_t current_pid,
49 atomic_t *claim_count);
50void libra_release_host(struct sdio_func *sdio_func_dev,
51 pid_t *curr_claimed, pid_t current_pid,
52 atomic_t *claim_count);
53void libra_sdiocmd52(struct sdio_func *sdio_func_dev,
54 u32 addr, u8 *b, int write, int *err_ret);
55u8 libra_sdio_readsb(struct sdio_func *func, void *dst,
56 unsigned int addr, int count);
57int libra_sdio_memcpy_fromio(struct sdio_func *func,
58 void *dst, unsigned int addr, int count);
59int libra_sdio_writesb(struct sdio_func *func,
60 unsigned int addr, void *src, int count);
61int libra_sdio_memcpy_toio(struct sdio_func *func,
62 unsigned int addr, void *src, int count);
63int libra_sdio_enable_polling(void);
64
65int libra_sdio_configure_suspend_resume(
66 suspend_handler_t *libra_sdio_suspend_hdlr,
67 resume_handler_t *libra_sdio_resume_hdlr);
68
69int libra_detect_card_change(void);
70
71void libra_sdio_set_clock(struct sdio_func *func, unsigned int clk_freq);
72void libra_sdio_get_card_id(struct sdio_func *func, unsigned short *card_id);
73void libra_sdio_release_irq(struct sdio_func *func);
74int libra_enable_sdio_irq(struct sdio_func *func, u8 enable);
75void libra_sdio_disable_func(struct sdio_func *func);
76int libra_disable_sdio_irq_capability(struct sdio_func *func, u8 disable);
77
78#endif /* __LIBRA_SDIOIF_H__ */