Commit graph

498 commits

Author SHA1 Message Date
Erwan Gouriou e88cdffcd6 drivers/gpio: stm32: exti: Clear triggers when not requested
Since it is now possible to disable/re-enable interrupts and
also to reconfigure an already configured interrupt, it is
now required to clear non requested triggers.
While it is not strictly requested, triggers are also cleared
when interrupt is disabled (assuming trigger should be configured
when interrupt is enabled).

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>

fixup exti
2020-02-05 12:00:36 +01:00
Peter Bigot fca26890b0 drivers/gpio: document that unsupported DEBOUNCE should be ignored
A large number of sensor drivers specify GPIO_INT_DEBOUNCE to request
a debounced signal; in practice the debounce may be performed by
external components on the board.  Historically this flag was ignored
on the many GPIO peripherals that do not support hardware debouncing.

Document that this flag is an exception to the normal rule that
unsupported features should be rejected by gpio_pin_configure.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 9e8947fe3e drivers: gpio: add named flag set for disconnected GPIO
A disconnected GPIO is one that is neither an input nor an output.
This is represented by a zero-valued all-default configuration.  Call
this configuration GPIO_DISCONNECTED so the intent is clear.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 060daac089 gpio: add error return when blocking might occur
External GPIO drivers may not be supported from interrupt context
because they involve blocking bus transactions.  Describe the return
value for this situation, and add the I/O error to operations where it
was missing.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 53178c36bd gpio: put back deprecation comments
The comments identifying replacement API were inadvertently removed
along with the flag that triggers deprecation warnings.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Kumar Gala cb9c3efaad drivers: gpio_mmio32: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala b535881f0c gpio: Handle logical conversion in gpio api layer
Move handling of logical flag support into gpio_pin_configure and
gpio_pin_interrupt_configure.  This way drivers don't need to know
anything about logical levels.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Kumar Gala 84b27a1525 gpio: Reorder code in drivers/gpio.h
Move z_impl_gpio_pin_interrupt_configure before gpio_pin_configure so we
can utilize z_impl_gpio_pin_interrupt_configure in gpio_pin_configure in
the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Peter Bigot 48b674b570 gpio: use named types to distinguish pin sets from pin values
Both pin sets and values encoding pin values are ultimately represented
by 32-bit unsigned integers. Provide typedefs that make the role of a
parameter explicit.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski 33193a57eb gpio: add gpio_pin_interrupt_configure function
This commit moves interrupt configuration for a single pin from
gpio_pin_configure to gpio_pin_interrupt_configure function.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski d6191b5781 gpio: add new functions to set/get pin/port values
This commit adds following functions which work with pin logical levels
(take into account GPIO_ACTIVE_LOW flag):
- gpio_port_get, gpio_port_set_masked, gpio_port_set_bits,
  gpio_port_clear_bits, gpio_port_set_clr_bits
- gpio_pin_get, gpio_pin_set
Functions which work with pin physical levels:
- gpio_port_get_raw, gpio_port_set_masked_raw, gpio_port_set_bits_raw,
  gpio_port_clear_bits_raw, gpio_port_set_clr_bits_raw
- gpio_pin_get_raw, gpio_pin_set_raw
As well as functions:
- gpio_port_toggle_bits, gpio_pin_toggle_bits

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski af972c2c47 api: gpio: Align GPIO dt-bindings flags with Linux DTS
This commit makes following changes to GPIO dt-bindings flags:
- Added GPIO_ACTIVE_LOW, GPIO_ACTIVE_HIGH to indicate pin active state.
- Added GPIO_OPEN_DRAIN, GPIO_OPEN_SOURCE to configure single ended pin
  driving mode.
- Added GPIO_PULL_UP, GPIO_PULL_DOWN flags.
- GPIO_INPUT, GPIO_OUTPUT to configure pin as input or output.
- Added GPIO_OUTPUT_LOW, GPIO_OUTPUT_HIGH flags to initialize output
  in low or high state.
- reworked GPIO_INT_* flags to configure pin interrupts.
- following flags were deprecated: GPIO_DIR_*, GPIO_DS_DISCONNECT_*,
  GPIO_PUD_*, GPIO_INT_ACTIVE_*, GPIO_INT_DOUBLE_EDGE, GPIO_POL_*.

To be aligned with Linux DTS standard any GPIO flags that should not be
used in DTS files are moved from include/dt-bindings/gpio/gpio.h file to
include/drivers/gpio.h with an exception of several old flags which
removal would cause DTS compilation errors. Those remaining old flags
will be removed from include/dt-bindings/gpio/gpio.h at a later stage.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Peter A. Bigot 4420c5ed40 adc: provide API to help with conversions
Gain values are specified with enumeration values that can't be used
to reverse the effects of scaling the input signal.  Provide a
function that reverses the effect of the gain by scaling a measured
value.

Also provide a function that converts a raw measurement captured with
a reference voltage and specific gain and resolution to the
corresponding voltage in millivolts.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-02-03 16:26:51 +01:00
Maureen Helm 5a330f9b36 drivers: kscan: Extend callback arguments to 32-bits
Extends the keyboard scan callback row and column arguments from 8-bits
to 32-bits to support a touch panel driver implementation.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-01 08:50:16 -05:00
Carlo Caione 6f36300219 drivers: timer: Add per-core ARM architected timer
ARM cores may have a per-core architected timer, which provides per-cpu
timers, attached to a GIC to deliver its per-processor interrupts via
PPIs. This is the most common case supported by QEMU in the virt
platform.

This patch introduces support for this timer abstracting the way the
timer registers are actually accessed. This is needed because different
architectures (for example ARMv7-R vs ARMv8-A) use different registers
and even the same architecture (ARMv8-A) can actually use different
timers (ELx physical timers vs ELx virtual timers).

So we introduce the common driver here but the actual SoC / architecture
/ board must provide the three helpers (arm_arch_timer_set_compare(),
arm_arch_timer_toggle(), arm_arch_timer_count()) using an header file
imported through the arch/cpu.h header file.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-02-01 08:08:43 -05:00
Mieszko Mierunski dc3c906d12 drivers: uart: Switch timeout values to s32_t in UART async API
Use signed values for timeout in UART asynchronous API, to be consistent
with timeout type in timer and workqueue values.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2020-01-29 19:37:31 +01:00
Kwon Tae-young 346e5c3a45 include: drivers: lora: Added support for RSSI and SNR in the recv API
Change the API to support RSSI, SNR of data received through lora_recv.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2020-01-28 17:28:26 -05:00
Henrik Brix Andersen c894a6db4d drivers: counter: add counter_get_value(), deprecate counter_read()
Introduce a new counter API function for reading the current counter
value (counter_get_value()) and deprecate the former counter_read() in
favor of this.

Update all drivers and calling code to match the new counter API.

The previous counter driver API function for reading the current value
of the counter (counter_read()) did not support indicating whether the
read suceeded. This is fine for counters internal to the SoC where the
read always succeeds but insufficient for external counters (e.g. I2C
or SPI slaves).

Fixes #21846.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-28 12:52:46 -05:00
Henrik Brix Andersen 0f60477667 drivers: counter: add missing syscalls
Add missing syscalls and fix already present syscalls for the counter
API.

Fixes #14650.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-21 11:36:55 -05:00
Jan Van Winkel 9814e743fd driver: display: Added BGR565 pixel format
Added BGR565 pixel format ti display format enumeration.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-20 09:21:04 -06:00
Jan Van Winkel ecaa7102d2 driver: display: Clarified byte order of pixel formats
Clarified that the byte order of multi byte pixel formats is in big
endian order.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-20 09:21:04 -06:00
Andrew Boie a51b125aba drivers: serial: add async API system calls
These were unintentionally omitted. We don't expose callback
registration or callback response APIs for security reasons.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-01-17 16:15:02 -05:00
Peter A. Bigot ac5acb9530 drivers: sensor: ccs811: provide API to fetch configuration and versions
The application may want to know the configured mode without inspecting
Kconfig macros; this is important for proper management of BASELINE
which is mode-dependent.

It also may need to know the version of the hardware and firmware, as
the behavior of application firmware 2.0 is significantly better than
version 1.1.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot 2dd990ad55 drivers: sensor: ccs811: enable drive mode 4
This mode is documented as producing a raw result every 250 ms that the
application must convert to eCO2 and eTVOC readings.  In practice
application firmware 2.0 appears to convert the readings as with all
other rates.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot cb84836745 drivers: sensor: ccs811: provide access to sensor results
Expose the entire content of the ALG_RESULT_DATA block to the
application, primarily so the status and error flags can be seen.  With
those available the application has the ability to detect that a stale
result has been provided so sensor_fetch_sample() can return -EAGAIN in
this case instead of -EIO, and it doesn't need to block which is
annoying.

This should also make the sensor usable on older Nordic Thingy:52
devices with outdated CCS811 application firmware that doesn't properly
implement the DATA_READY bit.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot c90a738d8c drivers: sensor: ccs811: support update of environmental conditions
Accurate estimate of gas presence requires temperature and humidity
data.  Add API to update these values.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot af0c69fb9f drivers: sensor: ccs811: add interface for BASELINE management
Proper use of the CCS811 requires maintenance of the BASELINE
register value measured in clean air at various points in the sensor
life cycle.  The sensor driver abstraction has no facility to support
this, so add an application header with functions to fetch and update
the register value.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Henrik Brix Andersen bc2113bd46 drivers: adc: add LMP90xxx ADC driver with GPIO
Add driver for the Texas Instruments LMP90xxx series of multi-channel,
low-power 16-/24-bit sensor analog frontends (AFEs).

The functionality is split into two drivers; an ADC driver and a GPIO
driver.

Tested with LMP90080 and LMP90100.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-09 17:27:52 +01:00
Henrik Brix Andersen 9d71384e50 drivers: adc: support for adc channel gain factor of 128
Support specifying a gain factor of 128 when configuring ADC channels.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-09 17:27:52 +01:00
Henrik Brix Andersen db611e6781 drivers: pwm: add support for inverted PWM signals
Add support for requesting an inverted PWM pulse (active-low) when
setting up the period and pulse width of a PWM pin. This is useful
when driving external, active-low circuitry (e.g. an LED) with a PWM
signal.

All in-tree PWM drivers is updated to match the new API signature, but
no driver support for inverted PWM signals is added yet.

All in-tree PWM consumers are updated to pass a flags value of 0
(0 meaning default, which is normal PWM polarity).

Fixes #21384.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-07 18:13:18 +01:00
Manivannan Sadhasivam 92b2994335 include: Add initial LoRa API
Add initial LoRa API for P2P mode.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2019-12-21 12:20:24 +01:00
Stephanos Ioannidis 2b441732ff interrupt_controller: gic: Support multiple GIC versions
The current GIC driver implementation only supports the GIC-400, which
implements the GICv2 interface.

This commit refactors the GIC driver to support multiple GIC versions
and adds GICv1 interface support (GICv1 and GICv2 interfaces are very
similar).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-12-19 11:05:27 -05:00
Tomasz Bursztyka 9abc0e2efd include/drivers: Move 2 specific intc headers into public location
sam0 and stm32 specific interrupt controller headers are meant to be
public, and as such should be found in
include/drivers/interrupt_controller and not in
drivers/interrupt_controllers.

Fixing documentation issues as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-12-18 21:49:46 +01:00
Andrew Boie 13b8b41676 drivers: watchdog: add system calls
wdt_install_timeout() was skipped as it installs an ISR-context
callback handler function. The rest are simple wrappers.

Added myself as the maintainer of the syscall handlers. WDT
subsystem appears to not currently have an owner.

Fixes: #21432

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-18 09:28:52 -05:00
Krzysztof Chruscinski 00156ad80a drivers: clock_control: nrf: Switch to single clock device
Low frequency and high frequency clocks had separate devices
while they are actually handled by single peripheral with single
interrupt. The split was done probably because opaque subsys
argument in the API was used for other purposes and there was
no way to pass the information which clock should be controlled.
Implementation changes some time ago and subsys parameter was
no longer used. It now can be used to indicate which clock should
be controlled.

Change become necessary when nrf5340 is taken into account where
there are more clocks and current approach would lead to create
multiple devices - mess.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-17 14:38:19 +01:00
Peter A. Bigot 8328159b09 include: respect line limit in api pointer initialization
The automated process used to remove implicit casts resulted in code
that exceeded the documented line length limits.  Break the assignment
into two lines where this happened.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-12-16 21:14:08 -05:00
Andrzej Puzdrowski aa0d41f7ec drivers/flash: protection API clarification
On some targets hardware (or middelware) doesn't allow
implement functionality flash protection API -
so fare it have to be emulated by software on such a target.

This patch changes documentation of this API, so on such a targets
API might implements no-operation.

fixes #15729

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-12-15 10:35:09 -05:00
Peter A. Bigot 2e358f11d0 include/drivers: remove implicit casts from api pointer initialization
C++ disallows implicit cast of void pointers to a non-void pointer
type.  Presence of implicit casts prevents use of these headers in C++
applications.

Process: Run the following coccinelle script:

@@
identifier V;
identifier TAG =~ "driver_api";
type T;
expression E;
@@
 T* V =
+(T *)
 E->TAG;

in this command line from $ZEPHYR_BASE:

spatch --sp-file expcast.cocci \
   --include-headers --dir include/ --very-quiet \
 | sed -e '/^\+/s@\*) @*)@' \
 | (cd include/ ; patch -p1)

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-12-15 10:18:17 -05:00
Brooks Prumo 32e3756d66 include: Fixes #1205, C++ usage of sensor.h
I ran into issue #1205 earlier today and realized the fix was to simply
provide the proper casts.  The issue is that C++ is less permissive than
C here, erroring when trying to implicitly convert from `void *` to
`struct gpio_driver_api *`.  The same cast is done in
include/drivers/gpio.h, which is why I did that here as well.

This fix was validated by compiling my C++ application successfully and
also successfully running my app on my board, interacting with sensors.

Signed-off-by: Brooks Prumo <brooks@prumo.org>
2019-12-12 11:06:34 -06:00
Ulf Magnusson 984bfae831 global: Remove leading/trailing blank lines in files
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.

Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.

Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-11 19:17:27 +01:00
Andrei Emeltchenko 07bee26f8f ipm: Correct IPM API error codes
Indicates that error codes are negative.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-10 10:26:38 -05:00
Kumar Gala 24ae1b1aa7 include: Fix use of <misc/FOO.h> -> <sys/FOO.h>
Fix #include <misc/FOO.h> as misc/FOO.h has been deprecated and
should be #include <sys/FOO.h>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-10 08:39:37 -05:00
Martí Bolívar 2de12df6b9 drivers: clock_control: clock_control_on should be blocking
Document this behavior. This partially addresses #20708, but we'll
have to deal with driver bugs case by case now that the desired
behavior is clear.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2019-12-09 12:50:36 -05:00
David B. Kinder 416a174ac2 doc: fix misspellings in docs
Fix misspellings in docs (and Kconfig and headers processed into docs)
missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-12-04 14:12:53 -06:00
Francisco Munoz 11f01dd682 API: eSPI: Add two more APIs for eSPI
eSPI is an aggregator device which is used by other blocks
to communicate with the master. This new APIs allows LPC
peripherals to communicate with eSPI master.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-11-20 15:02:08 -05:00
Krzysztof Chruscinski 16ba258052 drivers: clock_control: Clarify allowed calling context of API calls
Clarified that clock_control_off and clock_control_async_on can be
called from any context since they are non-blocking.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-11-20 18:04:40 +01:00
Krzysztof Chruscinski c53166a8c5 drivers: clock_control: Remove false description of clock_control_async_on
Description of clock_control_async_on contained information about
delayed start which is not supported by this function call.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-11-20 18:04:40 +01:00
Emil Obalski 6c82c80a3c drivers: Add support for nRF52833 in several drivers
By adding new SoC to Zephyr drivers has to be updated.
Commit affects:
 - USB driver
	- support for nRF52833 added.
	- support for USB_DEVICE_REMOTE_WAKEUP in hid-mouse added.
 - SPI
 - IEEE 802.15.4
 - CLOCK CONTROL

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-11-13 10:33:38 -06:00
Henrik Brix Andersen a2a7b776cb drivers: eeprom: add API for EEPROM devices
Add API for accessing Electrically Erasable Programmable Read-Only
Memory (EEPROM) devices.

EEPROMs have an erase block size of 1 byte, a long lifetime, and allows
overwriting data on byte-by-byte access.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Peter A. Bigot a58d8ebaa6 driver: uart: make deprecation effective
Several macros were documented as deprecated but lacked the
infrastructure to produce deprecation warnings.  Add the deprecation
marker, and fix the in-tree references to the deprecated spellings.

Note that one non-deprecated macro should have been deprecated, and
is, referring to a newly added line control bit.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-07 12:44:15 -06:00
Jacob Siverskog eb4679d0c4 uart: Improve line control documentation
Minor improvements to UART line control documentation.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2019-11-07 15:54:40 +01:00
Alexander Wachter d558fd055a drivers: CAN: Limit the DLC to 8
This commit limits the data length code to eight.
DLC > 8 returns a newly introduced CAN_TX_EINVAL error code.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-11-06 21:00:45 +01:00
David B. Kinder 73896c0bf0 doc: fix misspelling in API doxygen comments
Fix misspellings in API doxygen comments missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-10-29 06:00:14 +01:00
Loic Poulain 32169886ca drivers: Add video API
This generic video API can be used to capture/output video frames.

Once a video buffer is enqueued to a video device endpoint, device owns
the buffer and can process to capture (camera), output (disk, display),
convert (hw encoder)... User can then call dequeue to retrieve
the processed buffer (video driver ensure cache coherency).

Once dequeued, video buffer is owned by user (e.g. for frame
processing, display buffer update, write to media, etc...).

For each video-buffer, user needs allocate the associated frame buffer
via video_buffer_alloc. Buffer format is defined by video device
endpoint configuration. Video device can be controlled (e.g. contrast,
brightness, flip...) via controls.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-10-25 15:13:53 -05:00
Alexander Wachter 30ebf52a27 include: drivers: can: Fix zframe to frame conversion
can_copy_zframe_to_frame did not distinguish between the standard and
extended frames. As a result, uninitialized bits were copied to the
destination frame. This commit changes the function to use the correct
bitfields.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-24 21:51:40 +03:00
Alexander Wachter c0da8a7901 drivers: can: Extend CAN API for bus-state management.
This commit extends the CAN API with the following functions:
- can_get_state
- can_recover
- can_register_state_change_isr

This functions can be used to get the error-counters and the state
of the CAN controller. The recover function can be used to recover
from bus-off state when automatic recovery is disabled.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-24 12:28:01 +03:00
Francisco Munoz e13a1230b7 API: kscan: Add API for Keyboard scan matrix
-kscan_config
    -kscan_enable_callback
    -kscan_disable_callback

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-10-16 13:29:21 -07:00
Charles E. Youse f6d9fb10b1 drivers/interrupt_controller/loapic.h: add IPI support
Add a simple inline function and some definitions to faciliate
inter-processor interrupts for SMP initialization/synchronization.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-10-07 19:46:55 -04:00
Charles E. Youse a981f51fe6 arch/x86: drivers/loapic_intr.c: move local APIC initialization
In the general case, the local APIC can't be treated as a normal device
with a single boot-time initialization - on SMP systems, each CPU must
initialize its own. Hence the initialization proper is separated from
the device-driver initialization, and said initialization is called
from the early startup-assembly code when appropriate.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-10-07 19:46:55 -04:00
Morten Priess d9251a83a0 drivers: bluetooth: Added EVT_DATA_BUF_OVERFLOW to bt_hci_evt_is_prio
As it is possible that hci_acl_handle generates an overflow hci event,
the high priority thread must be able to processed it.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2019-10-07 12:43:46 +03:00
Alexander Wachter 1c7892df3f include: drivers: CAN: changed return parameter description
Changed return parameter description from
"@retval filter id on success"  to
"@retval filter_id on success".
This change suppresses the doxy warnings.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-04 13:05:44 -04:00
Krzysztof Chruscinski 6700f2f194 drivers: clock_control: nrf: reimplementation including API updates
Reimplementation of clock control driver for nrf platform. It includes
latest API changes: asynchronous starting and getting clock status.

Additionally, it implements calibration algorithm which optionally
skips calibration based on no temperature change. Internal temperature
sensor is used for that.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-04 17:15:39 +02:00
Anas Nashif 9d70a87f20 drivers: espi: move header to include/drivers
Driver APIs need to go into include/drivers/.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-10-01 16:18:36 -04:00
Andrei Emeltchenko a6eb2ae299 adc: Trivial style cleanup
Cleanup adc header and API test.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-30 12:20:39 -05:00
Yannis Damigos efec7f73b7 dts: esp32: Add GPIO support in DT
Add GPIO support in DT

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-09-25 17:39:42 +02:00
Andrei Emeltchenko 549fbae43b drivers: watchdog: Trivial style cleanup
Cleanup coding style.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-24 11:40:53 -07:00
Andrzej Głąbek 57c6cfc9cd nordic: Use hal/ in all inclusions of nrfx HAL header files
Header files of nrfx HALs are not supposed to be included directly
but only with their names prepended with the hal/ directory (so that
an inclusion of an nrfx HAL header clearly differs from an inclusion
of an nrfx driver header).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-24 16:20:16 +02:00
Kumar Gala 140a8d0c8a console: Remove deprecated function console_register_line_input
console_register_line_input has been deprecated for at least 2 releases
so we can now remove it.  Remove native_stdin_register_input that is
associated with console_register_line_input.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-18 19:14:25 -05:00
Piotr Mienkowski bfa89782a8 gpio: Clean up API documentation
Fix minor issues in doxygen comments. Do not use typedefs for internal
driver API calls. The functions are declared directly in
`struct gpio_driver_api`. No functional changes.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-09-18 13:28:58 +08:00
Piotr Mienkowski 8f31152983 api: gpio: remove deprecated gpio_port functions
Following functions have been deprecated for at least 2 releases. This
commit removes them:
- gpio_port_configure
- gpio_port_write
- gpio_port_read
- gpio_port_enable_callback
- gpio_port_disable_callback

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-09-18 13:28:58 +08:00
Francisco Munoz 1547aa0b2f API: ps2 : Add API for PS/2 devices
-ps2_config
	-ps2_read
	-ps2_write
        -ps2_enable_callback
        -ps2_disable_callback

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-09-18 13:23:52 +08:00
Kumar Gala 29e55d74e8 rtc: Remove old rtc functionality
Remove the old rtc functionality as its been deprecated for 2 releases
now.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-14 07:33:38 -05:00
Kumar Gala 373133132f drivers: counter: remove deprecated functions
counter_set_alarm and counter_get_user_data have been deprecated for at
least 2 releases.  We can now remove them.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-12 13:14:12 -05:00
Charles E. Youse ee525c2597 arch/x86: inline x2APIC EOI
From the Jailhouse days, this has been a function call. That's silly.
We now inline the EOI in the ISR when in x2APIC mode. Also clean up
z_irq_controller_eoi(), so it now uses the inline macros.

Also, we now enable x2APIC on up_squared by default.

Fixes: #17133

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-12 09:53:45 +08:00
Kumar Gala 874c35b509 i2c: Remove deprecated functions
We've had a number of API functions for I2C marked as deprecated for 2
releases.  We can now remove them.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-11 11:17:46 -05:00
Charles E. Youse 4a166f4913 drivers/pci: remove legacy PCI implementation
This has been subsumed by the new implementation in drivers/pcie.
We remove the legacy subsystem, related tests, shell module, and
outdated documentation/config references.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-08 22:09:10 -04:00
Tomasz Bursztyka 05aa6921ba include/drivers: Removing legacy leftovers in PWM header
These 2 macros are not used anymore anywhere.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-08-23 23:51:28 +02:00
Peter Bigot 6554a5e5b6 include: rearrange for standard use of extern "C" in various headers
Consistently place C++ use of extern "C" after all include directives,
within the negative branch of _ASMLANGUAGE if used.

The inclusion of the generated syscall files is placed outside the
extern "C" block as the generated file has its own extern "C" block.

Background from issue #17997:

Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.

Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.

See: https://en.cppreference.com/w/cpp/language/language_linkage
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-08-13 18:00:31 +02:00
Alexander Wachter 3febaad1d6 can: Add RX timestamp to zcan_frame
This commit introduces a timestamp for received CAN frames.
The timestamp is optional and can be activated via Kconfig.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-06 16:39:35 +03:00
Peter A. Bigot 5a39bcae84 drivers/adc: provide API to access reference voltage
Required for any real-world use of ADC_REF_INTERNAL.

Relates-to: issue #11922
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-01 13:28:41 +02:00
Anas Nashif cb412df725 x86: remove code for interrupt forwarding bug
This only applied to quark_se, so removing it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Anas Nashif 578ae40761 boards: remove quarl_se_c1000
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Jan Van Winkel 42d1899087 driver: display: Clarified blanking API
Updated the documentation of display_blanking_on and
display_blanking_off to clarify its usage.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-07-20 08:25:59 -04:00
Andrzej Puzdrowski 743f3dbae0 drivers/flash: add read alignment requirement comment
Added note on read alignment requirement in order to make
a user more conscious of restrictions.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-07-16 12:23:57 +03:00
Krzysztof Chruscinski 1baae96af6 drivers: counter: Extend set channel alarm flags
Added flags for controling detection of setting alarm to late.
Updated drivers to return -ENOTSUP when new option is requested.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-10 07:42:12 -05:00
Krzysztof Chruscinski a37fce6171 drivers: counter: Add optional flags to alarm configuration structure
Flags in alarm configuration structure will allow further extention
without breaking API. Initially, existing absolute flag was added
as the only flag.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-10 07:42:12 -05:00
Krzysztof Chruscinski 3c8e28d126 drivers: counter: Fix references in the doxygen comment
Doxygen comment was referencing deprecated function counter_set_alarm
when the intention was to reference counter_set_channel_alarm.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-04 12:31:17 +02:00
Charles E. Youse 0325a3d972 arch/x86: eliminate include/arch/x86/irq_controller.h
The MVIC is no longer supported, and only the APIC-based interrupt
subsystem remains. Thus this layer of indirection is unnecessary.

This also corrects an oversight left over from the Jailhouse x2APIC
implementation affecting EOI delivery for direct ISRs only.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-07-02 19:30:00 -04:00
Charles E. Youse c384c6685e arch/x86: move include/arch/x86/sys_io.h to ia32/sys_io.h
These inlines currently only apply to IA32, so place accordingly.
Minor changes to direct and indirect users of the file for ordering.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-07-02 19:30:00 -04:00
Krzysztof Chruscinski c661cc6c78 drivers: clock_control: nrf: Add option to use external LF source
Extended clock configuration to allow usage of external clock
source for nrf52 series.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-02 12:58:06 +02:00
Carles Cufi ee040e9e54 drivers: rtc: Adapt to new counter API
The counter API changed recently, and more specifically the
counter_set_top_value() now takes a configuration structure instead of
direct parameters. Adapt the rtc.h header so that it uses the new
signature correctly.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-06-28 12:20:02 -05:00
Anas Nashif 8f1780f6de docs: make doxygen happy with new locations
Change @file entry on some headers due to duplicated files in the
include/ tree (real header + shim).
Adapt the doxygen configuration file to the new locations and remove
directories which are already included.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif a2fd7d70ec cleanup: include/: move misc/util.h to sys/util.h
move misc/util.h to sys/util.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 536dd5a71f cleanup: include/: move misc/slist.h to sys/slist.h
move misc/slist.h to sys/slist.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 5eb90ec169 cleanup: include/: move misc/__assert.h to sys/__assert.h
move misc/__assert.h to sys/__assert.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 7435e5e089 cleanup: include/: move ring_buffer.h to sys/ring_buffer.h
move ring_buffer.h to sys/ring_buffer.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 9e35d53d1f cleanup: include/: move display.h to drivers/display.h
move display.h to drivers/display.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 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 bd70f6f1ed cleanup: include/: move spi.h to drivers/spi.h
move spi.h to drivers/spi.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 8c1f89fa99 cleanup: include/: move sensor.h to drivers/sensor.h
move sensor.h to drivers/sensor.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 fd359c21e9 cleanup: include/: move rtc.h to drivers/rtc.h
move rtc.h to drivers/rtc.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 5843884887 cleanup: include/: move pwm.h to drivers/pwm.h
move pwm.h to drivers/pwm.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 a8167ab17d cleanup: include/: move pinmux.h to drivers/pinmux.h
move pinmux.h to drivers/pinmux.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 afa85cdc0f cleanup: include/: move led_strip.h to drivers/led_strip.h
move led_strip.h to drivers/led_strip.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 a14ef3bf01 cleanup: include/: move led.h to drivers/led.h
move led.h to drivers/led.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 6524925753 cleanup: include/: move ipm.h to drivers/ipm.h
move ipm.h to drivers/ipm.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 f2e35134b0 cleanup: include/: move i2s.h to drivers/i2s.h
move i2s.h to drivers/i2s.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 8f692c7d38 cleanup: include/: move i2c.h to drivers/i2c.h
move i2c.h to drivers/i2c.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 f901e26de9 cleanup: include/: move hwinfo.h to drivers/hwinfo.h
move hwinfo.h to drivers/hwinfo.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 6aa9c3a68f cleanup: include/: move gpio.h to drivers/gpio.h
move gpio.h to drivers/gpio.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 08a9961678 cleanup: include/: move gna.h to drivers/gna.h
move gna.h to drivers/gna.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 fe051a9055 cleanup: include/: move flash.h to drivers/flash.h
move flash.h to drivers/flash.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 969f8f1c68 cleanup: include/: move entropy.h to drivers/entropy.h
move entropy.h to drivers/entropy.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 46a5d1e5cb cleanup: include/: move dma.h to drivers/dma.h
move dma.h to drivers/dma.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 7e7a9bdf88 cleanup: include/: move counter.h to drivers/counter.h
move counter.h to drivers/counter.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 17ddd1714c cleanup: include/: move clock_control.h to drivers/clock_control.h
move clock_control.h to drivers/clock_control.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 c0c9396d44 cleanup: include/: move can.h to drivers/can.h
move can.h to drivers/can.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 8007266e6a cleanup: include/: move aio_comparator.h to drivers/aio_comparator.h
move aio_comparator.h to drivers/aio_comparator.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 f4709f2c2f cleanup: include/: move adc.h to drivers/adc.h
move adc.h to drivers/adc.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 d4d20677ac cleanup: include/: move watchdog.h to drivers/watchdog.h
move watchdog.h to drivers/watchdog.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
Nicolas Pitre 659fa0d57d lifo/fifo: first word is not always first 4 bytes
The first word is used as a pointer, meaning it is 64 bits on 64-bit
systems. To reserve it, it has to be either a pointer, a long, or an
intptr_t. Not an int nor an u32_t.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-26 09:08:42 -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
Anas Nashif cdc78108d5 drivers: serial: ns16550: move header from /include/
Move ns16550 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
Anas Nashif 68c389c1f8 include: move system timer headers to include/drivers/timer/
Move internal and architecture specific headers from include/drivers to
subfolder for timer:

   include/drivers/timer

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-25 15:27:00 -04:00
Anas Nashif 43a49335f4 include: move interrupt controller headers to interrupt_controller/
Move internal and architecture specific headers from include/drivers to
subfolder for interrupt_controller:

include/drivers/interrupt_controller/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-25 15:27:00 -04:00
Charles E. Youse 3dc7c7a6ea drivers/interrupt_controller/mvic.c: remove MVIC interrupt controller
The Quark D2000 is the only x86 with an MVIC, and since support for
it has been dropped, the interrupt controller is orphaned. Removed.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-25 08:06:43 -04:00
Andy Ross a5137c8100 include/drivers/system_timer.h: Clean up docs
Tighten up some phrasing that had proven confusing.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-06-17 20:32:50 -04:00
Charles E. Youse ea1e19107c drivers/pcie/shell: add basic probe for MSI-X capability
This trivial patch extends the PCIe shell to check for and report
on a device's ability to use MSI-X interrupt signaling.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-10 10:52:02 -04:00
Charles E. Youse 53b370a7c6 arch/x86: add x2APIC-aware accessors for local APIC access
MSRs related to x2APIC will never be accessed directly by name, but
rather via an offset from a base MSR, so the definitions are removed
from msr.h.

New local APIC accessor functions, which are sensitive to xAPIC vs
x2APIC mode (CONFIG_X2APIC), are added to include/drivers/loapic.h.
These accessors use the MSR definitions as modified above.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-08 15:41:36 -04:00
Charles E. Youse 0fe4e1b3a8 arch/x86: x2APIC support is not specific to jailhouse
Simple renaming and Kconfig reorganization. Choice of local APIC
access method isn't specific to the Jailhouse hypervisor.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-08 15:41:36 -04:00
Erwan Gouriou 3d9416bfed drivers/bluetooth/hci: Implement HCI driver for stm32wb
Implement HCI driver for STM32WB. It allows host to controller.
It is based on ST library allowing communication over RAM shared
bewteen chip's C-M4 and C-M0 cores.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-06-03 09:38:19 -04:00
Charles Youse 629805d881 drivers/pcie: do not verify configured IRQ
Some firmwares (looking at you, slimbootloader) don't set the registers
in PCI configuration space to indicate the IRQ routing, so we remove
the check that verifies that the user and firmware agree on IRQ number.

Also eliminate the return value of pcie_irq_enable() since no one uses
it and we can't return a meaningful value any longer.

Signed-off-by: Charles Youse <charles.youse@intel.com>
2019-06-01 10:00:32 -04:00
Henrik Brix Andersen 98cecb3681 drivers: gpio: ht16k33: add GPIO driver for Holtek HT16K33 LED driver
The HT16K33 is a memory mapping, multifunction LED controller
driver. The controller supports up to 128 LEDs (up to 16 rows and 8
commons) and matrix key scan circuit of up to 13x3 keys.

This commit adds support for the keyscan functionality of the HT16K33.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-05-07 22:33:06 -04:00
Charles E. Youse f16f7fc491 drivers/pcie: add support to read wired IRQ configuration
Firmware is supposed to set a register in PCI configuration space which
indicates the hardware IRQ that the endpoint is attached to.

A function is implemented which reads this register, and the PCIe shell
is updated to use it instead of doing it "manually".

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-04 18:29:32 -04:00
Charles E. Youse 18833ac0ef drivers/pcie: verify PCI(e) assigned interrupts
A new function pcie_irq_enable() is added to be used in lieu of
irq_enable() when the target device is PCI(e)-attached. The function
attempts to use MSI, when configured in the kernel and supported by
the endpoint; failing that, it will verify that IRQ requested is in
fact routed to the device by the boot firmware before enabling it.

The NS16550 UART driver is updated to use pcie_irq_enable().

The PCI(e) shell is extended to dump information about wired IRQs.

The up_squared devicetree is fixed (reverted?) to IRQ5 for UART1.

The galileo enables MSI by default.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-04-28 13:36:28 -04:00
Andrei Emeltchenko 8d6fbde898 usb: Remove usb_dc_ep_set_callback return code
Make usb_dc_ep_set_callback() return void since the code is never
used.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
Carles Cufi bca3deb1e7 drivers: Bluetooth: Generalize IC-specific setup hook
In order to generalize the currently specialized nRF51 IC setup hook,
make the following changes:

- Generalize the hook to bt_ic_setup()
- Use a weak NOP version by default
- Move the currently existing one to the board folder

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-04-19 12:21:21 +02:00
Krzysztof Chruscinski d2291c4b12 drivers: clock_control: nrf: add SYNTH LFCLK clock source
Added option to have LFCLK synthesized from HFCLK. It is not low
power but ensures constant relation between HFCLK and LFCLK and
might be useful in certain scenarios (e.g. testing).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-04-18 17:50:53 -04:00
Charles E. Youse e039053546 uart/ns16550, drivers/pcie: add PCI(e) support
A parallel PCI implementation ("pcie") is added with features for PCIe.
In particular, message-signaled interrupts (MSI) are supported, which
are essential to the use of any non-trivial PCIe device.

The NS16550 UART driver is modified to use pcie.

pcie is a complete replacement for the old PCI support ("pci"). It is
smaller, by an order of magnitude, and cleaner. Both pci and pcie can
(and do) coexist in the same builds, but the intent is to rework any
existing drivers that depend on pci and ultimately remove pci entirely.

This patch is large, but things in mirror are smaller than they appear.
Most of the modified files are configuration-related, and are changed
only slightly to accommodate the modified UART driver.

Deficiencies:

64-bit support is minimal. The code works fine with 64-bit capable
devices, but will not cooperate with MMIO regions (or MSI targets) that
have high bits set. This is not needed on any current boards, and is
unlikely to be needed in the future. Only superficial changes would
be required if we change our minds.

The method specifying PCI endpoints in devicetree is somewhat kludgey.
The "right" way would be to hang PCI devices off a topological tree;
while this would be more aesthetically pleasing, I don't think it's
worth the effort, given our non-standard use of devicetree.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-04-17 10:50:05 -07:00
Krzysztof Chruscinski 431c450a42 drivers: clock_control: nrf: Fix lfclk source settings for nrf9160
Aligned lfclk source values for nrf9160.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-04-17 10:31:06 -05:00
Anas Nashif 83ceb4953a net: telnet: remove obsolete code
Remove obsolote telnet console code. We now have a proper shell backend
for telnet.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 10:26:27 -04:00
David B. Kinder 5d8e367efe doc: fix misspelling in docs and API comments
Fix misspellings missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-27 15:59:09 -04:00
Flavio Ceolin 95eb2b4fed include: Use macro BIT for shift operations
Use a macro BIT when dealing with bit shift operations.

MISRA-C rule 10.1

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-26 14:31:29 -04:00
Ramakrishna Pallala e1639b5345 device: Extend device_set_power_state API to support async requests
The existing device_set_power_state() API works only in synchronous
mode and this is not desirable for devices(ex: Gyro) which take
longer time (few 100 mSec) to suspend/resume.

To support async mode, a new callback argument is added to the API.
The device drivers can asynchronously suspend/resume and call the
callback function upon completion of the async request.

This commit adds the missing callback parameter to all the drivers
to make it compliant with the new API.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2019-03-14 14:26:15 +01:00
Patrik Flykt 4344e27c26 all: Update reserved function names
Update reserved function names starting with one underscore, replacing
them as follows:
   '_k_' with 'z_'
   '_K_' with 'Z_'
   '_handler_' with 'z_handl_'
   '_Cstart' with 'z_cstart'
   '_Swap' with 'z_swap'

This renaming is done on both global and those static function names
in kernel/include and include/. Other static function names in kernel/
are renamed by removing the leading underscore. Other function names
not starting with any prefix listed above are renamed starting with
a 'z_' or 'Z_' prefix.

Function names starting with two or three leading underscores are not
automatcally renamed since these names will collide with the variants
with two or three leading underscores.

Various generator scripts have also been updated as well as perf,
linker and usb files. These are
   drivers/serial/uart_handlers.c
   include/linker/kobject-text.ld
   kernel/include/syscall_handler.h
   scripts/gen_kobject_list.py
   scripts/gen_syscall_header.py

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-11 13:48:42 -04: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
Paweł Zadrożniak 3ecbff501a usb: Add remote wakeup support
This commit adds support for remote wakeup and extends USB api
with a wakeup request call. Remote wakeup can be dsabled in kconfig
when a specific driver does not support this feature.

Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
2019-02-27 10:37:16 +01:00
Andrew Boie 743677d743 uart: ns16550: place header in correct spot
This is an application facing define, specific to this
driver, for the public uart_drv_cmd() API. Put it with
public headers.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-22 23:32:31 -05:00
Kumar Gala dafad70b96 console: Remove CONFIG_WEBSOCKET_CONSOLE code
Websocket was removed in 1cba0161ed so
remove dead Kconfig references to CONFIG_WEBSOCKET_CONSOLE and
associated dead code/files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-11 22:29:58 -05:00