summaryrefslogtreecommitdiff
path: root/drivers/painter/gc9a01
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2023-03-20 14:13:53 +1100
committerGitHub <noreply@github.com>2023-03-20 14:13:53 +1100
commitcd94ba031c832266cca609951abc97eb52c90567 (patch)
tree09a8c6ca3814a082ee2e7fa8e5d860b622f58069 /drivers/painter/gc9a01
parentdfec6ac4719024c4068883287d1f1e1ce16d2079 (diff)
Quantum Painter QoL enhancements -- auto-poweroff, auto-flush, buffer sizing (#20013)
Diffstat (limited to 'drivers/painter/gc9a01')
-rw-r--r--drivers/painter/gc9a01/qp_gc9a01.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/painter/gc9a01/qp_gc9a01.c b/drivers/painter/gc9a01/qp_gc9a01.c
index 5d079435c6..56140fa50e 100644
--- a/drivers/painter/gc9a01/qp_gc9a01.c
+++ b/drivers/painter/gc9a01/qp_gc9a01.c
@@ -1,4 +1,5 @@
// Copyright 2021 Paul Cotter (@gr1mr3aver)
+// Copyright 2023 Nick Brassel (@tzarc)
// SPDX-License-Identifier: GPL-2.0-or-later
#include <wait.h>
@@ -141,6 +142,12 @@ painter_device_t qp_gc9a01_make_spi_device(uint16_t panel_width, uint16_t panel_
driver->spi_dc_reset_config.spi_config.mode = spi_mode;
driver->spi_dc_reset_config.dc_pin = dc_pin;
driver->spi_dc_reset_config.reset_pin = reset_pin;
+
+ if (!qp_internal_register_device((painter_device_t)driver)) {
+ memset(driver, 0, sizeof(tft_panel_dc_reset_painter_device_t));
+ return NULL;
+ }
+
return (painter_device_t)driver;
}
}