1515033f9SAnton Vorontsov /* 2515033f9SAnton Vorontsov * Copyright 2010 MontaVista Software, LLC. 3515033f9SAnton Vorontsov * 4515033f9SAnton Vorontsov * Author: Anton Vorontsov <avorontsov@ru.mvista.com> 5515033f9SAnton Vorontsov * 6515033f9SAnton Vorontsov * This program is free software; you can redistribute it and/or modify 7515033f9SAnton Vorontsov * it under the terms of the GNU General Public License version 2 as 8515033f9SAnton Vorontsov * published by the Free Software Foundation. 9515033f9SAnton Vorontsov */ 10515033f9SAnton Vorontsov 11515033f9SAnton Vorontsov #ifndef _DRIVERS_MMC_SDHCI_PLTFM_H 12515033f9SAnton Vorontsov #define _DRIVERS_MMC_SDHCI_PLTFM_H 13515033f9SAnton Vorontsov 144b711cb1SWolfram Sang #include <linux/clk.h> 154b711cb1SWolfram Sang #include <linux/types.h> 1685d6509dSShawn Guo #include <linux/platform_device.h> 1738576af1SShawn Guo #include <linux/mmc/sdhci.h> 1820b1597bSAnton Vorontsov 19*94cc6a86SShawn Guo struct sdhci_pltfm_data { 20*94cc6a86SShawn Guo struct sdhci_ops *ops; 21*94cc6a86SShawn Guo unsigned int quirks; 22*94cc6a86SShawn Guo }; 23*94cc6a86SShawn Guo 244b711cb1SWolfram Sang struct sdhci_pltfm_host { 254b711cb1SWolfram Sang struct clk *clk; 26e149860dSRichard Zhu void *priv; /* to handle quirks across io-accessor calls */ 27e307148fSShawn Guo 28e307148fSShawn Guo /* migrate from sdhci_of_host */ 29e307148fSShawn Guo unsigned int clock; 30e307148fSShawn Guo u16 xfer_mode_shadow; 314b711cb1SWolfram Sang }; 324b711cb1SWolfram Sang 3338576af1SShawn Guo #ifdef CONFIG_MMC_SDHCI_BIG_ENDIAN_32BIT_BYTE_SWAPPER 3438576af1SShawn Guo extern u32 sdhci_be32bs_readl(struct sdhci_host *host, int reg); 3538576af1SShawn Guo extern u16 sdhci_be32bs_readw(struct sdhci_host *host, int reg); 3638576af1SShawn Guo extern u8 sdhci_be32bs_readb(struct sdhci_host *host, int reg); 3738576af1SShawn Guo extern void sdhci_be32bs_writel(struct sdhci_host *host, u32 val, int reg); 3838576af1SShawn Guo extern void sdhci_be32bs_writew(struct sdhci_host *host, u16 val, int reg); 3938576af1SShawn Guo extern void sdhci_be32bs_writeb(struct sdhci_host *host, u8 val, int reg); 4038576af1SShawn Guo #endif 4138576af1SShawn Guo 4238576af1SShawn Guo extern void sdhci_get_of_property(struct platform_device *pdev); 4338576af1SShawn Guo 4485d6509dSShawn Guo extern struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, 4585d6509dSShawn Guo struct sdhci_pltfm_data *pdata); 4685d6509dSShawn Guo extern void sdhci_pltfm_free(struct platform_device *pdev); 4785d6509dSShawn Guo 4885d6509dSShawn Guo extern int sdhci_pltfm_register(struct platform_device *pdev, 4985d6509dSShawn Guo struct sdhci_pltfm_data *pdata); 5085d6509dSShawn Guo extern int sdhci_pltfm_unregister(struct platform_device *pdev); 5185d6509dSShawn Guo 5285d6509dSShawn Guo #ifdef CONFIG_PM 5385d6509dSShawn Guo extern int sdhci_pltfm_suspend(struct platform_device *dev, pm_message_t state); 5485d6509dSShawn Guo extern int sdhci_pltfm_resume(struct platform_device *dev); 5585d6509dSShawn Guo #endif 5620b1597bSAnton Vorontsov 57515033f9SAnton Vorontsov #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */ 58