mmc: tmio, renesas-sdhi: add max_{segs, blk_count} to tmio_mmc_data
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Wed, 21 Jun 2017 14:00:27 +0000 (16:00 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 30 Aug 2017 12:01:21 +0000 (14:01 +0200)
Allow TMIO and SDHI driver implementations to provide values for
max_segs and max_blk_count.

A follow-up patch will set these values for Renesas Gen3 SoCs
the using an SDHI driver.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Ai Kyuse <ai.kyuse.uw@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/renesas_sdhi.h
drivers/mmc/host/renesas_sdhi_core.c
drivers/mmc/host/tmio_mmc_core.c
include/linux/mfd/tmio.h

index ca83acc113b871a9c87589e0bbbd2e9292c82e78..b9dfea5d819369f7be8907a070ac99f18bcc28f2 100644 (file)
@@ -31,6 +31,8 @@ struct renesas_sdhi_of_data {
        int scc_offset;
        struct renesas_sdhi_scc *taps;
        int taps_num;
+       unsigned int max_blk_count;
+       unsigned short max_segs;
 };
 
 int renesas_sdhi_probe(struct platform_device *pdev,
index a4fb07d0ea916bb7f76fd2626d024214f2570aa3..569bcdd5e6537a3577bfe233d523512d027fbda4 100644 (file)
@@ -526,6 +526,8 @@ int renesas_sdhi_probe(struct platform_device *pdev,
                mmc_data->capabilities |= of_data->capabilities;
                mmc_data->capabilities2 |= of_data->capabilities2;
                mmc_data->dma_rx_offset = of_data->dma_rx_offset;
+               mmc_data->max_blk_count = of_data->max_blk_count;
+               mmc_data->max_segs = of_data->max_segs;
                dma_priv->dma_buswidth = of_data->dma_buswidth;
                host->bus_shift = of_data->bus_shift;
        }
index 88a94355ac90166c09286537151ce1b004ddb4d6..56478fde7a099f59b78774d1ecdbf0b9c524d042 100644 (file)
@@ -1251,10 +1251,10 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
 
        mmc->caps |= MMC_CAP_4_BIT_DATA | pdata->capabilities;
        mmc->caps2 |= pdata->capabilities2;
-       mmc->max_segs = 32;
+       mmc->max_segs = pdata->max_segs ? : 32;
        mmc->max_blk_size = 512;
-       mmc->max_blk_count = (PAGE_SIZE / mmc->max_blk_size) *
-               mmc->max_segs;
+       mmc->max_blk_count = pdata->max_blk_count ? :
+               (PAGE_SIZE / mmc->max_blk_size) * mmc->max_segs;
        mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
        mmc->max_seg_size = mmc->max_req_size;
 
index 26e8f8c0a6db6d445c3440ba9223e808698ab88b..18b17a39d465ed625b30e08748b8f46f995f3c2c 100644 (file)
@@ -128,6 +128,8 @@ struct tmio_mmc_data {
        unsigned int                    cd_gpio;
        int                             alignment_shift;
        dma_addr_t                      dma_rx_offset;
+       unsigned int                    max_blk_count;
+       unsigned short                  max_segs;
        void (*set_pwr)(struct platform_device *host, int state);
        void (*set_clk_div)(struct platform_device *host, int state);
 };