aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/mt7621-mmc (follow)
AgeCommit message (Collapse)AuthorFilesLines
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>
2018-06-28staging: mt7621-mmc: Remove unused field mode from msdc_dmaChristian Lütke-Stetzkamp2-5/+1
The field mode of struct msdc_dma has no remaining use, 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 DMA basic mode codeChristian Lütke-Stetzkamp1-56/+32
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 <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove register debugging structuresChristian Lütke-Stetzkamp1-411/+0
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 <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unused macro sdr_write8Christian Lütke-Stetzkamp1-2/+0
The macro sdr_write8 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 sdr_read8Christian Lütke-Stetzkamp1-1/+0
The macro sdr_read8 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: Replace sdr_read32 with readlChristian Lütke-Stetzkamp2-50/+49
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 <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Replace sdr_write32 with writelChristian Lütke-Stetzkamp2-33/+32
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 <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-mmc: Remove unused macro msdc_rxfifocntChristian Lütke-Stetzkamp1-2/+0
The macro msdc_rxfifocnt 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_txfifocntChristian Lütke-Stetzkamp1-1/+0
The macro msdc_txfifocnt 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_fifo_read32Christian Lütke-Stetzkamp1-1/+0
The macro msdc_fifo_read32 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_fifo_write32Christian Lütke-Stetzkamp1-1/+0
The macro msdc_fifo_write32 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_fifo_read8Christian Lütke-Stetzkamp1-1/+0
The macro msdc_fifo_read8 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_fifo_write8Christian Lütke-Stetzkamp1-1/+0
The macro msdc_fifo_write8 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 variable in msdc_command_respChristian Lütke-Stetzkamp1-3/+0
The variable resp in msdc_command_resp is once set and never read, delete it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-01staging: mt7621-mmc: Fix line size exceeding 80 columnsSankalp Negi1-1/+2
This patch fixes checkpatch.pl warning and check: WARNING: line over 80 characters CHECK: Alignment should match open parenthesis Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: mt7621-mmc: fix spelling mistake: "Illgal" -> "Illegal"Colin Ian King1-1/+1
Trivial fix to another spelling mistake in N_MSG message text Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-20staging: mt7621-mmc: fix spelling mistake: "Eanable" -> "Enable"Colin Ian King1-1/+1
Trivial fix to spelling mistake in N_MSG message text Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-mmc: Remove unused barrier macrosChristian Lütke-Stetzkamp1-7/+0
The current code has some barrier macros in it, which are already '#if 0' out, so just remove them. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-mmc: Cleanup includesChristian Lütke-Stetzkamp1-43/+8
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 <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-mmc: Remove unused macro HOST_MAX_NUMChristian Lütke-Stetzkamp1-2/+0
The macro HOST_MAX_NUM 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-05-06staging: mt7621-mmc: Always use linked DMA modeChristian Lütke-Stetzkamp1-4/+1
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 <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-mmc: Change return value of msdc_dma_config to voidChristian Lütke-Stetzkamp1-2/+1
The msdc_dma_config function currently returns always 0. Remove the return and change to void. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-mmc: Don't disables DMAChristian Lütke-Stetzkamp1-2/+0
Current code disables the DMA after the transfer. That only changes the transfer mode to non-DMA and does not save any power. This is not necessary any more, because now DMA transfer is always used. The macro for disabling DMA transfer is also removed, because it is not used any more. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-mmc: Inline function msdc_set_blknumChristian Lütke-Stetzkamp1-9/+1
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 <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-mmc: Remove initialisation in msdc_dma_configChristian Lütke-Stetzkamp1-1/+1
Current code initialises the variable sg at the beginning of the msdc_dma_config function. This is not necessary, because the variable is assigned by the for_each_sg macro later on. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-mmc: Remove redundant check for card statusChristian Lütke-Stetzkamp1-14/+0
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 <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-mmc: Do not BUG() if mrq set in msdc_ops_requestChristian Lütke-Stetzkamp1-4/+1
Currently the code BUG()'s, if host->mrq is set at the beginning of msdc_ops_request. This shoould normally not happen, but it is not that critical, because the critical sections are protected by a spin lock and in the worst case, some commands to the card are lost, so it is sufficient to just WARN_ON(). Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-mmc: Remove unused sdio irq codeChristian Lütke-Stetzkamp2-27/+0
Currently the code for the sdio irq is never used, because the flags for it (MSDC_(EXT_)SDIO_IRQ) are never set. So the whole code for it can be removed. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>