[PATCH master] video: ssd1307fb: set default mode
Ahmad Fatoum
a.fatoum at pengutronix.de
Thu Mar 20 13:30:57 PDT 2025
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 at 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
More information about the barebox
mailing list