display: display_max7219: 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>
This commit is contained in:
Marcus Folkesson 2023-12-05 12:28:03 +01:00 committed by Fabio Baltieri
parent 0096a980d3
commit 7c9205bc41

View file

@ -139,20 +139,6 @@ static inline void skip_pixel(uint8_t *mask, uint8_t *data, const uint8_t **buf,
}
}
static int max7219_blanking_on(const struct device *dev)
{
ARG_UNUSED(dev);
return -ENOTSUP;
}
static int max7219_blanking_off(const struct device *dev)
{
ARG_UNUSED(dev);
return -ENOTSUP;
}
static int max7219_write(const struct device *dev, const uint16_t x, const uint16_t y,
const struct display_buffer_descriptor *desc, const void *buf)
{
@ -213,25 +199,6 @@ static int max7219_write(const struct device *dev, const uint16_t x, const uint1
return 0;
}
static int max7219_read(const struct device *dev, const uint16_t x, const uint16_t y,
const struct display_buffer_descriptor *desc, void *buf)
{
ARG_UNUSED(dev);
ARG_UNUSED(x);
ARG_UNUSED(y);
ARG_UNUSED(desc);
ARG_UNUSED(buf);
return -ENOTSUP;
}
static void *max7219_get_framebuffer(const struct device *dev)
{
ARG_UNUSED(dev);
return NULL;
}
static int max7219_set_brightness(const struct device *dev, const uint8_t brightness)
{
int ret;
@ -249,14 +216,6 @@ static int max7219_set_brightness(const struct device *dev, const uint8_t bright
return 0;
}
static int max7219_set_contrast(const struct device *dev, const uint8_t contrast)
{
ARG_UNUSED(dev);
ARG_UNUSED(contrast);
return -ENOTSUP;
}
static int max7219_set_pixel_format(const struct device *dev,
const enum display_pixel_format format)
{
@ -296,13 +255,8 @@ static void max7219_get_capabilities(const struct device *dev, struct display_ca
}
static const struct display_driver_api max7219_api = {
.blanking_on = max7219_blanking_on,
.blanking_off = max7219_blanking_off,
.write = max7219_write,
.read = max7219_read,
.get_framebuffer = max7219_get_framebuffer,
.set_brightness = max7219_set_brightness,
.set_contrast = max7219_set_contrast,
.get_capabilities = max7219_get_capabilities,
.set_pixel_format = max7219_set_pixel_format,
.set_orientation = max7219_set_orientation,