Commit Graph

10 Commits

Author SHA1 Message Date
Chris Friedt 9504034733 sys: util: use BITS_PER_BYTE macro instead of the magic number 8
Obviously, everyone knows that there are 8 bits per byte, so
there isn't a lot of magic happening, per se, but it's also
helpful to clearly denote where the magic number 8 is referring
to the number of bits in a byte.

Occasionally, 8 will refer to a field size or offset in a
structure, MMR, or word. Occasionally, the number 8 will refer
to the number of bytes in a 64-bit value (which should probably
be replaced with `sizeof(uint64_t)`).

For converting bits to bytes, or vice-versa, let's use
`BITS_PER_BYTE` for clarity (or other appropriate `BITS_PER_*`
macros).

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-16 15:22:35 -05:00
Michael Hope 0e3d9cc2cc drivers: mipi_dbi: lower ROM usage by switching reset time to k_timeout_t
Calling k_msleep() leads to a int64_t division, causing udivdi3 and
similar to be linked in.

Keep the outer API the same, but switch to k_timeout_t before passing
to the inner API. This saves 1916 B of ROM.

Signed-off-by: Michael Hope <mlhx@google.com>
2024-08-17 08:55:28 -04:00
Michael Hope aab5730d0f drivers: mipi_dbi: reduce the RAM overhead
Constify the config and reorder the data fields for better packing.
This reduces the RAM usage of `mipi_dbi_spi` by 20 bytes.

Signed-off-by: Michael Hope <mlhx@google.com>
2024-07-27 10:45:34 +03:00
Ioannis Karachalios d5332532e5 drivers: mipi_dbi: smartbond: Unused symbol
Suppress warning thrown when
the reset line is not used.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-24 12:43:12 -04:00
Jordan Yates 07870934e3 everywhere: replace double words
Treewide search and replace on a range of double word combinations:
    * `the the`
    * `to to`
    * `if if`
    * `that that`
    * `on on`
    * `is is`
    * `from from`

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-22 05:40:22 -04:00
Ioannis Damigos 0a0bccabd8 drivers/smartbond: Fix PM device runtime support
Removed PM device runtime support from drivers in PD_SYS domain.

Update the rest device drivers to call pm_device_runtime_get/put()
functions when CONFIG_PM_DEVICE_RUNTIME is enabled.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-06-18 14:36:38 -04:00
Ioannis Karachalios 2958f691bb drivers: mipi_dbi: smartbond: Optimize driver PM
This commit should optimize the way the device is allowed
to enter the suspended state. Instead of returning a PM
error code to abort the PM process, the standby power state
is constrained as long as the device is not allowed to enter
suspension. With that approach, acquiring PD_SYS is not needed
when in PM device runtime mode.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-24 07:48:41 -04:00
Ioannis Karachalios b8836ab94a drivers: display: smartbond: Acquire power rail when using PM
The power rail of a peripheral block should always be
acquired/released before/after its employment even if
it's known that it should already be up and running.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-17 14:42:24 -05:00
Ioannis Karachalios 58b9facbd1 drivers: mipi dbi: smartbond: Add support for PM
This commit should add all the functionality needed for the MIPI DBI
driver to work when PM is enabled.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-06 21:55:03 +03:00
Ioannis Karachalios f011ad5bb1 drivers: mipi_dbi: smartbond: Add support for MIPI DBI driver class.
Add support for the MIPI DBI host controller.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-03-06 10:17:13 +00:00