Skip to content

Commit 603aa14

Browse files
shimodaystorulf
authored andcommitted
mmc: tmio, renesas-sdhi: add max_{segs, blk_count} to tmio_mmc_data
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>
1 parent 6bba406 commit 603aa14

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

drivers/mmc/host/renesas_sdhi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ struct renesas_sdhi_of_data {
3131
int scc_offset;
3232
struct renesas_sdhi_scc *taps;
3333
int taps_num;
34+
unsigned int max_blk_count;
35+
unsigned short max_segs;
3436
};
3537

3638
int renesas_sdhi_probe(struct platform_device *pdev,

drivers/mmc/host/renesas_sdhi_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,8 @@ int renesas_sdhi_probe(struct platform_device *pdev,
526526
mmc_data->capabilities |= of_data->capabilities;
527527
mmc_data->capabilities2 |= of_data->capabilities2;
528528
mmc_data->dma_rx_offset = of_data->dma_rx_offset;
529+
mmc_data->max_blk_count = of_data->max_blk_count;
530+
mmc_data->max_segs = of_data->max_segs;
529531
dma_priv->dma_buswidth = of_data->dma_buswidth;
530532
host->bus_shift = of_data->bus_shift;
531533
}

drivers/mmc/host/tmio_mmc_core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,10 +1251,10 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
12511251

12521252
mmc->caps |= MMC_CAP_4_BIT_DATA | pdata->capabilities;
12531253
mmc->caps2 |= pdata->capabilities2;
1254-
mmc->max_segs = 32;
1254+
mmc->max_segs = pdata->max_segs ? : 32;
12551255
mmc->max_blk_size = 512;
1256-
mmc->max_blk_count = (PAGE_SIZE / mmc->max_blk_size) *
1257-
mmc->max_segs;
1256+
mmc->max_blk_count = pdata->max_blk_count ? :
1257+
(PAGE_SIZE / mmc->max_blk_size) * mmc->max_segs;
12581258
mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
12591259
mmc->max_seg_size = mmc->max_req_size;
12601260

include/linux/mfd/tmio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ struct tmio_mmc_data {
128128
unsigned int cd_gpio;
129129
int alignment_shift;
130130
dma_addr_t dma_rx_offset;
131+
unsigned int max_blk_count;
132+
unsigned short max_segs;
131133
void (*set_pwr)(struct platform_device *host, int state);
132134
void (*set_clk_div)(struct platform_device *host, int state);
133135
};

0 commit comments

Comments
 (0)