1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/pkg/devices/lcd/include/lcd-jz4780-spi-device.h Fri Apr 19 16:27:55 2024 +0200
1.3 @@ -0,0 +1,71 @@
1.4 +/*
1.5 + * LCD device support for the JZ4740 and related SoCs.
1.6 + *
1.7 + * Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk>
1.8 + *
1.9 + * This program is free software; you can redistribute it and/or
1.10 + * modify it under the terms of the GNU General Public License as
1.11 + * published by the Free Software Foundation; either version 2 of
1.12 + * the License, or (at your option) any later version.
1.13 + *
1.14 + * This program is distributed in the hope that it will be useful,
1.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.17 + * GNU General Public License for more details.
1.18 + *
1.19 + * You should have received a copy of the GNU General Public License
1.20 + * along with this program; if not, write to the Free Software
1.21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor,
1.22 + * Boston, MA 02110-1301, USA
1.23 + */
1.24 +
1.25 +#pragma once
1.26 +
1.27 +#include <l4/devices/lcd.h>
1.28 +#include <l4/devices/lcd-device.h>
1.29 +
1.30 +#include <l4/re/c/dma_space.h>
1.31 +#include <l4/re/c/video/view.h>
1.32 +#include <l4/sys/types.h>
1.33 +
1.34 +
1.35 +
1.36 +/* C++ language interface. */
1.37 +
1.38 +#ifdef __cplusplus
1.39 +
1.40 +/* Support for specific JZ4780-based devices. */
1.41 +
1.42 +class Lcd_jz4780_spi_device : public Lcd_device
1.43 +{
1.44 + /* DMA region providing the DMA descriptor virtual and physical addresses. */
1.45 +
1.46 + struct dma_region _desc_region;
1.47 +
1.48 +protected:
1.49 + /* Device-specific memory allocation. */
1.50 +
1.51 + int _setup_memory();
1.52 +
1.53 +public:
1.54 + Lcd_jz4780_spi_device(Activation *display)
1.55 + : Lcd_device(display)
1.56 + {
1.57 + _setup_memory();
1.58 + }
1.59 +
1.60 + /* Device operations. */
1.61 +
1.62 + void disable();
1.63 + void enable();
1.64 +
1.65 + l4_size_t get_framebuffer_size();
1.66 +
1.67 + void get_view_info(l4re_video_view_info_t *view_info);
1.68 +
1.69 + /* Common device instance. */
1.70 +
1.71 + static Lcd_jz4780_spi_device *device;
1.72 +};
1.73 +
1.74 +#endif