aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty/serial/sccnxp.c
AgeCommit message (Collapse)AuthorFilesLines
2018-12-20serial: sccnxp: Allow to use non-standard baud ratesAlexander Shiyan1-3/+19
This patch adds support for the use of non-standard baud rates. For these purposes, we use the built-in timer/counter. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-12-20serial: sccnxp: Adds a delay between sequential read/write cyclesAlexander Shiyan1-5/+27
This patch adds a delay between sequential read/write cycles, to ensure the required minimum inactive time (tRWD). A time value from the datasheet has been added for each type of supported chips. The “inline” compiler attribute has been removed from the read/write functions, simply allow the compiler to control this. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-07-07headers: separate linux/mod_devicetable.h from linux/platform_device.hRandy Dunlap1-0/+1
At over 4000 #includes, <linux/platform_device.h> is the 9th most #included header file in the Linux kernel. It does not need <linux/mod_devicetable.h>, so drop that header and explicitly add <linux/mod_devicetable.h> to source files that need it. 4146 #include <linux/platform_device.h> After this patch, there are 225 files that use <linux/mod_devicetable.h>, for a reduction of around 3900 times that <linux/mod_devicetable.h> does not have to be read & parsed. 225 #include <linux/mod_devicetable.h> This patch was build-tested on 20 different arch-es. It also makes these drivers SubmitChecklist#1 compliant. Signed-off-by: Randy Dunlap <[email protected]> Reported-by: kbuild test robot <[email protected]> # drivers/media/platform/vimc/ Reported-by: kbuild test robot <[email protected]> # drivers/pinctrl/pinctrl-u300.c Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-11-08tty: serial: Remove redundant license textGreg Kroah-Hartman1-5/+0
Now that the SPDX tag is in all tty files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Jiri Slaby <[email protected]> Cc: Eric Anholt <[email protected]> Cc: Stefan Wahren <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Ray Jui <[email protected]> Cc: Scott Branden <[email protected]> Cc: [email protected] Cc: "James E.J. Bottomley" <[email protected]> Cc: Helge Deller <[email protected]> Cc: Joachim Eastwood <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Tobias Klauser <[email protected]> Cc: Russell King <[email protected]> Cc: Vineet Gupta <[email protected]> Cc: Richard Genoud <[email protected]> Cc: Alexander Shiyan <[email protected]> Cc: Baruch Siach <[email protected]> Cc: Pat Gefre <[email protected]> Cc: "Guilherme G. Piccoli" <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Vladimir Zapolskiy <[email protected]> Cc: Sylvain Lemieux <[email protected]> Cc: Carlo Caione <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: Liviu Dudau <[email protected]> Cc: Sudeep Holla <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Andy Gross <[email protected]> Cc: David Brown <[email protected]> Cc: "Andreas Färber" <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Kevin Cernekee <[email protected]> Cc: Laxman Dewangan <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Jonathan Hunter <[email protected]> Cc: Barry Song <[email protected]> Cc: Patrice Chotard <[email protected]> Cc: Maxime Coquelin <[email protected]> Cc: Alexandre Torgue <[email protected]> Cc: Chris Metcalf <[email protected]> Cc: Peter Korsgaard <[email protected]> Cc: Timur Tabi <[email protected]> Cc: Tony Prisk <[email protected]> Cc: Michal Simek <[email protected]> Cc: "Sören Brinkmann" <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-11-08tty: add SPDX identifiers to all remaining files in drivers/tty/Greg Kroah-Hartman1-0/+1
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/tty files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Jiri Slaby <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Chris Metcalf <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: David Sterba <[email protected]> Cc: James Hogan <[email protected]> Cc: Rob Herring <[email protected]> Cc: Eric Anholt <[email protected]> Cc: Stefan Wahren <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Ray Jui <[email protected]> Cc: Scott Branden <[email protected]> Cc: [email protected] Cc: "James E.J. Bottomley" <[email protected]> Cc: Helge Deller <[email protected]> Cc: Joachim Eastwood <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Tobias Klauser <[email protected]> Cc: Russell King <[email protected]> Cc: Vineet Gupta <[email protected]> Cc: Richard Genoud <[email protected]> Cc: Alexander Shiyan <[email protected]> Cc: Baruch Siach <[email protected]> Cc: "Maciej W. Rozycki" <[email protected]> Cc: "Uwe Kleine-König" <[email protected]> Cc: Pat Gefre <[email protected]> Cc: "Guilherme G. Piccoli" <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Vladimir Zapolskiy <[email protected]> Cc: Sylvain Lemieux <[email protected]> Cc: Carlo Caione <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: Liviu Dudau <[email protected]> Cc: Sudeep Holla <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Andy Gross <[email protected]> Cc: David Brown <[email protected]> Cc: "Andreas Färber" <[email protected]> Cc: Kevin Cernekee <[email protected]> Cc: Laxman Dewangan <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Jonathan Hunter <[email protected]> Cc: Barry Song <[email protected]> Cc: Patrice Chotard <[email protected]> Cc: Maxime Coquelin <[email protected]> Cc: Alexandre Torgue <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Peter Korsgaard <[email protected]> Cc: Timur Tabi <[email protected]> Cc: Tony Prisk <[email protected]> Cc: Michal Simek <[email protected]> Cc: "Sören Brinkmann" <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Kate Stewart <[email protected]> Cc: Philippe Ombredanne <[email protected]> Cc: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-11-04serial: sccnxp: Convert timers to use timer_setup()Kees Cook1-4/+3
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Jiri Slaby <[email protected]> Cc: [email protected] Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-09-18serial: sccnxp: Fix error handling in sccnxp_probe()Alexey Khoroshilov1-2/+11
sccnxp_probe() returns result of regulator_disable() that may lead to returning zero, while device is not properly initialized. Also the driver enables clocks, but it does not disable it. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-06-03Fix serial console on SNI RM400 machinesThomas Bogendoerfer1-5/+10
sccnxp driver doesn't get the correct uart clock rate, if CONFIG_HAVE_CLOCK is disabled. Correct usage of clk API to make it work with/without it. Fixes: 90efa75f7ab0 (serial: sccnxp: Using CLK API for getting UART clock) Suggested-by: Russell King - ARM Linux <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-10-20tty: serial: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <[email protected]>
2014-07-09serial: treewide: Remove empty implementations of enable_ms()Alexander Shiyan1-6/+0
Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-06-19serial: Fix IGNBRK handlingPeter Hurley1-1/+1
If IGNBRK is set without either BRKINT or PARMRK set, some uart drivers send a 0x00 byte for BREAK without the TTYBREAK flag to the line discipline, when it should send either nothing or the TTYBREAK flag set. This happens because the read_status_mask masks out the BI condition, which uart_insert_char() then interprets as a normal 0x00 byte. SUS v3 is clear regarding the meaning of IGNBRK; Section 11.2.2, General Terminal Interface - Input Modes, states: "If IGNBRK is set, a break condition detected on input shall be ignored; that is, not put on the input queue and therefore not read by any process." Fix read_status_mask to include the BI bit if IGNBRK is set; the lsr status retains the BI bit if a BREAK is recv'd, which is subsequently ignored in uart_insert_char() when masked with the ignore_status_mask. Affected drivers: 8250 - all serial_txx9 mfd amba-pl010 amba-pl011 atmel_serial bfin_uart dz ip22zilog max310x mxs-auart netx-serial pnx8xxx_uart pxa sb1250-duart sccnxp serial_ks8695 sirfsoc_uart st-asc vr41xx_siu zs sunzilog fsl_lpuart sunsab ucc_uart bcm63xx_uart sunsu efm32-uart pmac_zilog mpsc msm_serial m32r_sio Unaffected drivers: omap-serial rp2 sa1100 imx icom Annotated for fixes: altera_uart mcf Drivers without break detection: 21285 xilinx-uartps altera_jtaguart apbuart arc-uart clps711x max3100 uartlite msm_serial_hs nwpserial lantiq vt8500_serial Unknown: samsung mpc52xx_uart bfin_sport_uart cpm_uart/core Fixes: Bugzilla #71651, '8250_core.c incorrectly handles IGNBRK flag' Reported-by: Ivan <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-05-28serial: sccnxp: Add IGNPAR flag handlingAlexander Shiyan1-0/+2
This patch add IGNPAR flag handling for the driver. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-05-28serial: sccnxp: Remove useless timer_pending() checkAlexander Shiyan1-3/+1
sccnxp_timer() is triggered only by timer, so there are no need to check for timer_pending(). Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: sccnxp: missing uart_unregister_driver() on error in sccnxp_probe()Wei Yongjun1-0/+1
Add the missing uart_unregister_driver() before return from sccnxp_probe() in the error handling case. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-02Revert "serial: sccnxp: Add DT support"Greg Kroah-Hartman1-37/+9
This reverts commit 85c996907473e4ef824774b97b26499adf66521f. Alexander wishes to remove this patch as it is incorrect. Reported-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-31serial: sccnxp: Add DT supportAlexander Shiyan1-9/+37
Add DT support to the SCCNCP serial driver. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-31serial: sccnxp: Using structure for each supported IC instead of switch in probeAlexander Shiyan1-148/+124
This patch replaces switch in probe function to constant structure for each supported IC. This makes code a bit smaller and cleaner and helps adding DT support to the driver in the future. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-31serial: sccnxp: Using CLK API for getting UART clockAlexander Shiyan1-14/+22
This patch removes "frequency" parameter from SCCNXP platform_data and uses CLK API for getting clock. If CLK ommited, default IC frequency will be used instead. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-31serial: sccnxp: Disable regulator on errorAlexander Shiyan1-22/+18
The patch disables the regulator in case of errors, if we have it. In addition, the patch adds support for deferred regulator probe and makes error path are a bit clean. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-07-26serial: remove unnecessary platform_set_drvdata()Jingoo Han1-3/+0
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <[email protected]> Acked-by: Barry Song <[email protected]> Acked-by: Tony Prisk <[email protected]> Acked-by: Shawn Guo <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-04-15serial: sccnxp: Replace pdata.init/exit with regulator APIAlexander Shiyan1-6/+15
Typical usage of pdata.init/exit is enable/disable power and/or toggle reset for the target chip. This patch replaces these callbacks with regulator API. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-04-15serial: sccnxp: Do not override device nameAlexander Shiyan1-2/+0
Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-02-21Merge tag 'tty-3.9-rc1' of ↵Linus Torvalds1-58/+113
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial patches from Greg Kroah-Hartman: "Here's the big tty/serial driver patches for 3.9-rc1. More tty port rework and fixes from Jiri here, as well as lots of individual serial driver updates and fixes. All of these have been in the linux-next tree for a while." * tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (140 commits) tty: mxser: improve error handling in mxser_probe() and mxser_module_init() serial: imx: fix uninitialized variable warning serial: tegra: assume CONFIG_OF TTY: do not update atime/mtime on read/write lguest: select CONFIG_TTY to build properly. ARM defconfigs: add missing inclusions of linux/platform_device.h fb/exynos: include platform_device.h ARM: sa1100/assabet: include platform_device.h directly serial: imx: Fix recursive locking bug pps: Fix build breakage from decoupling pps from tty tty: Remove ancient hardpps() pps: Additional cleanups in uart_handle_dcd_change pps: Move timestamp read into PPS code proper pps: Don't crash the machine when exiting will do pps: Fix a use-after free bug when unregistering a source. pps: Use pps_lookup_dev to reduce ldisc coupling pps: Add pps_lookup_dev() function tty: serial: uartlite: Support uartlite on big and little endian systems tty: serial: uartlite: Fix sparse and checkpatch warnings serial/arc-uart: Miscll DT related updates (Grant's review comments) ... Fix up trivial conflicts, mostly just due to the TTY config option clashing with the EXPERIMENTAL removal.
2013-01-22serial: Convert to devm_ioremap_resource()Thierry Reding1-4/+4
Convert all uses of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages so all explicit error messages can be removed from the failure code paths. Signed-off-by: Thierry Reding <[email protected]> Cc: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-21serial: sccnxp: Make baudrate table struct staticAlexander Shiyan1-4/+2
This struct is used only for driver, so it should be static. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-21serial: sccnxp: Reset break and overrun bits in RX handlerAlexander Shiyan1-1/+6
This patch adds a hardware reset the break and overflow bits for these events. Without resetting the bits they will be reported to the core every time, when once occur. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-17serial: sccnxp: Fix possible crash if no platform data suppliedAlexander Shiyan1-2/+2
This patch fix possible kernel crash if no platform data supplied. We should not use platform data in this case, instead we will use default values from private driver structure. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-15serial: sccnxp: Rename header file to match functionalityAlexander Shiyan1-1/+1
Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-15serial: sccnxp: Implement polling modeAlexander Shiyan1-45/+103
This patch adds support for polling work mode, i.e. system is perform periodical check chip status when IRQ-line is not connected to CPU. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-01-15TTY: switch tty_flip_buffer_pushJiri Slaby1-7/+1
Now, we start converting tty buffer functions to actually use tty_port. This will allow us to get rid of the need of tty in many call sites. Only tty_port will needed and hence no more tty_port_tty_get in those paths. Now, the one where most of tty_port_tty_get gets removed: tty_flip_buffer_push. IOW we also closed all the races in drivers not using tty_port_tty_get at all yet. Also we move tty_flip_buffer_push declaration from include/linux/tty.h to include/linux/tty_flip.h to all others while we are changing it anyway. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-21tty: remove use of __devexitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Jiri Slaby <[email protected]> Cc: Alan Cox <[email protected]> Acked-by: Tobias Klauser <[email protected]> Cc: Lucas Tavares <[email protected]> Cc: Daniel Walker <[email protected]> Cc: Bryan Huntsman <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Peter Korsgaard <[email protected]> Cc: Tony Prisk <[email protected]> Acked-by: David Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-21tty: remove use of __devinitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Jiri Slaby <[email protected]> Cc: Alan Cox <[email protected]> Cc: Lucas Tavares <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Peter Korsgaard <[email protected]> Cc: Tony Prisk <[email protected]> Acked-by: Tobias Klauser <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-21tty: serial: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Alan Cox <[email protected]> Cc: Lucas Tavares <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Peter Korsgaard <[email protected]> Cc: Tony Prisk <[email protected]> Acked-by: Tobias Klauser <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-10-05tty: serial: sccnxp: Fix bug with unterminated platform_id listGreg Kroah-Hartman1-0/+1
The build even tells you that this is a bad thing: drivers/tty/serial/sccnxp: struct platform_device_id is 32 bytes. The last of 8 is: 0x73 0x63 0x36 0x38 0x36 0x39 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x54 0x0c 0x01 0x00 0x00 0x00 0x00 0x00 FATAL: drivers/tty/serial/sccnxp: struct platform_device_id is not terminated with a NULL entry! So fix this problem up before someone oopses their box when loading the driver, as this breaks the build. Cc: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-26serial: sccnxp: Make 'default' choice in switch lastAlexander Shiyan1-1/+1
Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-26serial: sccnxp: Remove mask termios caps for SW flow controlAlexander Shiyan1-1/+0
The kernel will handle IXON/IXOFF/IXANY in software if the hardware doesn't do it. Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-26serial: sccnxp: Report actual baudrate back to coreAlexander Shiyan1-4/+10
Signed-off-by: Alexander Shiyan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-06serial: serial_core.h needs console.h included firstStephen Rothwell1-1/+1
Fixes these build errors: In file included from drivers/tty/serial/sccnxp.c:20:0: include/linux/serial_core.h: In function 'uart_handle_break': include/linux/serial_core.h:543:30: error: dereferencing pointer to incomplete type Signed-off-by: Stephen Rothwell <[email protected]> Acked-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-05serial: New serial driver SCCNXPAlexander Shiyan1-0/+985
This driver is a replacement for a SC26XX driver with a lot of improvements and new features. The main differences from the SC26XX driver: - Removed dependency on MIPS. Driver can be used on any platform. - Added support for SCC2681, SCC2691, SCC2692, SC28L91, SC28L92, SC28L202, SCC68681 and SCC68692 ICs. - Using devm_-related functions. - Improved error handling of serial port, improved FIFO handling. - Ability to load multiple instances of drivers. To avoid the possibility of regression, driver SC26XX left in the system to confirm the stability of the driver on platforms where it is being used. Signed-off-by: Alexander Shiyan <[email protected]> Acked-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>