mmc: tmio: remove 'alignment_shift' from platform data
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 2 Nov 2022 12:54:30 +0000 (13:54 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 7 Dec 2022 12:22:37 +0000 (13:22 +0100)
There is only one alignment shift for one type of Renesas SDHI. Encode
it directly in its DMA driver to reduce complexity and ease further
simplifications.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20221102125430.28466-3-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/renesas_sdhi_core.c
drivers/mmc/host/renesas_sdhi_sys_dmac.c
include/linux/mfd/tmio.h

index 0733951325e95e0f5b03eff4999f7b150a96500c..b93ab11f112a1f4ac4d280337b0e392c92ca3c7c 100644 (file)
@@ -1018,7 +1018,6 @@ int renesas_sdhi_probe(struct platform_device *pdev,
        dma_priv->filter = shdma_chan_filter;
        dma_priv->enable = renesas_sdhi_enable_dma;
 
-       mmc_data->alignment_shift = 1; /* 2-byte alignment */
        mmc_data->capabilities |= MMC_CAP_MMC_HIGHSPEED;
 
        /*
index c4545cb143ddf4cf5e32bfffa6530267955efd5f..b559ad38b667263f64fe3ec655318a58e39c6566 100644 (file)
@@ -160,7 +160,7 @@ static void renesas_sdhi_sys_dmac_start_dma_rx(struct tmio_mmc_host *host)
        dma_cookie_t cookie;
        int ret, i;
        bool aligned = true, multiple = true;
-       unsigned int align = (1 << host->pdata->alignment_shift) - 1;
+       unsigned int align = 1; /* 2-byte alignment */
 
        for_each_sg(sg, sg_tmp, host->sg_len, i) {
                if (sg_tmp->offset & align)
@@ -232,7 +232,7 @@ static void renesas_sdhi_sys_dmac_start_dma_tx(struct tmio_mmc_host *host)
        dma_cookie_t cookie;
        int ret, i;
        bool aligned = true, multiple = true;
-       unsigned int align = (1 << host->pdata->alignment_shift) - 1;
+       unsigned int align = 1; /* 2-byte alignment */
 
        for_each_sg(sg, sg_tmp, host->sg_len, i) {
                if (sg_tmp->offset & align)
index 27264fe4b3b9a20f0debf41d3625ed86f1e1d87d..e8bf90281ba0309acdf4557778fd11e4613abe41 100644 (file)
@@ -102,7 +102,6 @@ struct tmio_mmc_data {
        unsigned long                   capabilities2;
        unsigned long                   flags;
        u32                             ocr_mask;       /* available voltages */
-       int                             alignment_shift;
        dma_addr_t                      dma_rx_offset;
        unsigned int                    max_blk_count;
        unsigned short                  max_segs;