aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorAndreas Fenkart <afenkart@gmail.com>2014-11-08 09:33:09 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2014-11-26 08:30:53 -0500
commit551434389074791da30b7afbf44c4bbe9b8b0116 (patch)
treec7a99e71b9e1b9ed02118329f97a2317b8602c1f /drivers/mmc/host
parent826c71a06588675a797534220364ed74df6188c0 (diff)
ARM: OMAP1/2+: MMC: separate platform data for mmc and mmc hs driver
- omap mmc driver supports multiplexing, omap_mmc_hs doesn't this leads to one of the major confusions in the omap_hsmmc driver - platform data should be read-only for the driver most callbacks are not set by the omap3 platform init code while still required. So they are set from the driver probe function, which is against the paradigm that platform-data should not be modified by the driver typical examples are card_detect, read_only callbacks un-bundling by searching for driver name \"omap_hsmmc in the arch/arm folder. omap_hsmmc_platform_data is not initialized directly, but from omap2_hsmmc_info, which is defined in a separate header file not touched by this patch hwmod includes platform headers to declare features of the platform. All the declared features are prefixed OMAP_HSMMC. There is no need to include platform header from hwmod other except for feature defines Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index df27bb4fc098..4957c5fe555b 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -42,7 +42,7 @@
42#include <linux/regulator/consumer.h> 42#include <linux/regulator/consumer.h>
43#include <linux/pinctrl/consumer.h> 43#include <linux/pinctrl/consumer.h>
44#include <linux/pm_runtime.h> 44#include <linux/pm_runtime.h>
45#include <linux/platform_data/mmc-omap.h> 45#include <linux/platform_data/hsmmc-omap.h>
46 46
47/* OMAP HSMMC Host Controller Registers */ 47/* OMAP HSMMC Host Controller Registers */
48#define OMAP_HSMMC_SYSSTATUS 0x0014 48#define OMAP_HSMMC_SYSSTATUS 0x0014
@@ -220,7 +220,7 @@ struct omap_hsmmc_host {
220#define HSMMC_SDIO_IRQ_ENABLED (1 << 1) /* SDIO irq enabled */ 220#define HSMMC_SDIO_IRQ_ENABLED (1 << 1) /* SDIO irq enabled */
221#define HSMMC_WAKE_IRQ_ENABLED (1 << 2) 221#define HSMMC_WAKE_IRQ_ENABLED (1 << 2)
222 struct omap_hsmmc_next next_data; 222 struct omap_hsmmc_next next_data;
223 struct omap_mmc_platform_data *pdata; 223 struct omap_hsmmc_platform_data *pdata;
224}; 224};
225 225
226struct omap_mmc_of_data { 226struct omap_mmc_of_data {
@@ -233,7 +233,7 @@ static void omap_hsmmc_start_dma_transfer(struct omap_hsmmc_host *host);
233static int omap_hsmmc_card_detect(struct device *dev, int slot) 233static int omap_hsmmc_card_detect(struct device *dev, int slot)
234{ 234{
235 struct omap_hsmmc_host *host = dev_get_drvdata(dev); 235 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
236 struct omap_mmc_platform_data *mmc = host->pdata; 236 struct omap_hsmmc_platform_data *mmc = host->pdata;
237 237
238 /* NOTE: assumes card detect signal is active-low */ 238 /* NOTE: assumes card detect signal is active-low */
239 return !gpio_get_value_cansleep(mmc->slots[0].switch_pin); 239 return !gpio_get_value_cansleep(mmc->slots[0].switch_pin);
@@ -242,7 +242,7 @@ static int omap_hsmmc_card_detect(struct device *dev, int slot)
242static int omap_hsmmc_get_wp(struct device *dev, int slot) 242static int omap_hsmmc_get_wp(struct device *dev, int slot)
243{ 243{
244 struct omap_hsmmc_host *host = dev_get_drvdata(dev); 244 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
245 struct omap_mmc_platform_data *mmc = host->pdata; 245 struct omap_hsmmc_platform_data *mmc = host->pdata;
246 246
247 /* NOTE: assumes write protect signal is active-high */ 247 /* NOTE: assumes write protect signal is active-high */
248 return gpio_get_value_cansleep(mmc->slots[0].gpio_wp); 248 return gpio_get_value_cansleep(mmc->slots[0].gpio_wp);
@@ -251,7 +251,7 @@ static int omap_hsmmc_get_wp(struct device *dev, int slot)
251static int omap_hsmmc_get_cover_state(struct device *dev, int slot) 251static int omap_hsmmc_get_cover_state(struct device *dev, int slot)
252{ 252{
253 struct omap_hsmmc_host *host = dev_get_drvdata(dev); 253 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
254 struct omap_mmc_platform_data *mmc = host->pdata; 254 struct omap_hsmmc_platform_data *mmc = host->pdata;
255 255
256 /* NOTE: assumes card detect signal is active-low */ 256 /* NOTE: assumes card detect signal is active-low */
257 return !gpio_get_value_cansleep(mmc->slots[0].switch_pin); 257 return !gpio_get_value_cansleep(mmc->slots[0].switch_pin);
@@ -262,7 +262,7 @@ static int omap_hsmmc_get_cover_state(struct device *dev, int slot)
262static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot) 262static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot)
263{ 263{
264 struct omap_hsmmc_host *host = dev_get_drvdata(dev); 264 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
265 struct omap_mmc_platform_data *mmc = host->pdata; 265 struct omap_hsmmc_platform_data *mmc = host->pdata;
266 266
267 disable_irq(mmc->slots[0].card_detect_irq); 267 disable_irq(mmc->slots[0].card_detect_irq);
268 return 0; 268 return 0;
@@ -271,7 +271,7 @@ static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot)
271static int omap_hsmmc_resume_cdirq(struct device *dev, int slot) 271static int omap_hsmmc_resume_cdirq(struct device *dev, int slot)
272{ 272{
273 struct omap_hsmmc_host *host = dev_get_drvdata(dev); 273 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
274 struct omap_mmc_platform_data *mmc = host->pdata; 274 struct omap_hsmmc_platform_data *mmc = host->pdata;
275 275
276 enable_irq(mmc->slots[0].card_detect_irq); 276 enable_irq(mmc->slots[0].card_detect_irq);
277 return 0; 277 return 0;
@@ -449,7 +449,7 @@ static inline int omap_hsmmc_have_reg(void)
449 449
450#endif 450#endif
451 451
452static int omap_hsmmc_gpio_init(struct omap_mmc_platform_data *pdata) 452static int omap_hsmmc_gpio_init(struct omap_hsmmc_platform_data *pdata)
453{ 453{
454 int ret; 454 int ret;
455 455
@@ -492,7 +492,7 @@ err_free_sp:
492 return ret; 492 return ret;
493} 493}
494 494
495static void omap_hsmmc_gpio_free(struct omap_mmc_platform_data *pdata) 495static void omap_hsmmc_gpio_free(struct omap_hsmmc_platform_data *pdata)
496{ 496{
497 if (gpio_is_valid(pdata->slots[0].gpio_wp)) 497 if (gpio_is_valid(pdata->slots[0].gpio_wp))
498 gpio_free(pdata->slots[0].gpio_wp); 498 gpio_free(pdata->slots[0].gpio_wp);
@@ -1286,7 +1286,7 @@ static void omap_hsmmc_protect_card(struct omap_hsmmc_host *host)
1286static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id) 1286static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id)
1287{ 1287{
1288 struct omap_hsmmc_host *host = dev_id; 1288 struct omap_hsmmc_host *host = dev_id;
1289 struct omap_mmc_slot_data *slot = &mmc_slot(host); 1289 struct omap_hsmmc_slot_data *slot = &mmc_slot(host);
1290 int carddetect; 1290 int carddetect;
1291 1291
1292 sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); 1292 sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
@@ -1957,9 +1957,9 @@ static const struct of_device_id omap_mmc_of_match[] = {
1957}; 1957};
1958MODULE_DEVICE_TABLE(of, omap_mmc_of_match); 1958MODULE_DEVICE_TABLE(of, omap_mmc_of_match);
1959 1959
1960static struct omap_mmc_platform_data *of_get_hsmmc_pdata(struct device *dev) 1960static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
1961{ 1961{
1962 struct omap_mmc_platform_data *pdata; 1962 struct omap_hsmmc_platform_data *pdata;
1963 struct device_node *np = dev->of_node; 1963 struct device_node *np = dev->of_node;
1964 u32 bus_width, max_freq; 1964 u32 bus_width, max_freq;
1965 int cd_gpio, wp_gpio; 1965 int cd_gpio, wp_gpio;
@@ -2009,7 +2009,7 @@ static struct omap_mmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
2009 return pdata; 2009 return pdata;
2010} 2010}
2011#else 2011#else
2012static inline struct omap_mmc_platform_data 2012static inline struct omap_hsmmc_platform_data
2013 *of_get_hsmmc_pdata(struct device *dev) 2013 *of_get_hsmmc_pdata(struct device *dev)
2014{ 2014{
2015 return ERR_PTR(-EINVAL); 2015 return ERR_PTR(-EINVAL);
@@ -2018,7 +2018,7 @@ static inline struct omap_mmc_platform_data
2018 2018
2019static int omap_hsmmc_probe(struct platform_device *pdev) 2019static int omap_hsmmc_probe(struct platform_device *pdev)
2020{ 2020{
2021 struct omap_mmc_platform_data *pdata = pdev->dev.platform_data; 2021 struct omap_hsmmc_platform_data *pdata = pdev->dev.platform_data;
2022 struct mmc_host *mmc; 2022 struct mmc_host *mmc;
2023 struct omap_hsmmc_host *host = NULL; 2023 struct omap_hsmmc_host *host = NULL;
2024 struct resource *res; 2024 struct resource *res;