Commit graph

23353 commits

Author SHA1 Message Date
Gerard Marull-Paretas
347e0f2bdc drivers: display: ili9340: add support for configuring pixel format
Move pixel format setting (RGB565/RGB888) to DeviceTree. Add support for
changing pixel format at runtime.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-29 14:18:05 -05:00
Gerard Marull-Paretas
5cc4cec488 drivers: display: ili9340: code reorganization
Moved initialization function to the bottom.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-29 14:18:05 -05:00
Gerard Marull-Paretas
b406527a66 drivers: display: ili9340: code cleanup
Multiple enhancements towards better code readability and consistency:

- sorted headers
- define and reference magic constants
- adjust some names
- add U suffix to unsigned constants
- move hw reset to a function
- remove non-needed initialization code from seeed tft

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-29 14:18:05 -05:00
Gerard Marull-Paretas
2d4ec8fca9 drivers: display: ili9340: improve error handling
Add error handling to multiple areas of the code and improve log
messages.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-29 14:18:05 -05:00
Gerard Marull-Paretas
26c3b99b55 drivers: display: ili9340: convert to multi-instance
Make ILI9340 driver compatible with multiple device instances.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-29 14:18:05 -05:00
Rick Talbott
60e5e79ca1 drivers: mcux: imx rt flexcan support
Adds imx rt support.
Allows n-number of can interfaces based on device-tree.
Adds a "common" irq name.
Added CAN bus pins and dts for 1060 and 1064 EVK.

Signed-off-by: Rick Talbott <rtalbott@fastmail.com>
2020-09-29 14:03:10 -05:00
Jesper Derander
5b80d4eac8 drivers: serial: uart_mcux_lpuart: Add configure functions
This enables support for the confgure and config_get functions in
the UART API, allowing users to change baudrate, parity, stop bits,
data bits and flow control in runtime.

Signed-off-by: Jesper Derander <jesper.derander@endian.se>
2020-09-29 13:42:39 -05:00
Brian Kubisiak
a84a0e6671 drivers: pinmux: stm32f0: Add additional I2C pins.
Add additional pinmux definitions for I2C1 and I2C2 that are used
on the stm32f030 series SoCs. Additionally, correct the PF0 and PF1 I2C
functions, which were swapped.

Signed-off-by: Brian Kubisiak <brian@kubisiak.com>
2020-09-28 14:00:43 -05:00
Audun Korneliussen
1e227d1576 drivers: serial: nrf_uarte: Reset rx byte counters
Reset rx byte counters when hw timer/counter is disabled.

Fixes issue where disabling and re-enabling async uart rx can produce
"UART_RX_RDY" events with invalid data when power management is used.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2020-09-28 12:15:52 +02:00
Armando Visconti
fe6a73669d drivers: sensor: hts221: Add checks for drdy_gpios macros
To avoid build errors enable the trigger only if DRDY gpio is
defined in DTS. Fix #28443

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-09-24 09:51:08 -05:00
Stephan Walter
381cac1a35 drivers: nrf_qspi: fix devicetree opcode references
The condition used to detect presence of optional devicetree
properties that specify read and write opcodes was inadvertently
changed to something that will never be true.  Update the check and
the property extraction to restore the original behavior.

Fixes #28635.

Signed-off-by: Stephan Walter <stephan@walter.name>
2020-09-23 13:27:46 -05:00
Armando Visconti
4df0d019fd drivers/sensor/lsm6dsl: Fix read/write bus API in shub code
The ce0cc3a7 commit (lsm6dsl: make the driver multi-instance) changes
all bus API signature, which now requires a "const struct device *dev"
and not a "struct lsm6dsl_data *data". By mistake the shub part was
left unchanged. Fix: #28565

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-09-23 13:17:06 -05:00
Krzysztof Chruscinski
03f4a648b1 drivers: clock_control: nrf: Fix waiting for LF clock
Algorithm for waiting for clock stabilization was failing in case when
it was waiting for clock availablity and clock was already available
before function was called. That is because nrfx_clock_is_running
was returning false because XTAL was already started but not yet
running.

Added a check for current LF source, if XTAL is picked that indicates
that RC is already running because of two stage startup procedure.

Added documentation of lfclk_spinwait with explanation of two stage
approach.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-22 09:58:19 +02:00
Johann Fischer
612ba4390b drivers: eth_enc424j600: initialize device pointer
Initialize device pointer in driver's context.

It was not done quite right in commit a1708cf2f2
("drivers: ethernet: Fix device instance const qualifier loss"),
and then completely removed in commit 113d9274ea
("drivers: ethernet: remove stray expression")'

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-09-21 16:45:03 -05:00
David Komel
92499fc9d1 drivers: net: slip: Allow slip to co-exist with other interfaces
This commit fixes the following issue:
When using slip without TAP, i.e. CONFIG_SLIP_TAP=n (default), while
another ethernet interface is enabled and sets CONFIG_NET_L2_ETHERNET=y.

This causes ethernet_init() to be wrongly called with struct dummy_api
instead of struct ethernet_api.
ethernet_init() expects struct ethernet_api (by cast), so we end up
with the get_capabilities field pointing to garbage!
Actually, as we are using the dummy api, we don't need to call
ethernet_init() at all.

Sole dependency on CONFIG_NET_L2_ETHERNET is wrong because it
can be enabled by another interface.

Signed-off-by: David Komel <a8961713@gmail.com>
2020-09-21 10:02:06 -05:00
Ievgenii Meshcheriakov
b7c9d9d34f drivers/flash/soc_flash_nrf: Enable ticker radio sync only with Zephyr LL
Ticker API is part of Zephyr software BLE Link Layer.

Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
2020-09-21 13:06:16 +02:00
Ievgenii Meshcheriakov
d27c32efc3 drivers/flash/soc_flash_nrf: Rename config option SOC_FLASH_NRF_RADIO_SYNC
Call it SOC_FLASH_NRF_RADIO_SYNC_TICKER so it is not too generic.

Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
2020-09-21 13:06:16 +02:00
Ievgenii Meshcheriakov
70c5371666 drivers/flash/soc_flash_nrf: Name flash sync choice
Named choice is needed in order to be able to extend it
in other modules.

Closes: #28559

Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
2020-09-21 13:06:16 +02:00
Armando Visconti
ce0cc3a7cc drivers: sensor: lsm6dsl: make the driver multi-instance
Make this driver multi-instance and use the new API.
Fixes #28390

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-09-18 22:08:44 -04:00
Paul Fagerburg
a8639a0432 drivers/pinmux/stm32: add/fix pinmux for F103xG
* Add missing the PINMUX macros for UART5 pins.
* Correct a typo in STM32F1_PINMUX_FUNC_PC5_ADC12_IN15; the macro
 used PC4 instead of PC5 for ADC12_IN15.

Signed-off-by: Paul Fagerburg <pfagerburg@google.com>
2020-09-18 14:25:55 -05:00
Erwan Gouriou
8b47e563e2 dts/Kconfig: Remove HAS_DTS_I2C
HAS_DTS_I2C is now selected by I2C and
always used as I2C && HAS_DTS_I2C.

It could then be purely removed.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-09-18 13:34:44 -05:00
Jukka Rissanen
060d36537a drivers: eth: Fix return value if we run out of bufs in TX
The correct return value is -ENOBUFS if we run out of network
buffers when sending the packets.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-17 09:31:10 +02:00
Ryan Erickson
5ac21bd604 drivers: modem: hl7800: fix dts binding
Fix hl7800 vendor prefix to match existing Sierra Wireless entry.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Ryan Erickson
7b5714669c drivers: modem: hl7800: add IPv6 support
Add support for dual mode IPv4/IPv6 stack.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Ryan Erickson
03e62be290 drivers: modem: hl7800: do not require DEVICE_POWER_MANAGEMENT
Remove requirement for DEVICE_POWER_MANAGEMENT,
the driver does not need it to operate.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Ryan Erickson
ad04354110 drivers: modem: hl7800: remove VLA
Remove variable length array from function to comply with MISRA checks.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Ryan Erickson
c74166ed5e drivers: modem: hl7800: modem receiver IMEI
Modem receiver IMEI data field is only available
when CONFIG_MODEM_SIM_NUMBERS.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Ryan Erickson
2e7b263013 drivers: modem: hl7800: struct device data renamed
change struct device->driver_data to new name of struct device->data.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Ryan Erickson
61ce2dc681 drivers: modem: hl7800: RTC only available with newlibc
RTC API is only available if NEWLIB_LIBC is available.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Vinayak Kariappa Chettimada
bd7ee86496 drivers: Bluetooth: rpmsg: Add missing BT_QUIRK_NO_AUTO_DLE
Add BT_QUIRK_NO_AUTO_DLE quirk option for HCI rpmsg driver
when the Zephyr open source BLE controller is used.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-16 12:02:32 +02:00
Rajavardhan Gundi
7d3dde5e5e drivers: peci: xec: Fix error recovery handling
Fix the error recovery mechanism that makes use of a temp variable
to avoid coverity issue without breaking error recovery.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2020-09-15 12:35:15 -05:00
Tomasz Bursztyka
ed98883795 device: Fixing new left over device instance made constant
Recent addition that went under the radar.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-15 09:18:43 -05:00
Andrzej Głąbek
a3430c2caf drivers: spi: nrfx: Restore recently changed spi_context function
Function spi_context_longest_current_buf() has been introduced in
commit ddef35c1da for the purpose of
getting the longest possible (potentially partial) SPI transfer
for which all currently active directions have a continuous buffer.
Such transfer can be done with taking advantage of a DMA that cannot
use scattered buffers (and this is the case for nRF SPI drivers with
which this function has been introduced).
Unfortunately, because of its inadequate name, later on this function
has been incorrectly used in other SPI drivers for getting the longer
of TX/RX buffers. And commit afc480f12b
recently "fixed" the implementation of this function, assumably to
adjust it to those incorrect uses, but this way it has also broken
the nRF SPI drivers.
Instead of restoring the original implementation of the function in
question, this commit adds a new one with functionality equivalent
to that original but with a hopefully less misleading name, and this
function is used in the nRF SPI drivers.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-09-15 15:59:18 +02:00
Emil Obalski
dc79b37167 usb: nrf: Do not allow to clear STALL or dtoggle for ISO ep.
Isochronous transactions do not support handshake phase
so in particular the ISO endpoint cannot be STALLed.
Isochronous transactions do no support data toggle sequencing
and should only send DATA0 PID.

Taking into consideration those requirements do not try to
clear dtoggle or STALL an ISO Endpoint in nRF USBD driver.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-15 10:15:20 +02:00
Roman Vaughan
4000e2849d drivers: led_strip: APA102 use CS flags from devicetree
The pull request #26269
drivers: SPI: Adds CS flags from devicetree
missed out on the APA102 led_strip driver, most likely due to the driver
not utilising the chip select signal until #25310
drivers: led_strip: Add support for external SPI CS on APA102 LED strips

Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
2020-09-14 18:35:26 -05:00
Andrzej Głąbek
b197fb0bbe drivers: spi: Kconfig.nrfx: Use RAM buffers for SPIMs by default
Enable by default the use of RAM buffers in the spi_nrfx_spim.c
driver for copying TX data located in flash (as SPIM peripherals
cannot transfer directly form flash). Without this patch, users can
get confused, especially when SPI transaction is used by an upper
level driver which does not check all error codes.
For size of the buffer, use the value used so far in the reel_board
default configuration and in the SPI loopback test, i.e. 8 bytes.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-09-14 16:02:59 -05:00
Armando Visconti
4ea9a8bd95 drivers: sensor: lis2dh: make the driver multi-instance
Make this driver multi-instance and use the new API.
Fixes #27753.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-09-14 13:28:45 -05:00
Alexandre Bourdiol
41621ba0bf drivers: dma: dma_stm32_v2: typo in compilation switch
For example, LL_DMA_IFCR_CTEF6 doesn't exist,
it must be replaced by LL_DMA_IFCR_CTEIF6.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-09-11 09:31:27 -05:00
Alexandre Bourdiol
4dbd96900d drivers: dma: dma_stm32: can't use device_get_binding() during init
Not possible to use device_get_binding() because we are
currently initializing DMA_1 device, so it is not ready and
device_get_binding() will fail.
Directly use string compare is more efficient.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-09-11 09:31:27 -05:00
Krzysztof Chruscinski
d58841a1bd drivers: clock_control: nrf: Fix nrf53 LFXO pin configuration
Pins used for external LF clock source must be configured as
used by peripheral to allow using LFXO on network side.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-11 15:55:54 +02:00
Vincent Wan
23b54832f8 drivers: wifi: simplelink: reimplement getaddrinfo
Reimplement getaddrinfo to call SlNetUtil_getAddrInfo from the TI HAL
for a more robust implementation that supports both client and server
modes, and performs better error-checking.

Fixes #11890

Signed-off-by: Vincent Wan <vwan@ti.com>
2020-09-11 15:29:03 +03:00
Jeremy LOCHE
1740dfc8c2 drivers: bluetooth: hci_spi: fix init priority
Fixes #28275 by adding bluetooth HCI spi driver priority lower
(75 instead of 50) than SPI (70) to avoid device_get_binding
to return NULL because the device was not initialized.

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-09-10 15:57:54 -05:00
Krzysztof Chruscinski
dcaead68c7 drivers: clock_control: nrf: Improve waiting for LF clock
Enabled going to idle when waiting for low frequency clock.
Added 2 stages of starting LF clock when XTAL is used. First
stage is starting RC and then when it is ready XTAL is started.
It is done to get event/interrupt when RC is ready which means
that LF clock is available (but not stable).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-10 21:31:01 +02:00
Krzysztof Chruscinski
c69a27b789 drivers: timer: nrf: Add configurable clock startup mode
Added configuration for approach to starting system clock source.
There are 3 options: no wait, wait untill available, wait until
stable.

Added support for those modes in clock control driver which handles
low frequency source clock.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-10 21:31:01 +02:00
Andrzej Puzdrowski
285d8786ee drivers/flash/nrf_qspi_nor: corrects write-block-size to 4B
The driver is able to write with 32-bits word alignment of size
and offset, apart form sub-word writes for which it can write
part of word to aligned offset (which is a hack).

fixes #26729

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-09-10 12:10:26 -05:00
Kumar Gala
184a25769c arm: systick: default CORTEX_M_SYSTICK based on dts
Use setting from devicetree to drive the default setting for
CORTEX_M_SYSTICK.  We update the dts files to default systick to be
enabled since the major of cortex-m platforms utilize it by default
(except on Nordic SoCs, TI CC13x2/CC26x2 and MEC1501 in which we
default to disabled).

Fixes #25299

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-09-10 09:49:00 +02:00
Abhishek Shah
e628dbb069 drivers: watchdog: cmsdk: rename wdog_cmsdk_apb_enable
Rename wdog_cmsdk_apb_enable to wdog_cmsdk_apb_setup,
this API is supposed to be called during driver probe based on
CONFIG_WDOG_CMSDK_APB_START_AT_BOOT (enabled by default).

Fixes: 03c7d9bd49 ("drivers: wdog: Update CMSDK Wdog driver")

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-09-09 17:19:43 +02:00
Abhishek Shah
7f6676b556 Revert "drivers: watchdog: Remove useless Kconfig entry"
This reverts commit 45832ac1d6.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-09-09 17:19:43 +02:00
Erwan Gouriou
1cb7ae8142 drivers/entropy: stm32: fix error erasing
"unused value" issue reported by Coverity (CID: 214211).
This is actually a true bug as reported error is erased
and not taken into account.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-09-09 14:10:07 +02:00
Peter Bigot
d6fa062a7d drivers: pcie: endpoint: fix ISR prototype
Two optional ISR handlers need the void *arg converted to const struct
device *dev.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-08 18:10:22 -05:00