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>
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>
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>
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>
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>
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>
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>