summaryrefslogtreecommitdiffstats
path: root/drivers/tty (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * serial: 8250_exar: Don't use "proxy" headersAndy Shevchenko2024-03-021-5/+9
| | | | | | | | | | | | | | | | | | Update header inclusions to follow IWYU (Include What You Use) principle. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240219150627.2101198-8-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial: 8250_exar: Use 8250 PCI library to map and assign resourcesAndy Shevchenko2024-03-022-5/+7
| | | | | | | | | | | | | | | | | | | | 8250 PCI library provides a common code to map and assign resources. Use it in order to deduplicate existing code and support IO port variants. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240219150627.2101198-7-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial: 8250_exar: switch to DEFINE_SIMPLE_DEV_PM_OPS()Andy Shevchenko2024-03-021-4/+5
| | | | | | | | | | | | | | | | | | | | SIMPLE_DEV_PM_OPS() is deprecated, replace it with DEFINE_SIMPLE_DEV_PM_OPS() and use pm_sleep_ptr() for setting the driver's PM routines. We can now remove the __maybe_unused qualifier in the suspend and resume functions. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240219150627.2101198-6-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial: 8250_exar: Use generic function to set firmware nodeAndy Shevchenko2024-03-021-2/+2
| | | | | | | | | | | | | | | | Use generic function to set firmware node instead of ACPI specific one. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240219150627.2101198-5-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial: 8250_exar: Clear interrupts before registering handlerAndy Shevchenko2024-03-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | While now there is no issue if IRQ is fired before we clearing the interrupts as the handler does the same, but strictly speaking it might be problematic if IRQ handler wants to do something more. Move clearing interrupt code to be called before registering the IRQ handler. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240219150627.2101198-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial: 8250_exar: Use dev_get_drvdata() directly in PM callbacksAndy Shevchenko2024-03-021-2/+1
| | | | | | | | | | | | | | | | | | | | PM callbacks take struct device pointer as a parameter, use dev_get_drvdata() to retrieve it instead of unneeded double loop of referencing via pci_get_drvdata(to_pci_dev(dev)). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240219150627.2101198-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial: 8250_exar: Don't remove GPIO device on suspendAndy Shevchenko2024-03-021-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | It seems a copy&paste mistake that suspend callback removes the GPIO device. There is no counterpart of this action, means once suspended there is no more GPIO device available untile full unbind-bind cycle is performed. Remove suspicious GPIO device removal in suspend. Fixes: d0aeaa83f0b0 ("serial: exar: split out the exar code from 8250_pci") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240219150627.2101198-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * Merge 6.8-rc6 into tty-nextGreg Kroah-Hartman2024-02-273-34/+38
| |\ | | | | | | | | | | | | | | | We need the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: pmac_zilog: Convert to platform remove callback returning voidUwe Kleine-König2024-02-191-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Note that pmz_detach() is only called once pmz_attach() was successfully called. In that case platform_set_drvdata() was called and so platform_get_drvdata() won't return NULL. This allows to drop the respective check and so get rid of the only error path in pmz_detach(). After that the driver can be trivially converted from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/90b9a65ad8800b4d047aa5219959008a01588a94.1708246007.git.u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: goldfish: Convert to platform remove callback returning voidUwe Kleine-König2024-02-191-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/60d0657daf8f4f9e2e3e282941ba542f08dc7f96.1708246007.git.u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: amiserial: Convert to platform remove callback returning voidUwe Kleine-König2024-02-191-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/f2ad92c97086c42dab23cdb165d9f978bbf3d3b5.1708246007.git.u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | Merge 6.8-rc5 into tty-nextGreg Kroah-Hartman2024-02-192-2/+5
| |\ \ | | | | | | | | | | | | | | | | | | | | We need the serial/tty fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: Don't include tty_buffer.h in tty.hIlpo Järvinen2024-02-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need to include linux/tty_buffer.h in linux/tty.h. Move the include into tty_buffer.c that is actually using it. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20240215111538.1920-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: 8250_of: Drop quirk fot NPCM from 8250_portAndy Shevchenko2024-02-182-26/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are not supposed to spread quirks in 8250_port module especially when we have a separate driver for the hardware in question. Move quirk from generic module to the driver that uses it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20240215145029.581389-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: jsm: Remove redundant assignment to variable linestatusColin Ian King2024-02-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The variable linestate being assigned a value that is never read, the following continue statement jumps to the end of the while-loop and then it is re-assigned a new value. The assignment is redundant and can be removed. Cleans up clang scan build warning: drivers/tty/serial/jsm/jsm_cls.c:398:4: warning: Value stored to 'linestatus' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20240216121732.2106445-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: lpc32xx_hs: remove redundant check and assignment of hsu_rateColin Ian King2024-02-181-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Variable hsu_rate is being checked for an upper limit and is assigned a value that is never read. The if statement and assignment are redundant and can be removed. Cleans up clang scan build warning: drivers/tty/serial/lpc32xx_hs.c:237:3: warning: Value stored to 'hsu_rate' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20240215232944.2075789-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: 8250_bcm7271: Replace custom unit definitionsAndy Shevchenko2024-02-181-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace custom unit definitions that are available via units.h. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20240215160234.653305-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: 8250_pci1xxxx: Don't use "proxy" headersAndy Shevchenko2024-02-171-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update header inclusions to follow IWYU (Include What You Use) principle. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240213193827.3207353-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: hvc-iucv: fix function pointer castsArnd Bergmann2024-02-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang warns about explicitly casting between incompatible function pointers: drivers/tty/hvc/hvc_iucv.c:1100:23: error: cast from 'void (*)(const void *)' to 'void (*)(struct device *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 1100 | priv->dev->release = (void (*)(struct device *)) kfree; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Add a separate function to handle this correctly. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240213101756.461701-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty/vt: Corrected doc of vc_sanitize_unicode(), vc_translate_unicode()Roman Žilka2024-02-171-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Corrected the doc of vc_sanitize_unicode() and vc_translate_unicode(), tightly coupled functions which parse UTF-8 byte sequences. 1. Desc. of @rescan corresponded to the meaning of the return value -1. Corrected + added "Return:" section. 2. Replaced the ambiguous "character" with "code point" or "byte". Signed-off-by: Roman Žilka <roman.zilka@gmail.com> Link: https://lore.kernel.org/r/bee9faa8-0ea7-4411-bf77-3cb2e06385c7@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: decrypt magic constants in vc_is_control()Jiri Slaby (SUSE)2024-02-061-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0x0d00ff81 and 0x0800f501 are bitmasks of ASCII characters. Spell them explicitly using BIT() + ASCII constants. GENMASK() is used for the 9-bit range in CTRL_ACTION. This also modifies the 'if' checking if the masks should be applied. >From a "random" ' ' to the actual size of the bitmasks' type. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-23-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: use ASCII enum constants in vt_console_print()Jiri Slaby (SUSE)2024-02-061-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are still numbers used for ASCII characters in vt_console_print(). As we have an ASCII enum now, use the constant names from the enum instead. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-22-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: use switch+case in the ESgetpars caseJiri Slaby (SUSE)2024-02-061-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To be uniform in the 'c' handling, use switch-case (with ranges) even in the ESgetpars case in do_con_trol(). Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-21-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: use switch+case in the ESnonstd caseJiri Slaby (SUSE)2024-02-061-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To be uniform in the 'c' handling, use switch-case (with ranges) even in the ESnonstd case in do_con_trol(). Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-20-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: add new helper for reseting vc parametersJiri Slaby (SUSE)2024-02-061-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code to reset the vc parameter parsing is repeated on two locations. Create a helper vc_reset_params() and use it on both of them. And instead of a 'for' loop to clear the array of parameters, use simpler memset(). Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-19-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: handle CSI+[ inside preexisting switch-caseJiri Slaby (SUSE)2024-02-061-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In do_con_trol()'s ESsquare case, there is already a switch (c). It is preceded by an 'if (c == '[')'. Despite this 'if' handles a state transition and not a modifier, move it as one of the switch cases. This makes all the 'c' decision making more obvious there. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-18-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: simplify ansi_control_string()Jiri Slaby (SUSE)2024-02-061-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given all the ANSI control states are sequential in the vc_ctl_state enum, we can define first/last constants and use them in ansi_control_string(). It makes the test simple and allows for removal of the 'if' (which was unnecessary at all -- the 'return' should have returned the 'if' content directly anyway). And remove the useless comment -- it's clear from the function prototype. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-17-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: name, reflow and document enum vc_ctl_stateJiri Slaby (SUSE)2024-02-061-17/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The enum for states is currently compact and undocumented. Put each definition on a separate line and document them all using kernel-doc. Document the same on the use sites. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-16-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: move CSI ECMA handling to a separate functionJiri Slaby (SUSE)2024-02-061-130/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to previous moves, move also "CSI ..." (i.e. vc_priv == EPecma) handling to a separate function. This is the last large move of code out of do_con_trol(). And despite it is still 151 lines of code (down from 407!), it is now quite easy to folllow the transitions of the state machine in there. ESnonstd and ESpalette handling still can be moved away, but it won't improve that much. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-15-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: move CSI DEC handling to a separate functionJiri Slaby (SUSE)2024-02-061-31/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The handling of "CSI ? ..." (i.e. vc_priv == EPdec) can be easily moved out of do_con_trol() into a separate function. This again increases readability of do_con_trol(). Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-14-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: separate ESesc state handling into handle_esc()Jiri Slaby (SUSE)2024-02-061-62/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to the ASCII handling, the ESC handling can be easily moved away from do_con_trol(). So create a new handle_esc() for that. And add a comment with an example. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-13-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: extract ascii handling to handle_ascii()Jiri Slaby (SUSE)2024-02-061-21/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make the do_con_trol() a bit more understandable, extract the ASCII handling (the switch-case) to a separate function. Other nested switch-cases will follow in the next patches. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-12-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: accept u8 in do_con_trol() and vc_setGx()Jiri Slaby (SUSE)2024-02-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions expect u8 as the control character. Switch the type from 'int' appropriately. The caller passing the value (do_con_write()) is fixed as well. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-11-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: put cases on separate linesJiri Slaby (SUSE)2024-02-061-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some cases of the CSI switch are stuffed on one line. Put them all to a separate line as is dictated by the coding style (and for better readability). Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-10-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: rename setterm_command() to csi_RSB()Jiri Slaby (SUSE)2024-02-061-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It follows naming of other similar functions. RSB stands here for Right Square Bracket as (obviously) ']' cannot be in the function name. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-9-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: define an enum for CSI+] codesJiri Slaby (SUSE)2024-02-061-11/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decrypt the constant values by proper enum names. This time in setterm_command() (to be renamed to csi_RSB() in the next patches). Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-8-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: move CSI+n handling along to other ECMA CSIsJiri Slaby (SUSE)2024-02-061-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CSIs without [<=>?] modifiers (ECMA) are handled in the switch-case below this DEC switch+case handler. So move this ECMA CSI+n there too as it fits there better. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-7-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: remove unneeded assignment of EPecma to vc_privJiri Slaby (SUSE)2024-02-061-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vc_data::vc_priv is _always_ assigned before the ESgetpars case is entered (in ESsquare). Therefore, there is no need to reset it when leaving the ESgetpars case. Note the state is set to ESnormal few lines above, so ESgetpars is entered only by the next CSI. Therefore, this obfuscation can be removed. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-6-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: split DEC CSI+h/l handling into csi_DEC_hl()Jiri Slaby (SUSE)2024-02-061-67/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DEC and ECMA handling of CSI+h/l is needlessly complicated. Split these two, so that DEC is handled when the state is EPdec ('CSI ?' was seen) and ECMA is handled in the EPecma state (no '?'). Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-5-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: rename set_mode() to csi_hl()Jiri Slaby (SUSE)2024-02-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's how the other CSI handling functions are named, so unify to that. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-4-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: define enums for CSI+h/l codesJiri Slaby (SUSE)2024-02-061-12/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decrypt the constant values by proper enum names. This time in set_mode(). Define two of them as DEC ('CSI ?') is about to be split away in the next patches. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-3-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: vt: make rgb_from_256() slighly more comprehensibleJiri Slaby (SUSE)2024-02-061-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * make the parameter unsigned, as it is expected to be unsigned, * make the computation easier to follow -- step-by-step, and * don't use 85 / 2 which is only a reduced form of 255 / 6 (by a factor 3). Unlike the former, the latter can be understood. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-2-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: core: make serial_base_bus_type constRicardo B. Marliere2024-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the driver core can properly handle constant struct bus_type, move the serial_base_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net> Link: https://lore.kernel.org/r/20240203-bus_cleanup-tty-v1-2-86b698c82efe@marliere.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serdev: make serdev_bus_type constRicardo B. Marliere2024-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the driver core can properly handle constant struct bus_type, move the serdev_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net> Link: https://lore.kernel.org/r/20240203-bus_cleanup-tty-v1-1-86b698c82efe@marliere.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: serial: samsung: Remove superfluous braces in macroSam Protsenko2024-02-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 59f37b7370ef ("tty: serial: samsung: Remove USI initialization") removes parameters from EXYNOS_COMMON_SERIAL_DRV_DATA() macro, but leaves unnecessary empty braces. Remove those to fix the style. No functional change. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240202010507.22638-1-semen.protsenko@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | Revert "tty: serial: amba-pl011: Remove QDF2xxx workarounds"Konrad Dybcio2024-02-061-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original commit assumed this hardware is long rotting in the junkyards, but apparently Qualcomm is still using some of these old servers internally and the thing can still run upstream. Adding insult to injury, I apparently managed to overdelete code and broke non-QDF2xxx platforms [1]. Revert the removal to keep things going, at least for now. This reverts commit 196f34af2bf4c87ac4299a9775503d81b446980c. [1] https://lore.kernel.org/lkml/20240131213543.958051-1-m.szyprowski@samsung.com/ Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Tested-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20240201-topic-qdf24xx_is_back_apparently-v1-1-edb112a2ef90@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | Merge 6.8-rc3 into tty-nextGreg Kroah-Hartman2024-02-043-13/+46
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | We need the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | | tty: serial: uartps: Add rs485 support to uartps driverManikanta Guntupalli2024-01-281-4/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add rs485 support to uartps driver. Use either rts-gpios or RTS to control RS485 phy as driver or a receiver. Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com> Link: https://lore.kernel.org/r/20240123061655.2150946-4-manikanta.guntupalli@amd.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | | tty: serial: uartps: Relocate cdns_uart_tx_empty to facilitate rs485Manikanta Guntupalli2024-01-281-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Relocate cdns_uart_tx_empty function to avoid prototype statement in rs485 changes. Update return check with uart_tx_stopped() in cdns_uart_handle_tx(). Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com> Link: https://lore.kernel.org/r/20240123061655.2150946-3-manikanta.guntupalli@amd.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | | 8250: microchip: Add 4 Mbps support in PCI1XXXX UARTRengarajan S2024-01-282-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current clock input is set to 62.5 MHz for supporting fractional divider, which enables generation of an acceptable baud rate from any frequency. With the current clock input the baud rate range is limited to 3.9 Mbps. Hence, the current range is extended to support 4 Mbps with Burst mode operation. Divisor calculation for a given baud rate is updated as the sampling rate is reduced from 16 to 8 for 4 Mbps. Signed-off-by: Rengarajan S <rengarajan.s@microchip.com> Link: https://lore.kernel.org/r/20240125100619.154873-1-rengarajan.s@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>