[PATCH 1/2] mfd: rtsx: add func to split u32 into register

2014-11-26 Thread micky_ching
From: Micky Ching Add helper function to write u32 to registers, if we want to put u32 value to 4 continuous register, this can help us reduce tedious work. Signed-off-by: Micky Ching --- include/linux/mfd/rtsx_pci.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/include/

[PATCH 0/2] mmc: rtsx: add support for sdio card

2014-11-26 Thread micky_ching
From: Micky Ching This patch is used to change transfer mode for sdio card support by SD interface. Micky Ching (2): mfd: rtsx: add func to split u32 into register mmc: rtsx: add support for sdio card drivers/mmc/host/rtsx_pci_sdmmc.c | 366 ++ include/l

[PATCH 2/2] mmc: rtsx: add support for sdio card

2014-11-26 Thread micky_ching
From: Micky Ching Add support for sdio card by SD interface. The main change is data transfer mode, When read data, host wait data transfer while command start. When write data, host will start data transfer after command get response. The transfer mode modify can be applied both for SD/MMC card

[PATCH v2 1/2] mfd: rtsx: add func to split u32 into register

2014-11-27 Thread micky_ching
From: Micky Ching Add helper function to write u32 to registers, if we want to put u32 value to 4 continuous register, this can help us reduce tedious work. Signed-off-by: Micky Ching --- include/linux/mfd/rtsx_pci.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux/mf

[PATCH v2 2/2] mmc: rtsx: add support for sdio card

2014-11-27 Thread micky_ching
From: Micky Ching Add support for sdio card by SD interface. The main change is data transfer mode, When read data, host wait data transfer while command start. When write data, host will start data transfer after command get response. The transfer mode modify can be applied both for SD/MMC card

[PATCH v2 0/2] mmc: rtsx: add support for sdio card

2014-11-27 Thread micky_ching
From: Micky Ching v2: rtsx_pci.h: - remove unused rtsx_pci_write_le32 - add SD_CMD_START rtsx_pci_sdmmc.c: - dump_reg_range - alloc data on stack - remove forward declaration - use SD_CMD_START replace magic number 0x40 - move initialize assignment to error handl

[PATCH v2 1/2] mfd: rtsx: add func to split u32 into register

2014-12-01 Thread micky_ching
From: Micky Ching Add helper function to write u32 to registers, if we want to put u32 value to 4 continuous register, this can help us reduce tedious work. Signed-off-by: Micky Ching Acked-by: Lee Jones --- include/linux/mfd/rtsx_pci.h | 9 + 1 file changed, 9 insertions(+) diff --

[PATCH v2 0/2] mmc: rtsx: add support for sdio card

2014-12-01 Thread micky_ching
From: Micky Ching v3: rtsx_pci_sdmmc.c: - dump_reg_range - remove unused pointer check - fix start index v2: rtsx_pci.h: - remove unused rtsx_pci_write_le32 - add SD_CMD_START rtsx_pci_sdmmc.c: - dump_reg_range - alloc data on stack - remove forward dec

[PATCH v2 2/2] mmc: rtsx: add support for sdio card

2014-12-01 Thread micky_ching
From: Micky Ching Add support for sdio card by SD interface. The main change is data transfer mode, When read data, host wait data transfer while command start. When write data, host will start data transfer after command get response. The transfer mode modify can be applied both for SD/MMC card

[PATCH v4 2/6] mmc: rtsx: add dump_reg_range to simplify dump register

2014-12-04 Thread micky_ching
From: Micky Ching Add a new function to dump register within a range. We print 1 register a line before this patch, this may make debug info too long when we add more register to dump. The new dump_reg_range() dump to 8 register a line, and it is easy to use. Signed-off-by: Micky Ching --- dr

[PATCH v4 0/6] mmc: rtsx: add support for sdio card

2014-12-04 Thread micky_ching
From: Micky Ching v4: split patch in more detailed patches. no code changes diff v3. v3: rtsx_pci_sdmmc.c: - dump_reg_range - remove unused pointer check - fix start index v2: rtsx_pci.h: - remove unused rtsx_pci_write_le32 - add SD_CMD_START rtsx_pci_sdmmc.c:

[PATCH v4 4/6] mmc: rtsx: add helper function to simplify code

2014-12-04 Thread micky_ching
From: Micky Ching To support sdio card, transfer mode need make a change, this need to split code and use it in different place, Add new function to simplify repeat operation. Signed-off-by: Micky Ching --- drivers/mmc/host/rtsx_pci_sdmmc.c | 95 +-- 1 file

[PATCH v4 5/6] mmc: rtsx: add support for sdio card

2014-12-04 Thread micky_ching
From: Micky Ching Modify transfer mode for support sdio card, send cmd and data at the same time for read data transfer, but send data after cmd for write data transfer. Signed-off-by: Micky Ching --- drivers/mmc/host/rtsx_pci_sdmmc.c | 231 ++ 1 file change

[PATCH v4 3/6] mmc: rtsx: init cookie at probe/card_event

2014-12-04 Thread micky_ching
From: Micky Ching host->cookie is used for handle async request, we should init it to negative value when new card inserted, make cookie value invalid. Signed-off-by: Micky Ching --- drivers/mmc/host/rtsx_pci_sdmmc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/host/rtsx_p

[PATCH v4 6/6] mmc: rtsx: swap function position to avoid pre declaration

2014-12-04 Thread micky_ching
From: Micky Ching move function sd_read_data()/sd_write_data() behind sd_send_cmd_get_rsp() to avoid pre-declaration. Signed-off-by: Micky Ching --- drivers/mmc/host/rtsx_pci_sdmmc.c | 200 +++--- 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a

[PATCH v4 1/6] mfd: rtsx: add func to split u32 into register

2014-12-04 Thread micky_ching
From: Micky Ching Add helper function to write u32 to registers, if we want to put u32 value to 4 continuous register, this can help us reduce tedious work. Signed-off-by: Micky Ching Acked-by: Lee Jones --- include/linux/mfd/rtsx_pci.h | 9 + 1 file changed, 9 insertions(+) diff --g

[PATCH v5 3/6] mmc: rtsx: init cookie at probe/card_event

2014-12-22 Thread micky_ching
From: Micky Ching host->cookie is used for handle async request, we should init it to negative value when new card inserted, make cookie value invalid. Signed-off-by: Micky Ching --- drivers/mmc/host/rtsx_pci_sdmmc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/host/rtsx_p

[PATCH v5 2/6] mmc: rtsx: add dump_reg_range to simplify dump register

2014-12-22 Thread micky_ching
From: Micky Ching Add a new function to dump register within a range. We print 1 register a line before this patch, this may make debug info too long when we add more register to dump. The new dump_reg_range() dump to 8 register a line, and it is easy to use. Signed-off-by: Micky Ching --- dr

[PATCH v5 0/6] mmc: rtsx: add support for sdio card

2014-12-22 Thread micky_ching
From: Micky Ching v5: fix patch(5) building error, no code change diff v4. v4: split patch in more detailed patches. no code changes diff v3. v3: rtsx_pci_sdmmc.c: - dump_reg_range - remove unused pointer check - fix start index v2: rtsx_pci.h: - remove unused rtsx_p

[PATCH v5 1/6] mfd: rtsx: add func to split u32 into register

2014-12-22 Thread micky_ching
From: Micky Ching Add helper function to write u32 to registers, if we want to put u32 value to 4 continuous register, this can help us reduce tedious work. Signed-off-by: Micky Ching Acked-by: Lee Jones --- include/linux/mfd/rtsx_pci.h | 9 + 1 file changed, 9 insertions(+) diff --g

[PATCH v5 6/6] mmc: rtsx: swap function position to avoid pre declaration

2014-12-22 Thread micky_ching
From: Micky Ching move function sd_read_data()/sd_write_data() behind sd_send_cmd_get_rsp() to avoid pre-declaration. Signed-off-by: Micky Ching --- drivers/mmc/host/rtsx_pci_sdmmc.c | 203 +++--- 1 file changed, 100 insertions(+), 103 deletions(-) diff --git a

[PATCH v5 5/6] mmc: rtsx: add support for sdio card

2014-12-22 Thread micky_ching
From: Micky Ching Modify transfer mode for support sdio card, send cmd and data at the same time for read data transfer, but send data after cmd for write data transfer. Signed-off-by: Micky Ching --- drivers/mmc/host/rtsx_pci_sdmmc.c | 234 ++ 1 file change

[PATCH v5 4/6] mmc: rtsx: add helper function to simplify code

2014-12-22 Thread micky_ching
From: Micky Ching To support sdio card, transfer mode need make a change, this need to split code and use it in different place, Add new function to simplify repeat operation. Signed-off-by: Micky Ching --- drivers/mmc/host/rtsx_pci_sdmmc.c | 95 +-- 1 file

[PATCH 1/3] memstick: rtsx: dump register using compact format

2015-01-13 Thread micky_ching
From: Micky Ching Using more compact format for dump register when error occurs, this is useful to read debug log and reduce log length. Signed-off-by: Micky Ching --- drivers/memstick/host/rtsx_pci_ms.c | 37 - 1 file changed, 20 insertions(+), 17 deletions

[PATCH 3/3] memstick: rtsx: move suspend/resume to pm ops

2015-01-13 Thread micky_ching
From: Micky Ching Move suspend/resume function to pm ops, make it consistence with rtsx_usb_ms.c driver. Signed-off-by: Micky Ching --- drivers/memstick/host/rtsx_pci_ms.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/memstick/host/rtsx

[PATCH 2/3] memstick: rtsx: finish request if no card exist

2015-01-13 Thread micky_ching
From: Micky Ching Check card exist before start request, this method can make card remove faster. If we found the card is not exist, just return error-code, not sending request can save much time. Signed-off-by: Micky Ching --- drivers/memstick/host/rtsx_pci_ms.c | 27 ++---

[PATCH 0/3] memstick: rtsx: finish request faster if no card exist

2015-01-13 Thread micky_ching
From: Micky Ching This pathset include some misc coding update. - dump register using compact format. This prevent dump a lot of lines register dump when some error occurs. - finish request if no card exist check card exist before sending any request, When card removed, request can returne

[PATCH 0/2] mmc: rtsx: add check before sending request

2015-01-13 Thread micky_ching
From: Micky Ching Add check before sending request can make request return faster. - finish request if no card exist This can make request finish faster, especial for some sdio card, when card removed, there still a lot of command pending, if we check card exist and stop request, the card w

[PATCH 1/2] mmc: rtsx: finish request if no card exist

2015-01-13 Thread micky_ching
From: Micky Ching Return error-code directly if no card exist, this can make card remove faster. Signed-off-by: Micky Ching --- drivers/mmc/host/rtsx_pci_sdmmc.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/r

[PATCH 2/2] mmc: rtsx: check sg_count before long data xfer

2015-01-13 Thread micky_ching
From: Micky Ching Check sg_count before sending long data xfer. Because dma_map_sg() return int, and sg_count may be negative, so using int instead of unsigned. Signed-off-by: Micky Ching --- drivers/mmc/host/rtsx_pci_sdmmc.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) d

[PATCH 01/10] mfd: rtsx: replace TAB by SPC after #define

2015-01-15 Thread micky_ching
From: Micky Ching Re-format coding-style, using uniform SPC after "#define" keyword instead of mixing using TAB and SPC. Signed-off-by: Micky Ching --- include/linux/mfd/rtsx_pci.h | 254 +-- 1 file changed, 127 insertions(+), 127 deletions(-) diff --gi

[PATCH 05/10] mfd: rtsx: update driving settings

2015-01-15 Thread micky_ching
From: Micky Ching update card drive settings, This setting can be used for rts5249 rts524A and rts525A. Signed-off-by: Micky Ching --- drivers/mfd/rts5249.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/rts5249.c b/drivers/mfd/rts5249.c index 225a

[PATCH 06/10] mfd: rtsx: update phy register

2015-01-15 Thread micky_ching
From: Micky Ching update phy register value and using direct value instead of macros. It is much easier to debug using constant value than a lot of macros. We usually need compare the value directly to check the configure. Signed-off-by: Micky Ching --- drivers/mfd/rts5249.c | 46 +

[PATCH 02/10] mfd: rtsx: place register address and values togather

2015-01-15 Thread micky_ching
From: Micky Ching It is more readable to place register address and values define togather. The values define add two leading space indicate belong to the register address defined above. Signed-off-by: Micky Ching --- include/linux/mfd/rtsx_pci.h | 836 +++--

[PATCH 03/10] mfd: rtsx: add debug info when access register failed

2015-01-15 Thread micky_ching
From: Micky Ching Add debug info when access register failed, this is useful for debug. Signed-off-by: Micky Ching --- drivers/mfd/rtsx_pcr.c | 22 +- include/linux/mfd/rtsx_pci.h | 2 ++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/rts

[PATCH 07/10] mfd: rtsx: remove LCTLR defination

2015-01-15 Thread micky_ching
From: Micky Ching To enable/disable ASPM we should find LINK CONTROL register in PCI config space. All old chip use 0x80 address, but new chip may use another address, so we using pci_find_capability() to get LINK CONTROL address. rtsx_gops.c was removed, we consider to put some common operation

[PATCH 00/10] mfd: rtsx: add support for new rts524A and rts525A

2015-01-15 Thread micky_ching
From: Micky Ching This patchset including re-format some coding-style and add two new chip rts524A and rts525A. Micky Ching (10): mfd: rtsx: replace TAB by SPC after #define mfd: rtsx: place register address and values togather mfd: rtsx: add debug info when access register failed mfd: r

[PATCH 04/10] mfd: rtsx: update PETXCFG address

2015-01-15 Thread micky_ching
From: Micky Ching PETXCFG is defined at 0xFF03, the old 0xFE49 not used any more. Signed-off-by: Micky Ching --- drivers/mfd/rts5227.c| 6 ++ drivers/mfd/rts5249.c| 6 ++ include/linux/mfd/rtsx_pci.h | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a

[PATCH 09/10] mfd: rtsx: add support for rts525A

2015-01-15 Thread micky_ching
From: Micky Ching add support for new chip rts525A. Signed-off-by: Micky Ching --- drivers/mfd/rts5249.c | 93 +- drivers/mfd/rtsx_pcr.c | 13 +-- drivers/mfd/rtsx_pcr.h | 1 + 3 files changed, 103 insertions(+), 4 deletions(-) diff --git

[PATCH 10/10] mfd: rtsx: using pcr_dbg replace dev_dbg

2015-01-15 Thread micky_ching
From: Micky Ching pcr_dbg is a wrapper of dev_dbg, which can save some code, and help to enable/disable debug message static. Signed-off-by: Micky Ching --- drivers/mfd/rtl8411.c | 11 +-- drivers/mfd/rts5209.c | 4 ++-- drivers/mfd/rts5227.c | 4 ++-- drivers/mfd/rts5229.c | 4

[PATCH 08/10] mfd: rtsx: add support for rts524A

2015-01-15 Thread micky_ching
From: Micky Ching add support for new chip rts524A. Signed-off-by: Micky Ching --- drivers/mfd/rts5249.c| 112 +++ drivers/mfd/rtsx_pcr.c | 5 ++ drivers/mfd/rtsx_pcr.h | 4 ++ include/linux/mfd/rtsx_pci.h | 87 ++

[PATCH] mfd: rtsx: add support for rts522A

2015-04-16 Thread micky_ching
From: Micky Ching rts522a(rts5227s) is derived from rts5227, and mainly same with rts5227. Add it to file mfd/rts5227.c to support this chip. Signed-off-by: Micky Ching --- drivers/mfd/rts5227.c| 77 ++-- drivers/mfd/rtsx_pcr.c | 5 +++ dr

[PATCH v2] mfd: rtsx: add support for rts522A

2015-04-16 Thread micky_ching
From: Micky Ching rts522a(rts5227s) is derived from rts5227, and mainly same with rts5227. Add it to file mfd/rts5227.c to support this chip. Signed-off-by: Micky Ching --- drivers/mfd/Kconfig | 7 ++-- drivers/mfd/rts5227.c| 77 ++-- d

[PATCH 02/12] mmc: core: modify mmc_app_cmd interface for SD4.0

2015-04-28 Thread micky_ching
From: Micky Ching When card running in SD4.0 mode, ACMD is not need to send two command, we only need to mark a flag for the CMD which is to be send. Signed-off-by: Micky Ching Signed-off-by: Wei Wang --- drivers/mmc/card/block.c | 2 +- drivers/mmc/core/sd_ops.c | 17 - inc

[PATCH 03/12] mmc: core: add SD4.0 operation function

2015-04-28 Thread micky_ching
From: Micky Ching SD4.0 add some new operations, which include follows: UHSII interface detect: when UHSII interface is detected, the power is up. go/exit dormant: enter or exit dormant state. device init: device init CCMD. enumerate: enumerate CCMD. config space read/write CCMD. when we send S

[PATCH 07/12] mmc: sdhci: add data structure for SD4.0

2015-04-28 Thread micky_ching
From: Micky Ching add SD4.0 register define and host data structure for handshake with SD4.0 card. Signed-off-by: Micky Ching Signed-off-by: Wei Wang --- drivers/mmc/host/sdhci.h | 136 ++- 1 file changed, 135 insertions(+), 1 deletion(-) diff --gi

[PATCH 05/12] mmc: core: disable full power cycle for SD4.0

2015-04-28 Thread micky_ching
From: Micky Ching We should not do power cycle when card is in SD4.0 mode, if we power off, we should detect UHSII interface again. so we can disable it when card is in UHSII mode. Signed-off-by: Micky Ching Signed-off-by: Wei Wang --- drivers/mmc/core/core.c | 3 ++- 1 file changed, 2 insert

[PATCH 09/12] mmc: sdhci: add tlp handler for SD4.0

2015-04-28 Thread micky_ching
From: Micky Ching SD4.0 mode using tlp for cmd/data transfer, add tlp functions to handle this case. Signed-off-by: Micky Ching Signed-off-by: Wei Wang --- drivers/mmc/host/sdhci.c | 244 ++- 1 file changed, 220 insertions(+), 24 deletions(-) diff

[PATCH 06/12] mmc: core: init SD4.0 mode before legacy mode

2015-04-28 Thread micky_ching
From: Micky Ching We alloc card before init card, if init UHSII mode failed, then try to init legacy mode. Since we card is allocated before do init operations, so mmc/sdio card init should do some modify. To reduce many diff hunks, the old labels are reserved(we can remove them in the future).

[PATCH 04/12] mmc: core: add tlp request handler for SD4.0

2015-04-28 Thread micky_ching
From: Micky Ching when card is work in SD4.0 mode, we should send tlp instead of cmd. add this function to handle tlp request. Signed-off-by: Micky Ching Signed-off-by: Wei Wang --- drivers/mmc/core/core.c | 111 +--- 1 file changed, 104 insertions(

[PATCH 11/12] mmc: sdhci: set DMA configure for SD4.0 mode

2015-04-28 Thread micky_ching
From: Micky Ching SD4.0 mode not using SDMA any more, and UHSII mode using different register to specify block size/count. Signed-off-by: Micky Ching Signed-off-by: Wei Wang --- drivers/mmc/host/sdhci.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git

[PATCH 00/12] mmc: core: add SD4.0 support

2015-04-28 Thread micky_ching
From: Micky Ching Add support for SD4.0 card, which introduce UHSII mode and tlp transfer. Micky Ching (12): mmc: core: add data structure define for SD4.0 mmc: core: modify mmc_app_cmd interface for SD4.0 mmc: core: add SD4.0 operation function mmc: core: add tlp request handler for SD4

[PATCH 08/12] mmc: sdhci: add SD4.0 operations

2015-04-28 Thread micky_ching
From: Micky Ching SD4.0 operations include UHSII interface detect, go/exit dormant and uhsii ios settings. Signed-off-by: Micky Ching Signed-off-by: Wei Wang --- drivers/mmc/host/sdhci.c | 183 ++- 1 file changed, 182 insertions(+), 1 deletion(-) d

[PATCH 10/12] mmc: sdhci: disable clock control for SD4.0 mode

2015-04-28 Thread micky_ching
From: Micky Ching Skip clock control settings for UHSII mode. When card is in UHSII mode, we only allow poweroff. Signed-off-by: Micky Ching Signed-off-by: Wei Wang --- drivers/mmc/host/sdhci.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers

[PATCH 12/12] mmc: sdhci: add SD4.0 support

2015-04-28 Thread micky_ching
From: Micky Ching Add support for SD4.0 card. Signed-off-by: Micky Ching Signed-off-by: Wei Wang --- drivers/mmc/host/sdhci.c | 108 --- 1 file changed, 102 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhc

[PATCH 01/12] mmc: core: add data structure define for SD4.0

2015-04-28 Thread micky_ching
From: Micky Ching The new data structure for SD4.0 including follows: register: SD4.0 IO space register define. protocol: host and card handshake data. tlp: tlp request data structure for SD4.0 mode. uhsii ios: UHSII bus control data structure. Signed-off-by: Micky Ching Signed-off-by: Wei Wan

[PATCH RESEND 0/3] mmc: rtsx: fix bug and support nonblocking request

2014-02-16 Thread micky_ching
From: Micky Ching First we fix the card poweroff bug: the card power is not shutdown when sd/mmc card removed, this will make UHS-card failed to running in high speed mode if we insert the card again. We offer a concise tuning searching method, it is much easier to read. At last we add support

[PATCH RESEND 2/3] mmc: rtsx: modify phase searching method for tuning

2014-02-16 Thread micky_ching
From: Micky Ching The new phase searching method is more concise and easier to understand. Signed-off-by: Micky Ching --- drivers/mmc/host/rtsx_pci_sdmmc.c | 112 +++-- include/linux/mfd/rtsx_pci.h |2 +- 2 files changed, 33 insertions(+), 81 deletions

[PATCH RESEND 3/3] mmc: rtsx: add support for pre_req and post_req

2014-02-16 Thread micky_ching
From: Micky Ching Add support for non-blocking request, pre_req() runs dma_map_sg() and post_req() runs dma_unmap_sg(). This patch can increase card read/write speed, especially for high speed card and slow CPU(for some embedded platform). Users can get a great benefit from this patch. if CPU fr

[PATCH RESEND 1/3] mmc: rtsx: fix card poweroff bug

2014-02-16 Thread micky_ching
From: Micky Ching If the host driver removed while card in the slot, the host will not power off card power correctly. This bug is produced because host eject flag set before the last mmc_set_ios callback, we should set the eject flag after power off. Signed-off-by: Micky Ching --- drivers/mmc

[PATCH v2 1/3] mmc: rtsx: fix card poweroff bug

2014-02-17 Thread micky_ching
From: Micky Ching If the host driver removed while card in the slot, the host will not power off card power correctly. This bug is produced because host eject flag set before the last mmc_set_ios callback, we should set the eject flag after power off. Signed-off-by: Micky Ching --- drivers/mmc

[PATCH v2 2/3] mmc: rtsx: modify phase searching method for tuning

2014-02-17 Thread micky_ching
From: Micky Ching The new phase searching method is more concise and easier to understand. Signed-off-by: Micky Ching --- drivers/mmc/host/rtsx_pci_sdmmc.c | 112 +++-- include/linux/mfd/rtsx_pci.h |2 +- 2 files changed, 33 insertions(+), 81 deletions

[PATCH v2 0/3] mmc: rtsx: fix bug and support nonblocking request

2014-02-17 Thread micky_ching
From: Micky Ching First we fix the card poweroff bug: the card power is not shutdown when sd/mmc card removed, this will make UHS-card failed to running in high speed mode if we insert the card again. We offer a concise tuning searching method, it is much easier to read. At last we add support

[PATCH v2 3/3] mmc: rtsx: add support for pre_req and post_req

2014-02-17 Thread micky_ching
From: Micky Ching Add support for non-blocking request, pre_req() runs dma_map_sg() and post_req() runs dma_unmap_sg(). This patch can increase card read/write speed, especially for high speed card and slow CPU(for some embedded platform). Users can get a great benefit from this patch. if CPU fr

[PATCH] mmc: sdhci: add support for realtek rts5250

2014-02-21 Thread micky_ching
From: Micky Ching Add support for realtek rts5250 pci card reader. The card reader have some problem with DDR50 mode, so add a new quirks2 for broken ddr50. Signed-off-by: Micky Ching --- drivers/mmc/host/sdhci-pci.c | 20 drivers/mmc/host/sdhci.c |3 ++- include

[PATCH 1/2] mmc: rtsx: add R1-no-CRC mmc command type handle

2014-03-17 Thread micky_ching
From: Micky Ching commit a27fbf2f067b0cd6f172c8b696b9a44c58bfaa7a produced a cmd.flags unhandled in realtek pci host driver. This will make MMC card failed initialize, this patch is used to handle the new cmd.flags condition and MMC card can be used. Signed-off-by: Micky Ching --- drivers/mmc

[PATCH 0/2] add new cmd type handle and remove smatch warnings

2014-03-17 Thread micky_ching
From: Micky Ching Add new command type(R1 without CRC) handle, without this patch mmc card initialize will be failed. Using a more careful handle in request timeout, and debug info is printed using non DMA mode. Smatch warning was removed. Micky Ching (2): mmc: rtsx: add R1-no-CRC mmc command

[PATCH 2/2] mmc: rtsx: modify error handle and remove smatch warnings

2014-03-17 Thread micky_ching
From: Micky Ching Using non-DMA dump-regs, which would be more exactly for DMA transfer failed. More careful handle when cmd/data timeout, add stop(CMD12) cmd before go to finish request when multi-rw timeout. Remove some static checher warings. on commit: drivers/mmc/host/rtsx_pci_sdmmc.c:194

[PATCH 1/2] mmc: rtsx: add R1-no-CRC mmc command type handle

2014-03-23 Thread micky_ching
From: Micky Ching commit a27fbf2f067b0cd6f172c8b696b9a44c58bfaa7a produced a cmd.flags unhandled in realtek pci host driver. This will make MMC card failed initialize, this patch is used to handle the new cmd.flags condition and MMC card can be used. Signed-off-by: Micky Ching --- drivers/mmc

[PATCH 2/2] mmc: rtsx: modify error handle and remove smatch warnings

2014-03-23 Thread micky_ching
From: Micky Ching Using non-DMA dump-regs, which would be more exactly for DMA transfer failed. More careful handle when cmd/data timeout, add stop(CMD12) cmd before go to finish request when multi-rw timeout. Remove some static checher warings. on commit: drivers/mmc/host/rtsx_pci_sdmmc.c:194

mmc: rtsx: add new cmd type handle and modify error handle

2014-03-23 Thread micky_ching
From: Micky Ching Add new command type(R1 without CRC) handle, without this patch mmc card initialize will be failed. Using a more careful handle in request timeout, this would improve error recover capability. Debug info is printed using non DMA mode, this would help print more accurately for D

[PATCH 1/2] mmc: rtsx: add R1-no-CRC mmc command type handle

2014-03-25 Thread micky_ching
From: Micky Ching commit a27fbf2f067b0cd6f172c8b696b9a44c58bfaa7a produced a cmd.flags unhandled in realtek pci host driver. This will make MMC card failed initialize, this patch is used to handle the new cmd.flags condition and MMC card can be used. Signed-off-by: Micky Ching --- drivers/mmc

[PATCH 0/2] mmc: rtsx: add new cmd type handle and modify error handle

2014-03-25 Thread micky_ching
From: Micky Ching Add new command type(R1 without CRC) handle, without this patch mmc card initialize will be failed. Using a more careful handle in request timeout, this would improve error recover capability. Debug info is printed using non DMA mode, this would help print more accurately for D

[PATCH 2/2] mmc: rtsx: modify error handle and remove smatch warnings

2014-03-25 Thread micky_ching
From: Micky Ching Using non-DMA dump-regs, which would be more exactly for DMA transfer failed. More careful handle when cmd/data timeout, add stop(CMD12) cmd before go to finish request when multi-rw timeout. Remove some static checher warings. on commit: drivers/mmc/host/rtsx_pci_sdmmc.c:194

[PATCH v2 2/2] mmc: rtsx: modify error handle and remove smatch warnings

2014-03-26 Thread micky_ching
From: Micky Ching Using non-DMA dump-regs, which would be more exactly for DMA transfer failed. More careful handle when cmd/data timeout, add stop(CMD12) cmd before go to finish request when multi-rw timeout. Remove some static checher warings. on commit: drivers/mmc/host/rtsx_pci_sdmmc.c:194

[PATCH v2 1/2] mmc: rtsx: add R1-no-CRC mmc command type handle

2014-03-26 Thread micky_ching
From: Micky Ching commit a27fbf2f067b0cd6f172c8b696b9a44c58bfaa7a produced a cmd.flags unhandled in realtek pci host driver. This will make MMC card failed initialize, this patch is used to handle the new cmd.flags condition and MMC card can be used. Signed-off-by: Micky Ching --- drivers/mmc

[PATCH v2 0/2] mmc: rtsx: add new cmd type handle and modify error handle

2014-03-26 Thread micky_ching
From: Micky Ching v2: fix checkpatch warning. WARNING: Missing a blank line after declarations v1: Add new command type(R1 without CRC) handle, without this patch mmc card initialize will be failed. Using a more careful handle in request timeout, this would improve error recover capability. Deb

[PATCH] staging: rts5208: fix static checker warnings

2014-04-02 Thread micky_ching
From: Micky Ching The patch fa590c222fba: "staging: rts5208: add support for rts5208 and rts5288" from Nov 12, 2013, leads to the following static checker warning: drivers/staging/rts5208/rtsx_chip.c:107 rtsx_enable_bus_int() warn: add curly braces? This warning is produced becaus

[PATCH] mmc: rtsx: fix possible circular locking dependency

2014-04-15 Thread micky_ching
From: Micky Ching To avoid dead lock, we need make sure host->lock is always acquire before pcr->lock. But in irq handler, we acquired pcr->lock in rtsx mfd driver, and sd_isr_done_transfer() is called during pcr->lock already acquired. Since in sd_isr_done_transfer() the only work we do is schdu

[PATCH] mmc: rtsx: Revert "mmc: rtsx: add support for pre_req and post_req"

2014-04-28 Thread micky_ching
From: Micky Ching This reverts commit c42deffd5b53c9e583d83c7964854ede2f12410d. commit did use mutex_unlock() in tasklet, but mutex_unlock() can't used in tasklet(atomic context). The driver need use mutex to avoid concurrency, so we can't use tasklet here, the patch need to be removed. The sp

[RESEND] mfd: rtsx: add support for rts522A

2015-06-28 Thread micky_ching
From: Micky Ching rts522a(rts5227s) is derived from rts5227, and mainly same with rts5227. Add it to file mfd/rts5227.c to support this chip. Signed-off-by: Micky Ching --- drivers/mfd/Kconfig | 7 ++-- drivers/mfd/rts5227.c| 77 ++-- d

[PATCH v2 1/9] mfd: rtsx: replace TAB by SPC after #define

2015-01-21 Thread micky_ching
From: Micky Ching Re-format coding-style, using uniform SPC after "#define" keyword instead of mixing using TAB and SPC. Signed-off-by: Micky Ching --- include/linux/mfd/rtsx_pci.h | 254 +-- 1 file changed, 127 insertions(+), 127 deletions(-) diff --gi

[PATCH v2 3/9] mfd: rtsx: update PETXCFG address

2015-01-21 Thread micky_ching
From: Micky Ching PETXCFG is defined at 0xFF03, the old 0xFE49 not used any more. Signed-off-by: Micky Ching --- drivers/mfd/rts5227.c| 6 ++ drivers/mfd/rts5249.c| 6 ++ include/linux/mfd/rtsx_pci.h | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a

[PATCH v2 5/9] mfd: rtsx: update phy register

2015-01-21 Thread micky_ching
From: Micky Ching update phy register value and using direct value instead of macros. It is much easier to debug using constant value than a lot of macros. We usually need compare the value directly to check the configure. Signed-off-by: Micky Ching --- drivers/mfd/rts5249.c| 55 +

[PATCH v2 8/9] mfd: rtsx: add support for rts525A

2015-01-21 Thread micky_ching
From: Micky Ching add support for new chip rts525A. Signed-off-by: Micky Ching --- drivers/mfd/rts5249.c| 104 ++- drivers/mfd/rtsx_pcr.c | 13 -- drivers/mfd/rtsx_pcr.h | 1 + include/linux/mfd/rtsx_pci.h | 15 +++ 4 file

[PATCH v2 6/9] mfd: rtsx: remove LCTLR defination

2015-01-21 Thread micky_ching
From: Micky Ching To enable/disable ASPM we should find LINK CONTROL register in PCI config space. All old chip use 0x80 address, but new chip may use another address, so we using pci_find_capability() to get LINK CONTROL address. rtsx_gops.c was removed, we consider to put some common operation

[PATCH v2 2/9] mfd: rtsx: place register address and values togather

2015-01-21 Thread micky_ching
From: Micky Ching It is more readable to place register address and values define togather. The values define add two leading space indicate belong to the register address defined above. Signed-off-by: Micky Ching --- include/linux/mfd/rtsx_pci.h | 836 +++--

[PATCH v2 0/9] mfd: rtsx: add support for new rts524A and rts525A

2015-01-21 Thread micky_ching
From: Micky Ching v2: - remove debug info when access failed. - using macro list for phy register init. - rename function for multi chip prefix with rtsx_base_ - save pcie_cap offset when init chip, not calling pci_find_capacity() every time. - add pcr->ops: write_phy/read_phy for special chip.

[PATCH v2 4/9] mfd: rtsx: update driving settings

2015-01-21 Thread micky_ching
From: Micky Ching update card drive settings, This setting can be used for rts5249 rts524A and rts525A. Signed-off-by: Micky Ching --- drivers/mfd/rts5249.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/rts5249.c b/drivers/mfd/rts5249.c index 225a

[PATCH v2 7/9] mfd: rtsx: add support for rts524A

2015-01-21 Thread micky_ching
From: Micky Ching add support for new chip rts524A. Signed-off-by: Micky Ching --- drivers/mfd/rts5249.c| 186 --- drivers/mfd/rtsx_pcr.c | 25 +- drivers/mfd/rtsx_pcr.h | 7 ++ include/linux/mfd/rtsx_pci.h | 125 ++

[PATCH v2 9/9] mfd: rtsx: using pcr_dbg replace dev_dbg

2015-01-21 Thread micky_ching
From: Micky Ching pcr_dbg is a wrapper of dev_dbg, which can save some code, and help to enable/disable debug message static. Signed-off-by: Micky Ching --- drivers/mfd/rtl8411.c | 11 +-- drivers/mfd/rts5209.c | 4 ++-- drivers/mfd/rts5227.c | 4 ++-- drivers/mfd/rts5229.c | 4

[RESEND PATCH v2 5/9] mfd: rtsx: update phy register

2015-01-21 Thread micky_ching
From: Micky Ching update phy register value and using direct value instead of macros. It is much easier to debug using constant value than a lot of macros. We usually need compare the value directly to check the configure. Signed-off-by: Micky Ching --- drivers/mfd/rts5249.c| 55 +

[RESEND PATCH v2 0/9] mfd: rtsx: add support for new rts524A and rts525A

2015-01-21 Thread micky_ching
From: Micky Ching resend: - add lee jones ack for some patch. v2: - remove debug info when access failed. - using macro list for phy register init. - rename function for multi chip prefix with rtsx_base_ - save pcie_cap offset when init chip, not calling pci_find_capacity() every time. - add pc

[RESEND PATCH v2 4/9] mfd: rtsx: update driving settings

2015-01-21 Thread micky_ching
From: Micky Ching update card drive settings, This setting can be used for rts5249 rts524A and rts525A. Signed-off-by: Micky Ching Acked-by: Lee Jones --- drivers/mfd/rts5249.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/rts5249.c b/drivers/mfd

[RESEND PATCH v2 9/9] mfd: rtsx: using pcr_dbg replace dev_dbg

2015-01-21 Thread micky_ching
From: Micky Ching pcr_dbg is a wrapper of dev_dbg, which can save some code, and help to enable/disable debug message static. Signed-off-by: Micky Ching Acked-by: Lee Jones --- drivers/mfd/rtl8411.c | 11 +-- drivers/mfd/rts5209.c | 4 ++-- drivers/mfd/rts5227.c | 4 ++-- drivers

[RESEND PATCH v2 2/9] mfd: rtsx: place register address and values togather

2015-01-21 Thread micky_ching
From: Micky Ching It is more readable to place register address and values define togather. The values define add two leading space indicate belong to the register address defined above. Signed-off-by: Micky Ching Acked-by: Lee Jones --- include/linux/mfd/rtsx_pci.h | 836 +++-

[RESEND PATCH v2 1/9] mfd: rtsx: replace TAB by SPC after #define

2015-01-21 Thread micky_ching
From: Micky Ching Re-format coding-style, using uniform SPC after "#define" keyword instead of mixing using TAB and SPC. Signed-off-by: Micky Ching Acked-by: Lee Jones --- include/linux/mfd/rtsx_pci.h | 254 +-- 1 file changed, 127 insertions(+), 127 de

[RESEND PATCH v2 8/9] mfd: rtsx: add support for rts525A

2015-01-21 Thread micky_ching
From: Micky Ching add support for new chip rts525A. Signed-off-by: Micky Ching --- drivers/mfd/rts5249.c| 104 ++- drivers/mfd/rtsx_pcr.c | 13 -- drivers/mfd/rtsx_pcr.h | 1 + include/linux/mfd/rtsx_pci.h | 15 +++ 4 file

[RESEND PATCH v2 7/9] mfd: rtsx: add support for rts524A

2015-01-21 Thread micky_ching
From: Micky Ching add support for new chip rts524A. Signed-off-by: Micky Ching --- drivers/mfd/rts5249.c| 186 --- drivers/mfd/rtsx_pcr.c | 25 +- drivers/mfd/rtsx_pcr.h | 7 ++ include/linux/mfd/rtsx_pci.h | 125 ++

[RESEND PATCH v2 6/9] mfd: rtsx: remove LCTLR defination

2015-01-21 Thread micky_ching
From: Micky Ching To enable/disable ASPM we should find LINK CONTROL register in PCI config space. All old chip use 0x80 address, but new chip may use another address, so we using pci_find_capability() to get LINK CONTROL address. rtsx_gops.c was removed, we consider to put some common operation

  1   2   >