summaryrefslogtreecommitdiff
path: root/drivers/mfd/rave-sp.c
AgeCommit message (Collapse)AuthorFilesLines
2020-08-24treewide: Use fallthrough pseudo-keywordGustavo A. R. Silva1-2/+2
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2020-07-06mfd: rave-sp: Fix mistake in 'struct rave_sp_deframer's kerneldocLee Jones1-1/+1
Argument 'received' was incorrectly named by its struct type 'completion' instead of its name. Fixes the following W=1 warning: drivers/mfd/rave-sp.c:107: warning: Function parameter or member 'received' not described in 'rave_sp_reply' Cc: Andrey Vostrikov <andrey.vostrikov@cogentembedded.com> Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Cc: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-01-03mfd: rave-sp: Fix typo in rave_sp_checksum commentYangtao Li1-1/+1
Caculated -> Calculated Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2018-07-27mfd: rave-sp: Emulate CMD_GET_STATUS on device that don't support itAndrey Smirnov1-33/+63
CMD_GET_STATUS is not supported by some devices implementing RDU2-compatible ICD as well as "legacy" devices. To account for that fact, add code that obtains the same information (app/bootloader FW version) using several different commands. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2018-07-27mfd: rave-sp: Add legacy watchdog ping command translationAndrey Smirnov1-0/+2
This is needed to make rave-sp-wdt driver to properly ping the watchdog on "legacy" firmware. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2018-07-27mfd: rave-sp: Add legacy EEPROM access command translationAndrey Smirnov1-0/+2
This is needed to make rave-sp-eeprom driver work on "legacy" firmware. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2018-07-27mfd: rave-sp: Initialize flow control and parity of the portAndrey Smirnov1-0/+7
Relying on serial port defaults for flow control and parity can result in complete breakdown of communication with RAVE SP on some platforms where defaults are not what we need them to be. One such case is VF610-base ZII SPU3 board (not supported upstream). To avoid this problem in the future, add code to explicitly configure both. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2018-07-27mfd: rave-sp: Fix incorrectly specified checksum typeAndrey Smirnov1-1/+1
RAVE SP firmware covered by "legacy" variant uses 16-bit CCITT checksum algorithm. Change the code to correctly reflect that. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2018-07-27mfd: rave-sp: Remove unused definesAndrey Smirnov1-10/+0
Remove unusded defines that are a leftover from earlier iterations of the driver. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2018-05-16mfd: rave-sp: Remove VLAKyle Spiers1-2/+9
As part of the effort to remove VLAs from the kernel[1], this creates constants for the checksum lengths of CCITT and 8B2C and changes crc_calculated to be the maximum size of a checksum. https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Kyle Spiers <ksspiers@google.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2018-05-16mfd: rave-sp: Check received frame length before accepting next byteAndrey Smirnov1-2/+2
Check received frame length _before_ accepting next byte in order to avoid incorrectly rejecting payloads that are RAVE_SP_RX_BUFFER_SIZE long. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Tested-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2018-05-16mfd: rave-sp: Convert print_hex_dump() to print_hex_dump_debug()Andrey Smirnov1-4/+4
Convert print_hex_dump() to print_hex_dump_debug() to be able to leverage CONFIG_DYNAMIC_DEBUG. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2018-05-16mfd: rave-sp: Add code to print firmware versionsAndrey Smirnov1-0/+95
Add code that would query and print out bootloader and application firmware version info. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Tested-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2018-01-08mfd: Add driver for RAVE Supervisory ProcessorAndrey Smirnov1-0/+710
Add a driver for RAVE Supervisory Processor, an MCU implementing various bits of housekeeping functionality (watchdoging, backlight control, LED control, etc) on RAVE family of products by Zodiac Inflight Innovations. This driver implementes core MFD/serdev device as well as communication subroutines necessary for commanding the device. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Acked-by: Philippe Ombredanne <pombredanne@nexb.com> Acked-by: Pavel Machek <pavel@ucw.cz> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Tested-by: Chris Healy <cphealy@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>