]> git.baikalelectronics.ru Git - kernel.git/commit
of: Create platform devices for OF framebuffers
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 19 Apr 2022 10:04:04 +0000 (12:04 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 20 Apr 2022 08:07:41 +0000 (10:07 +0200)
commit0896b392fc1436ccdfe2ee1d9268ae5fd227a2b0
tree9fc6b22bc42fd45bf8771a0ba8d023dea2d028b2
parent7ed68762537a061ded3bcbb7a0d6efecba8fd08c
of: Create platform devices for OF framebuffers

Create a platform device for each OF-declared framebuffer and have
offb bind to these devices. Allows for real hot-unplugging and other
drivers besides offb.

Originally, offb created framebuffer devices while initializing its
module by parsing the OF device tree. No actual Linux device was set
up. This tied OF framebuffers to offb and makes writing other drivers
for the OF framebuffers complicated. The absence of a Linux device
further prevented real hot-unplugging. Adding a distinct platform
device for each OF framebuffer solves both problems. Specifically, a
DRM driver can now provide graphics output for modern userspace.

Some of the offb init code is now located in the OF initialization.
There's now also an implementation of of_platform_default_populate_init(),
which was missing before. The OF side creates different devices for
either OF display nodes or BootX displays as they require different
handling by the driver. The offb drivers picks up each type of device
and runs the appropriate fbdev initialization.

Tested with OF display nodes on qemu's ppc64le target.

v3:
* declare variable 'node' with function scope (Rob)
v2:
* run PPC code as part of existing initialization (Rob)
* add a few more error warnings (Javier)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220419100405.12600-2-tzimmermann@suse.de
drivers/of/platform.c
drivers/video/fbdev/offb.c