Commit graph

273 commits

Author SHA1 Message Date
Konstantinos Papadopoulos b8604024f7 drivers: display: stm32_ltdc temporary patch for LTDC clock
LTDC clock on F4/F7 series, is generated from PLLSAI which yet is not
implemented into Zephyr.

Signed-off-by: Konstantinos Papadopoulos <kostas.papadopulos@gmail.com>
2022-04-08 15:49:42 -07:00
Konstantinos Papadopoulos 5e519fef40 drivers: ILI9341 add interface control registers
This enables the option through dts to drive the display
with RGB interface.

Signed-off-by: Konstantinos Papadopoulos <kostas.papadopulos@gmail.com>
2022-04-08 15:49:42 -07:00
Mahesh Mahadevan a8f8c1c185 drivers: display: Add blanking support for NXP ELCDIF driver
Implement the blanking_on and blanking_off API functions for
NXP's MCUX ELCDIF display driver

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-04-07 16:37:50 -05:00
Casper Meijn c33d1b55f8 drivers: display: st7789v: Add multi-instance support
Replace the config and data struct with a macro. Execute the macro
for each instance.

Signed-off-by: Casper Meijn <casper@meijn.net>
2022-04-06 10:58:26 +02:00
Casper Meijn ac9cd9e89a drivers: display: st7789v: Remove compile time reset selection
Replace the compiletime `#if` with a runtime decision. This makes
a multi-instance driver possible.

Signed-off-by: Casper Meijn <casper@meijn.net>
2022-04-06 10:58:26 +02:00
Casper Meijn 7f5c5cf317 drivers: display: st7789v: Move params to struct config
Move the const configuration parameters to `struct st7789v_config`.

Signed-off-by: Casper Meijn <casper@meijn.net>
2022-04-06 10:58:26 +02:00
Tomislav Milkovic 9f0fa15bb7 drivers: display: add stm32_ltdc driver
Add Kconfig for STM32 LTDC driver
Add STM32 LTDC driver C source
Update display drivers CMakeLists with the new driver
Update display drivers Kconfig with the new driver

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-03-29 18:30:02 -07:00
Daniel DeGrasse 9824721680 drivers: display: display_mcux_elcdif: add backlight-gpios property
Add backlight gpios property to mcux display driver, so that the driver
can correctly initialize the backlight gpio control.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-25 15:47:54 -05:00
Daniel DeGrasse 5ec576fb04 drivers: display: display_mcux_elcdif: add pinctrl support
add pinctrl support for display_mcux_elcdif driver

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-25 15:47:54 -05:00
Gerard Marull-Paretas d965f0a578 drivers: display: ili9xxx: default based on DT compatible
Enable the ILI9XXX display driver based on DT compatible status.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-24 13:36:54 +01:00
Johann Fischer a713315f0c drivers: ssd16xx: propagate errors where possible
Fix error propagation on several places.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-03-23 18:40:08 +01:00
Johann Fischer 75fb9ee143 drivers: ssd16xx: rework function to clear panel buffer at init
Rework function to clear panel buffer to use less memory
and propagate the errors.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-03-23 18:40:08 +01:00
Johann Fischer e36c2699e4 drivers: ssd16xx: use usual scheme struct foo *data = dev->data
Use usual scheme "struct foo *data = dev->data;".

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-03-23 18:40:08 +01:00
Johann Fischer a2e7e9a0e0 drivers: ssd16xx: add multi-instance support
Get rid of all DT_INST_PROP(0,...) and rework
the driver to support multiple instances.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-03-23 18:40:08 +01:00
Nazar Kazakov f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Nazar Kazakov 9713f0d47c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-14 20:22:24 -04:00
Gerard Marull-Paretas 95fb0ded6b kconfig: remove Enable from boolean prompts
According to Kconfig guidelines, boolean prompts must not start with
"Enable...". The following command has been used to automate the changes
in this patch:

sed -i "s/bool \"[Ee]nables\? \(\w\)/bool \"\U\1/g" **/Kconfig*

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-09 15:35:54 +01:00
Krzysztof Chruscinski 47ae656cc1 all: Deprecate UTIL_LISTIFY and replace with LISTIFY
UTIL_LISTIFY is deprecated. Replacing it with LISTIFY.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-08 11:03:30 +01:00
Casper Meijn 2eb1feea91 drivers: display: st7789v: fix gpio_dt_spec initialization
The `gpio_dt_spec` structures where never initialised, therefore the driver
would always fault with "E: Reset GPIO device not ready" printed to the
console.

Fixes: 069bf6be44
("drivers: display: st7789v: use gpio_dt_spec")

Signed-off-by: Casper Meijn <casper@meijn.net>
2022-03-01 14:38:21 -06:00
Mahesh Mahadevan 45cc1d6fc7 drivers: display: Update the MCUX ELCDIF driver
1. Rename device data to dev_data to fix variable
   name clash
2. Use Device Tree properties to setup the display
3. Delete unused Kconfigs

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-02-25 13:35:58 -06:00
Mahesh Mahadevan 3489a39631 dts: Rename NXP LCDIF dts node
Rename fsl,imx6sx-lcdif to nxp,imx-elcdif as it
used by imxrt and imx platforms.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-02-25 13:35:58 -06:00
Fabio Baltieri 824bb337d5 drivers: display: ls0xx: fix compiler warning
Fix a compiler warning introduced in 0fa2c45037:

/zephyr/drivers/display/ls0xx.c: In function 'ls0xx_init':
/zephyr/drivers/display/ls0xx.c:294:9: error: passing argument 5 of
'k_thread_create' discards 'const' qualifier from pointer target type
[-Werror=discarded-qualifiers]
  294 |         config, NULL, NULL,
      |         ^~~~~~

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2022-02-24 09:09:02 -08:00
Fabio Baltieri 1b370eead8 drivers: display: gd7965: fix build break
gd7965 broke after 42bbb30ecf:

/zephyr/drivers/display/gd7965.c: In function 'gd7965_init':
/zephyr/drivers/display/gd7965.c:379:23: error: passing argument 1 of
'device_is_ready' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  379 |  if (!device_is_ready(&config->reset_gpio.port)) {
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~
      |                       |
      |                       const struct device * const*

Fix all the occurrences.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2022-02-24 09:09:02 -08:00
Fabio Baltieri 1c2d72cfad drivers: display: st7735r: fix build break
display_st7735r broke after cd1fb2972e:

/zephyr/drivers/display/display_st7735r.c: In function 'st7735r_write':
/zephyr/drivers/display/display_st7735r.c:191:34: error: initialization
discards 'const' qualifier from pointer target type
[-Werror=discarded-qualifiers]
  191 |  struct st7735r_config *config = dev->config;
      |                                  ^~~
/zephyr/drivers/display/display_st7735r.c: In function 'st7735r_lcd_init':
/zephyr/drivers/display/display_st7735r.c:318:26: error: passing
argument 1 of 'st7735r_set_lcd_margins' from incompatible pointer type
[-Werror=incompatible-po
inter-types]
  318 |  st7735r_set_lcd_margins(dev, data->x_offset, data->y_offset);
      |                          ^~~
      |                          |
      |                          const struct device *
/zephyr/drivers/display/display_st7735r.c:60:58: note: expected 'struct
st7735r_data *' but argument is of type 'const struct device *'
   60 | static void st7735r_set_lcd_margins(struct st7735r_data *data,
      |                                     ~~~~~~~~~~~~~~~~~~~~~^~~~
/zephyr/drivers/display/display_st7735r.c: In function 'st7735r_init':
/zephyr/drivers/display/display_st7735r.c:441:24: error: passing
argument 1 of 'device_is_ready' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  441 |   if (!device_is_ready(&config->reset)) {
      |                        ^~~~~~~~~~~~~~
      |                        |
      |                        const struct gpio_dt_spec *

and few others. Fix all of them.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2022-02-24 09:09:02 -08:00
Gerard Marull-Paretas 9a00b99884 drivers: display: grove_lcd_rgb: move to misc
The driver does not implement a display API, it has a custom API. Having
it under display is confusing, since display API consumers may expect
they can use it. These sort of custom drivers fit better under
drivers/misc.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas db00924764 drivers: display: ssd16xx: use gpio_dt_spec
Simplify driver implementation by using gpio_dt_spec. To simplify
migration, all internal functions now take a device reference instead of
device data. As a result, the redundant config pointer in data has been
removed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-21 22:16:10 -05:00
Gerard Marull-Paretas 0fa2c45037 drivers: display: ls0xx: use gpio_dt_spec
Simplify driver implementation by using gpio_dt_spec. As a result, the
driver data structure has become unused and so removed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-21 22:16:10 -05:00
Gerard Marull-Paretas 42bbb30ecf drivers: display: gd7965: use gpio_dt_spec
Simplify driver implementation by using gpio_dt_spec. Note that as a
result, the driver data structure has become obsolete/unused and so has
been entirely removed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-21 22:16:10 -05:00
Gerard Marull-Paretas 069bf6be44 drivers: display: st7789v: use gpio_dt_spec
Simplify driver implementation by using gpio_dt_spec.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-21 22:16:10 -05:00
Gerard Marull-Paretas 065f8645fb drivers: display: st7789v: use spi_dt_spec
Simplify driver implementation by using spi_dt_spec.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-21 22:16:10 -05:00
Gerard Marull-Paretas cd1fb2972e drivers: display: st7735r: use gpio_dt_spec
Simplify the driver implementation by using gpio_dt_spec. Note that most
internal functions have been changed to accept a device instance instead
of data/config references to make transition easier and to align with
most other drivers.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-21 22:16:10 -05:00
Gerard Marull-Paretas 83cccdf757 drivers: display: st7789v: fix function argument
The st7789v_transmit function accepts a device, not device data. As a
result, driver could not be compiled when reset GPIOs were not defined
in Devicetree.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-08 07:31:07 -05:00
Gerard Marull-Paretas 0cb5e2155e drivers: display: gd7965: fix syntax error
The configuration initializer had a syntax error (missing =). The driver
could not be compiled as a result.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-08 07:31:07 -05:00
Gerard Marull-Paretas 435213a753 drivers: remove redundant data/config casts
Some drivers explicitely casted data/config from void * to the
corresponding type. However, this is unnecessary and, in many drivers it
has been misused to drop const qualifier (refer to previous commits).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-19 18:16:02 +01:00
Gerard Marull-Paretas 51e552a9a3 drivers: display: st7735r: constify device config access
`const` was missing from one device config access.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-19 18:16:02 +01:00
Gerard Marull-Paretas ddc168fa78 pm: s/PM_DEVICE_(DT_(INST))_REF/PM_DEVICE_(DT_(INST))_GET
In order to align with macros used to obtain a device reference (e.g.
DEVICE_DT_GET), align the PM macros to use "GET" instead of "REF". This
change should have low impact since no official release has gone out yet
with the "REF" macros.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-18 12:14:06 -05:00
Andrzej Głąbek ea81b4b812 drivers: display_nrf_led_matrix: Correct calculation of pixel period
This is a follow-up to commit 4dfab40cac.

The calculation of the pixel period is done incorrectly and results
in higher than configured refresh frequency if pixels are refreshed
in groups. Fix that and lower the base frequency for the timer and
PWM so that wider range of refresh frequency can be used also with
the pixel grouping.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-12-22 15:50:44 +01:00
Andrzej Głąbek 4dfab40cac drivers: display_nrf_led_matrix: Add option to light LEDs in groups
Add a new DT property named "pixel-group-size" that allows users to
configure the driver to refresh the matrix by illuminating multiple
LEDs in particular rows simultaneously. This way the maximum possible
brightness of the LEDs can be increased (as they can be lit longer)
and the timer interrupt handler is executed less frequently, what
results in decreased CPU load, but more GPIOTE/PPI channels needs to
be allocated if the PWM peripheral cannot be used. Thus, it is left
to users to select the configuration that suits them best.

Update definitions of both the bbc_microbit boards with this new
property, using the maximum available group size (to achieve maximum
possible brightness). For v2, no new resources are used (only all
channels in the already used PWM peripheral are now utilized).
For v1, two more GPIOTE and PPI channels are allocated.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-12-21 17:53:38 +01:00
Johann Fischer 44585b7fc5 drivers: mb_display: rework bbc:microbit display support
Rework bbc:microbit display support to use nRF LED matrix
display controller driver and allow to use it with
bbc:microbit v2 board.

This patch turns the driver into a higher level driver
using the display controller API. Code that directly
accesses hardware (GPIO) is removed.
This driver is reworked to be more generic. It still
has a lot of potential for improvement, but it requires
changes in all applications that use this tool.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-12-21 17:06:03 +01:00
Johann Fischer de072e47b0 drivers: nrf_led_matrix: enable driver if compatible is enabled
Enable nRF LED matrix display controller driver if compatible
devicetree node is enabled.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-12-21 17:06:03 +01:00
Gerard Marull-Paretas 9f5de86e8a drivers: display: st7735r: replace non-existing DT_INST_HAS_PROP
DT_INST_HAS_PROP macro is not available, DT_INST_NODE_HAS_PROP needs to
be used instead.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-17 17:30:06 +01:00
Andrzej Głąbek e7f7e955b3 drivers: display: Add support for LED matrix driven by nRF SoC GPIOs
Add a display driver and the corresponding devicetree binding for a LED
matrix with rows and columns driven by nRF SoCs GPIOs. Such matrix can
be found, for example, in the BBC micro:bit boards.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-12-17 15:48:08 +01:00
Johann Fischer 307c13b218 drivers: display: remove unused Kconfig options
remove unused options SDL_DISPLAY_* and DUMMY_DISPLAY_*.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-12-10 12:47:30 +01:00
Johann Fischer 2d175d14f3 drivers: display_dummy: rework to obtain configuration from devicetree
Add bindings for dummy display controller.
Rework dummy display controller driver to obtain
configuration from devicetree. Remove unnecessary casts,
add multi-instance support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-12-10 12:47:30 +01:00
Johann Fischer dee50e9aae drivers: display_sdl: rework to obtain configuration from devicetree
Add bindings for SDL based display controller.
Rework SDL based display controller driver to obtain
configuration from devicetree. Remove unnecessary casts,
add multi-instance support.

Add display controller node and chosen property
to native_posix devicetree.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-12-10 12:47:30 +01:00
Johann Fischer 5e722c4368 drivers: ssd16xx: fix driver initialization
ssd16xx driver is not well designed and does not pass configuration
via device->config but via struct ssd16xx_data, this was not taken
into account in the commit 4d6d50e2bc
("display: ssd16xx: convert to spi_dt_spec").

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-12-10 12:47:30 +01:00
Casper Meijn 2b618bdb5c drivers: display: st7789v: Use device * for internal functions
The internal functions of this driver needed either `device *`
or `st7789v_data *` as argument. Standardize to
using `device *`.

Signed-off-by: Casper Meijn <casper@meijn.net>
2021-12-07 09:38:43 -06:00
Casper Meijn 7dfdaf4ab7 drivers: display: st7789v: Remove explicit cast
Remove explicit cast of `data`.

Signed-off-by: Casper Meijn <casper@meijn.net>
2021-12-06 08:04:26 -05:00
Casper Meijn 889ab9107e drivers: display: st7789v: Make naming consistent
The names of `struct st7789v_data` varied a bit in the driver code.
Make the name consistently `data`.

Signed-off-by: Casper Meijn <casper@meijn.net>
2021-11-29 16:29:55 +01:00
Gerard Marull-Paretas 89a4f36fc8 device: remove inclusion of pm/device.h
The device PM subsystem _depends_ on device, not vice-versa. Devices
only hold a reference to struct pm_device now, and initialize this
reference with the value provided in Z_DEVICE_DEFINE. This requirement
can be solved with a forward struct declaration, meaning there is no
need to include device PM headers.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-29 11:08:38 +01:00