aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/mt7621-mmc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-12-20staging: mt7621-mmc: Correct spelling mistakes in commentsJona Crasselt1-2/+2
Changed "avaiable" to "available" and "interupt" to "interrupt". Signed-off-by: Jona Crasselt <jona.crasselt@fau.de> Signed-off-by: Felix Windsheimer <felix.windsheimer@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-20mt7621-mmc: char * array declaration might be better as static constJona Crasselt1-4/+4
Issue reported by checkpatch.pl. Signed-off-by: Jona Crasselt <jona.crasselt@fau.de> Signed-off-by: Felix Windsheimer <felix.windsheimer@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-20mt7621-mmc: return statement in void function unnecessaryJona Crasselt1-2/+0
Issue reported by checkpatch.pl. Signed-off-by: Jona Crasselt <jona.crasselt@fau.de> Signed-off-by: Felix Windsheimer <felix.windsheimer@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-20mt7621-mmc: Alignment should match open parenthesisJona Crasselt1-2/+2
Issue reported by checkpatch.pl. Signed-off-by: Jona Crasselt <jona.crasselt@fau.de> Signed-off-by: Felix Windsheimer <felix.windsheimer@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-20mt7621-mmc: Removed unnecessary blank linesJona Crasselt1-2/+0
Issue reported by checkpatch.pl. Signed-off-by: Jona Crasselt <jona.crasselt@fau.de> Signed-off-by: Felix Windsheimer <felix.windsheimer@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-20mt7621-mmc: Fix some coding style issuesJona Crasselt1-14/+17
Fix some comment-related issues reported by checkpatch.pl: - Block comments use * on subsequent lines - Block comments use a trailing */ on a separate line Signed-off-by: Jona Crasselt <jona.crasselt@fau.de> Signed-off-by: Felix Windsheimer <felix.windsheimer@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12staging: mt7621-mmc: Fix incompletely removed #if 0 block in sd.cNishad Kamdar1-20/+0
Commit 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c") does not completely remove an #if 0 block in sd.c. This causes the function msdc_select_clksrc() which was eariler not compiled, to be compiled. That causes an error - MSDC_CLKSRC_REG is not defined. This patch completely removes the #if 0 block Reported-by: NeilBrown <neil@brown.name> Fixes: 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c") Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12staging: mt7621-mmc: fix compile warnging: cmd_bufNeilBrown1-1/+1
cmd_buf is only used when MT6575_SD_DEBUG is defined. So only declare it in that case. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12staging: mt7621-mmc: add missing header.NeilBrown1-0/+1
<linux/interrupt.h> is sometimes included by other include files, and sometimes not, depending on config, particularly CONFIG_HIGHMEM. So include it explicitly rather than relying on implicit inclusion. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12staging: mt7621-mmc: set correct dma mask.NeilBrown1-1/+1
Since commit f8c55dc6e828 ("MIPS: use generic dma noncoherent ops for simple noncoherent platforms") changed MIPS dma handling, the mmc driver fails because it doesn't have a dma mask is set. So set the correct dma mask. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07staging: mt7621-mmc: Add blank line after declarationNícolas F. R. A. Prado1-0/+1
Correct the following warning from checkpatch.pl: WARNING: Missing a blank line after declarations + struct msdc_host *host = mmc_priv(mmc); + msdc_pm(state, (void *)host); Signed-off-by: Nícolas F. R. A. Prado <nfraprado@protonmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-14staging: mt7621-mmc: Use BIT macro instead of explicit shifting in dbg.hNishad Kamdar1-11/+11
Replace explicit shifting with BIT macro in dbg.h. Issue found by checkpatch. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-14staging: mt7621-mmc: Fix lines over 80 characters in dbg.hNishad Kamdar1-13/+15
This patch fixes lines over 80 characters in dbg.h. Issue found by checkpatch. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-14staging: mt7621-mmc: Fix lines over 80 characters in dbg.cNishad Kamdar1-32/+47
This patch fixes lines over 80 characters in dbg.c. Issue found by checkpatch. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09staging: mt7621-mmc: Add blank line after declarationJaakko Tyynismaa1-0/+1
Add blank line after declaration. Reported by checkpatch. Signed-off-by: Jaakko Tyynismaa <jaakko.tyynismaa@hotmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09staging: mt7621-mmc: Remove #if 0 blocks in dbg.hNishad Kamdar1-15/+0
This patch removes #if 0 code blocks and usages of functions defined in the #if 0 blocks in dbg.h. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09staging: mt7621-mmc: Remove #if 0 blocks in dbg.cNishad Kamdar1-20/+1
This patch removes #if 0 code blocks and usages of functions defined in the #if 0 blocks in dbg.c Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09staging: mt7621-mmc: Remove #if 0 blocks in sd.cNishad Kamdar1-248/+1
This patch removes #if 0 code blocks and usages of functions defined in the #if 0 blocks in sd.c. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-02staging: mt7621-mmc: Remove unused single statement macrosNishad Kamdar1-28/+0
This patch removes unused single statement macros in sd.c Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-02staging: mt7621-mmc: Remove single statement macro msdc_irq_restore()Nishad Kamdar1-6/+1
This patch removes the macro msdc_irq_restore() and replaces its usage with call to the function called in the macro definition. Issue found by checkpatch. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-02staging: mt7621-mmc: replace `printk` with preferred APIDafna Hirschfeld1-3/+3
Replace calls to `printk` with `dev_info` and `pr_err` Issues found with checkpatch.pl Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-02staging: mt7621-mmc: Fix comparison to NULLDafna Hirschfeld1-5/+5
Replace comparisons of a variable 'x' to NULL with either 'x' or '!x'. Issues found with checkpatch.pl Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-02staging: mt7621-mmc: remove unnecessary braces from 'if' statementsDafna Hirschfeld1-6/+3
Remove unnecessary braces from one line 'if' statements. Issues found with checkpatch.pl Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20staging: mt7621-mmc: Delete IRQ_MSG() and its usersNishad Kamdar2-34/+2
This patch removes IRQ_MSG() and its users as currently it is a no-op. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: mt7621-mmc: Fix debug macro ERR_MSG and its usagesNishad Kamdar2-45/+81
Replace all usages of ERR_MSG with with dev_<level> without __func__ or __LINE__ or current->comm and current->pid. Remove the do {} while(0) loop for the single statement macro. Delete commented ERR_MSG() usage. Drop ERR_MSG from dbg.h. Issue found by checkpatch. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: mt7621-mmc: Delete N_MSG() and all its usersNishad Kamdar2-252/+0
This patch removes N_MSG() and all its users since it is a no-op. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-27staging: mt7621-mmc: Remove macro INIT_MSG and its usagesNishad Kamdar2-23/+0
Removed all usages of INIT_MSG and dropped it from dbg.h. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-27staging: mt7621-mmc: place a check for sscanfSumit Pundir1-1/+3
Placed a check for the return value of sscanf. -EINVAL is returned if the value is anything other than expected. Reported by checkpatch.pl Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-29staging: mt7621-mmc: Use BIT macro instead of explicit shifting in board.hNishad Kamdar1-4/+4
Replace explicit shifting with BIT macro in board.h. Issue found by checkpatch. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-06staging: mt7621-mmc: Fix printk() facility levelSergej Perschin1-27/+27
The patch fixes the following issue: WARNING: printk() should include KERN_<LEVEL> facility level Signed-off-by: Sergej Perschin <ser.perschin@gmail.com> Signed-off-by: Marcel Budoj <marcel.budoj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Find response of SD_APP_OP_COND by defaultChristian Lütke-Stetzkamp1-3/+1
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-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Find response of MMC_SEND_OP_COND by defaultChristian Lütke-Stetzkamp1-1/+1
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 <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Factor out from msdc_command_start()Christian Lütke-Stetzkamp1-15/+25
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 <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unused argument from msdc_do_commandChristian Lütke-Stetzkamp1-3/+2
The argument tune of msdc_do_command is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unused macro is_card_presentChristian Lütke-Stetzkamp1-4/+0
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 <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unused define MAX_PHY_SGMTSChristian Lütke-Stetzkamp1-1/+0
The define MAX_PHY_SGMTS is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unused enum msdc_modeChristian Lütke-Stetzkamp1-6/+0
The enum msdc_mode is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unused define IRQ_SDCChristian Lütke-Stetzkamp1-2/+0
The define IRQ_SDC is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unused define RALINK_MSDC_BASEChristian Lütke-Stetzkamp1-2/+0
The define RALINK_MSDC_BASE is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Cleanup source of base address for ioChristian Lütke-Stetzkamp2-303/+236
Currently the base address for all io operations is hidden behind a macro, REG_ADD. This macro uses the symbol "base" as the base address and all functions set base = host->base. This is hard to read, so the whole wrapping is removed and host->base is directly inserted in the io access. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove MSDC_MODE_* definesChristian Lütke-Stetzkamp1-7/+0
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 <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unused variable from msdc_tune_requestChristian Lütke-Stetzkamp1-2/+0
The variable cmd in the function msdc_tune_request is set but never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unused macro MAX_BD_PER_GPDChristian Lütke-Stetzkamp1-1/+0
The macro MAX_BD_PER_GPD is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unused macro msdc_retryChristian Lütke-Stetzkamp1-13/+0
The macro msdc_retry is never used, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Make msdc_clr_fifo a function and relax cpuChristian Lütke-Stetzkamp1-13/+15
In the current code, msdc_clr_fifo is a macro and just busy waits for a limited amount of time for the fifo clear to finish. That is not correct, the programming manual hits, that the user should wait until the bit is cleared by hardware and not a limited amount of time. So the code is changed to a function, that also relaxes the cpu while busy waiting. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unnecessary BUG_ON() in msdc_dma_setupChristian Lütke-Stetzkamp1-3/+0
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 <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove variable num form msdc_dma_setupChristian Lütke-Stetzkamp1-3/+2
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 <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unused field sglen from msdc_dmaChristian Lütke-Stetzkamp2-4/+0
The field sglen from struct msdc_dma is once set and never read, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unused field sg from msdc_dmaChristian Lütke-Stetzkamp2-2/+0
The field sg from struct msdc_dma is once set and never read, so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Refactor dma setup processChristian Lütke-Stetzkamp1-21/+13
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-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>