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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
:
- 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_
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 ++
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
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
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 ---
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 ---
-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
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
---
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
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
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
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/
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
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/
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
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 +
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
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
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
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 ++-
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
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
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
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
, 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 - 100 of 260 matches
Mail list logo