OSDN Git Service

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)
commit52b1b46c39ae4321459a1a28dd4e596497b375b8
tree9fc6b22bc42fd45bf8771a0ba8d023dea2d028b2
parentac2f033aa4fbc94a512e703a953ed36e1bb45d0a
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