aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2014-02-14 00:45:48 -0500
committerChris Ball <chris@printf.net>2014-03-04 11:44:31 -0500
commit59445b10d08144d870d8340ce25634014bf972d5 (patch)
tree907589e80355020d595048a43c1827f629ecdadb /drivers/mmc/host
parentb38313d627e29d7dfc4aed242fc007806a85d3f0 (diff)
mmc: omap_hsmmc: Add support for quirky omap3 hsmmc controller
When device is booted using devicetree, platforms impacted by Erratum 2.1.1.128 is not detected easily in the mmc driver. This erratum indicates that the module cannot do multi-block transfers. Platforms such as LDP which use OMAP3 ES revision prior to ES3.0 are impacted by this. Provide a new compatible property "ti,omap3-pre-es3-hsmmc" to allow driver to determine if driver needs to implement quirks associated with the specific module version (primarily because the IP revision information is not sufficient for the same). Signed-off-by: Nishanth Menon <nm@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Balaji T K <balajitk@ti.com> Signed-off-by: Chris Ball <chris@printf.net>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 4ff906cfd23c..b1ac26a76306 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -192,6 +192,11 @@ struct omap_hsmmc_host {
192 struct omap_mmc_platform_data *pdata; 192 struct omap_mmc_platform_data *pdata;
193}; 193};
194 194
195struct omap_mmc_of_data {
196 u32 reg_offset;
197 u8 controller_flags;
198};
199
195static int omap_hsmmc_card_detect(struct device *dev, int slot) 200static int omap_hsmmc_card_detect(struct device *dev, int slot)
196{ 201{
197 struct omap_hsmmc_host *host = dev_get_drvdata(dev); 202 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
@@ -1677,18 +1682,29 @@ static void omap_hsmmc_debugfs(struct mmc_host *mmc)
1677#endif 1682#endif
1678 1683
1679#ifdef CONFIG_OF 1684#ifdef CONFIG_OF
1680static u16 omap4_reg_offset = 0x100; 1685static const struct omap_mmc_of_data omap3_pre_es3_mmc_of_data = {
1686 /* See 35xx errata 2.1.1.128 in SPRZ278F */
1687 .controller_flags = OMAP_HSMMC_BROKEN_MULTIBLOCK_READ,
1688};
1689
1690static const struct omap_mmc_of_data omap4_mmc_of_data = {
1691 .reg_offset = 0x100,
1692};
1681 1693
1682static const struct of_device_id omap_mmc_of_match[] = { 1694static const struct of_device_id omap_mmc_of_match[] = {
1683 { 1695 {
1684 .compatible = "ti,omap2-hsmmc", 1696 .compatible = "ti,omap2-hsmmc",
1685 }, 1697 },
1686 { 1698 {
1699 .compatible = "ti,omap3-pre-es3-hsmmc",
1700 .data = &omap3_pre_es3_mmc_of_data,
1701 },
1702 {
1687 .compatible = "ti,omap3-hsmmc", 1703 .compatible = "ti,omap3-hsmmc",
1688 }, 1704 },
1689 { 1705 {
1690 .compatible = "ti,omap4-hsmmc", 1706 .compatible = "ti,omap4-hsmmc",
1691 .data = &omap4_reg_offset, 1707 .data = &omap4_mmc_of_data,
1692 }, 1708 },
1693 {}, 1709 {},
1694}; 1710};
@@ -1758,6 +1774,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
1758 dma_cap_mask_t mask; 1774 dma_cap_mask_t mask;
1759 unsigned tx_req, rx_req; 1775 unsigned tx_req, rx_req;
1760 struct pinctrl *pinctrl; 1776 struct pinctrl *pinctrl;
1777 const struct omap_mmc_of_data *data;
1761 1778
1762 match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev); 1779 match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
1763 if (match) { 1780 if (match) {
@@ -1767,8 +1784,9 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
1767 return PTR_ERR(pdata); 1784 return PTR_ERR(pdata);
1768 1785
1769 if (match->data) { 1786 if (match->data) {
1770 const u16 *offsetp = match->data; 1787 data = match->data;
1771 pdata->reg_offset = *offsetp; 1788 pdata->reg_offset = data->reg_offset;
1789 pdata->controller_flags |= data->controller_flags;
1772 } 1790 }
1773 } 1791 }
1774 1792