summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/samsung_tty.c
AgeCommit message (Collapse)AuthorFilesLines
2020-08-18serial: samsung: Removes the IRQ not found warningTamseel Shams1-3/+5
In few older Samsung SoCs like s3c2410, s3c2412 and s3c2440, UART IP is having 2 interrupt lines. However, in other SoCs like s3c6400, s5pv210, exynos5433, and exynos4210 UART is having only 1 interrupt line. Due to this, "platform_get_irq(platdev, 1)" call in the driver gives the following false-positive error: "IRQ index 1 not found" on newer SoC's. This patch adds the condition to check for Tx interrupt only for the those SoC's which have 2 interrupt lines. Tested-by: Alim Akhtar <alim.akhtar@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Tamseel Shams <m.shams@samsung.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200810030021.45348-1-m.shams@samsung.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-27serial: samsung: fix spelling mistakeTamseel Shams1-1/+1
There is a spelling mistake in a comment. Fix it. Signed-off-by: Tamseel Shams <m.shams@samsung.com> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Link: https://lore.kernel.org/r/20200617105907.7143-1-m.shams@samsung.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-27serial: samsung: Minor whitespace cleanupsKrzysztof Kozlowski1-13/+9
Make the code slightly more readable by removing unneeded line breaks, adding missing line breaks and white spaces. This also fixes few strict checkpatch suggestions: CHECK: spaces preferred around that '-' (ctx:VxV) CHECK: Unbalanced braces around else statement CHECK: Lines should not end with a '(' Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20200617152856.18086-1-krzk@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-15tty: serial: samsung: Correct clock selection logicJonathan Bakker1-4/+4
Some variants of the samsung tty driver can pick which clock to use for their baud rate generation. In the DT conversion, a default clock was selected to be used if a specific one wasn't assigned and then a comparison of which clock rate worked better was done. Unfortunately, the comparison was implemented in such a way that only the default clock was ever actually compared. Fix this by iterating through all possible clocks, except when a specific clock has already been picked via clk_sel (which is only possible via board files). Signed-off-by: Jonathan Bakker <xc-racer2@live.ca> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/BN6PR04MB06604E63833EA41837EBF77BA3A30@BN6PR04MB0660.namprd04.prod.outlook.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-06serial: samsung: 32-bit access for TX/RX hold registersHyunki Koo1-5/+57
Support 32-bit access for the TX/RX hold registers UTXH and URXH. This is required for some newer SoCs. Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Tested on Odroid HC1 (Exynos5422): Tested-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20200506080242.18623-3-hyunki00.koo@samsung.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-06serial: samsung: Replace rd_regb/wr_regb with rd_reg/wr_regHyunki Koo1-9/+9
This patch change the name of macro for general usage. Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Tested on Odroid HC1 (Exynos5422): Tested-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20200506080242.18623-1-hyunki00.koo@samsung.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-06serial: samsung: Rename Exynos to lowercaseKrzysztof Kozlowski1-1/+1
Fix up inconsistent usage of upper and lowercase letters in "Exynos" name. "EXYNOS" is not an abbreviation but a regular trademarked name. Therefore it should be written with lowercase letters starting with capital letter. The lowercase "Exynos" name is promoted by its manufacturer Samsung Electronics Co., Ltd., in advertisement materials and on website. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20200104152107.11407-18-krzk@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-18tty/serial: Migrate samsung_tty to use has_sysrqDmitry Safonov1-4/+1
The SUPPORT_SYSRQ ifdeffery is not nice as: - May create misunderstanding about sizeof(struct uart_port) between different objects - Prevents moving functions from serial_core.h - Reduces readability (well, it's ifdeffery - it's hard to follow) In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery. Signed-off-by: Dmitry Safonov <dima@arista.com> Link: https://lore.kernel.org/r/20191213000657.931618-38-dima@arista.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-17tty: serial: samsung_tty: do not abuse the struct uart_port unused fieldsGreg Kroah-Hartman1-23/+23
The samsung_tty driver was trying to abuse the struct uart_port by using two "empty" bytes for its own use. That's not ok, and was found by removing those fields from the structure. Move the variables into the port-specific structure, which is where everything else for this port already is. There is no space wasted here as there was an empty "hole" in the structure already for these bytes. Cc: Kukjin Kim <kgene@kernel.org> Cc: Hyunki Koo <kkoos00@naver.com> Cc: HYUN-KI KOO <hyunki00.koo@samsung.com> Cc: Shinbeom Choi <sbeom.choi@samsung.com> Cc: Krzysztof Kozlowski <krzk@kernel.org> Cc: Dmitry Safonov <dima@arista.com> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Link: https://lore.kernel.org/r/20191217140232.GA3489190@kroah.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-12tty: serial: samsung_tty: fix blank line checkpatch warningGreg Kroah-Hartman1-0/+3
checkpatch is giving a bunch of: WARNING: Missing a blank line after declarations messages on this file, so fix up all instances of that issue. Cc: Kukjin Kim <kgene@kernel.org> Cc: Krzysztof Kozlowski <krzk@kernel.org> Cc: Hyunki Koo <kkoos00@naver.com> Cc: HYUN-KI KOO <hyunki00.koo@samsung.com> Cc: Shinbeom Choi <sbeom.choi@samsung.com> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Link: https://lore.kernel.org/r/20191210143706.3928480-10-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-12tty: serial: samsung_tty: fix up minor comment formattingGreg Kroah-Hartman1-7/+9
Fix up some minor formatting of comment blocks to make checkpatch happier and to make things look more uniform. Cc: Kukjin Kim <kgene@kernel.org> Cc: Hyunki Koo <kkoos00@naver.com> Cc: HYUN-KI KOO <hyunki00.koo@samsung.com> Cc: Shinbeom Choi <sbeom.choi@samsung.com> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20191210143706.3928480-9-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-12tty: serial: samsung_tty: use 'unsigned int' not 'unsigned'Greg Kroah-Hartman1-1/+2
The function uart_console_write() expects an unsigned int, so use that variable type, not 'unsigned', which is generally frowned apon in the kernel now. Cc: Kukjin Kim <kgene@kernel.org> Cc: Hyunki Koo <kkoos00@naver.com> Cc: HYUN-KI KOO <hyunki00.koo@samsung.com> Cc: Shinbeom Choi <sbeom.choi@samsung.com> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20191210143706.3928480-8-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-12tty: serial: samsung_tty: use standard debugging macrosGreg Kroah-Hartman1-48/+30
The dbg() macro for the driver is not needed at all, all drivers should use the common dynamic debugging infrastructure, not roll their own. So delete the custom macro and convert the driver to use dev_dbg() instead, providing a lot more information than the previous macro provided. Cc: Kukjin Kim <kgene@kernel.org> Cc: Hyunki Koo <kkoos00@naver.com> Cc: HYUN-KI KOO <hyunki00.koo@samsung.com> Cc: Shinbeom Choi <sbeom.choi@samsung.com> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20191210143706.3928480-7-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-12tty: serial: samsung_tty: drop unneded dbg() callsGreg Kroah-Hartman1-22/+0
Now that the kernel has ftrace, any debugging calls that just do "made it to this function!" and "leaving this function!" can be removed. On the quest to move the samsung_tty driver over to use the standard kernel debugging functions, drop these unneeded calls. Cc: Kukjin Kim <kgene@kernel.org> Cc: Hyunki Koo <kkoos00@naver.com> Cc: HYUN-KI KOO <hyunki00.koo@samsung.com> Cc: Shinbeom Choi <sbeom.choi@samsung.com> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20191210143706.3928480-6-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-12tty: serial: samsung_tty: delete samsung.hGreg Kroah-Hartman1-3/+130
There is no need for a .h file for a single .c file, so just move all of the content of samsung.h into samsung_tty.c Cc: Kukjin Kim <kgene@kernel.org> Cc: Hyunki Koo <kkoos00@naver.com> Cc: HYUN-KI KOO <hyunki00.koo@samsung.com> Cc: Shinbeom Choi <sbeom.choi@samsung.com> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20191210143706.3928480-5-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-12tty: serial: samsung_tty: fix build warningGreg Kroah-Hartman1-0/+3
Fix a build warning on systems that do not have CONFIG_OF enabled. Cc: Kukjin Kim <kgene@kernel.org> Cc: Hyunki Koo <kkoos00@naver.com> Cc: HYUN-KI KOO <hyunki00.koo@samsung.com> Cc: Shinbeom Choi <sbeom.choi@samsung.com> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20191210143706.3928480-2-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-12tty: serial: samsung: remove variable 'ufstat' set but not usedChen Wandun1-2/+2
Fixes gcc '-Wunused-but-set-variable' warning: drivers/tty/serial/samsung_tty.c: In function s3c24xx_serial_rx_chars_dma: drivers/tty/serial/samsung_tty.c:549:24: warning: variable ufstat set but not used [-Wunused-but-set-variable] Signed-off-by: Chen Wandun <chenwandun@huawei.com> Link: https://lore.kernel.org/r/1574424258-138975-1-git-send-email-chenwandun@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-18{tty: serial, nand: onenand}: samsung: rename to fix build warningSudip Mukherjee1-0/+2595
Any arm config which has 'CONFIG_MTD_ONENAND_SAMSUNG=m' and 'CONFIG_SERIAL_SAMSUNG=m' gives a build warning: warning: same module names found: drivers/tty/serial/samsung.ko drivers/mtd/nand/onenand/samsung.ko Rename both drivers/tty/serial/samsung.c to drivers/tty/serial/samsung_tty.c and drivers/mtd/nand/onenand/samsung.c drivers/mtd/nand/onenand/samsung_mtd.c to fix the warning. Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Acked-by: Richard Weinberger <richard@nod.at> Link: https://lore.kernel.org/r/20191117202435.28127-1-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>