summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rts5208/rtsx_chip.c
Commit message (Collapse)AuthorAgeFilesLines
* Staging: rts5208: Coding style warnings fix for block commentsPunit Vara2015-09-211-13/+15
| | | | | | | | | | This is patch to rtsx_chip.c that fixes up following warning reported by checkpatch.pl : -Block comments use * on subsequent lines Signed-off-by: Punit Vara <punitvara@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: fix CHANGE_LINK_STATE valueFabio Falzoi2015-06-191-1/+1
| | | | | | | | Fix CHANGE_LINK_STATE value when card_exist is true. Fixes: a9b693cd77d7 ("Staging: rts5208: helper function to manage delink states") Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: helper function to manage delink statesFabio Falzoi2015-06-181-69/+72
| | | | | | | Use a helper function to manage delink states Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: helper function to manage 1lun and 2lun modesFabio Falzoi2015-06-181-44/+53
| | | | | | | Use a helper function to manage lun modes when SUPPORT_OCP is defined Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: helper function to manage idleFabio Falzoi2015-06-181-20/+25
| | | | | | | Use a helper function to manage idle state Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: helper function to manage aspmFabio Falzoi2015-06-181-21/+30
| | | | | | | Use a helper function to manage aspm mode Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: helper function to manage ssFabio Falzoi2015-06-181-33/+33
| | | | | | | Use a helper function to manage ss_counter Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: helper function to manage power offFabio Falzoi2015-06-181-14/+20
| | | | | | | Use a helper function to check if power off is needed. Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: helper function to manage sd erase statusFabio Falzoi2015-06-181-17/+21
| | | | | | | | Use a helper function to manage SD erase status when SUPPORT_SD_LOCK is defined Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Remove RTSX_READ_REG and RTSX_WRITE_REG macrosJoe Perches2015-03-261-109/+498
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Macros with hidden flow control are bad form as the code path taken can be unexpected for the reader. Expand these in-place and remove the macros. Done with coccinelle script: @@ expression chip; expression arg1; expression arg2; expression arg3; @@ - RTSX_WRITE_REG(chip, arg1, arg2, arg3); + retval = rtsx_write_register(chip, arg1, arg2, arg3); + if (retval) { + rtsx_trace(chip); + return retval; + } @@ expression chip; expression arg1; expression arg2; @@ - RTSX_READ_REG(chip, arg1, arg2); + retval = rtsx_read_register(chip, arg1, arg2); + if (retval) { + rtsx_trace(chip); + return retval; + } Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Remove TRACE_RET and TRACE_GOTO macrosJoe Perches2015-03-261-103/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove these flow hiding macros. Miscellanea: o Add a macro and function to replace a large inline o Simplify #includes o Add trace.c and update Makefile o Remove static inline filename function and use kbasename instead This reduces object size quite a lot: ~350KB (x86-64 allyesconfig) $ size drivers/staging/rts5208/built-in.o* text data bss dec hex filename 248385 36728 77888 363001 589f9 drivers/staging/rts5208/built-in.o.new 506691 83352 115896 705939 ac593 drivers/staging/rts5208/built-in.o.old Done via coccinelle script and some typing. @@ expression chip; expression ret; @@ - TRACE_RET(chip, ret); + rtsx_trace(chip); + return ret; @@ expression chip; identifier label; @@ - TRACE_GOTO(chip, label); + rtsx_trace(chip); + goto label; Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Convert non-returned local variable to boolean when relevantQuentin Lambert2015-03-071-26/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch was produced using Coccinelle. A simplified version of the semantic patch is: @r exists@ identifier f; local idexpression u8 x; identifier xname; @@ f(...) { ...when any ( x@xname = 1; | x@xname = 0; ) ...when any } @bad exists@ identifier r.f; local idexpression u8 r.x expression e1 != {0, 1}, e2; @@ f(...) { ...when any ( x = e1; | x + e2 ) ...when any } @depends on !bad@ identifier r.f; local idexpression u8 r.x; identifier r.xname; @@ f(...) { ... ++ bool xname; - int xname; <... ( x = - 1 + true | x = - -1 + false ) ...> } Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: helper function to enable interrupts during resetFabio Falzoi2014-10-291-47/+48
| | | | | | | | | Define the helper function rtsx_enable_pcie_intr to shorten the rtsx_reset_chip code and get rid of the LONG_LINE checkpatch warnings. Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Reviewed-by: Dan Carpenter <dan.carpente@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: helper function to manage aspm during resetFabio Falzoi2014-10-291-31/+39
| | | | | | | | | Define the helper function rtsx_reset_aspm to shorten the rtsx_reset_chip code and get rid of the LONG_LINE checkpatch warnings. Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Reviewed-by: Dan Carpenter <dan.carpente@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: use ternary operators to reduce indentation levelGiedrius Statkevičius2014-10-201-67/+23Star
| | | | | | | | | Convert code in format of if (a) if(b) { [...] } to one line with a simple ternary operation to avoid unnecesary increase of indentation level. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: divide lines to make them less than 80 characters longGiedrius Statkevičius2014-10-201-9/+22
| | | | | | | | Make a couple of lines shorter than the max limit by diving them and also make sure to align them properly where possible. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: align divided lines to opening paranthesisGiedrius Statkevičius2014-10-201-42/+45
| | | | | | | | | | | Make all divided lines aligned to the opening paranthesis. Basically makes all lines aligned to the opening paranthesis to make the code more readable and it also gets rid of a lot of checkpatch.pl "checks". Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: get rid of Camel Case, remove unneeded lines and paranthesesGiedrius Statkevičius2014-10-201-31/+21Star
| | | | | | | | | | | | | | Convert labels from Camel Case to lower case, remove unnecessary parantheses around operands of dereference operators and remove unneeded empty lines before }. Gets rid of a checkpatch.pl "check" that code should avoid Camel Case, also the code had a bunch of &(a) where a is some variable so it gets rid of them too. Finally, in a few places there were a empty line before } so remove them. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: combine ifs where possibleGiedrius Statkevičius2014-10-201-56/+44Star
| | | | | | | | | | | | Join together chained if's where possible to lower the indentation level. In a lot of places of this code the indentation level is already very high. As a result, this patch increases the code flow and readability. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Remove unneeded void returnMelike Yurtoglu2014-10-021-4/+0Star
| | | | | | | | Fixes "void function return statements are not generally useful"checkpatch.pl warning Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Fix missing blank line warningMahati Chamarthy2014-09-291-0/+10
| | | | | | | | This fixes the following checkpatch.pl warnings: WARNING: Missing a blank line after declarations Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Use dev_dbg and print_hex_dump_bytes to dump memoryFabio Falzoi2014-08-161-2/+4
| | | | | | | | Use dev_dbg with %*ph format specifier and print_hex_dump_bytes to dump memory instead of relying on custom macro. Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Replace custom macro with dev_dbgFabio Falzoi2014-07-311-62/+71
| | | | | | | Use dev_dbg macro to control tracing verbosity through dynamic debug facility. Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: fix static checker warningsMicky Ching2014-05-151-1/+1
| | | | | | | | | | | | 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 because incorrect code indent. Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: add support for rts5208 and rts5288Micky Ching2013-11-251-0/+1979
There are still many rts5208/5288 card readers being used, but no drivers are supported them in kernel now. This driver can make a great convenience for people who use them. Many other rts-series card reader are supported by mfd driver, but due to much difference with others, rts5208/5288 can not add into mfd driver pretty now, so we provide a separated driver here to support the device. Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>