* [PATCH 1/6] omap_hsmmc: unshare platform data struct with mmci driver
2014-09-22 11:55 [PATCH 0/6] unshare and simplify omap_hsmmc platform struct Andreas Fenkart
@ 2014-09-22 11:55 ` Andreas Fenkart
2014-09-22 11:55 ` [PATCH 2/6] omap_hsmmc: remove unused callbacks from platform data struct Andreas Fenkart
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Andreas Fenkart @ 2014-09-22 11:55 UTC (permalink / raw)
To: linux-mmc
Cc: linux-omap, Tony Lindgren, Balaji T K, Ulf Hansson, pascal.huerst,
Andreas Fenkart
- mmci driver supports multiple slots, omap_hsmmc only one
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 platform init code while being
required by the driver, leading to the fact that they are set by the
driver during it's probe function
typical example are card detect / read only detect callbacks
Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
---
arch/arm/mach-omap2/hsmmc.c | 24 ++--
arch/arm/mach-omap2/mmc.h | 6 +-
.../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 6 +-
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 6 +-
drivers/mmc/host/omap_hsmmc.c | 28 ++--
include/linux/platform_data/hsmmc-omap.h | 152 +++++++++++++++++++++
6 files changed, 187 insertions(+), 35 deletions(-)
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 07d4c7b..e3555f2 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -47,7 +47,7 @@ static void omap_hsmmc1_before_set_reg(struct device *dev, int slot,
int power_on, int vdd)
{
u32 reg, prog_io;
- struct omap_mmc_platform_data *mmc = dev->platform_data;
+ struct omap_hsmmc_platform_data *mmc = dev->platform_data;
if (mmc->slots[0].remux)
mmc->slots[0].remux(dev, slot, power_on);
@@ -120,7 +120,7 @@ static void omap_hsmmc1_after_set_reg(struct device *dev, int slot,
}
}
-static void hsmmc2_select_input_clk_src(struct omap_mmc_platform_data *mmc)
+static void hsmmc2_select_input_clk_src(struct omap_hsmmc_platform_data *mmc)
{
u32 reg;
@@ -135,7 +135,7 @@ static void hsmmc2_select_input_clk_src(struct omap_mmc_platform_data *mmc)
static void hsmmc2_before_set_reg(struct device *dev, int slot,
int power_on, int vdd)
{
- struct omap_mmc_platform_data *mmc = dev->platform_data;
+ struct omap_hsmmc_platform_data *mmc = dev->platform_data;
if (mmc->slots[0].remux)
mmc->slots[0].remux(dev, slot, power_on);
@@ -147,7 +147,7 @@ static void hsmmc2_before_set_reg(struct device *dev, int slot,
static int am35x_hsmmc2_set_power(struct device *dev, int slot,
int power_on, int vdd)
{
- struct omap_mmc_platform_data *mmc = dev->platform_data;
+ struct omap_hsmmc_platform_data *mmc = dev->platform_data;
if (power_on)
hsmmc2_select_input_clk_src(mmc);
@@ -161,8 +161,8 @@ static int nop_mmc_set_power(struct device *dev, int slot, int power_on,
return 0;
}
-static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller,
- int controller_nr)
+static inline void omap_hsmmc_mux(struct omap_hsmmc_platform_data
+ *mmc_controller, int controller_nr)
{
if (gpio_is_valid(mmc_controller->slots[0].switch_pin) &&
(mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
@@ -243,7 +243,7 @@ static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller,
}
static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
- struct omap_mmc_platform_data *mmc)
+ struct omap_hsmmc_platform_data *mmc)
{
char *hc_name;
@@ -368,7 +368,7 @@ static int omap_hsmmc_done;
void omap_hsmmc_late_init(struct omap2_hsmmc_info *c)
{
struct platform_device *pdev;
- struct omap_mmc_platform_data *mmc_pdata;
+ struct omap_hsmmc_platform_data *mmc_pdata;
int res;
if (omap_hsmmc_done != 1)
@@ -408,12 +408,12 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo,
struct omap_device *od;
struct platform_device *pdev;
char oh_name[MAX_OMAP_MMC_HWMOD_NAME_LEN];
- struct omap_mmc_platform_data *mmc_data;
- struct omap_mmc_dev_attr *mmc_dev_attr;
+ struct omap_hsmmc_platform_data *mmc_data;
+ struct omap_hsmmc_dev_attr *mmc_dev_attr;
char *name;
int res;
- mmc_data = kzalloc(sizeof(struct omap_mmc_platform_data), GFP_KERNEL);
+ mmc_data = kzalloc(sizeof(*mmc_data), GFP_KERNEL);
if (!mmc_data) {
pr_err("Cannot allocate memory for mmc device!\n");
return;
@@ -463,7 +463,7 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo,
}
res = platform_device_add_data(pdev, mmc_data,
- sizeof(struct omap_mmc_platform_data));
+ sizeof(struct omap_hsmmc_platform_data));
if (res) {
pr_err("Could not add pdata for %s\n", name);
goto put_pdev;
diff --git a/arch/arm/mach-omap2/mmc.h b/arch/arm/mach-omap2/mmc.h
index 0cd4b08..db28c14 100644
--- a/arch/arm/mach-omap2/mmc.h
+++ b/arch/arm/mach-omap2/mmc.h
@@ -1,5 +1,5 @@
#include <linux/mmc/host.h>
-#include <linux/platform_data/mmc-omap.h>
+#include <linux/platform_data/hsmmc-omap.h>
#define OMAP24XX_NR_MMC 2
#define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE
@@ -8,9 +8,9 @@
#define OMAP4_MMC_REG_OFFSET 0x100
#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
-void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data);
+void omap242x_init_mmc(struct omap_hsmmc_platform_data **mmc_data);
#else
-static inline void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
+static inline void omap242x_init_mmc(struct omap_hsmmc_platform_data **mmc_data)
{
}
#endif
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
index a579b89..7a85958 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
@@ -836,7 +836,7 @@ static struct omap_hwmod_class am33xx_mmc_hwmod_class = {
};
/* mmc0 */
-static struct omap_mmc_dev_attr am33xx_mmc0_dev_attr = {
+static struct omap_hsmmc_dev_attr am33xx_mmc0_dev_attr = {
.flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
};
@@ -854,7 +854,7 @@ struct omap_hwmod am33xx_mmc0_hwmod = {
};
/* mmc1 */
-static struct omap_mmc_dev_attr am33xx_mmc1_dev_attr = {
+static struct omap_hsmmc_dev_attr am33xx_mmc1_dev_attr = {
.flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
};
@@ -872,7 +872,7 @@ struct omap_hwmod am33xx_mmc1_hwmod = {
};
/* mmc2 */
-static struct omap_mmc_dev_attr am33xx_mmc2_dev_attr = {
+static struct omap_hsmmc_dev_attr am33xx_mmc2_dev_attr = {
.flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
};
struct omap_hwmod am33xx_mmc2_hwmod = {
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 1cd0cfd..20a2b88 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -1786,12 +1786,12 @@ static struct omap_hwmod_opt_clk omap34xx_mmc1_opt_clks[] = {
{ .role = "dbck", .clk = "omap_32k_fck", },
};
-static struct omap_mmc_dev_attr mmc1_dev_attr = {
+static struct omap_hsmmc_dev_attr mmc1_dev_attr = {
.flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
};
/* See 35xx errata 2.1.1.128 in SPRZ278F */
-static struct omap_mmc_dev_attr mmc1_pre_es3_dev_attr = {
+static struct omap_hsmmc_dev_attr mmc1_pre_es3_dev_attr = {
.flags = (OMAP_HSMMC_SUPPORTS_DUAL_VOLT |
OMAP_HSMMC_BROKEN_MULTIBLOCK_READ),
};
@@ -1854,7 +1854,7 @@ static struct omap_hwmod_opt_clk omap34xx_mmc2_opt_clks[] = {
};
/* See 35xx errata 2.1.1.128 in SPRZ278F */
-static struct omap_mmc_dev_attr mmc2_pre_es3_dev_attr = {
+static struct omap_hsmmc_dev_attr mmc2_pre_es3_dev_attr = {
.flags = OMAP_HSMMC_BROKEN_MULTIBLOCK_READ,
};
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 35ac2e4..5f2b5b7 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -42,7 +42,7 @@
#include <linux/regulator/consumer.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pm_runtime.h>
-#include <linux/platform_data/mmc-omap.h>
+#include <linux/platform_data/hsmmc-omap.h>
/* OMAP HSMMC Host Controller Registers */
#define OMAP_HSMMC_SYSSTATUS 0x0014
@@ -220,7 +220,7 @@ struct omap_hsmmc_host {
#define HSMMC_SDIO_IRQ_ENABLED (1 << 1) /* SDIO irq enabled */
#define HSMMC_WAKE_IRQ_ENABLED (1 << 2)
struct omap_hsmmc_next next_data;
- struct omap_mmc_platform_data *pdata;
+ struct omap_hsmmc_platform_data *pdata;
};
struct omap_mmc_of_data {
@@ -233,7 +233,7 @@ static void omap_hsmmc_start_dma_transfer(struct omap_hsmmc_host *host);
static int omap_hsmmc_card_detect(struct device *dev, int slot)
{
struct omap_hsmmc_host *host = dev_get_drvdata(dev);
- struct omap_mmc_platform_data *mmc = host->pdata;
+ struct omap_hsmmc_platform_data *mmc = host->pdata;
/* NOTE: assumes card detect signal is active-low */
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)
static int omap_hsmmc_get_wp(struct device *dev, int slot)
{
struct omap_hsmmc_host *host = dev_get_drvdata(dev);
- struct omap_mmc_platform_data *mmc = host->pdata;
+ struct omap_hsmmc_platform_data *mmc = host->pdata;
/* NOTE: assumes write protect signal is active-high */
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)
static int omap_hsmmc_get_cover_state(struct device *dev, int slot)
{
struct omap_hsmmc_host *host = dev_get_drvdata(dev);
- struct omap_mmc_platform_data *mmc = host->pdata;
+ struct omap_hsmmc_platform_data *mmc = host->pdata;
/* NOTE: assumes card detect signal is active-low */
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)
static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot)
{
struct omap_hsmmc_host *host = dev_get_drvdata(dev);
- struct omap_mmc_platform_data *mmc = host->pdata;
+ struct omap_hsmmc_platform_data *mmc = host->pdata;
disable_irq(mmc->slots[0].card_detect_irq);
return 0;
@@ -271,7 +271,7 @@ static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot)
static int omap_hsmmc_resume_cdirq(struct device *dev, int slot)
{
struct omap_hsmmc_host *host = dev_get_drvdata(dev);
- struct omap_mmc_platform_data *mmc = host->pdata;
+ struct omap_hsmmc_platform_data *mmc = host->pdata;
enable_irq(mmc->slots[0].card_detect_irq);
return 0;
@@ -449,7 +449,7 @@ static inline int omap_hsmmc_have_reg(void)
#endif
-static int omap_hsmmc_gpio_init(struct omap_mmc_platform_data *pdata)
+static int omap_hsmmc_gpio_init(struct omap_hsmmc_platform_data *pdata)
{
int ret;
@@ -492,7 +492,7 @@ err_free_sp:
return ret;
}
-static void omap_hsmmc_gpio_free(struct omap_mmc_platform_data *pdata)
+static void omap_hsmmc_gpio_free(struct omap_hsmmc_platform_data *pdata)
{
if (gpio_is_valid(pdata->slots[0].gpio_wp))
gpio_free(pdata->slots[0].gpio_wp);
@@ -1286,7 +1286,7 @@ static void omap_hsmmc_protect_card(struct omap_hsmmc_host *host)
static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id)
{
struct omap_hsmmc_host *host = dev_id;
- struct omap_mmc_slot_data *slot = &mmc_slot(host);
+ struct omap_hsmmc_slot_data *slot = &mmc_slot(host);
int carddetect;
sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
@@ -1947,9 +1947,9 @@ static const struct of_device_id omap_mmc_of_match[] = {
};
MODULE_DEVICE_TABLE(of, omap_mmc_of_match);
-static struct omap_mmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
+static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
{
- struct omap_mmc_platform_data *pdata;
+ struct omap_hsmmc_platform_data *pdata;
struct device_node *np = dev->of_node;
u32 bus_width, max_freq;
int cd_gpio, wp_gpio;
@@ -1999,7 +1999,7 @@ static struct omap_mmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
return pdata;
}
#else
-static inline struct omap_mmc_platform_data
+static inline struct omap_hsmmc_platform_data
*of_get_hsmmc_pdata(struct device *dev)
{
return ERR_PTR(-EINVAL);
@@ -2008,7 +2008,7 @@ static inline struct omap_mmc_platform_data
static int omap_hsmmc_probe(struct platform_device *pdev)
{
- struct omap_mmc_platform_data *pdata = pdev->dev.platform_data;
+ struct omap_hsmmc_platform_data *pdata = pdev->dev.platform_data;
struct mmc_host *mmc;
struct omap_hsmmc_host *host = NULL;
struct resource *res;
diff --git a/include/linux/platform_data/hsmmc-omap.h b/include/linux/platform_data/hsmmc-omap.h
new file mode 100644
index 0000000..cb91db4
--- /dev/null
+++ b/include/linux/platform_data/hsmmc-omap.h
@@ -0,0 +1,152 @@
+/*
+ * MMC definitions for OMAP2
+ *
+ * Copyright (C) 2006 Nokia Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#define OMAP_MMC_MAX_SLOTS 1
+
+/*
+ * struct omap_hsmmc_dev_attr.flags possibilities
+ *
+ * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can
+ * operate with either 1.8Vdc or 3.0Vdc card voltages; this flag
+ * should be set if this is the case. See for example Section 22.5.3
+ * "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia
+ * Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R).
+ *
+ * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers
+ * don't work correctly on some MMC controller instances on some
+ * OMAP3 SoCs; this flag should be set if this is the case. See
+ * for example Advisory 2.1.1.128 "MMC: Multiple Block Read
+ * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_
+ * Revision F (October 2010) (SPRZ278F).
+ */
+#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0)
+#define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1)
+#define OMAP_HSMMC_SWAKEUP_MISSING BIT(2)
+
+struct mmc_card;
+
+struct omap_hsmmc_dev_attr {
+ u8 flags;
+};
+
+struct omap_hsmmc_platform_data {
+ /* back-link to device */
+ struct device *dev;
+
+ /* number of slots per controller */
+ unsigned nr_slots:2;
+
+ /* set if your board has components or wiring that limits the
+ * maximum frequency on the MMC bus */
+ unsigned int max_freq;
+
+ /* switch the bus to a new slot */
+ int (*switch_slot)(struct device *dev, int slot);
+ /* initialize board-specific MMC functionality, can be NULL if
+ * not supported */
+ int (*init)(struct device *dev);
+ void (*cleanup)(struct device *dev);
+ void (*shutdown)(struct device *dev);
+
+ /* To handle board related suspend/resume functionality for MMC */
+ int (*suspend)(struct device *dev, int slot);
+ int (*resume)(struct device *dev, int slot);
+
+ /* Return context loss count due to PM states changing */
+ int (*get_context_loss_count)(struct device *dev);
+
+ /* Integrating attributes from the omap_hwmod layer */
+ u8 controller_flags;
+
+ /* Register offset deviation */
+ u16 reg_offset;
+
+ struct omap_hsmmc_slot_data {
+ /*
+ * 4/8 wires and any additional host capabilities
+ * need to OR'd all capabilities (ref. linux/mmc/host.h)
+ */
+ u8 wires; /* Used for the MMC driver on omap1 and 2420 */
+ u32 caps; /* Used for the MMC driver on 2430 and later */
+ u32 pm_caps; /* PM capabilities of the mmc */
+
+ /*
+ * nomux means "standard" muxing is wrong on this board, and
+ * that board-specific code handled it before common init logic.
+ */
+ unsigned nomux:1;
+
+ /* switch pin can be for card detect (default) or card cover */
+ unsigned cover:1;
+
+ /* use the internal clock */
+ unsigned internal_clock:1;
+
+ /* nonremovable e.g. eMMC */
+ unsigned nonremovable:1;
+
+ /* Try to sleep or power off when possible */
+ unsigned power_saving:1;
+
+ /* If using power_saving and the MMC power is not to go off */
+ unsigned no_off:1;
+
+ /* eMMC does not handle power off when not in sleep state */
+ unsigned no_regulator_off_init:1;
+
+ /* Regulator off remapped to sleep */
+ unsigned vcc_aux_disable_is_sleep:1;
+
+ /* we can put the features above into this variable */
+#define HSMMC_HAS_PBIAS (1 << 0)
+#define HSMMC_HAS_UPDATED_RESET (1 << 1)
+#define HSMMC_HAS_HSPE_SUPPORT (1 << 2)
+#define MMC_OMAP7XX (1 << 3)
+#define MMC_OMAP15XX (1 << 4)
+#define MMC_OMAP16XX (1 << 5)
+ unsigned features;
+
+ int switch_pin; /* gpio (card detect) */
+ int gpio_wp; /* gpio (write protect) */
+
+ int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
+ int (*set_power)(struct device *dev, int slot,
+ int power_on, int vdd);
+ int (*get_ro)(struct device *dev, int slot);
+ void (*remux)(struct device *dev, int slot, int power_on);
+ /* Call back before enabling / disabling regulators */
+ void (*before_set_reg)(struct device *dev, int slot,
+ int power_on, int vdd);
+ /* Call back after enabling / disabling regulators */
+ void (*after_set_reg)(struct device *dev, int slot,
+ int power_on, int vdd);
+ /* if we have special card, init it using this callback */
+ void (*init_card)(struct mmc_card *card);
+
+ /* return MMC cover switch state, can be NULL if not supported.
+ *
+ * possible return values:
+ * 0 - closed
+ * 1 - open
+ */
+ int (*get_cover_state)(struct device *dev, int slot);
+
+ const char *name;
+ u32 ocr_mask;
+
+ /* Card detection IRQs */
+ int card_detect_irq;
+
+ int (*card_detect)(struct device *dev, int slot);
+
+ unsigned int ban_openended:1;
+
+ } slots[OMAP_MMC_MAX_SLOTS];
+};
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 2/6] omap_hsmmc: remove unused callbacks from platform data struct
2014-09-22 11:55 [PATCH 0/6] unshare and simplify omap_hsmmc platform struct Andreas Fenkart
2014-09-22 11:55 ` [PATCH 1/6] omap_hsmmc: unshare platform data struct with mmci driver Andreas Fenkart
@ 2014-09-22 11:55 ` Andreas Fenkart
2014-09-22 11:55 ` [PATCH 3/6] omap_hsmmc: remove unused fields in platform_data Andreas Fenkart
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Andreas Fenkart @ 2014-09-22 11:55 UTC (permalink / raw)
To: linux-mmc
Cc: linux-omap, Tony Lindgren, Balaji T K, Ulf Hansson, pascal.huerst,
Andreas Fenkart
driver never references these fields
Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
---
arch/arm/mach-omap2/hsmmc.c | 9 ---------
arch/arm/mach-omap2/hsmmc.h | 4 ----
drivers/mmc/host/omap_hsmmc.c | 9 ---------
include/linux/platform_data/hsmmc-omap.h | 4 ----
4 files changed, 26 deletions(-)
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index e3555f2..d599195 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -49,9 +49,6 @@ static void omap_hsmmc1_before_set_reg(struct device *dev, int slot,
u32 reg, prog_io;
struct omap_hsmmc_platform_data *mmc = dev->platform_data;
- if (mmc->slots[0].remux)
- mmc->slots[0].remux(dev, slot, power_on);
-
/*
* Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the
* card with Vcc regulator (from twl4030 or whatever). OMAP has both
@@ -137,9 +134,6 @@ static void hsmmc2_before_set_reg(struct device *dev, int slot,
{
struct omap_hsmmc_platform_data *mmc = dev->platform_data;
- if (mmc->slots[0].remux)
- mmc->slots[0].remux(dev, slot, power_on);
-
if (power_on)
hsmmc2_select_input_clk_src(mmc);
}
@@ -271,9 +265,6 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
mmc->slots[0].switch_pin = c->gpio_cd;
mmc->slots[0].gpio_wp = c->gpio_wp;
- mmc->slots[0].remux = c->remux;
- mmc->slots[0].init_card = c->init_card;
-
if (c->cover_only)
mmc->slots[0].cover = 1;
diff --git a/arch/arm/mach-omap2/hsmmc.h b/arch/arm/mach-omap2/hsmmc.h
index 7f2e790..a8bc0c2 100644
--- a/arch/arm/mach-omap2/hsmmc.h
+++ b/arch/arm/mach-omap2/hsmmc.h
@@ -29,10 +29,6 @@ struct omap2_hsmmc_info {
int ocr_mask; /* temporary HACK */
int max_freq; /* maximum clock, if constrained by external
* circuitry, or 0 for default */
- /* Remux (pad configuration) when powering on/off */
- void (*remux)(struct device *dev, int slot, int power_on);
- /* init some special card */
- void (*init_card)(struct mmc_card *card);
};
#if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 5f2b5b7..02f3438 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1682,14 +1682,6 @@ static int omap_hsmmc_get_ro(struct mmc_host *mmc)
return mmc_slot(host).get_ro(host->dev, 0);
}
-static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card)
-{
- struct omap_hsmmc_host *host = mmc_priv(mmc);
-
- if (mmc_slot(host).init_card)
- mmc_slot(host).init_card(card);
-}
-
static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
{
struct omap_hsmmc_host *host = mmc_priv(mmc);
@@ -1838,7 +1830,6 @@ static const struct mmc_host_ops omap_hsmmc_ops = {
.set_ios = omap_hsmmc_set_ios,
.get_cd = omap_hsmmc_get_cd,
.get_ro = omap_hsmmc_get_ro,
- .init_card = omap_hsmmc_init_card,
.enable_sdio_irq = omap_hsmmc_enable_sdio_irq,
};
diff --git a/include/linux/platform_data/hsmmc-omap.h b/include/linux/platform_data/hsmmc-omap.h
index cb91db4..7620c21 100644
--- a/include/linux/platform_data/hsmmc-omap.h
+++ b/include/linux/platform_data/hsmmc-omap.h
@@ -116,19 +116,15 @@ struct omap_hsmmc_platform_data {
int switch_pin; /* gpio (card detect) */
int gpio_wp; /* gpio (write protect) */
- int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
int (*set_power)(struct device *dev, int slot,
int power_on, int vdd);
int (*get_ro)(struct device *dev, int slot);
- void (*remux)(struct device *dev, int slot, int power_on);
/* Call back before enabling / disabling regulators */
void (*before_set_reg)(struct device *dev, int slot,
int power_on, int vdd);
/* Call back after enabling / disabling regulators */
void (*after_set_reg)(struct device *dev, int slot,
int power_on, int vdd);
- /* if we have special card, init it using this callback */
- void (*init_card)(struct mmc_card *card);
/* return MMC cover switch state, can be NULL if not supported.
*
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 3/6] omap_hsmmc: remove unused fields in platform_data
2014-09-22 11:55 [PATCH 0/6] unshare and simplify omap_hsmmc platform struct Andreas Fenkart
2014-09-22 11:55 ` [PATCH 1/6] omap_hsmmc: unshare platform data struct with mmci driver Andreas Fenkart
2014-09-22 11:55 ` [PATCH 2/6] omap_hsmmc: remove unused callbacks from platform data struct Andreas Fenkart
@ 2014-09-22 11:55 ` Andreas Fenkart
2014-09-22 11:55 ` [PATCH 4/6] omap_hsmmc: remove unused get_context_loss_count callback Andreas Fenkart
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Andreas Fenkart @ 2014-09-22 11:55 UTC (permalink / raw)
To: linux-mmc
Cc: linux-omap, Tony Lindgren, Balaji T K, Ulf Hansson, pascal.huerst,
Andreas Fenkart
Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
---
arch/arm/mach-omap2/hsmmc.c | 13 -------------
arch/arm/mach-omap2/hsmmc.h | 5 -----
include/linux/platform_data/hsmmc-omap.h | 24 ------------------------
3 files changed, 42 deletions(-)
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index d599195..2f202bf 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -256,7 +256,6 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
mmc->slots[0].name = hc_name;
mmc->nr_slots = 1;
mmc->slots[0].caps = c->caps;
- mmc->slots[0].pm_caps = c->pm_caps;
mmc->slots[0].internal_clock = !c->ext_clock;
mmc->max_freq = c->max_freq;
mmc->reg_offset = 0;
@@ -271,18 +270,6 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
if (c->nonremovable)
mmc->slots[0].nonremovable = 1;
- if (c->power_saving)
- mmc->slots[0].power_saving = 1;
-
- if (c->no_off)
- mmc->slots[0].no_off = 1;
-
- if (c->no_off_init)
- mmc->slots[0].no_regulator_off_init = c->no_off_init;
-
- if (c->vcc_aux_disable_is_sleep)
- mmc->slots[0].vcc_aux_disable_is_sleep = 1;
-
/*
* NOTE: MMC slots should have a Vcc regulator set up.
* This may be from a TWL4030-family chip, another
diff --git a/arch/arm/mach-omap2/hsmmc.h b/arch/arm/mach-omap2/hsmmc.h
index a8bc0c2..b18059b 100644
--- a/arch/arm/mach-omap2/hsmmc.h
+++ b/arch/arm/mach-omap2/hsmmc.h
@@ -12,15 +12,10 @@ struct omap2_hsmmc_info {
u8 mmc; /* controller 1/2/3 */
u32 caps; /* 4/8 wires and any additional host
* capabilities OR'd (ref. linux/mmc/host.h) */
- u32 pm_caps; /* PM capabilities */
bool transceiver; /* MMC-2 option */
bool ext_clock; /* use external pin for input clock */
bool cover_only; /* No card detect - just cover switch */
bool nonremovable; /* Nonremovable e.g. eMMC */
- bool power_saving; /* Try to sleep or power off when possible */
- bool no_off; /* power_saving and power is not to go off */
- bool no_off_init; /* no power off when not in MMC sleep state */
- bool vcc_aux_disable_is_sleep; /* Regulator off remapped to sleep */
bool deferred; /* mmc needs a deferred probe */
int gpio_cd; /* or -EINVAL */
int gpio_wp; /* or -EINVAL */
diff --git a/include/linux/platform_data/hsmmc-omap.h b/include/linux/platform_data/hsmmc-omap.h
index 7620c21..b80460d 100644
--- a/include/linux/platform_data/hsmmc-omap.h
+++ b/include/linux/platform_data/hsmmc-omap.h
@@ -30,8 +30,6 @@
#define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1)
#define OMAP_HSMMC_SWAKEUP_MISSING BIT(2)
-struct mmc_card;
-
struct omap_hsmmc_dev_attr {
u8 flags;
};
@@ -73,16 +71,9 @@ struct omap_hsmmc_platform_data {
* 4/8 wires and any additional host capabilities
* need to OR'd all capabilities (ref. linux/mmc/host.h)
*/
- u8 wires; /* Used for the MMC driver on omap1 and 2420 */
u32 caps; /* Used for the MMC driver on 2430 and later */
u32 pm_caps; /* PM capabilities of the mmc */
- /*
- * nomux means "standard" muxing is wrong on this board, and
- * that board-specific code handled it before common init logic.
- */
- unsigned nomux:1;
-
/* switch pin can be for card detect (default) or card cover */
unsigned cover:1;
@@ -92,25 +83,13 @@ struct omap_hsmmc_platform_data {
/* nonremovable e.g. eMMC */
unsigned nonremovable:1;
- /* Try to sleep or power off when possible */
- unsigned power_saving:1;
-
- /* If using power_saving and the MMC power is not to go off */
- unsigned no_off:1;
-
/* eMMC does not handle power off when not in sleep state */
unsigned no_regulator_off_init:1;
- /* Regulator off remapped to sleep */
- unsigned vcc_aux_disable_is_sleep:1;
-
/* we can put the features above into this variable */
#define HSMMC_HAS_PBIAS (1 << 0)
#define HSMMC_HAS_UPDATED_RESET (1 << 1)
#define HSMMC_HAS_HSPE_SUPPORT (1 << 2)
-#define MMC_OMAP7XX (1 << 3)
-#define MMC_OMAP15XX (1 << 4)
-#define MMC_OMAP16XX (1 << 5)
unsigned features;
int switch_pin; /* gpio (card detect) */
@@ -141,8 +120,5 @@ struct omap_hsmmc_platform_data {
int card_detect_irq;
int (*card_detect)(struct device *dev, int slot);
-
- unsigned int ban_openended:1;
-
} slots[OMAP_MMC_MAX_SLOTS];
};
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 4/6] omap_hsmmc: remove unused get_context_loss_count callback
2014-09-22 11:55 [PATCH 0/6] unshare and simplify omap_hsmmc platform struct Andreas Fenkart
` (2 preceding siblings ...)
2014-09-22 11:55 ` [PATCH 3/6] omap_hsmmc: remove unused fields in platform_data Andreas Fenkart
@ 2014-09-22 11:55 ` Andreas Fenkart
2014-09-22 11:55 ` [PATCH 5/6] omap_hsmmc: remove un-initialized callbacks from platform data Andreas Fenkart
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Andreas Fenkart @ 2014-09-22 11:55 UTC (permalink / raw)
To: linux-mmc
Cc: linux-omap, Tony Lindgren, Balaji T K, Ulf Hansson, pascal.huerst,
Andreas Fenkart
Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
---
arch/arm/mach-omap2/hsmmc.c | 12 ------------
include/linux/platform_data/hsmmc-omap.h | 3 ---
2 files changed, 15 deletions(-)
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 2f202bf..9ed9f70 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -32,17 +32,6 @@ static u16 control_devconf1_offset;
#define HSMMC_NAME_LEN 9
-#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
-
-static int hsmmc_get_context_loss(struct device *dev)
-{
- return omap_pm_get_dev_context_loss_count(dev);
-}
-
-#else
-#define hsmmc_get_context_loss NULL
-#endif
-
static void omap_hsmmc1_before_set_reg(struct device *dev, int slot,
int power_on, int vdd)
{
@@ -259,7 +248,6 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
mmc->slots[0].internal_clock = !c->ext_clock;
mmc->max_freq = c->max_freq;
mmc->reg_offset = 0;
- mmc->get_context_loss_count = hsmmc_get_context_loss;
mmc->slots[0].switch_pin = c->gpio_cd;
mmc->slots[0].gpio_wp = c->gpio_wp;
diff --git a/include/linux/platform_data/hsmmc-omap.h b/include/linux/platform_data/hsmmc-omap.h
index b80460d..28b8cff 100644
--- a/include/linux/platform_data/hsmmc-omap.h
+++ b/include/linux/platform_data/hsmmc-omap.h
@@ -57,9 +57,6 @@ struct omap_hsmmc_platform_data {
int (*suspend)(struct device *dev, int slot);
int (*resume)(struct device *dev, int slot);
- /* Return context loss count due to PM states changing */
- int (*get_context_loss_count)(struct device *dev);
-
/* Integrating attributes from the omap_hwmod layer */
u8 controller_flags;
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 5/6] omap_hsmmc: remove un-initialized callbacks from platform data
2014-09-22 11:55 [PATCH 0/6] unshare and simplify omap_hsmmc platform struct Andreas Fenkart
` (3 preceding siblings ...)
2014-09-22 11:55 ` [PATCH 4/6] omap_hsmmc: remove unused get_context_loss_count callback Andreas Fenkart
@ 2014-09-22 11:55 ` Andreas Fenkart
2014-09-22 11:55 ` [PATCH 6/6] omap_hsmmc: remove un-initialized get_cover_state callback Andreas Fenkart
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Andreas Fenkart @ 2014-09-22 11:55 UTC (permalink / raw)
To: linux-mmc
Cc: linux-omap, Tony Lindgren, Balaji T K, Ulf Hansson, pascal.huerst,
Andreas Fenkart
Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
---
drivers/mmc/host/omap_hsmmc.c | 15 +--------------
include/linux/platform_data/hsmmc-omap.h | 8 --------
2 files changed, 1 insertion(+), 22 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 02f3438..465c34e 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2195,18 +2195,10 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
goto err_irq;
}
- if (pdata->init != NULL) {
- if (pdata->init(&pdev->dev) != 0) {
- dev_err(mmc_dev(host->mmc),
- "Unable to configure MMC IRQs\n");
- goto err_irq;
- }
- }
-
if (omap_hsmmc_have_reg() && !mmc_slot(host).set_power) {
ret = omap_hsmmc_reg_get(host);
if (ret)
- goto err_reg;
+ goto err_irq;
host->use_reg = 1;
}
@@ -2269,9 +2261,6 @@ err_slot_name:
err_irq_cd:
if (host->use_reg)
omap_hsmmc_reg_put(host);
-err_reg:
- if (host->pdata->cleanup)
- host->pdata->cleanup(&pdev->dev);
err_irq:
if (host->tx_chan)
dma_release_channel(host->tx_chan);
@@ -2297,8 +2286,6 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
mmc_remove_host(host->mmc);
if (host->use_reg)
omap_hsmmc_reg_put(host);
- if (host->pdata->cleanup)
- host->pdata->cleanup(&pdev->dev);
if (host->tx_chan)
dma_release_channel(host->tx_chan);
diff --git a/include/linux/platform_data/hsmmc-omap.h b/include/linux/platform_data/hsmmc-omap.h
index 28b8cff..066075c 100644
--- a/include/linux/platform_data/hsmmc-omap.h
+++ b/include/linux/platform_data/hsmmc-omap.h
@@ -45,14 +45,6 @@ struct omap_hsmmc_platform_data {
* maximum frequency on the MMC bus */
unsigned int max_freq;
- /* switch the bus to a new slot */
- int (*switch_slot)(struct device *dev, int slot);
- /* initialize board-specific MMC functionality, can be NULL if
- * not supported */
- int (*init)(struct device *dev);
- void (*cleanup)(struct device *dev);
- void (*shutdown)(struct device *dev);
-
/* To handle board related suspend/resume functionality for MMC */
int (*suspend)(struct device *dev, int slot);
int (*resume)(struct device *dev, int slot);
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 6/6] omap_hsmmc: remove un-initialized get_cover_state callback
2014-09-22 11:55 [PATCH 0/6] unshare and simplify omap_hsmmc platform struct Andreas Fenkart
` (4 preceding siblings ...)
2014-09-22 11:55 ` [PATCH 5/6] omap_hsmmc: remove un-initialized callbacks from platform data Andreas Fenkart
@ 2014-09-22 11:55 ` Andreas Fenkart
2014-09-23 16:22 ` [PATCH 0/6] unshare and simplify omap_hsmmc platform struct Tony Lindgren
2014-09-24 8:55 ` Ulf Hansson
7 siblings, 0 replies; 9+ messages in thread
From: Andreas Fenkart @ 2014-09-22 11:55 UTC (permalink / raw)
To: linux-mmc
Cc: linux-omap, Tony Lindgren, Balaji T K, Ulf Hansson, pascal.huerst,
Andreas Fenkart
Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
---
arch/arm/mach-omap2/hsmmc.c | 3 --
arch/arm/mach-omap2/hsmmc.h | 1 -
drivers/mmc/host/omap_hsmmc.c | 83 ++------------------------------
include/linux/platform_data/hsmmc-omap.h | 10 ----
4 files changed, 4 insertions(+), 93 deletions(-)
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 9ed9f70..068ccf5 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -252,9 +252,6 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
mmc->slots[0].switch_pin = c->gpio_cd;
mmc->slots[0].gpio_wp = c->gpio_wp;
- if (c->cover_only)
- mmc->slots[0].cover = 1;
-
if (c->nonremovable)
mmc->slots[0].nonremovable = 1;
diff --git a/arch/arm/mach-omap2/hsmmc.h b/arch/arm/mach-omap2/hsmmc.h
index b18059b..1c4a363 100644
--- a/arch/arm/mach-omap2/hsmmc.h
+++ b/arch/arm/mach-omap2/hsmmc.h
@@ -14,7 +14,6 @@ struct omap2_hsmmc_info {
* capabilities OR'd (ref. linux/mmc/host.h) */
bool transceiver; /* MMC-2 option */
bool ext_clock; /* use external pin for input clock */
- bool cover_only; /* No card detect - just cover switch */
bool nonremovable; /* Nonremovable e.g. eMMC */
bool deferred; /* mmc needs a deferred probe */
int gpio_cd; /* or -EINVAL */
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 465c34e..a558c87 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -248,15 +248,6 @@ static int omap_hsmmc_get_wp(struct device *dev, int slot)
return gpio_get_value_cansleep(mmc->slots[0].gpio_wp);
}
-static int omap_hsmmc_get_cover_state(struct device *dev, int slot)
-{
- struct omap_hsmmc_host *host = dev_get_drvdata(dev);
- struct omap_hsmmc_platform_data *mmc = host->pdata;
-
- /* NOTE: assumes card detect signal is active-low */
- return !gpio_get_value_cansleep(mmc->slots[0].switch_pin);
-}
-
#ifdef CONFIG_PM
static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot)
@@ -454,11 +445,7 @@ static int omap_hsmmc_gpio_init(struct omap_hsmmc_platform_data *pdata)
int ret;
if (gpio_is_valid(pdata->slots[0].switch_pin)) {
- if (pdata->slots[0].cover)
- pdata->slots[0].get_cover_state =
- omap_hsmmc_get_cover_state;
- else
- pdata->slots[0].card_detect = omap_hsmmc_card_detect;
+ pdata->slots[0].card_detect = omap_hsmmc_card_detect;
pdata->slots[0].card_detect_irq =
gpio_to_irq(pdata->slots[0].switch_pin);
ret = gpio_request(pdata->slots[0].switch_pin, "mmc_cd");
@@ -786,29 +773,6 @@ static void send_init_stream(struct omap_hsmmc_host *host)
enable_irq(host->irq);
}
-static inline
-int omap_hsmmc_cover_is_closed(struct omap_hsmmc_host *host)
-{
- int r = 1;
-
- if (mmc_slot(host).get_cover_state)
- r = mmc_slot(host).get_cover_state(host->dev, host->slot_id);
- return r;
-}
-
-static ssize_t
-omap_hsmmc_show_cover_switch(struct device *dev, struct device_attribute *attr,
- char *buf)
-{
- struct mmc_host *mmc = container_of(dev, struct mmc_host, class_dev);
- struct omap_hsmmc_host *host = mmc_priv(mmc);
-
- return sprintf(buf, "%s\n",
- omap_hsmmc_cover_is_closed(host) ? "closed" : "open");
-}
-
-static DEVICE_ATTR(cover_switch, S_IRUGO, omap_hsmmc_show_cover_switch, NULL);
-
static ssize_t
omap_hsmmc_show_slot_name(struct device *dev, struct device_attribute *attr,
char *buf)
@@ -1256,30 +1220,6 @@ err:
return ret;
}
-/* Protect the card while the cover is open */
-static void omap_hsmmc_protect_card(struct omap_hsmmc_host *host)
-{
- if (!mmc_slot(host).get_cover_state)
- return;
-
- host->reqs_blocked = 0;
- if (mmc_slot(host).get_cover_state(host->dev, host->slot_id)) {
- if (host->protect_card) {
- dev_info(host->dev, "%s: cover is closed, "
- "card is now accessible\n",
- mmc_hostname(host->mmc));
- host->protect_card = 0;
- }
- } else {
- if (!host->protect_card) {
- dev_info(host->dev, "%s: cover is open, "
- "card is now inaccessible\n",
- mmc_hostname(host->mmc));
- host->protect_card = 1;
- }
- }
-}
-
/*
* irq handler to notify the core about card insertion/removal
*/
@@ -1289,15 +1229,10 @@ static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id)
struct omap_hsmmc_slot_data *slot = &mmc_slot(host);
int carddetect;
- sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
-
- if (slot->card_detect)
- carddetect = slot->card_detect(host->dev, host->slot_id);
- else {
- omap_hsmmc_protect_card(host);
- carddetect = -ENOSYS;
- }
+ if (!slot->card_detect)
+ return IRQ_HANDLED;
+ carddetect = slot->card_detect(host->dev, host->slot_id);
if (carddetect)
mmc_detect_change(host->mmc, (HZ * 200) / 1000);
else
@@ -2234,8 +2169,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
if (!ret)
mmc->caps |= MMC_CAP_SDIO_IRQ;
- omap_hsmmc_protect_card(host);
-
mmc_add_host(mmc);
if (mmc_slot(host).name != NULL) {
@@ -2243,12 +2176,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
if (ret < 0)
goto err_slot_name;
}
- if (mmc_slot(host).card_detect_irq && mmc_slot(host).get_cover_state) {
- ret = device_create_file(&mmc->class_dev,
- &dev_attr_cover_switch);
- if (ret < 0)
- goto err_slot_name;
- }
omap_hsmmc_debugfs(mmc);
pm_runtime_mark_last_busy(host->dev);
@@ -2368,8 +2295,6 @@ static int omap_hsmmc_resume(struct device *dev)
if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER))
omap_hsmmc_conf_bus_power(host);
- omap_hsmmc_protect_card(host);
-
if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) &&
!(host->mmc->pm_flags & MMC_PM_WAKE_SDIO_IRQ))
enable_irq(host->wake_irq);
diff --git a/include/linux/platform_data/hsmmc-omap.h b/include/linux/platform_data/hsmmc-omap.h
index 066075c..e856301 100644
--- a/include/linux/platform_data/hsmmc-omap.h
+++ b/include/linux/platform_data/hsmmc-omap.h
@@ -63,8 +63,6 @@ struct omap_hsmmc_platform_data {
u32 caps; /* Used for the MMC driver on 2430 and later */
u32 pm_caps; /* PM capabilities of the mmc */
- /* switch pin can be for card detect (default) or card cover */
- unsigned cover:1;
/* use the internal clock */
unsigned internal_clock:1;
@@ -94,14 +92,6 @@ struct omap_hsmmc_platform_data {
void (*after_set_reg)(struct device *dev, int slot,
int power_on, int vdd);
- /* return MMC cover switch state, can be NULL if not supported.
- *
- * possible return values:
- * 0 - closed
- * 1 - open
- */
- int (*get_cover_state)(struct device *dev, int slot);
-
const char *name;
u32 ocr_mask;
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 0/6] unshare and simplify omap_hsmmc platform struct
2014-09-22 11:55 [PATCH 0/6] unshare and simplify omap_hsmmc platform struct Andreas Fenkart
` (5 preceding siblings ...)
2014-09-22 11:55 ` [PATCH 6/6] omap_hsmmc: remove un-initialized get_cover_state callback Andreas Fenkart
@ 2014-09-23 16:22 ` Tony Lindgren
2014-09-24 8:55 ` Ulf Hansson
7 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2014-09-23 16:22 UTC (permalink / raw)
To: Andreas Fenkart
Cc: linux-mmc, linux-omap, Balaji T K, Ulf Hansson, pascal.huerst
* Andreas Fenkart <afenkart@gmail.com> [140922 04:55]:
> mmci and omap_hsmmc share very little fields in the platform
> struct. unsharing significantly simplifies the omap_hsmmc driver
I think this is good to do. I was hoping we could drop omap3
legacy booting support and completely get rid of the platform_data
for omap_hsmmc. But that happens when it happens, so let's do
this meanwhile to remove some dependencies for the omap_hsmmc
clean-up work.
Some patches have missing descriptions, can you please add those?
Once the patches have proper descriptions, and assuming this
does not break the omap3 legacy booting with the board-*.c
files, please feel free to add:
Acked-by: Tony Lindgren <tony@atomide.com>
As it seems this is best merged via the MMC tree.
Regards,
Tony
> Andreas Fenkart (6):
> omap_hsmmc: unshare platform data struct with mmci driver
> omap_hsmmc: remove unused callbacks from platform data struct
> omap_hsmmc: remove unused fields in platform_data
> omap_hsmmc: remove unused get_context_loss_count callback
> omap_hsmmc: remove un-initialized callbacks from platform data
> omap_hsmmc: remove un-initialized get_cover_state callback
>
> arch/arm/mach-omap2/hsmmc.c | 61 ++--------
> arch/arm/mach-omap2/hsmmc.h | 10 --
> arch/arm/mach-omap2/mmc.h | 6 +-
> .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 6 +-
> arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 6 +-
> drivers/mmc/host/omap_hsmmc.c | 133 +++------------------
> include/linux/platform_data/hsmmc-omap.h | 103 ++++++++++++++++
> 7 files changed, 142 insertions(+), 183 deletions(-)
> create mode 100644 include/linux/platform_data/hsmmc-omap.h
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH 0/6] unshare and simplify omap_hsmmc platform struct
2014-09-22 11:55 [PATCH 0/6] unshare and simplify omap_hsmmc platform struct Andreas Fenkart
` (6 preceding siblings ...)
2014-09-23 16:22 ` [PATCH 0/6] unshare and simplify omap_hsmmc platform struct Tony Lindgren
@ 2014-09-24 8:55 ` Ulf Hansson
7 siblings, 0 replies; 9+ messages in thread
From: Ulf Hansson @ 2014-09-24 8:55 UTC (permalink / raw)
To: Andreas Fenkart
Cc: linux-mmc, linux-omap, Tony Lindgren, Balaji T K, pascal.huerst
On 22 September 2014 13:55, Andreas Fenkart <afenkart@gmail.com> wrote:
> mmci and omap_hsmmc share very little fields in the platform
mmci? Should be omap right?
I noticed the similar typo for one of the patches as well.
Kind regards
Uffe
> struct. unsharing significantly simplifies the omap_hsmmc driver
>
> Andreas Fenkart (6):
> omap_hsmmc: unshare platform data struct with mmci driver
> omap_hsmmc: remove unused callbacks from platform data struct
> omap_hsmmc: remove unused fields in platform_data
> omap_hsmmc: remove unused get_context_loss_count callback
> omap_hsmmc: remove un-initialized callbacks from platform data
> omap_hsmmc: remove un-initialized get_cover_state callback
>
> arch/arm/mach-omap2/hsmmc.c | 61 ++--------
> arch/arm/mach-omap2/hsmmc.h | 10 --
> arch/arm/mach-omap2/mmc.h | 6 +-
> .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 6 +-
> arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 6 +-
> drivers/mmc/host/omap_hsmmc.c | 133 +++------------------
> include/linux/platform_data/hsmmc-omap.h | 103 ++++++++++++++++
> 7 files changed, 142 insertions(+), 183 deletions(-)
> create mode 100644 include/linux/platform_data/hsmmc-omap.h
>
> --
> 2.1.0
>
^ permalink raw reply [flat|nested] 9+ messages in thread