Anton Vorontsov | 515033f | 2010-08-10 18:01:47 -0700 | [diff] [blame] | 1 | /* |
| 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 Sang | 4b711cb | 2010-10-15 12:20:59 +0200 | [diff] [blame] | 14 | #include <linux/clk.h> |
| 15 | #include <linux/types.h> |
Shawn Guo | 85d6509 | 2011-05-27 23:48:12 +0800 | [diff] [blame] | 16 | #include <linux/platform_device.h> |
Shawn Guo | 38576af | 2011-05-27 23:48:14 +0800 | [diff] [blame] | 17 | #include <linux/mmc/sdhci.h> |
Anton Vorontsov | 20b1597b | 2010-08-10 18:01:49 -0700 | [diff] [blame] | 18 | |
Shawn Guo | 94cc6a8 | 2011-05-27 23:48:15 +0800 | [diff] [blame^] | 19 | struct sdhci_pltfm_data { |
| 20 | struct sdhci_ops *ops; |
| 21 | unsigned int quirks; |
| 22 | }; |
| 23 | |
Wolfram Sang | 4b711cb | 2010-10-15 12:20:59 +0200 | [diff] [blame] | 24 | struct sdhci_pltfm_host { |
| 25 | struct clk *clk; |
Richard Zhu | e149860 | 2011-03-25 09:18:27 -0400 | [diff] [blame] | 26 | void *priv; /* to handle quirks across io-accessor calls */ |
Shawn Guo | e307148 | 2011-07-20 17:13:36 -0400 | [diff] [blame] | 27 | |
| 28 | /* migrate from sdhci_of_host */ |
| 29 | unsigned int clock; |
| 30 | u16 xfer_mode_shadow; |
Wolfram Sang | 4b711cb | 2010-10-15 12:20:59 +0200 | [diff] [blame] | 31 | }; |
| 32 | |
Shawn Guo | 38576af | 2011-05-27 23:48:14 +0800 | [diff] [blame] | 33 | #ifdef CONFIG_MMC_SDHCI_BIG_ENDIAN_32BIT_BYTE_SWAPPER |
| 34 | extern u32 sdhci_be32bs_readl(struct sdhci_host *host, int reg); |
| 35 | extern u16 sdhci_be32bs_readw(struct sdhci_host *host, int reg); |
| 36 | extern u8 sdhci_be32bs_readb(struct sdhci_host *host, int reg); |
| 37 | extern void sdhci_be32bs_writel(struct sdhci_host *host, u32 val, int reg); |
| 38 | extern void sdhci_be32bs_writew(struct sdhci_host *host, u16 val, int reg); |
| 39 | extern void sdhci_be32bs_writeb(struct sdhci_host *host, u8 val, int reg); |
| 40 | #endif |
| 41 | |
| 42 | extern void sdhci_get_of_property(struct platform_device *pdev); |
| 43 | |
Shawn Guo | 85d6509 | 2011-05-27 23:48:12 +0800 | [diff] [blame] | 44 | extern struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, |
| 45 | struct sdhci_pltfm_data *pdata); |
| 46 | extern void sdhci_pltfm_free(struct platform_device *pdev); |
| 47 | |
| 48 | extern int sdhci_pltfm_register(struct platform_device *pdev, |
| 49 | struct sdhci_pltfm_data *pdata); |
| 50 | extern int sdhci_pltfm_unregister(struct platform_device *pdev); |
| 51 | |
| 52 | #ifdef CONFIG_PM |
| 53 | extern int sdhci_pltfm_suspend(struct platform_device *dev, pm_message_t state); |
| 54 | extern int sdhci_pltfm_resume(struct platform_device *dev); |
| 55 | #endif |
Anton Vorontsov | 20b1597b | 2010-08-10 18:01:49 -0700 | [diff] [blame] | 56 | |
Anton Vorontsov | 515033f | 2010-08-10 18:01:47 -0700 | [diff] [blame] | 57 | #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */ |