Re: [PATCH 03/16] staging: m57621-mmc: delete driver from the tree.

2019-04-02 Thread Christian Lütke-Stetzkamp
On Wed, Apr 03, 2019 at 06:51:49AM +1100, NeilBrown wrote: > People keep telling me that drivers/mmc/host/mtk-sd.c should be able to > handle the same hardware as this driver, with a little bit of work. > Unfortunately they haven't told me what the little bit of work involves. > > Have you

[PATCH v2 23/34] staging: mt7621-mmc: Remove unused variable from msdc_tune_request

2018-06-16 Thread Christian Lütke-Stetzkamp
The variable cmd in the function msdc_tune_request is set but never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index

[PATCH v2 08/34] staging: mt7621-mmc: Replace sdr_write32 with writel

2018-06-16 Thread Christian Lütke-Stetzkamp
The current code uses a macro (sdr_write32) for writing to hardware, but it is only a writel with switched arguments, so replace it to get nearer to upstream code. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 1 - drivers/staging/mt7621-mmc/sd.c

[PATCH v2 06/34] staging: mt7621-mmc: Remove unused macro msdc_txfifocnt

2018-06-16 Thread Christian Lütke-Stetzkamp
The macro msdc_txfifocnt is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 0f9cba918586..c6aced0c0a6a 100644

[PATCH v2 20/34] staging: mt7621-mmc: Make msdc_clr_fifo a function and relax cpu

2018-06-16 Thread Christian Lütke-Stetzkamp
to a function, that also relaxes the cpu while busy waiting. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc

[PATCH v2 22/34] staging: mt7621-mmc: Remove unused macro MAX_BD_PER_GPD

2018-06-16 Thread Christian Lütke-Stetzkamp
The macro MAX_BD_PER_GPD is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 0e94bb0d5927..e99a12002646 100644

[PATCH v2 17/34] staging: mt7621-mmc: Remove unused field sglen from msdc_dma

2018-06-16 Thread Christian Lütke-Stetzkamp
The field sglen from struct msdc_dma is once set and never read, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 2 -- drivers/staging/mt7621-mmc/sd.c| 2 -- 2 files changed, 4 deletions(-) diff --git a/drivers/staging/mt7621-mmc

[PATCH v2 02/34] staging: mt7621-mmc: Remove unused macro msdc_fifo_write8

2018-06-16 Thread Christian Lütke-Stetzkamp
The macro msdc_fifo_write8 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 7cfadb41a53d..4a69bc84bbd2 100644

[PATCH v2 01/34] staging: mt7621-mmc: Remove unused variable in msdc_command_resp

2018-06-16 Thread Christian Lütke-Stetzkamp
The variable resp in msdc_command_resp is once set and never read, delete it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 648a2dd1436e

[PATCH v2 16/34] staging: mt7621-mmc: Remove unused field sg from msdc_dma

2018-06-16 Thread Christian Lütke-Stetzkamp
The field sg from struct msdc_dma is once set and never read, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 1 - drivers/staging/mt7621-mmc/sd.c| 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc

[PATCH v2 07/34] staging: mt7621-mmc: Remove unused macro msdc_rxfifocnt

2018-06-16 Thread Christian Lütke-Stetzkamp
The macro msdc_rxfifocnt is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index c6aced0c0a6a..78a681a72f11 100644

[PATCH v2 15/34] staging: mt7621-mmc: Refactor dma setup process

2018-06-16 Thread Christian Lütke-Stetzkamp
Current code uses two functions for dma setup, msdc_dma_config and msdc_dma_setup. By now msdc_dma_setup is nearly empty and mainly calls msdc_dma_config, so the later one can be inline into the first one. While doing this there is also some refactoring done. Signed-off-by: Christian Lütke

[PATCH v2 27/34] staging: mt7621-mmc: Remove unused define IRQ_SDC

2018-06-16 Thread Christian Lütke-Stetzkamp
The define IRQ_SDC is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 101ceca2ee4c..31ee9c533f35 100644

[PATCH v2 32/34] staging: mt7621-mmc: Factor out from msdc_command_start()

2018-06-16 Thread Christian Lütke-Stetzkamp
Currently msdc_command_start does multiple things and is hard to read, so factor out the finding of the response type. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 40 +--- 1 file changed, 25 insertions(+), 15 deletions

[PATCH v2 30/34] staging: mt7621-mmc: Remove unused macro is_card_present

2018-06-16 Thread Christian Lütke-Stetzkamp
The macro is_card_present is unused and also a duplicate of a macro in mmc, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index

[PATCH v2 34/34] staging: mt7621-mmc: Find response of SD_APP_OP_COND by default

2018-06-16 Thread Christian Lütke-Stetzkamp
The response type of the SD_APP_OP_COND command is correctly determined using the mmc_resp_type macro, because the only use of that opcode, mmc_send_app_op_cond, correctly places MMC_RSP_R3 in cmd.flags. So there is no need to treat that opcode separately. Signed-off-by: Christian Lütke

[PATCH v2 31/34] staging: mt7621-mmc: Remove unused argument from msdc_do_command

2018-06-16 Thread Christian Lütke-Stetzkamp
The argument tune of msdc_do_command is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index

[PATCH v2 33/34] staging: mt7621-mmc: Find response of MMC_SEND_OP_COND by default

2018-06-16 Thread Christian Lütke-Stetzkamp
The response type of the MMC_SEND_OP_COND command is correctly determined using the mmc_resp_type macro, because the only use of that opcode, mmc_send_op_cond, correctly places MMC_RSP_R3 in cmd.flags. So there is no need to treat that opcode separately. Signed-off-by: Christian Lütke-Stetzkamp

[PATCH v2 25/34] staging: mt7621-mmc: Cleanup source of base address for io

2018-06-16 Thread Christian Lütke-Stetzkamp
access. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 161 -- drivers/staging/mt7621-mmc/sd.c| 378 + 2 files changed, 236 insertions(+), 303 deletions(-) diff --git a/drivers/staging/mt7621-mmc/mt6575

[PATCH v2 29/34] staging: mt7621-mmc: Remove unused define MAX_PHY_SGMTS

2018-06-16 Thread Christian Lütke-Stetzkamp
The define MAX_PHY_SGMTS is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 31ee9c533f35..45d9b62f4a58 100644

[PATCH v2 28/34] staging: mt7621-mmc: Remove unused enum msdc_mode

2018-06-16 Thread Christian Lütke-Stetzkamp
The enum msdc_mode is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/mt7621-mmc/dbg.h b/drivers/staging/mt7621-mmc/dbg.h index 5a25a69b00c9..2f2c56b73987 100644

[PATCH v2 05/34] staging: mt7621-mmc: Remove unused macro msdc_fifo_read32

2018-06-16 Thread Christian Lütke-Stetzkamp
The macro msdc_fifo_read32 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 9e00f86a0398..0f9cba918586 100644

[PATCH v2 12/34] staging: mt7621-mmc: Remove register debugging structures

2018-06-16 Thread Christian Lütke-Stetzkamp
Current code has structures for all the registers of the device, but these are never used and there are also masks for all of them, so these structures do not contain any useful information. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 411

[PATCH v2 19/34] staging: mt7621-mmc: Remove unnecessary BUG_ON() in msdc_dma_setup

2018-06-16 Thread Christian Lütke-Stetzkamp
The BUG_ON() removed by this patch is just a duplicate of a prior BUG_ON() statement. There the condition is just clearer, it checks weather sglen > MAX_BD_NUM and MAX_BD_NUM is equal MAX_BD_PER_GPD. So this statement can be safely removed. Signed-off-by: Christian Lütke-Stetzkamp --- driv

[PATCH v2 00/34] staging: mt7621-mmc: Cleanup continues

2018-06-16 Thread Christian Lütke-Stetzkamp
: - commit "Factor out from msdc_command_start()" had a wrong parameter definition Christian Lütke-Stetzkamp (34): staging: mt7621-mmc: Remove unused variable in msdc_command_resp staging: mt7621-mmc: Remove unused macro msdc_fifo_write8 staging: mt7621-mmc: Remove unused macro msdc_

[PATCH v2 24/34] staging: mt7621-mmc: Remove MSDC_MODE_* defines

2018-06-16 Thread Christian Lütke-Stetzkamp
The MSDC_MODE_* defines are all never used and do not contain any information about the device, so remove them. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b

[PATCH v2 21/34] staging: mt7621-mmc: Remove unused macro msdc_retry

2018-06-16 Thread Christian Lütke-Stetzkamp
The macro msdc_retry is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 13 - 1 file changed, 13 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 01a925ae662e..0e94bb0d5927

[PATCH v2 11/34] staging: mt7621-mmc: Remove unused macro sdr_write8

2018-06-16 Thread Christian Lütke-Stetzkamp
The macro sdr_write8 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b/drivers/staging/mt7621-mmc/mt6575_sd.h index adccabe32660

[PATCH v2 18/34] staging: mt7621-mmc: Remove variable num form msdc_dma_setup

2018-06-16 Thread Christian Lütke-Stetzkamp
The variable num in msdc_dma_setup is only used for a BUG_ON statement, so it can be removed by inlining the condition. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/mt7621

[PATCH v2 14/34] staging: mt7621-mmc: Remove unused field mode from msdc_dma

2018-06-16 Thread Christian Lütke-Stetzkamp
The field mode of struct msdc_dma has no remaining use, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 1 - drivers/staging/mt7621-mmc/sd.c| 5 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/mt7621

[PATCH v2 10/34] staging: mt7621-mmc: Remove unused macro sdr_read8

2018-06-16 Thread Christian Lütke-Stetzkamp
The macro sdr_read8 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b/drivers/staging/mt7621-mmc/mt6575_sd.h index 29e2ede6816b

[PATCH v2 09/34] staging: mt7621-mmc: Replace sdr_read32 with readl

2018-06-16 Thread Christian Lütke-Stetzkamp
The current code uses a macro (sdr_read32) for reading from hardware, but it is only a readl, so replace it to get nearer to upstream code. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 1 - drivers/staging/mt7621-mmc/sd.c| 98

[PATCH v2 26/34] staging: mt7621-mmc: Remove unused define RALINK_MSDC_BASE

2018-06-16 Thread Christian Lütke-Stetzkamp
The define RALINK_MSDC_BASE is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index e639ceb2ba85..101ceca2ee4c 100644

[PATCH v2 03/34] staging: mt7621-mmc: Remove unused macro msdc_fifo_read8

2018-06-16 Thread Christian Lütke-Stetzkamp
The macro msdc_fifo_read8 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 4a69bc84bbd2..98bcb0fe6f40 100644

[PATCH v2 13/34] staging: mt7621-mmc: Remove DMA basic mode code

2018-06-16 Thread Christian Lütke-Stetzkamp
The driver currently only uses DMA linked mode and the upstream driver does the same, so remove the basic mode code. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 88 +++-- 1 file changed, 32 insertions(+), 56 deletions

[PATCH v2 04/34] staging: mt7621-mmc: Remove unused macro msdc_fifo_write32

2018-06-16 Thread Christian Lütke-Stetzkamp
The macro msdc_fifo_write32 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 98bcb0fe6f40..9e00f86a0398 100644

[PATCH 12/34] staging: mt7621-mmc: Remove register debugging structures

2018-06-11 Thread Christian Lütke-Stetzkamp
Current code has structures for all the registers of the device, but these are never used and there are also masks for all of them, so these structures do not contain any useful information. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 411

[PATCH 15/34] staging: mt7621-mmc: Refactor dma setup process

2018-06-11 Thread Christian Lütke-Stetzkamp
Current code uses two functions for dma setup, msdc_dma_config and msdc_dma_setup. By now msdc_dma_setup is nearly empty and mainly calls msdc_dma_config, so the later one can be inline into the first one. While doing this there is also some refactoring done. Signed-off-by: Christian Lütke

[PATCH 01/34] staging: mt7621-mmc: Remove unused variable in msdc_command_resp

2018-06-11 Thread Christian Lütke-Stetzkamp
The variable resp in msdc_command_resp is once set and never read, delete it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 648a2dd1436e

[PATCH 21/34] staging: mt7621-mmc: Remove unused macro msdc_retry

2018-06-11 Thread Christian Lütke-Stetzkamp
The macro msdc_retry is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 13 - 1 file changed, 13 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 01a925ae662e..0e94bb0d5927

[PATCH 06/34] staging: mt7621-mmc: Remove unused macro msdc_txfifocnt

2018-06-11 Thread Christian Lütke-Stetzkamp
The macro msdc_txfifocnt is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 0f9cba918586..c6aced0c0a6a 100644

[PATCH 23/34] staging: mt7621-mmc: Remove unused variable from msdc_tune_request

2018-06-11 Thread Christian Lütke-Stetzkamp
The variable cmd in the function msdc_tune_request is set but never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index

[PATCH 25/34] staging: mt7621-mmc: Cleanup source of base address for io

2018-06-11 Thread Christian Lütke-Stetzkamp
access. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 161 -- drivers/staging/mt7621-mmc/sd.c| 378 + 2 files changed, 236 insertions(+), 303 deletions(-) diff --git a/drivers/staging/mt7621-mmc/mt6575

[PATCH 00/34] staging: mt7621-mmc: Cleanup continues

2018-06-11 Thread Christian Lütke-Stetzkamp
Here are the next cleanups for the mt7621-mmc driver. Again much of unused code is removed and the IO is cleaned up. The next major step will be the complete refactoring of the tuning, because it does not use the tuning capabilities of sd-core, but kind of re-implements that. Christian Lütke

[PATCH 17/34] staging: mt7621-mmc: Remove unused field sglen from msdc_dma

2018-06-11 Thread Christian Lütke-Stetzkamp
The field sglen from struct msdc_dma is once set and never read, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 2 -- drivers/staging/mt7621-mmc/sd.c| 2 -- 2 files changed, 4 deletions(-) diff --git a/drivers/staging/mt7621-mmc

[PATCH 18/34] staging: mt7621-mmc: Remove variable num form msdc_dma_setup

2018-06-11 Thread Christian Lütke-Stetzkamp
The variable num in msdc_dma_setup is only used for a BUG_ON statement, so it can be removed by inlining the condition. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/mt7621

[PATCH 22/34] staging: mt7621-mmc: Remove unused macro MAX_BD_PER_GPD

2018-06-11 Thread Christian Lütke-Stetzkamp
The macro MAX_BD_PER_GPD is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 0e94bb0d5927..e99a12002646 100644

[PATCH 09/34] staging: mt7621-mmc: Replace sdr_read32 with readl

2018-06-11 Thread Christian Lütke-Stetzkamp
The current code uses a macro (sdr_read32) for reading from hardware, but it is only a readl, so replace it to get nearer to upstream code. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 1 - drivers/staging/mt7621-mmc/sd.c| 98

[PATCH 03/34] staging: mt7621-mmc: Remove unused macro msdc_fifo_read8

2018-06-11 Thread Christian Lütke-Stetzkamp
The macro msdc_fifo_read8 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 4a69bc84bbd2..98bcb0fe6f40 100644

[PATCH 24/34] staging: mt7621-mmc: Remove MSDC_MODE_* defines

2018-06-11 Thread Christian Lütke-Stetzkamp
The MSDC_MODE_* defines are all never used and do not contain any information about the device, so remove them. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b

[PATCH 31/34] staging: mt7621-mmc: Remove unused argument from msdc_do_command

2018-06-11 Thread Christian Lütke-Stetzkamp
The argument tune of msdc_do_command is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index

[PATCH 29/34] staging: mt7621-mmc: Remove unused define MAX_PHY_SGMTS

2018-06-11 Thread Christian Lütke-Stetzkamp
The define MAX_PHY_SGMTS is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 31ee9c533f35..45d9b62f4a58 100644

[PATCH 10/34] staging: mt7621-mmc: Remove unused macro sdr_read8

2018-06-11 Thread Christian Lütke-Stetzkamp
The macro sdr_read8 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b/drivers/staging/mt7621-mmc/mt6575_sd.h index 29e2ede6816b

[PATCH 27/34] staging: mt7621-mmc: Remove unused define IRQ_SDC

2018-06-11 Thread Christian Lütke-Stetzkamp
The define IRQ_SDC is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 101ceca2ee4c..31ee9c533f35 100644

[PATCH 14/34] staging: mt7621-mmc: Remove unused field mode from msdc_dma

2018-06-11 Thread Christian Lütke-Stetzkamp
The field mode of struct msdc_dma has no remaining use, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 1 - drivers/staging/mt7621-mmc/sd.c| 5 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/mt7621

[PATCH 32/34] staging: mt7621-mmc: Factor out from msdc_command_start()

2018-06-11 Thread Christian Lütke-Stetzkamp
Currently msdc_command_start does multiple things and is hard to read, so factor out the finding of the response type. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 40 +--- 1 file changed, 25 insertions(+), 15 deletions

[PATCH 20/34] staging: mt7621-mmc: Make msdc_clr_fifo a function and relax cpu

2018-06-11 Thread Christian Lütke-Stetzkamp
to a function, that also relaxes the cpu while busy waiting. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc

[PATCH 11/34] staging: mt7621-mmc: Remove unused macro sdr_write8

2018-06-11 Thread Christian Lütke-Stetzkamp
The macro sdr_write8 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/mt6575_sd.h b/drivers/staging/mt7621-mmc/mt6575_sd.h index adccabe32660

[PATCH 05/34] staging: mt7621-mmc: Remove unused macro msdc_fifo_read32

2018-06-11 Thread Christian Lütke-Stetzkamp
The macro msdc_fifo_read32 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 9e00f86a0398..0f9cba918586 100644

[PATCH 08/34] staging: mt7621-mmc: Replace sdr_write32 with writel

2018-06-11 Thread Christian Lütke-Stetzkamp
The current code uses a macro (sdr_write32) for writing to hardware, but it is only a writel with switched arguments, so replace it to get nearer to upstream code. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 1 - drivers/staging/mt7621-mmc/sd.c

[PATCH 34/34] staging: mt7621-mmc: Find response of SD_APP_OP_COND by default

2018-06-11 Thread Christian Lütke-Stetzkamp
The response type of the SD_APP_OP_COND command is correctly determined using the mmc_resp_type macro, because the only use of that opcode, mmc_send_app_op_cond, correctly places MMC_RSP_R3 in cmd.flags. So there is no need to treat that opcode separately. Signed-off-by: Christian Lütke

[PATCH 19/34] staging: mt7621-mmc: Remove unnecessary BUG_ON() in msdc_dma_setup

2018-06-11 Thread Christian Lütke-Stetzkamp
The BUG_ON() removed by this patch is just a duplicate of a prior BUG_ON() statement. There the condition is just clearer, it checks weather sglen > MAX_BD_NUM and MAX_BD_NUM is equal MAX_BD_PER_GPD. So this statement can be safely removed. Signed-off-by: Christian Lütke-Stetzkamp --- driv

[PATCH 28/34] staging: mt7621-mmc: Remove unused enum msdc_mode

2018-06-11 Thread Christian Lütke-Stetzkamp
The enum msdc_mode is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/dbg.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/mt7621-mmc/dbg.h b/drivers/staging/mt7621-mmc/dbg.h index 5a25a69b00c9..2f2c56b73987 100644

[PATCH 16/34] staging: mt7621-mmc: Remove unused field sg from msdc_dma

2018-06-11 Thread Christian Lütke-Stetzkamp
The field sg from struct msdc_dma is once set and never read, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/mt6575_sd.h | 1 - drivers/staging/mt7621-mmc/sd.c| 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc

[PATCH 02/34] staging: mt7621-mmc: Remove unused macro msdc_fifo_write8

2018-06-11 Thread Christian Lütke-Stetzkamp
The macro msdc_fifo_write8 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 7cfadb41a53d..4a69bc84bbd2 100644

[PATCH 30/34] staging: mt7621-mmc: Remove unused macro is_card_present

2018-06-11 Thread Christian Lütke-Stetzkamp
The macro is_card_present is unused and also a duplicate of a macro in mmc, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index

[PATCH 04/34] staging: mt7621-mmc: Remove unused macro msdc_fifo_write32

2018-06-11 Thread Christian Lütke-Stetzkamp
The macro msdc_fifo_write32 is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 98bcb0fe6f40..9e00f86a0398 100644

[PATCH 33/34] staging: mt7621-mmc: Find response of MMC_SEND_OP_COND by default

2018-06-11 Thread Christian Lütke-Stetzkamp
The response type of the MMC_SEND_OP_COND command is correctly determined using the mmc_resp_type macro, because the only use of that opcode, mmc_send_op_cond, correctly places MMC_RSP_R3 in cmd.flags. So there is no need to treat that opcode separately. Signed-off-by: Christian Lütke-Stetzkamp

[PATCH 07/34] staging: mt7621-mmc: Remove unused macro msdc_rxfifocnt

2018-06-11 Thread Christian Lütke-Stetzkamp
The macro msdc_rxfifocnt is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index c6aced0c0a6a..78a681a72f11 100644

[PATCH 26/34] staging: mt7621-mmc: Remove unused define RALINK_MSDC_BASE

2018-06-11 Thread Christian Lütke-Stetzkamp
The define RALINK_MSDC_BASE is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index e639ceb2ba85..101ceca2ee4c 100644

[PATCH 13/34] staging: mt7621-mmc: Remove DMA basic mode code

2018-06-11 Thread Christian Lütke-Stetzkamp
The driver currently only uses DMA linked mode and the upstream driver does the same, so remove the basic mode code. Signed-off-by: Christian Lütke-Stetzkamp --- drivers/staging/mt7621-mmc/sd.c | 88 +++-- 1 file changed, 32 insertions(+), 56 deletions

Re: [PATCH 00/30] staging: mt7621-mmc: Next cleanups

2018-04-30 Thread Christian Lütke-Stetzkamp
On Mon, Apr 30, 2018 at 08:57:38AM +1000, NeilBrown wrote: > On Sun, Apr 29 2018, Christian Lütke-Stetzkamp wrote: > > > Here are the next cleanups for the mt7621-mmc driver. It contains the > > removal of some unused things, the removal of the non DMA code and > > alwa

Re: [PATCH 24/30] staging: mt7621-mmc: Inline function msdc_set_blknum

2018-04-30 Thread Christian Lütke-Stetzkamp
On Mon, Apr 30, 2018 at 08:51:45AM +1000, NeilBrown wrote: > On Sun, Apr 29 2018, Christian Lütke-Stetzkamp wrote: > > > The function msdc_set_blknum consists of one (real) line of code and > > is only called once, so inline it makes the code shorter and more > > read

Re: [PATCH 11/30] staging: mt7621-mmc: Replace macro sdr_get_field with function

2018-04-30 Thread Christian Lütke-Stetzkamp
On Mon, Apr 30, 2018 at 08:33:07AM +1000, NeilBrown wrote: > On Sun, Apr 29 2018, Christian Lütke-Stetzkamp wrote: > > > Currently sdr_get_field is a macro, to bring the code in line with the > > upstream driver mtk-sd, it is changed to a function. > > > > Signed-off

Re: [PATCH 09/30] staging: mt7621-mmc: Remove function uffs

2018-04-30 Thread Christian Lütke-Stetzkamp
On Mon, Apr 30, 2018 at 08:28:26AM +1000, NeilBrown wrote: > On Sun, Apr 29 2018, Christian Lütke-Stetzkamp wrote: > > > The function uffs that is implemented by this driver returns the same > > values as the kernel function ffs. So the uffs function is removed

[PATCH 09/30] staging: mt7621-mmc: Remove function uffs

2018-04-29 Thread Christian Lütke-Stetzkamp
The function uffs that is implemented by this driver returns the same values as the kernel function ffs. So the uffs function is removed and the calls to it are replaced with calls to ffs. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/mt657

[PATCH 04/30] staging: mt7621-mmc: Remove unused field dat_drv from msdc_hw

2018-04-29 Thread Christian Lütke-Stetzkamp
The field dat_drv of msdc_hw is set to a constant and only used once, replace that position with the constant and remove the unused field. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/board.h | 1 - drivers/staging/mt7621-mmc/sd.c| 5 ++

[PATCH 16/30] staging: mt7621-mmc: Remove non-DMA transfer code

2018-04-29 Thread Christian Lütke-Stetzkamp
Currently the driver is capable of DMA and non-DMA transfer. But the option to choose non-DMA transfer has already been removed. Now remove also the code for the non-DMA transfer. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/sd.c

[PATCH 01/30] staging: mt7621-mmc: Fix typo in function parameters

2018-04-29 Thread Christian Lütke-Stetzkamp
The type pm_message does not exist in the kernel, the correct type is pm_message_t, so the type of the parameter is corrected. Fixes: 9673d9f6f44b ("staging: mt7621-mmc: Refactor suspend, resume") Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging

[PATCH 22/30] staging: mt7621-mmc: Remove redundant check for card status

2018-04-29 Thread Christian Lütke-Stetzkamp
Current code checks the card status at the beginning of msdc_ops_request. This is not necessary because mmc core always checks the card status before calling this operation. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/sd.c | 14 ---

[PATCH 13/30] staging: mt7621-mmc: Remove transfer mode setting from proc

2018-04-29 Thread Christian Lütke-Stetzkamp
of the driver also indicates, that the option was used for debugging purposes. So it is removed to clean up the driver and bring it more in line with the upstream one. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/dbg.c | 15 ---

[PATCH 25/30] staging: mt7621-mmc: Don't disables DMA

2018-04-29 Thread Christian Lütke-Stetzkamp
-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/sd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 00c862b02419..0d1eed2a7964 100644 --- a/drivers/staging/mt7621-mmc/sd.c +++ b/d

[PATCH 21/30] staging: mt7621-mmc: Do not BUG() if mrq set in msdc_ops_request

2018-04-29 Thread Christian Lütke-Stetzkamp
ust WARN_ON(). Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/sd.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 7a6101e62891..7549ef40ac17 100644 ---

[PATCH 18/30] staging: mt7621-mmc: Fix error number assignment

2018-04-29 Thread Christian Lütke-Stetzkamp
Currently the value that data->error is set to is converted to an unsigned int, but it is a usual error number, so it should be negative. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/sd.c | 29 +++-- 1 file ch

[PATCH 12/30] staging: mt7621-mmc: Remove unused static msdc_regs

2018-04-29 Thread Christian Lütke-Stetzkamp
The static variable msdc_regs is set once, but never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/sd.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mm

[PATCH 27/30] staging: mt7621-mmc: Always use linked DMA mode

2018-04-29 Thread Christian Lütke-Stetzkamp
Current code uses linked DMA mode only when there is more than one entry in the scatterlist. But the overhead of the linked DMA is very small, so the code is easier when only using linked DMA and this is also the way, the upstream driver mtk-sd handles it. Signed-off-by: Christian Lütke-Stetzkamp

[PATCH 07/30] staging: mt7621-mmc: Remove unused macro msdc_init_gpd_ex

2018-04-29 Thread Christian Lütke-Stetzkamp
The macro msdc_init_gpd_ex is never used and does not provied any information about the hardware, so it is removed. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/sd.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/

[PATCH 08/30] staging: mt7621-mmc: Remove unused macros sdr_{read, write}16

2018-04-29 Thread Christian Lütke-Stetzkamp
The sdr_{read,write}16 macros are never used and does not provide any information about the device, so they are removed. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/mt6575_sd.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/s

[PATCH 26/30] staging: mt7621-mmc: Change return value of msdc_dma_config to void

2018-04-29 Thread Christian Lütke-Stetzkamp
The msdc_dma_config function currently returns always 0. Remove the return and change to void. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/sd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/

[PATCH 03/30] staging: mt7621-mmc: Remove unused field data_edge from msdc_hw

2018-04-29 Thread Christian Lütke-Stetzkamp
The field data_edge of msdc_hw is set to a constant and only used once, replace that position with the constant and remove the unused field. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/board.h | 1 - drivers/staging/mt7621-mmc/sd.c

[PATCH 02/30] staging: mt7621-mmc: Remove unused field cmd_edge from msdc_hw

2018-04-29 Thread Christian Lütke-Stetzkamp
The field cmd_edge of msdc_hw is set to a constant and only used once, replace that position with the constant and remove the unused field. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/board.h | 1 - drivers/staging/mt7621-mmc/sd.c| 4 +

[PATCH 17/30] staging: mt7621-mmc: Remove unused variable dma_xfer from msdc_host

2018-04-29 Thread Christian Lütke-Stetzkamp
The field dma_xfer of the struct msdc_host is not used anymore, remove it. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/mt6575_sd.h | 1 - drivers/staging/mt7621-mmc/sd.c| 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff

[PATCH 29/30] staging: mt7621-mmc: Cleanup includes

2018-04-29 Thread Christian Lütke-Stetzkamp
This commit cleans the includes in the sd.c file. Those which are not needed are removed, the remaining ones are sorted alphabetically. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/sd.c | 51 +++-- 1 file c

[PATCH 11/30] staging: mt7621-mmc: Replace macro sdr_get_field with function

2018-04-29 Thread Christian Lütke-Stetzkamp
Currently sdr_get_field is a macro, to bring the code in line with the upstream driver mtk-sd, it is changed to a function. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/mt6575_sd.h | 10 +- drivers/staging/mt7621-mmc/sd.c

[PATCH 06/30] staging: mt7621-mmc: Remove unused field clk_drv from msdc_hw

2018-04-29 Thread Christian Lütke-Stetzkamp
The field clk_drv of msdc_hw is set to a constant and only used once, replace that position with the constant and remove the unused field. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/board.h | 1 - drivers/staging/mt7621-mmc/sd.c| 6 ++-

[PATCH 28/30] staging: mt7621-mmc: Remove unused macro HOST_MAX_NUM

2018-04-29 Thread Christian Lütke-Stetzkamp
The macro HOST_MAX_NUM is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/sd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 706eab

[PATCH 15/30] staging: mt7621-mmc: Remove unused global dma_size

2018-04-29 Thread Christian Lütke-Stetzkamp
The global variable dma_size was previously used to select DMA or non-DMA transfer mode based on the size of the data that should be transferred. This option was removed preivously, so the variable is not used any more and can be removed. Signed-off-by: Christian Lütke-Stetzkamp <chr

[PATCH 00/30] staging: mt7621-mmc: Next cleanups

2018-04-29 Thread Christian Lütke-Stetzkamp
Here are the next cleanups for the mt7621-mmc driver. It contains the removal of some unused things, the removal of the non DMA code and always using linked DMA mode together with some minor cleanups. Christian Lütke-Stetzkamp (30): staging: mt7621-mmc: Fix typo in function parameters staging

[PATCH 24/30] staging: mt7621-mmc: Inline function msdc_set_blknum

2018-04-29 Thread Christian Lütke-Stetzkamp
The function msdc_set_blknum consists of one (real) line of code and is only called once, so inline it makes the code shorter and more readable. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/sd.c | 10 +- 1 file changed, 1 insertion

[PATCH 14/30] staging: mt7621-mmc: Remove transfer mode setting variable

2018-04-29 Thread Christian Lütke-Stetzkamp
, because it cannot be changed any more. Signed-off-by: Christian Lütke-Stetzkamp <christ...@lkamp.de> --- drivers/staging/mt7621-mmc/dbg.c | 15 --- drivers/staging/mt7621-mmc/dbg.h | 1 - drivers/staging/mt7621-mmc/sd.c | 7 +-- 3 files changed, 1 insertion(+), 22 del

  1   2   3   >