From 11bb10b44b89c6c156a0113fefa24d366b4cf0db Mon Sep 17 00:00:00 2001 From: Maxim Poliakovski Date: Thu, 11 Jul 2024 02:36:01 +0200 Subject: [PATCH] Taos: cleanup GPIO pins. --- devices/video/taos.cpp | 3 ++- devices/video/taos.h | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/devices/video/taos.cpp b/devices/video/taos.cpp index c86e486..9fb8739 100644 --- a/devices/video/taos.cpp +++ b/devices/video/taos.cpp @@ -91,7 +91,8 @@ uint32_t TaosVideo::read(uint32_t rgn_start, uint32_t offset, int size) { case CRT_CTRL: return this->crt_ctrl; case GPIO_IN: - return ((this->mon_id << 29) | (vsync_active << 25)) & ~this->gpio_cfg; + return ((this->mon_id << GPIO_MONID) | (1 << GPIO_CDTRAY) | + (vsync_active << GPIO_VSYNC)) & ~this->gpio_cfg; case INT_ENABLES: return this->int_enables; case TAOS_VERSION: diff --git a/devices/video/taos.h b/devices/video/taos.h index d924a19..6c1a983 100644 --- a/devices/video/taos.h +++ b/devices/video/taos.h @@ -111,6 +111,13 @@ enum { MON_ID_VGA = 6 // GPIO_0 = "1", GPIO_1 = "1", GPIO_2 = "0" }; +/** Definitions for the GPIO pins. */ +enum { + GPIO_MONID = 29, // GPIO 0..2 are monitor identification pins + GPIO_CDTRAY = 27, // GPIO 4: "1" - CD-ROM tray is closed + GPIO_VSYNC = 25, // GPIO 6: vertical synch input (active low) +}; + /** Broktree Bt856 digital video encoder. */ class Bt856 : public I2CDevice, public HWComponent { public: