Commit graph

23353 commits

Author SHA1 Message Date
Mahesh Mahadevan
c7b0b43ec6 drivers: Add NXP LPC clock control driver
Add clock control driver for NXP LPC devices that use
the MCUX SDK drivers

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2020-10-15 11:17:24 -05:00
Armando Visconti
1921a2d84e drivers/sensor: add support to IIS2ICLX accelerometer
The IIS2ICLX is a high-accuracy. ultra-low noise, low-power
two-axis linear accelerometer which can be interfaced through
either I2C or SPI bus.
Its high accuracy, stability over temperature and repeatability
make IIS2ICLX particularly suitable for inclination measurement
for industrial applications (inclinometers).

https://www.st.com/resource/en/datasheet/iis2iclx.pdf

This driver is based on stmemsc i/f v1.03.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-10-15 09:57:47 -05:00
Ryan Erickson
e36fc53fa6 drivers: modem: hl7800: fix file open in fw update
File open function for firmware update
requires a flags parameter to be passed in.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-10-15 08:46:41 -05:00
Łukasz Mazur
705e1a4610 SPI: Refactoring in SPI with DMA (peripheral switching on/off)
Moved enabling SPI peripheral in front of the buffers loop.
Removed SPI DMA switching on in front of the buffers loop.

Signed-off-by: Łukasz Mazur <lukasz.mazur@hidglobal.com>
2020-10-15 14:11:46 +02:00
Łukasz Mazur
f091aab0d7 SPI: Do not disable SPI peripheral while switching DMA buffers
Removed SPI peripheral disabling when switching DMA to another buffer.
When using hardware chip select this would cause to stop driving
CS pin when swhitching buffers. This is different (and wrong) than
when used software CS.

Fixes #28833

Signed-off-by: Łukasz Mazur <lukasz.mazur@hidglobal.com>
2020-10-15 14:11:46 +02:00
Kumar Gala
c22e34397e drivers: serial: stm32: set default parity in driver
Have the driver default to UART_CFG_PARITY_NONE if no parity property
exists rather than using default in binding.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-10-15 04:01:22 -05:00
Andrei Gansari
801e2dba42 drivers: fix gpio_mcux_lpc_port_set_masked_raw
Fixes gpio_mcux_lpc_port_set_masked_raw function inside gpio_mcux_lpc
driver. Writing masked data is correctly done using device registers.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-10-14 15:21:34 -05:00
Armand Ciejak
430c229568 eth: mcux: Use different RX and TX buffers for each instance
Before the same buffers were used by both instances leading to
data corruption.

Signed-off-by: Armand Ciejak <armand@riedonetworks.com>
2020-10-14 07:19:09 -05:00
Martin Jäger
72d395a897 drivers: adc: stm32: add support for pinmux
Add support for DT based pinmux configurations.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-10-14 07:15:12 -05:00
Jakub Rzeszutko
6ed13678b8 adc_shell: rework commands
ADC shell commands can be only executed on the property label
existing in the device tree. It is realized by the dynamic subcommand
returning existing ADC Label.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2020-10-14 14:12:54 +02:00
Jakub Rzeszutko
333e5e0166 adc_shell: extend channel command
The channel command has been extended with subcommands: id, positive,
and negetive. Some boards require positive input configuration before
measurement can be started.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2020-10-14 14:12:54 +02:00
Jakub Rzeszutko
fb653608b4 adc_shell: use shell to validate arguments count
Use dedicated shell macros so argument count can be validated before
the command handler is executed. This change simplifies the command
handlers implementation inside the adc_shell file.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2020-10-14 14:12:54 +02:00
Jakub Rzeszutko
ceb3c4c576 adc_shell: introduce dictionary commands
Changed gain and reference commands to dictionary commands.
This change removes an obsolete look-up table (string <-> value)
for gain and reference commands.
Now, each modification of gain or reference value will require only
a dictionary command update.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2020-10-14 14:12:54 +02:00
Erwan Gouriou
91e9fde778 drivers/serial: stm32f1: REMAP_FULL is not a possible remap value
'remap' value can never be REMAP_FULL for usart.
Fix this value depending on the usart instance.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-14 07:11:46 -05:00
Krzysztof Chruscinski
b5919479c4 drivers: clock_control: nrf: Change errno for clock_control_async_on
Aligned returned errno with API.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-10-14 14:06:56 +02:00
Krzysztof Chruscinski
a348cec400 drivers: clock_control: Change clock_control_async_on parameters
Stable API change: modify parameters of clock_control_async_on which
previously took a structure which contains list node, callback and user
context. Removing list node and replacing structure with two parameters:
callback and user context. List node is removed because it has no use
in current API.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-10-14 14:06:56 +02:00
Krzysztof Chruscinski
db6bfde8b3 drivers: serial: nrfx_uarte: Refactoring poll_out
Refactoring poll_out to be ready for handling preemption. uart_tx and
uart_fifo_fill modified so they are resilient to being preempted by
uart_poll_out.

Refactored uart_poll_out implementation to be common for interrupt
driven API and asynchronous API. In both APIs active state is detected
by evaluating state of ENDTX and TXSTOPPED events. If anyone is set it
means that new transfer can be started.

Patch is fixing existing issues:
- potential bytes dropping with flow control enabled
- busywaiting for ENDTX (asynchronous API) - poor performance
- potential bytes dropping during preemption
- potential uart_tx returning -EBUSY when interrupted poll_out

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-10-14 14:06:25 +02:00
Thorvald Natvig
4d0750920b drivers: ethernet: eth_gecko: Fetch MAC address from device info
If neither a random address nor a specific local address is in the
device tree, then use the MAC address from the device information page.

Signed-off-by: Thorvald Natvig <thorvald@natvig.com>
2020-10-14 12:31:49 +03:00
Ryan Erickson
72d54055a3 drivers: modem: hl7800: UDP socket not closed
Ensure UDP socket is always closed when offload_put is called.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-10-14 12:30:45 +03:00
Armando Visconti
de5135b05e modules/hal_st: Align sensor drivers to stmemsc HAL i/f v1.03
Align all sensor drivers that are using stmemsc (STdC) HAL i/f
to new APIs of stmemsc v1.03.

Requires https://github.com/zephyrproject-rtos/hal_st/pull/5
(merged as b52fdbf4b62439be9fab9bb4bae9690a42d2fb14)

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-10-13 09:46:08 -05:00
Armando Visconti
4250028483 drivers/sensor: iis2mdc: Fix the temperature in celsius
Fix the formula to translate raw temperature read from
register to Celsius.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-10-13 09:46:08 -05:00
Armando Visconti
99b97f5ff4 drivers/sensor: ism330dhcx: Fix init routines order
The interrupt enabling routine was called before the
chip enabling routine resulting in a runtime failure
when triggers are set.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-10-13 09:46:08 -05:00
Martin Jäger
109a624c85 drivers: can: stm32: add support for pinmux
Add support for DT based pinmux configurations.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-10-13 13:13:08 +02:00
Toby Firth
dc37f988e0 drivers: adc: added support adc driver for lpcexpresso55s69
Added shim driver for the LPADC for lpcexpresso55s69 board.

Fixes #22703.

Signed-off-by: Toby Firth <tobyjfirth@gmail.com>
2020-10-12 14:59:40 -05:00
Mulin Chao
4260cac1e4 drivers: espi: npcx7: fix wrong comparison in vw generic isr.
This CL fixed the wrong comparison during searching the vw signal
that issued interrupt from MIWU in espi_vw_generic_isr().

Signed-off-by: Mulin Chao <MLChao@nuvoton.com>
2020-10-12 14:47:33 -05:00
Martin Jäger
1de10bdb9b drivers: dac: stm32: add support for pinmux
Add support for DT based pinmux configurations.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-10-12 08:49:36 -05:00
Erwan Gouriou
b74a2162cb soc/arm: stm32: swap argument order in ST_STM32 PINCTRL macros
In order to be in line with other DT_INST macros in zephyr code base,
swap the arguments order in following macro definitions:
*ST_STM32_DT_PINCTRL
*ST_STM32_DT_INST_PINCTRL
Update the users accordingly.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-09 11:52:59 +02:00
Erwan Gouriou
b38d84fef4 drivers/i2c: stm32: Add pinctrl configuration at driver init
Convert driver to pcintrl configuration using pcintrl helper
macros.
Pinctrl init sequence has to be done before bus_mutex initialization.

Driver dts bindings are updated to reflect usage of pinctrl-x
properties

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-09 11:52:59 +02:00
Erwan Gouriou
2d3cda7663 soc/arm: stm32: use _INST_ namespace in devicetree pinctrl helpers
Current set of helpers provided for STM32 pinctrl devicetree are
using device instance as input.
In order to prepare for next version that will take node identifier
as input, change existing set of macros using _INST_ namespace.

Additionally rename NODE_ID_FROM_PINCTRL to
ST_STM32_DT_INST_NODE_ID_FROM_PINCTRL.

Finally update existing macros users to this new name scheme.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-09 11:52:59 +02:00
Erwan Gouriou
02bd657ce3 drivers/gpio: stm32: Change order of registers configuration
During implementation of i2c pinctrl configuration within i2c driver,
it appears that current order of register configuration used to
generate a spike on I2C bus, leading to broken configuration with
I2C device.
Reverse the order so that pin mode setting is done only after pupd,
speed and type are set, in order to avoid generating unwanted
artefacts on the bus.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-09 11:52:47 +02:00
Armand Ciejak
1faf2a92d7 eth: mcux: Fix typo in define name
VALN -> VLAN

Signed-off-by: Armand Ciejak <armand@riedonetworks.com>
2020-10-09 11:50:50 +02:00
Armand Ciejak
90262c9a95 eth: mcux: Rename eth_* to eth* to be have consistent naming
Both eth_* and eth* were used before.

Signed-off-by: Armand Ciejak <armand@riedonetworks.com>
2020-10-09 11:50:50 +02:00
Armand Ciejak
df119d2bbf eth: mcux: Enable PTP IRQ only if the ptp node is enabled
This covers the case of 1 controller having PTP enabled and
the other not.

Signed-off-by: Armand Ciejak <armand@riedonetworks.com>
2020-10-09 11:50:50 +02:00
Armand Ciejak
c627ef37ed eth: mcux: Make consistent use of #if defined
As well as #ifndef.
Apply it for all CONFIG_* defines.

Signed-off-by: Armand Ciejak <armand@riedonetworks.com>
2020-10-09 11:50:50 +02:00
Armand Ciejak
cd35b17879 eth: mcux: Rework MAC address assignment functions
Do not override OUI of the local MAC address in the devicetree.
Simplify the mac address assignment conditions. Each interface has
its own function. Code duplication will be eliminated with the
use of DT_INST_FOREACH_STATUS_OKAY in a later commit to completely
remove duplicated code.
The 3 possible MAC address assignment (local, random and unique)
are covered and have been tested.

Signed-off-by: Armand Ciejak <armand@riedonetworks.com>
2020-10-09 11:50:50 +02:00
Armand Ciejak
fde702359e eth: mcux: Do not call eth_name() when dev->name can be used
Spare a function call.

Signed-off-by: Armand Ciejak <armand@riedonetworks.com>
2020-10-09 11:50:50 +02:00
Armand Ciejak
55b88eef22 eth: mcux: Do not compile phy_state_name() if not used
This is better than declaring it unused.

Signed-off-by: Armand Ciejak <armand@riedonetworks.com>
2020-10-09 11:50:50 +02:00
Armand Ciejak
8b38a67ca2 eth: mcux: Replace hard-coded eth_context.clock
This fixes wrong value for i.MX RT.
This is one less hard-coded value in eth_N_context structures.

Signed-off-by: Armand Ciejak <armand@riedonetworks.com>
2020-10-09 11:50:50 +02:00
Armand Ciejak
ac31c4e458 eth: mcux: Get rid of CONFIG_ETH_MCUX_*
Use node's status in device tree instead.

Signed-off-by: Armand Ciejak <armand@riedonetworks.com>
2020-10-09 11:50:50 +02:00
Antoine Zen-Ruffinen
dd72f1f4e6 eth: mcux: Implement set_config
This allows setting the MAC address at run time.

Signed-off-by: Antoine Zen-Ruffinen <antoine@riedonetworks.com>
Signed-off-by: Armand Ciejak <armand@riedonetworks.com>
2020-10-09 11:50:50 +02:00
Eric Hay
e51b24b429 drivers: clock_control: stm32g0: Enable the Q divisor on g0X1 variants
The PLL Q divisor does not exist on stm32g0X0 variants. It should only
be configured for g0X1 variants.

Signed-off-by: Eric Hay <EHay@sierrawireless.com>
2020-10-09 11:49:39 +02:00
Eric Hay
5f42ba52d8 soc: arm: stm32g0: add STM32G070 SoC series
This commit adds support for the STM32G070xx SoCs
by STMicroelectronics.

Signed-off-by: Eric Hay <EHay@sierrawireless.com>
2020-10-09 11:49:39 +02:00
Kuba Sanak
52a8020398 drivers: lora: Add CheckRfFrequency callback to SX1276 driver
CheckRfFrequency was not assigned correctly to the Radio. This lead
to the system hang when the loramac library tries to call a relevant
Radio method when processing a join-accept message

Signed-off-by: Kuba Sanak <contact@kuba.fyi>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2020-10-08 12:15:38 +02:00
Manivannan Sadhasivam
4d1d1bb330 drivers: lora: Add missing function definitions & callbacks for LoRaWAN
For preparing the radio drivers (specifically SX1276) for LoRaWAN
support, let's add missing function definitions and callbacks required
by the stack.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2020-10-08 12:15:38 +02:00
Manivannan Sadhasivam
47a262f28b drivers: lora: hal_common: Offload calling TimerIrqHandler to work queue
Since TimerIrqHandler() API does SPI transactions, it is not advised to
call from an IRQ context. Hence, offload it to a work queue.

Reported-by: Andreas Sandberg <andreas@sandberg.pp.se>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2020-10-08 12:15:38 +02:00
Manivannan Sadhasivam
0668e2b795 drivers: lora: Only create loramac-node library if not done before
The loramac-node library definition will also be created by
'subsys/lorawan' for the LoRaWAN support. Hence, just add the source
files if the previous declaration of the library is found else create
a new one.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2020-10-08 12:15:38 +02:00
Peter Bigot
2ffbad4941 drivers: counter: stm32: hide irrelevant options
CONFIG_COUNTER_RTC_STM32_BACKUP_DOMAIN_RESET=y was showing up in
configs for non-STM32 boards.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-10-07 15:26:03 -05:00
Gerard Marull-Paretas
af1b9442ca drivers: pwm: stm32: add support for pinmux
Add support for DT based pinmux configurations.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-10-07 12:27:37 -05:00
Gerard Marull-Paretas
aa45e0a90c drivers: pwm: stm32: remove data and config helpers
Now that Zephyr names have been made short and nice the need of these
helpers is less justified.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-10-07 12:27:37 -05:00
Mulin Chao
50753c1d7d drivers: npcx: Add const modifier for hal instances and so on.
Add const modifier for hal instances, clock devices pointer, and module
base address in npcx drivers to prevent driver functions change them
unexpectedly.

Signed-off-by: Mulin Chao <MLChao@nuvoton.com>
2020-10-06 18:16:02 -05:00