drivers: display: remove dummy functions for unsupported API
As the display API now check against valid callback functions and
returns -ENOSYS (or equalent), there is no need to provide
such functions in the driver code
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
diff --git a/drivers/display/display_hx8394.c b/drivers/display/display_hx8394.c
index d5fecfb..b14846a 100644
--- a/drivers/display/display_hx8394.c
+++ b/drivers/display/display_hx8394.c
@@ -415,21 +415,6 @@
return 0;
}
-static int hx8394_read(const struct device *dev, const uint16_t x,
- const uint16_t y,
- const struct display_buffer_descriptor *desc,
- void *buf)
-{
- LOG_WRN("Read not implemented");
- return -ENOTSUP;
-}
-
-static void *hx8394_get_framebuffer(const struct device *dev)
-{
- LOG_WRN("Direct framebuffer access not implemented");
- return NULL;
-}
-
static int hx8394_blanking_off(const struct device *dev)
{
const struct hx8394_config *config = dev->config;
@@ -452,20 +437,6 @@
}
}
-static int hx8394_set_brightness(const struct device *dev,
- const uint8_t brightness)
-{
- LOG_WRN("Set brightness not implemented");
- return -ENOTSUP;
-}
-
-static int hx8394_set_contrast(const struct device *dev,
- const uint8_t contrast)
-{
- LOG_WRN("Set contrast not implemented");
- return -ENOTSUP;
-}
-
static int hx8394_set_pixel_format(const struct device *dev,
const enum display_pixel_format pixel_format)
{
@@ -526,10 +497,6 @@
.blanking_on = hx8394_blanking_on,
.blanking_off = hx8394_blanking_off,
.write = hx8394_write,
- .read = hx8394_read,
- .get_framebuffer = hx8394_get_framebuffer,
- .set_brightness = hx8394_set_brightness,
- .set_contrast = hx8394_set_contrast,
.get_capabilities = hx8394_get_capabilities,
.set_pixel_format = hx8394_set_pixel_format,
.set_orientation = hx8394_set_orientation,
diff --git a/drivers/display/display_intel_multibootfb.c b/drivers/display/display_intel_multibootfb.c
index fc2ef3f..e2b93b6 100644
--- a/drivers/display/display_intel_multibootfb.c
+++ b/drivers/display/display_intel_multibootfb.c
@@ -26,33 +26,6 @@
uint32_t pitch;
};
-static int framebuf_blanking_on(const struct device *dev)
-{
- return -ENOTSUP;
-}
-
-static int framebuf_blanking_off(const struct device *dev)
-{
- return -ENOTSUP;
-}
-
-static void *framebuf_get_framebuffer(const struct device *dev)
-{
- return NULL;
-}
-
-static int framebuf_set_brightness(const struct device *dev,
- const uint8_t brightness)
-{
- return -ENOTSUP;
-}
-
-static int framebuf_set_contrast(const struct device *dev,
- const uint8_t contrast)
-{
- return -ENOTSUP;
-}
-
static int framebuf_set_pixel_format(const struct device *dev,
const enum display_pixel_format format)
{
@@ -133,13 +106,8 @@
}
const struct display_driver_api framebuf_display_api = {
- .blanking_on = framebuf_blanking_on,
- .blanking_off = framebuf_blanking_off,
.write = framebuf_write,
.read = framebuf_read,
- .get_framebuffer = framebuf_get_framebuffer,
- .set_brightness = framebuf_set_brightness,
- .set_contrast = framebuf_set_contrast,
.get_capabilities = framebuf_get_capabilities,
.set_pixel_format = framebuf_set_pixel_format,
.set_orientation = framebuf_set_orientation
diff --git a/drivers/display/display_mcux_elcdif.c b/drivers/display/display_mcux_elcdif.c
index 830bc3e..3046380 100644
--- a/drivers/display/display_mcux_elcdif.c
+++ b/drivers/display/display_mcux_elcdif.c
@@ -211,27 +211,6 @@
return ret;
}
-static int mcux_elcdif_read(const struct device *dev, const uint16_t x,
- const uint16_t y,
- const struct display_buffer_descriptor *desc,
- void *buf)
-{
- LOG_ERR("Read not implemented");
- return -ENOTSUP;
-}
-
-static void *mcux_elcdif_get_framebuffer(const struct device *dev)
-{
- /*
- * Direct FB access is not available. If the user wants to set
- * the framebuffer directly, they must provide a buffer to
- * `display_write` equal in size to the connected display,
- * with coordinates [0,0]
- */
- LOG_ERR("Direct framebuffer access not available");
- return NULL;
-}
-
static int mcux_elcdif_display_blanking_off(const struct device *dev)
{
const struct mcux_elcdif_config *config = dev->config;
@@ -246,20 +225,6 @@
return gpio_pin_set_dt(&config->backlight_gpio, 0);
}
-static int mcux_elcdif_set_brightness(const struct device *dev,
- const uint8_t brightness)
-{
- LOG_WRN("Set brightness not implemented");
- return -ENOTSUP;
-}
-
-static int mcux_elcdif_set_contrast(const struct device *dev,
- const uint8_t contrast)
-{
- LOG_ERR("Set contrast not implemented");
- return -ENOTSUP;
-}
-
static int mcux_elcdif_set_pixel_format(const struct device *dev,
const enum display_pixel_format
pixel_format)
@@ -368,10 +333,6 @@
.blanking_on = mcux_elcdif_display_blanking_on,
.blanking_off = mcux_elcdif_display_blanking_off,
.write = mcux_elcdif_write,
- .read = mcux_elcdif_read,
- .get_framebuffer = mcux_elcdif_get_framebuffer,
- .set_brightness = mcux_elcdif_set_brightness,
- .set_contrast = mcux_elcdif_set_contrast,
.get_capabilities = mcux_elcdif_get_capabilities,
.set_pixel_format = mcux_elcdif_set_pixel_format,
.set_orientation = mcux_elcdif_set_orientation,
diff --git a/drivers/display/display_nrf_led_matrix.c b/drivers/display/display_nrf_led_matrix.c
index dd36126..5468347 100644
--- a/drivers/display/display_nrf_led_matrix.c
+++ b/drivers/display/display_nrf_led_matrix.c
@@ -188,12 +188,6 @@
return 0;
}
-static int api_set_contrast(const struct device *dev,
- const uint8_t contrast)
-{
- return -ENOTSUP;
-}
-
static int api_set_pixel_format(const struct device *dev,
const enum display_pixel_format format)
{
@@ -279,22 +273,12 @@
return 0;
}
-static int api_read(const struct device *dev,
- const uint16_t x, const uint16_t y,
- const struct display_buffer_descriptor *desc,
- void *buf)
-{
- return -ENOTSUP;
-}
-
const struct display_driver_api driver_api = {
.blanking_on = api_blanking_on,
.blanking_off = api_blanking_off,
.write = api_write,
- .read = api_read,
.get_framebuffer = api_get_framebuffer,
.set_brightness = api_set_brightness,
- .set_contrast = api_set_contrast,
.get_capabilities = api_get_capabilities,
.set_pixel_format = api_set_pixel_format,
.set_orientation = api_set_orientation,
diff --git a/drivers/display/display_otm8009a.c b/drivers/display/display_otm8009a.c
index 2463b43..c2349a3 100644
--- a/drivers/display/display_otm8009a.c
+++ b/drivers/display/display_otm8009a.c
@@ -586,27 +586,11 @@
return -ENOTSUP;
}
-static int otm8009a_read(const struct device *dev, uint16_t x, uint16_t y,
- const struct display_buffer_descriptor *desc, void *buf)
-{
- return -ENOTSUP;
-}
-
-static void *otm8009a_get_framebuffer(const struct device *dev)
-{
- return NULL;
-}
-
static int otm8009a_set_brightness(const struct device *dev, uint8_t brightness)
{
return otm8009a_dcs_write(dev, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, &brightness, 1);
}
-static int otm8009a_set_contrast(const struct device *dev, uint8_t contrast)
-{
- return -ENOTSUP;
-}
-
static void otm8009a_get_capabilities(const struct device *dev,
struct display_capabilities *capabilities)
{
@@ -621,29 +605,12 @@
capabilities->current_orientation = data->orientation;
}
-static int otm8009a_set_pixel_format(const struct device *dev,
- enum display_pixel_format pixel_format)
-{
- return -ENOTSUP;
-}
-
-static int otm8009a_set_orientation(const struct device *dev,
- enum display_orientation orientation)
-{
- return -ENOTSUP;
-}
-
static const struct display_driver_api otm8009a_api = {
.blanking_on = otm8009a_blanking_on,
.blanking_off = otm8009a_blanking_off,
.write = otm8009a_write,
- .read = otm8009a_read,
- .get_framebuffer = otm8009a_get_framebuffer,
.set_brightness = otm8009a_set_brightness,
- .set_contrast = otm8009a_set_contrast,
.get_capabilities = otm8009a_get_capabilities,
- .set_pixel_format = otm8009a_set_pixel_format,
- .set_orientation = otm8009a_set_orientation,
};
static int otm8009a_init(const struct device *dev)
diff --git a/drivers/display/display_rm67162.c b/drivers/display/display_rm67162.c
index afb7f4d..e63a446 100644
--- a/drivers/display/display_rm67162.c
+++ b/drivers/display/display_rm67162.c
@@ -512,20 +512,6 @@
}
}
-static int rm67162_set_brightness(const struct device *dev,
- const uint8_t brightness)
-{
- LOG_WRN("Set brightness not implemented");
- return -ENOTSUP;
-}
-
-static int rm67162_set_contrast(const struct device *dev,
- const uint8_t contrast)
-{
- LOG_ERR("Set contrast not implemented");
- return -ENOTSUP;
-}
-
static int rm67162_set_pixel_format(const struct device *dev,
const enum display_pixel_format pixel_format)
{
@@ -595,8 +581,6 @@
.blanking_off = rm67162_blanking_off,
.get_capabilities = rm67162_get_capabilities,
.write = rm67162_write,
- .set_brightness = rm67162_set_brightness,
- .set_contrast = rm67162_set_contrast,
.set_pixel_format = rm67162_set_pixel_format,
.set_orientation = rm67162_set_orientation,
};
diff --git a/drivers/display/display_rm68200.c b/drivers/display/display_rm68200.c
index a89e0d0..7048790 100644
--- a/drivers/display/display_rm68200.c
+++ b/drivers/display/display_rm68200.c
@@ -102,21 +102,6 @@
return 0;
}
-static int rm68200_read(const struct device *dev, const uint16_t x,
- const uint16_t y,
- const struct display_buffer_descriptor *desc,
- void *buf)
-{
- LOG_ERR("Read not implemented");
- return -ENOTSUP;
-}
-
-static void *rm68200_get_framebuffer(const struct device *dev)
-{
- LOG_ERR("Direct framebuffer access not implemented");
- return NULL;
-}
-
static int rm68200_blanking_off(const struct device *dev)
{
const struct rm68200_config *config = dev->config;
@@ -139,20 +124,6 @@
}
}
-static int rm68200_set_brightness(const struct device *dev,
- const uint8_t brightness)
-{
- LOG_WRN("Set brightness not implemented");
- return -ENOTSUP;
-}
-
-static int rm68200_set_contrast(const struct device *dev,
- const uint8_t contrast)
-{
- LOG_ERR("Set contrast not implemented");
- return -ENOTSUP;
-}
-
static int rm68200_set_pixel_format(const struct device *dev,
const enum display_pixel_format pixel_format)
{
@@ -192,10 +163,6 @@
.blanking_on = rm68200_blanking_on,
.blanking_off = rm68200_blanking_off,
.write = rm68200_write,
- .read = rm68200_read,
- .get_framebuffer = rm68200_get_framebuffer,
- .set_brightness = rm68200_set_brightness,
- .set_contrast = rm68200_set_contrast,
.get_capabilities = rm68200_get_capabilities,
.set_pixel_format = rm68200_set_pixel_format,
.set_orientation = rm68200_set_orientation,
diff --git a/drivers/display/display_sdl.c b/drivers/display/display_sdl.c
index b411896..dabd0a0 100644
--- a/drivers/display/display_sdl.c
+++ b/drivers/display/display_sdl.c
@@ -269,11 +269,6 @@
disp_data->renderer, buf, desc->pitch);
}
-static void *sdl_display_get_framebuffer(const struct device *dev)
-{
- return NULL;
-}
-
static int sdl_display_blanking_off(const struct device *dev)
{
struct sdl_display_data *disp_data = dev->data;
@@ -299,18 +294,6 @@
return 0;
}
-static int sdl_display_set_brightness(const struct device *dev,
- const uint8_t brightness)
-{
- return -ENOTSUP;
-}
-
-static int sdl_display_set_contrast(const struct device *dev,
- const uint8_t contrast)
-{
- return -ENOTSUP;
-}
-
static void sdl_display_get_capabilities(
const struct device *dev, struct display_capabilities *capabilities)
{
@@ -361,9 +344,6 @@
.blanking_off = sdl_display_blanking_off,
.write = sdl_display_write,
.read = sdl_display_read,
- .get_framebuffer = sdl_display_get_framebuffer,
- .set_brightness = sdl_display_set_brightness,
- .set_contrast = sdl_display_set_contrast,
.get_capabilities = sdl_display_get_capabilities,
.set_pixel_format = sdl_display_set_pixel_format,
};
diff --git a/drivers/display/display_st7735r.c b/drivers/display/display_st7735r.c
index a20242d..88c282d 100644
--- a/drivers/display/display_st7735r.c
+++ b/drivers/display/display_st7735r.c
@@ -159,15 +159,6 @@
return st7735r_transmit(dev, ST7735R_CMD_DISP_ON, NULL, 0);
}
-static int st7735r_read(const struct device *dev,
- const uint16_t x,
- const uint16_t y,
- const struct display_buffer_descriptor *desc,
- void *buf)
-{
- return -ENOTSUP;
-}
-
static int st7735r_set_mem_area(const struct device *dev,
const uint16_t x, const uint16_t y,
const uint16_t w, const uint16_t h)
@@ -267,23 +258,6 @@
return ret;
}
-static void *st7735r_get_framebuffer(const struct device *dev)
-{
- return NULL;
-}
-
-static int st7735r_set_brightness(const struct device *dev,
- const uint8_t brightness)
-{
- return -ENOTSUP;
-}
-
-static int st7735r_set_contrast(const struct device *dev,
- const uint8_t contrast)
-{
- return -ENOTSUP;
-}
-
static void st7735r_get_capabilities(const struct device *dev,
struct display_capabilities *capabilities)
{
@@ -548,10 +522,6 @@
.blanking_on = st7735r_blanking_on,
.blanking_off = st7735r_blanking_off,
.write = st7735r_write,
- .read = st7735r_read,
- .get_framebuffer = st7735r_get_framebuffer,
- .set_brightness = st7735r_set_brightness,
- .set_contrast = st7735r_set_contrast,
.get_capabilities = st7735r_get_capabilities,
.set_pixel_format = st7735r_set_pixel_format,
.set_orientation = st7735r_set_orientation,
diff --git a/drivers/display/display_st7789v.c b/drivers/display/display_st7789v.c
index 56440c3..0d3a9eb 100644
--- a/drivers/display/display_st7789v.c
+++ b/drivers/display/display_st7789v.c
@@ -141,15 +141,6 @@
return 0;
}
-static int st7789v_read(const struct device *dev,
- const uint16_t x,
- const uint16_t y,
- const struct display_buffer_descriptor *desc,
- void *buf)
-{
- return -ENOTSUP;
-}
-
static void st7789v_set_mem_area(const struct device *dev, const uint16_t x,
const uint16_t y, const uint16_t w, const uint16_t h)
{
@@ -204,23 +195,6 @@
return 0;
}
-static void *st7789v_get_framebuffer(const struct device *dev)
-{
- return NULL;
-}
-
-static int st7789v_set_brightness(const struct device *dev,
- const uint8_t brightness)
-{
- return -ENOTSUP;
-}
-
-static int st7789v_set_contrast(const struct device *dev,
- const uint8_t contrast)
-{
- return -ENOTSUP;
-}
-
static void st7789v_get_capabilities(const struct device *dev,
struct display_capabilities *capabilities)
{
@@ -413,10 +387,6 @@
.blanking_on = st7789v_blanking_on,
.blanking_off = st7789v_blanking_off,
.write = st7789v_write,
- .read = st7789v_read,
- .get_framebuffer = st7789v_get_framebuffer,
- .set_brightness = st7789v_set_brightness,
- .set_contrast = st7789v_set_contrast,
.get_capabilities = st7789v_get_capabilities,
.set_pixel_format = st7789v_set_pixel_format,
.set_orientation = st7789v_set_orientation,
diff --git a/drivers/display/display_stm32_ltdc.c b/drivers/display/display_stm32_ltdc.c
index 99001c3..4472529 100644
--- a/drivers/display/display_stm32_ltdc.c
+++ b/drivers/display/display_stm32_ltdc.c
@@ -86,16 +86,6 @@
const struct pinctrl_dev_config *pctrl;
};
-static int stm32_ltdc_blanking_on(const struct device *dev)
-{
- return -ENOTSUP;
-}
-
-static int stm32_ltdc_blanking_off(const struct device *dev)
-{
- return -ENOTSUP;
-}
-
static void *stm32_ltdc_get_framebuffer(const struct device *dev)
{
struct display_stm32_ltdc_data *data = dev->data;
@@ -103,18 +93,6 @@
return (void *) data->frame_buffer;
}
-static int stm32_ltdc_set_brightness(const struct device *dev,
- const uint8_t brightness)
-{
- return -ENOTSUP;
-}
-
-static int stm32_ltdc_set_contrast(const struct device *dev,
- const uint8_t contrast)
-{
- return -ENOTSUP;
-}
-
static int stm32_ltdc_set_pixel_format(const struct device *dev,
const enum display_pixel_format format)
{
@@ -379,13 +357,9 @@
#endif /* CONFIG_PM_DEVICE */
static const struct display_driver_api stm32_ltdc_display_api = {
- .blanking_on = stm32_ltdc_blanking_on,
- .blanking_off = stm32_ltdc_blanking_off,
.write = stm32_ltdc_write,
.read = stm32_ltdc_read,
.get_framebuffer = stm32_ltdc_get_framebuffer,
- .set_brightness = stm32_ltdc_set_brightness,
- .set_contrast = stm32_ltdc_set_contrast,
.get_capabilities = stm32_ltdc_get_capabilities,
.set_pixel_format = stm32_ltdc_set_pixel_format,
.set_orientation = stm32_ltdc_set_orientation