blob: 99e6f724a22412e26c3650eee04c48921ad70b65 [file] [log] [blame]
Pavan Kumar89f18c32012-03-21 14:55:22 +05301/* Copyright (c) 2009-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
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 *);
Pavan Kumar89f18c32012-03-21 14:55:22 +053037typedef void (notify_card_removal_t)(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070038
Pavan Kumar8832b232012-03-05 19:32:29 +053039int libra_enable_sdio_irq_in_chip(struct sdio_func *func, u8 enable);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040int libra_sdio_configure(sdio_irq_handler_t libra_sdio_rxhandler,
41 void (*func_drv_fn)(int *status),
42 u32 funcdrv_timeout, u32 blksize);
43void libra_sdio_deconfigure(struct sdio_func *func);
44struct sdio_func *libra_getsdio_funcdev(void);
45void libra_sdio_setprivdata(struct sdio_func *sdio_func_dev,
46 void *padapter);
47void *libra_sdio_getprivdata(struct sdio_func *sdio_func_dev);
48void libra_claim_host(struct sdio_func *sdio_func_dev,
49 pid_t *curr_claimed, pid_t current_pid,
50 atomic_t *claim_count);
51void libra_release_host(struct sdio_func *sdio_func_dev,
52 pid_t *curr_claimed, pid_t current_pid,
53 atomic_t *claim_count);
54void libra_sdiocmd52(struct sdio_func *sdio_func_dev,
55 u32 addr, u8 *b, int write, int *err_ret);
56u8 libra_sdio_readsb(struct sdio_func *func, void *dst,
57 unsigned int addr, int count);
58int libra_sdio_memcpy_fromio(struct sdio_func *func,
59 void *dst, unsigned int addr, int count);
60int libra_sdio_writesb(struct sdio_func *func,
61 unsigned int addr, void *src, int count);
62int libra_sdio_memcpy_toio(struct sdio_func *func,
63 unsigned int addr, void *src, int count);
64int libra_sdio_enable_polling(void);
65
66int libra_sdio_configure_suspend_resume(
67 suspend_handler_t *libra_sdio_suspend_hdlr,
68 resume_handler_t *libra_sdio_resume_hdlr);
69
70int libra_detect_card_change(void);
71
72void libra_sdio_set_clock(struct sdio_func *func, unsigned int clk_freq);
73void libra_sdio_get_card_id(struct sdio_func *func, unsigned short *card_id);
74void libra_sdio_release_irq(struct sdio_func *func);
75int libra_enable_sdio_irq(struct sdio_func *func, u8 enable);
76void libra_sdio_disable_func(struct sdio_func *func);
77int libra_disable_sdio_irq_capability(struct sdio_func *func, u8 disable);
Pavan Kumar89f18c32012-03-21 14:55:22 +053078int libra_sdio_notify_card_removal(
79 notify_card_removal_t *libra_sdio_notify_card_removal_hdlr);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070080#endif /* __LIBRA_SDIOIF_H__ */