* [PATCH master] video: ssd1307fb: set default mode
@ 2025-03-20 20:30 Ahmad Fatoum
0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2025-03-20 20:30 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
The framebuffer support will refuse modification of the fbX.enable
parameter if there are no modes. The ssd1307fb is the only driver
that has no provisions for populating modes and thus always runs
into this case.
The display is normally used as a small framebuffer console and the
frame buffer console support will call fb_enable sidestepping the check
in the device parameter, which caused the issue to fly under the radar
so far. If used without framebuffer console, however, the problem
becomes quickly apparent.
Reported-by: @jakthree:matrix.org
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/video/ssd1307fb.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c
index fb50e895c59a..5880f2b4a57a 100644
--- a/drivers/video/ssd1307fb.c
+++ b/drivers/video/ssd1307fb.c
@@ -77,6 +77,7 @@ struct ssd1307fb_par {
struct spi_device *spi;
u32 height;
struct fb_info *info;
+ struct fb_videomode mode;
u32 page_offset;
u32 prechargep1;
u32 prechargep2;
@@ -594,6 +595,11 @@ static int ssd1307fb_probe(struct device *dev)
if (ret)
goto reset_oled_error;
+ par->mode.xres = par->width;
+ par->mode.yres = par->height;
+ par->mode.name = "default";
+
+ info->mode = &par->mode;
info->dev.parent = dev;
ret = register_framebuffer(info);
if (ret) {
--
2.39.5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-03-20 20:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-20 20:30 [PATCH master] video: ssd1307fb: set default mode Ahmad Fatoum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox