Commit Graph

163 Commits

Author SHA1 Message Date
Nishad Kamdar
370a1b573d staging: mt7621-mmc: Use BIT macro instead of explicit shifting in dbg.h
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-14 13:30:34 +02:00
Nishad Kamdar
23f5fb5d87 staging: mt7621-mmc: Fix lines over 80 characters in dbg.h
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-14 13:30:33 +02:00
Nishad Kamdar
01378deb37 staging: mt7621-mmc: Fix lines over 80 characters in dbg.c
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-14 13:30:33 +02:00
Jaakko Tyynismaa
6b8b5fa2af staging: mt7621-mmc: Add blank line after declaration
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-09 15:13:24 +02:00
Nishad Kamdar
ecfbc770df staging: mt7621-mmc: Remove #if 0 blocks in dbg.h
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-09 15:13:24 +02:00
Nishad Kamdar
c668906916 staging: mt7621-mmc: Remove #if 0 blocks in dbg.c
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-09 15:13:24 +02:00
Nishad Kamdar
2a54e3259e staging: mt7621-mmc: Remove #if 0 blocks in sd.c
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-09 15:13:24 +02:00
Nishad Kamdar
ee607b8fb5 staging: mt7621-mmc: Remove unused single statement macros
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-02 15:16:20 -07:00
Nishad Kamdar
afa163e3f8 staging: mt7621-mmc: Remove single statement macro msdc_irq_restore()
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-02 15:16:20 -07:00
Dafna Hirschfeld
7b6e286c39 staging: mt7621-mmc: replace printk with preferred API
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-02 14:53:18 -07:00
Dafna Hirschfeld
ffa8ed13d9 staging: mt7621-mmc: Fix comparison to NULL
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-02 14:53:18 -07:00
Dafna Hirschfeld
f259e47af3 staging: mt7621-mmc: remove unnecessary braces from 'if' statements
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-10-02 14:53:18 -07:00
Nishad Kamdar
5f1a9140dd staging: mt7621-mmc: Delete IRQ_MSG() and its users
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-20 12:28:02 +02:00
Nishad Kamdar
bc554d1e94 staging: mt7621-mmc: Fix debug macro ERR_MSG and its usages
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-10 17:04:21 +02:00
Nishad Kamdar
72536ea687 staging: mt7621-mmc: Delete N_MSG() and all its users
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-09-10 17:02:52 +02:00
Nishad Kamdar
13c7a0ecdf staging: mt7621-mmc: Remove macro INIT_MSG and its usages
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-27 19:35:51 +02:00
Sumit Pundir
b9e50d0cfd staging: mt7621-mmc: place a check for sscanf
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-08-27 19:31:59 +02:00
Nishad Kamdar
910ca496b8 staging: mt7621-mmc: Use BIT macro instead of explicit shifting in board.h
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-29 10:08:02 +02:00
Sergej Perschin
b3cd051dc3 staging: mt7621-mmc: Fix printk() facility level
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-07-06 17:32:24 +02:00
Christian Lütke-Stetzkamp
370713270e staging: mt7621-mmc: Find response of SD_APP_OP_COND by default
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-28 21:48:05 +09:00
Christian Lütke-Stetzkamp
c3f28802a1 staging: mt7621-mmc: Find response of MMC_SEND_OP_COND by default
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-28 21:48:05 +09:00
Christian Lütke-Stetzkamp
256e086636 staging: mt7621-mmc: Factor out from msdc_command_start()
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-28 21:48:05 +09:00
Christian Lütke-Stetzkamp
38ee87eaad staging: mt7621-mmc: Remove unused argument from msdc_do_command
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-28 21:48:05 +09:00
Christian Lütke-Stetzkamp
008f3853de staging: mt7621-mmc: Remove unused macro is_card_present
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-28 21:48:05 +09:00
Christian Lütke-Stetzkamp
2de186940b staging: mt7621-mmc: Remove unused define MAX_PHY_SGMTS
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-28 21:48:05 +09:00
Christian Lütke-Stetzkamp
4bd8897a7d staging: mt7621-mmc: Remove unused enum msdc_mode
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-28 21:48:05 +09:00
Christian Lütke-Stetzkamp
ed940e7547 staging: mt7621-mmc: Remove unused define IRQ_SDC
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-28 21:48:05 +09:00
Christian Lütke-Stetzkamp
a76187ffa5 staging: mt7621-mmc: Remove unused define RALINK_MSDC_BASE
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-28 21:48:05 +09:00
Christian Lütke-Stetzkamp
2dfc73d5bb staging: mt7621-mmc: Cleanup source of base address for io
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-28 21:48:04 +09:00
Christian Lütke-Stetzkamp
8a5b9f049b staging: mt7621-mmc: Remove MSDC_MODE_* defines
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-28 21:48:04 +09:00
Christian Lütke-Stetzkamp
6aab8b5308 staging: mt7621-mmc: Remove unused variable from msdc_tune_request
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-28 21:48:04 +09:00
Christian Lütke-Stetzkamp
a98c143734 staging: mt7621-mmc: Remove unused macro MAX_BD_PER_GPD
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-28 21:48:04 +09:00
Christian Lütke-Stetzkamp
6a1636fa11 staging: mt7621-mmc: Remove unused macro msdc_retry
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-28 21:48:04 +09:00
Christian Lütke-Stetzkamp
e327df5e88 staging: mt7621-mmc: Make msdc_clr_fifo a function and relax cpu
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-28 21:48:04 +09:00
Christian Lütke-Stetzkamp
41015d06e6 staging: mt7621-mmc: Remove unnecessary BUG_ON() in msdc_dma_setup
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-28 21:48:04 +09:00
Christian Lütke-Stetzkamp
d812c6a9bb staging: mt7621-mmc: Remove variable num form msdc_dma_setup
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-28 21:48:04 +09:00
Christian Lütke-Stetzkamp
fe219842d6 staging: mt7621-mmc: Remove unused field sglen from msdc_dma
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-28 21:48:04 +09:00
Christian Lütke-Stetzkamp
acbd652b03 staging: mt7621-mmc: Remove unused field sg from msdc_dma
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-28 21:48:04 +09:00
Christian Lütke-Stetzkamp
8cfba8ac75 staging: mt7621-mmc: Refactor dma setup process
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-28 21:48:03 +09:00
Christian Lütke-Stetzkamp
1668d5fc7b staging: mt7621-mmc: Remove unused field mode from msdc_dma
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-28 21:48:03 +09:00
Christian Lütke-Stetzkamp
f3e1b5766c staging: mt7621-mmc: Remove DMA basic mode code
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-28 21:48:03 +09:00
Christian Lütke-Stetzkamp
b9ec4b8378 staging: mt7621-mmc: Remove register debugging structures
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-28 21:48:03 +09:00
Christian Lütke-Stetzkamp
9705766bfb staging: mt7621-mmc: Remove unused macro sdr_write8
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-28 21:48:03 +09:00
Christian Lütke-Stetzkamp
85e25ffc99 staging: mt7621-mmc: Remove unused macro sdr_read8
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-28 21:48:03 +09:00
Christian Lütke-Stetzkamp
e988d35a62 staging: mt7621-mmc: Replace sdr_read32 with readl
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-28 21:48:03 +09:00
Christian Lütke-Stetzkamp
8fbcf12087 staging: mt7621-mmc: Replace sdr_write32 with writel
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-28 21:48:03 +09:00
Christian Lütke-Stetzkamp
09cb808cfd staging: mt7621-mmc: Remove unused macro msdc_rxfifocnt
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-28 21:48:03 +09:00
Christian Lütke-Stetzkamp
98336f9924 staging: mt7621-mmc: Remove unused macro msdc_txfifocnt
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-28 21:48:03 +09:00
Christian Lütke-Stetzkamp
dbed911180 staging: mt7621-mmc: Remove unused macro msdc_fifo_read32
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-28 21:48:02 +09:00
Christian Lütke-Stetzkamp
bbe95e2421 staging: mt7621-mmc: Remove unused macro msdc_fifo_write32
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-28 21:48:02 +09:00