Commit graph

16 commits

Author SHA1 Message Date
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Christoph Schramm ce4cc465fc driver: modem: add simple power management to modem receiver
As modem receiver is using UART, it requires disabling
of the UART and its callbacks to save power.
This adds simple sleep/wake functions which should be
called from defined device_pm functions in modem drivers later.

Signed-off-by: Christoph Schramm <schramm@makaio.com>
2019-09-08 12:41:29 +02:00
Anas Nashif d1b2718687 cleanup: include/: move uart.h to drivers/uart.h
move uart.h to drivers/uart.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 158d921cde drivers: modem: modem_receiver.h: move header from /include/
Move modem_receiver.h to the driver directory. No other users in the
tree and it is a private header.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-25 15:27:00 -04:00
Michael Scott bc5a3f25ad drivers: modem: fix extra bytes sent by mdm_receiver_send()
mdm_receiver_send() was sending 1 too many bytes of buf.  This ended
up being the NULL terminator.  Size should be reduced prior to the
while check so that this doesn't happen.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/14001

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-04 09:40:45 -05:00
Georgij Cernysiov 3fe917ef64 drivers: modem: receiver: guards against 0 size
Protects against 0 size in send, receive, and
registration.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-03-01 09:46:48 +01:00
Georgij Cernysiov 27618404f6 drivers: modem: receiver: replace fifo_fill with poll_out
Repalces send fifo_fill implementation with poll_out,
this makes the receiver usefull on most SoC.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-03-01 09:46:48 +01:00
Georgij Cernysiov 886ab98fd0 drivers: modem: receiver: use asserts internally
Switch to asserts where applicable for internal
functions.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-03-01 09:46:48 +01:00
Georgij Cernysiov 2234621d9e drivers: modem: receiver: fix sending
Send implementation shall return 0 for ok,
or < 0 for an error.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-03-01 09:46:48 +01:00
Georgij Cernysiov de8b39f6eb drivers: modem: receiver: rearrange and comment
Rearranges functions to public and private groups,
and adds missing function comments.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-03-01 09:46:48 +01:00
Georgij Cernysiov 94ee0ddbde drivers: modem: receiver: switch to ring buffer from pipe api
Replaces used k_pipe with ring_buffer API which is safe for ISR.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-03-01 09:46:48 +01:00
Georgij Cernysiov 23b64b0d35 drivers: modem: receiver: correct device bind error type
Log possible uart device binding error and change
the error type to a more correct one.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-03-01 09:46:48 +01:00
Kumar Gala b0e7d312db modem: Fix LOG Kconfig typo
LOG_LEVEL should be set to CONFIG_MODEM_LOG_LEVEL not
CONFIG_LOG_MODEM_LEVEL.  In cleaning this up use
LOG_MODULE_REGISTER(x,y) form to reduce 3 lines to 1.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-12 07:50:06 -05:00
Anas Nashif 5c76143bcd drivers: modem: register logging module
Add missing registration for modem driver.

Fixes #10518

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-15 10:48:11 -04:00
Anas Nashif ecc050e69e drivers: modem: move to new logger
Move driver to new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-10 10:22:01 -04:00
Michael Scott 9182d2e59c drivers: modem: add modem receiver (tty) driver
Modem drivers need a fast buffer-based receiver for passing data
back and forth from the UART to the driver.  This provides an
efficient configuarable driver which merely sends and receives
but doesn't process the data, that's left up to the modem driver.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-08-06 10:43:46 +03:00