• Thomas Zimmermann's avatar
    of: Create platform devices for OF framebuffers · 52b1b46c
    Thomas Zimmermann authored
    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: default avatarThomas Zimmermann <tzimmermann@suse.de>
    Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
    Reviewed-by: default avatarRob Herring <robh@kernel.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20220419100405.12600-2-tzimmermann@suse.de
    52b1b46c
offb.c 20.3 KB