1fb76cd81SFrançois Tigeot /* 2056b029cSFrançois Tigeot * Copyright (c) 2015-2020 François Tigeot <ftigeot@wolfpond.org> 3fb76cd81SFrançois Tigeot * All rights reserved. 4fb76cd81SFrançois Tigeot * 5fb76cd81SFrançois Tigeot * Redistribution and use in source and binary forms, with or without 6fb76cd81SFrançois Tigeot * modification, are permitted provided that the following conditions 7fb76cd81SFrançois Tigeot * are met: 8fb76cd81SFrançois Tigeot * 1. Redistributions of source code must retain the above copyright 9fb76cd81SFrançois Tigeot * notice unmodified, this list of conditions, and the following 10fb76cd81SFrançois Tigeot * disclaimer. 11fb76cd81SFrançois Tigeot * 2. Redistributions in binary form must reproduce the above copyright 12fb76cd81SFrançois Tigeot * notice, this list of conditions and the following disclaimer in the 13fb76cd81SFrançois Tigeot * documentation and/or other materials provided with the distribution. 14fb76cd81SFrançois Tigeot * 15fb76cd81SFrançois Tigeot * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16fb76cd81SFrançois Tigeot * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17fb76cd81SFrançois Tigeot * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18fb76cd81SFrançois Tigeot * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19fb76cd81SFrançois Tigeot * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20fb76cd81SFrançois Tigeot * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21fb76cd81SFrançois Tigeot * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22fb76cd81SFrançois Tigeot * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23fb76cd81SFrançois Tigeot * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24fb76cd81SFrançois Tigeot * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25fb76cd81SFrançois Tigeot */ 26fb76cd81SFrançois Tigeot 27fb76cd81SFrançois Tigeot #ifndef _LINUX_FB_H_ 28fb76cd81SFrançois Tigeot #define _LINUX_FB_H_ 29fb76cd81SFrançois Tigeot 30056b029cSFrançois Tigeot #include <linux/kgdb.h> 3183b4b9b9SFrançois Tigeot #include <uapi/linux/fb.h> 324281e57dSFrançois Tigeot 33fe1d53e2SFrançois Tigeot #include <linux/fs.h> 3483b4b9b9SFrançois Tigeot #include <linux/init.h> 3583b4b9b9SFrançois Tigeot #include <linux/workqueue.h> 36fe1d53e2SFrançois Tigeot #include <linux/notifier.h> 37fe1d53e2SFrançois Tigeot #include <linux/list.h> 38fb76cd81SFrançois Tigeot #include <linux/backlight.h> 3983b4b9b9SFrançois Tigeot #include <asm/io.h> 40fb76cd81SFrançois Tigeot 41233d54adSImre Vadász #include <machine/framebuffer.h> 42233d54adSImre Vadász 43*1e12ee3bSFrançois Tigeot struct videomode; 44*1e12ee3bSFrançois Tigeot 459edbd4a0SFrançois Tigeot #define KHZ2PICOS(a) (1000000000UL/(a)) 469edbd4a0SFrançois Tigeot 471dedbd3bSFrançois Tigeot struct apertures_struct { 481dedbd3bSFrançois Tigeot unsigned int count; 491dedbd3bSFrançois Tigeot struct aperture { 501dedbd3bSFrançois Tigeot resource_size_t base; 511dedbd3bSFrançois Tigeot resource_size_t size; 521dedbd3bSFrançois Tigeot } ranges[0]; 531dedbd3bSFrançois Tigeot }; 541dedbd3bSFrançois Tigeot 551dedbd3bSFrançois Tigeot extern int remove_conflicting_framebuffers(struct apertures_struct *a, 561dedbd3bSFrançois Tigeot const char *name, bool primary); 571dedbd3bSFrançois Tigeot 581dedbd3bSFrançois Tigeot extern void fb_set_suspend(struct fb_info *info, int state); 591dedbd3bSFrançois Tigeot 60ba55f2f5SFrançois Tigeot extern int fb_get_options(const char *name, char **option); 61ba55f2f5SFrançois Tigeot 621b13d190SFrançois Tigeot #define FBINFO_STATE_RUNNING 0 631b13d190SFrançois Tigeot 641dedbd3bSFrançois Tigeot struct device_node; 651dedbd3bSFrançois Tigeot 663f122055SFrançois Tigeot struct fb_info * framebuffer_alloc(size_t size, struct device *dev); 673f122055SFrançois Tigeot void framebuffer_release(struct fb_info *info); 683f122055SFrançois Tigeot 69fb76cd81SFrançois Tigeot #endif /* _LINUX_FB_H_ */ 70