1 /* 2 * LCD device support for the X1600. 3 * 4 * Copyright (C) 2018, 2023, 2024 Paul Boddie <paul@boddie.org.uk> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA 20 */ 21 22 #pragma once 23 24 #include <l4/devices/lcd.h> 25 #include <l4/devices/lcd-device.h> 26 27 #include <l4/re/c/dma_space.h> 28 #include <l4/re/c/video/view.h> 29 #include <l4/sys/types.h> 30 31 32 33 /* C++ language interface. */ 34 35 #ifdef __cplusplus 36 37 /* Support for specific JZ4780-based devices. */ 38 39 class Lcd_x1600_spi_device : public Lcd_device 40 { 41 /* DMA region providing the DMA descriptor virtual and physical addresses. */ 42 43 struct dma_region _desc_region; 44 45 protected: 46 /* Device-specific memory allocation. */ 47 48 int _setup_memory(); 49 50 public: 51 Lcd_x1600_spi_device(Activation *display) 52 : Lcd_device(display) 53 { 54 _setup_memory(); 55 } 56 57 /* Device operations. */ 58 59 void disable(); 60 void enable(); 61 62 l4_size_t get_framebuffer_size(); 63 64 void get_view_info(l4re_video_view_info_t *view_info); 65 66 /* Common device instance. */ 67 68 static Lcd_x1600_spi_device *device; 69 }; 70 71 #endif