blob: fe27b83f5bb12fb2f3a728288b785a767968ea42 [file] [log] [blame]
Anton Vorontsov515033f2010-08-10 18:01:47 -07001/*
2 * Copyright 2010 MontaVista Software, LLC.
3 *
4 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef _DRIVERS_MMC_SDHCI_PLTFM_H
12#define _DRIVERS_MMC_SDHCI_PLTFM_H
13
Wolfram Sang4b711cb2010-10-15 12:20:59 +020014#include <linux/clk.h>
15#include <linux/types.h>
Shawn Guo85d65092011-05-27 23:48:12 +080016#include <linux/platform_device.h>
Wolfram Sangd3b993d2010-10-15 12:21:00 +020017#include <linux/mmc/sdhci-pltfm.h>
Shawn Guo38576af2011-05-27 23:48:14 +080018#include <linux/mmc/sdhci.h>
Anton Vorontsov20b1597b2010-08-10 18:01:49 -070019
Wolfram Sang4b711cb2010-10-15 12:20:59 +020020struct sdhci_pltfm_host {
21 struct clk *clk;
Richard Zhue1498602011-03-25 09:18:27 -040022 void *priv; /* to handle quirks across io-accessor calls */
Shawn Guoe3071482011-07-20 17:13:36 -040023
24 /* migrate from sdhci_of_host */
25 unsigned int clock;
26 u16 xfer_mode_shadow;
Wolfram Sang4b711cb2010-10-15 12:20:59 +020027};
28
Shawn Guo38576af2011-05-27 23:48:14 +080029#ifdef CONFIG_MMC_SDHCI_BIG_ENDIAN_32BIT_BYTE_SWAPPER
30extern u32 sdhci_be32bs_readl(struct sdhci_host *host, int reg);
31extern u16 sdhci_be32bs_readw(struct sdhci_host *host, int reg);
32extern u8 sdhci_be32bs_readb(struct sdhci_host *host, int reg);
33extern void sdhci_be32bs_writel(struct sdhci_host *host, u32 val, int reg);
34extern void sdhci_be32bs_writew(struct sdhci_host *host, u16 val, int reg);
35extern void sdhci_be32bs_writeb(struct sdhci_host *host, u8 val, int reg);
36#endif
37
38extern void sdhci_get_of_property(struct platform_device *pdev);
39
Shawn Guo85d65092011-05-27 23:48:12 +080040extern struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
41 struct sdhci_pltfm_data *pdata);
42extern void sdhci_pltfm_free(struct platform_device *pdev);
43
44extern int sdhci_pltfm_register(struct platform_device *pdev,
45 struct sdhci_pltfm_data *pdata);
46extern int sdhci_pltfm_unregister(struct platform_device *pdev);
47
48#ifdef CONFIG_PM
49extern int sdhci_pltfm_suspend(struct platform_device *dev, pm_message_t state);
50extern int sdhci_pltfm_resume(struct platform_device *dev);
51#endif
Anton Vorontsov20b1597b2010-08-10 18:01:49 -070052
Anton Vorontsov515033f2010-08-10 18:01:47 -070053#endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */