diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-08-24 08:46:03 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-08-24 08:46:03 -0700 |
| commit | cf9610f9116d55c5a66ef9f1faecacabd93a9322 (patch) | |
| tree | 757a3d280760c654767631cab5ad8af2d86d1848 /drivers/video/cmdline.c | |
| download | linux-stable-cf9610f9116d55c5a66ef9f1faecacabd93a9322.tar.gz linux-stable-cf9610f9116d55c5a66ef9f1faecacabd93a9322.zip | |
Merge tag 'pinctrl-v7.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrlgrafted
Pull pin control updates from Linus Walleij:
"Core changes:
- Use the non-blocking mux_state_try_select() in the generic MUX pin
control back-end
- Free pin maps on pinctrl_generic_to_map() failure in the core
helpers
New hardware pin control:
- Qualcomm Maili TLMM SoC, PMG1110 PMIC, and Eliza LPASS LPI TLMM SoC
(this is for the low power audio, LPASS = Low Power Audio SubSystem
portions)
- Upboard support on top of the Intel pin controller
- Apple T6030 and T6031 support (just compatible strings)
- Samsung Exynos 8855 SoC
- Mediatek MT6858 SoC
- Rockchip RK3308B and RV1106 SoCs
- Airoha EN7523 and AN7563 SoCs
Improvements:
- Qualcomm TLMM GPIOs are unconditionally marked as wakeup capable
- Qualcomm improvements on top of the Qualcomm PDC (power domain
controller) irqchip improvements from tglx:s tree
- Qualcomm IPQ806x and IPQ9650 non-urgent pin grop fixups
- The NPCM8xx driver has been put into shape fixing many pin and
group definitions
- Some non-urgent Tegra 264 pin assignments are fixed up
- Some non-urgent fixups to Airoha AN7581 and AN7583 registers and
pin assignments, missing features etc"
* tag 'pinctrl-v7.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (130 commits)
dt-bindings: pinctrl: Convert TI DA850 pupd to DT schema
pinctrl: meson: sync some modify from A4
pinctrl: meson: a4: Add input enable pin configuration
pinctrl: realtek: rtd1625: remove unused group name spdif_sel
pinctrl: realtek: rtd1625: fix base_bit for VE4 GPIO 13
dt-bindings: pinctrl: microchip,pic32mzda-pinctrl: Convert to DT schema
Revert "Merge branch 'ib-rsk7204' into devel"
pinctrl: rockchip: Add RV1106 pinctrl support
dt-bindings: pinctrl: rockchip: Add RV1106 compatible
pinctrl: rockchip: Decode drive strength in the get function
pinctrl: fix PINCTRL_GENERIC_MUX not always being selectable
pinctrl: airoha: add support of an7563 SoC
dt-bindings: pinctrl: airoha: add support of an7563 pin controller
pinctrl: airoha: try to find chip scu node by phandle first
pinctrl: airoha: add support of en7523 SoC
dt-bindings: pinctrl: airoha: add support of en7523 pin controller
pinctrl: airoha: an7583: add support for olt pinmux
pinctrl: airoha: an7583: add support for pon_alt pinmux
pinctrl: airoha: an7583: add support for npu_uart pinmux
dt-bindings: pinctrl: airoha: an7583: add missed features
...
Diffstat (limited to 'drivers/video/cmdline.c')
| -rw-r--r-- | drivers/video/cmdline.c | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/drivers/video/cmdline.c b/drivers/video/cmdline.c new file mode 100644 index 000000000..49ee3fb49 --- /dev/null +++ b/drivers/video/cmdline.c @@ -0,0 +1,135 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Based on the fbdev code in drivers/video/fbdev/core/fb_cmdline: + * + * Copyright (C) 2014 Intel Corp + * Copyright (C) 1994 Martin Schaller + * + * 2001 - Documented with DocBook + * - Brad Douglas <brad@neruo.com> + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + * + * Authors: + * Daniel Vetter <daniel.vetter@ffwll.ch> + */ + +#include <linux/fb.h> /* for FB_MAX */ +#include <linux/init.h> + +#include <video/cmdline.h> + +/* + * FB_MAX is the maximum number of framebuffer devices and also + * the maximum number of video= parameters. Although not directly + * related to each other, it makes sense to keep it that way. + */ +static const char *video_options[FB_MAX] __read_mostly; +static const char *video_option __read_mostly; +static int video_of_only __read_mostly; + +static const char *__video_get_option_string(const char *name) +{ + const char *options = NULL; + size_t name_len = 0; + + if (name) + name_len = strlen(name); + + if (name_len) { + unsigned int i; + const char *opt; + + for (i = 0; i < ARRAY_SIZE(video_options); ++i) { + if (!video_options[i]) + continue; + if (video_options[i][0] == '\0') + continue; + opt = video_options[i]; + if (!strncmp(opt, name, name_len) && opt[name_len] == ':') + options = opt + name_len + 1; + } + } + + /* No match, return global options */ + if (!options) + options = video_option; + + return options; +} + +/** + * video_get_options - get kernel boot parameters + * @name: name of the output as it would appear in the boot parameter + * line (video=<name>:<options>) + * + * Looks up the video= options for the given name. Names are connector + * names with DRM, or driver names with fbdev. If no video option for + * the name has been specified, the function returns the global video= + * setting. A @name of NULL always returns the global video setting. + * + * Returns: + * The string of video options for the given name, or NULL if no video + * option has been specified. + */ +const char *video_get_options(const char *name) +{ + return __video_get_option_string(name); +} +EXPORT_SYMBOL(video_get_options); + +#if IS_ENABLED(CONFIG_FB_CORE) +bool __video_get_options(const char *name, const char **options, bool is_of) +{ + bool enabled = true; + const char *opt = NULL; + + if (video_of_only && !is_of) + enabled = false; + + opt = __video_get_option_string(name); + + if (options) + *options = opt; + + return enabled; +} +EXPORT_SYMBOL(__video_get_options); +#endif + +/* + * Process command line options for video adapters. This function is + * a __setup and __init function. It only stores the options. Drivers + * have to call video_get_options() as necessary. + */ +static int __init video_setup(char *options) +{ + if (!options || !*options) + goto out; + + if (!strncmp(options, "ofonly", 6)) { + video_of_only = true; + goto out; + } + + if (strchr(options, ':')) { + /* named */ + size_t i; + + for (i = 0; i < ARRAY_SIZE(video_options); i++) { + if (!video_options[i]) { + video_options[i] = options; + break; + } + } + } else { + /* global */ + video_option = options; + } + +out: + return 1; +} +__setup("video=", video_setup); |
