]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mmc: tmio: tmio_mmc_host has .write16_hook
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 13 Jan 2015 04:57:42 +0000 (04:57 +0000)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 20 Jan 2015 09:22:17 +0000 (10:22 +0100)
Current .write16_hook is implemented under tmio_mmc_data.
It goes to tmio_mmc_host by this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sh_mobile_sdhi.c
drivers/mmc/host/tmio_mmc.h
drivers/mmc/host/tmio_mmc_pio.c
include/linux/mfd/tmio.h

index 288e78d2c7a108037f8f0413b8c2afdbced8dbbe..77ff0620912e0f6793d2318f9127dcd6a295f996 100644 (file)
@@ -214,11 +214,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
        }
 
        host->dma               = dma_priv;
+       host->write16_hook      = sh_mobile_sdhi_write16_hook;
 
        mmc_data->clk_enable = sh_mobile_sdhi_clk_enable;
        mmc_data->clk_disable = sh_mobile_sdhi_clk_disable;
        mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
-       mmc_data->write16_hook = sh_mobile_sdhi_write16_hook;
        mmc_data->multi_io_quirk = sh_mobile_sdhi_multi_io_quirk;
        if (p) {
                mmc_data->flags = p->tmio_flags;
index 49a2559ff489aa2e75a09f3ad500c2c2f244c057..3fa96b11f76cbab665a47e0b705e3c4eff359a23 100644 (file)
@@ -94,6 +94,8 @@ struct tmio_mmc_host {
        struct mutex            ios_lock;       /* protect set_ios() context */
        bool                    native_hotplug;
        bool                    sdio_irq_enabled;
+
+       int (*write16_hook)(struct tmio_mmc_host *host, int addr);
 };
 
 struct tmio_mmc_host *tmio_mmc_host_alloc(struct platform_device *pdev);
@@ -183,7 +185,7 @@ static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val
        /* If there is a hook and it returns non-zero then there
         * is an error and the write should be skipped
         */
-       if (host->pdata->write16_hook && host->pdata->write16_hook(host, addr))
+       if (host->write16_hook && host->write16_hook(host, addr))
                return;
        writew(val, host->ctl + (addr << host->pdata->bus_shift));
 }
index 396be0e95a98ce0851837fd569f9f62ec5601d4e..58f4e47aac8c7e4a7a7d58a58150c4c2081f7c6c 100644 (file)
@@ -1092,7 +1092,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
        tmio_mmc_of_parse(pdev, pdata);
 
        if (!(pdata->flags & TMIO_MMC_HAS_IDLE_WAIT))
-               pdata->write16_hook = NULL;
+               _host->write16_hook = NULL;
 
        res_ctl = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res_ctl)
index 8d708c7cf681bc9610b48924d1eef8961ce31ab8..0872ca1e5dc2df6178f5447949d136a959b96296 100644 (file)
@@ -112,8 +112,6 @@ void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state);
 
 struct dma_chan;
 
-struct tmio_mmc_host;
-
 /*
  * data for the MMC controller
  */
@@ -127,7 +125,6 @@ struct tmio_mmc_data {
        unsigned int                    cd_gpio;
        void (*set_pwr)(struct platform_device *host, int state);
        void (*set_clk_div)(struct platform_device *host, int state);
-       int (*write16_hook)(struct tmio_mmc_host *host, int addr);
        /* clock management callbacks */
        int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
        void (*clk_disable)(struct platform_device *pdev);