Commit graph

737 commits

Author SHA1 Message Date
Peter Bigot 9d6127606a drivers: gpio_stellaris: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 6ef8dbbae2 drivers: gpio_sifive: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot b943f71e19 drivers: gpio_sam0: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 02676d1b3c drivers: gpio_sam: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot afd987fe9f drivers: gpio_rv32m1: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 71873c8a16 drivers: gpio_pca95xx: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 7c175c5197 drivers: gpio_mcux_lpc: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot c446588523 drivers: gpio_mcux_igpio: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 56f975fbb4 drivers: gpio_mcux: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 5eebc35d8b drivers: gpio_mchp_xec: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 8236d8209a drivers: gpio_intel_apl: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the hard-coded device-specific pin count to
initialize it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot d869a6c766 drivers: gpio_imx: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.  Not all aliases appear to be present, but using instances breaks
because the ports used by different boards do not always start with
the first.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 84ee7341fe drivers: gpio_ht16k33: add hard-coded support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure.  The devicetree binding does not inherit from
gpio-controller, so the required property is not available there.  A
hard-coded value of 32 pins has been implemented to make the driver
function.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot a908db8d20 drivers: gpio_gecko: add hard-coded support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure.  This driver uses fixups to define a common name
based on the SOC; until aliases for the new properties are added the
code assumes all pins are supported.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 10075991cc drivers: gpio_esp32: add support for pin validation
Add a config structure for each port and use the devicetree GPIO pin
count to initialize it.  Simplify device initialization by using
instance number as only variation point.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot cbe207377e drivers: gpio_dw: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 432b33d3fe drivers: gpio_cmsdk_ahb: add support for pin validation
Replace the common data structure with the common config structure as
a prefix of the driver-specific config structure and use the
devicetree GPIO pin counts to initialize it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 13c6cac876 drivers: gpio_cc32xx: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 47eb2fa27a drivers: gpio_cc13xx_cc26xx: add support for pin validation
Add a config structure and use the devicetree GPIO pin count to
initialize it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot a8ba5fb1a5 drivers: gpio_sx1509b: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 63141c1a31 drivers: gpio_nrfx: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 9022d33fec drivers: gpio: add support for device-specific pin validation
Extend the driver data structure with a field that identifies the pins
supported by the device.  Document the fields and who is responsible
for maintaining them.

Update all configuration functions for specific pins to return an
error if the pin is not supported.

Update all set/get functions for specific pins to assert if the pin is
not supported.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Daniel Leung 07cb01b079 x86: apollo_lake: changes GPIO definition in DTS
This breaks down the GPIO controller definition in DTS into
multiple entries. This allows these controllers to be
referenced by other DTS, and test board overlay files.
And also we can remove the entries in the dts fixup file.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung 4e05433790 gpio: intel_apl: convert to new GPIO API
Update driver code to use new GPIO configuration flags such as
GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Peter Bigot 2016cc64aa drivers: gpio: provide typedefs for flags and devicetree properties
The public API for GPIO flags should use unsigned values, and for
MISRA compliance the size should not be platform-dependent.  Add a
typedef for generic flags.

Also add typedefs for pin indexes and devicetree flags so these can
be safely recorded from devicetree property values without risking
loss of information if more flags are added in the future.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Robert Winkler e8d0eb1db1 drivers: gpio: Add LiteX GPIO driver
This commits adds GPIO driver for LiteX SoC builder.

Due to the fact that GPIO in LiteX is unidirectional and can be
configured with different pins amount per port, additional entries
were added to the dts file.

Signed-off-by: Robert Winkler <rwinkler@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
2020-02-05 12:00:36 +01:00
Peter Bigot 7821104ee9 drivers: gpio_sx1509b: add support for pin configuration on device init
IO extenders may provide input signals to LEDs or sensors where
leaving the signal undriven may result in increased power consumption
or misbehavior.  The SX1509B powers up with all signals configured as
inputs.  Provide a way to indicate which pins should be set as output,
and their initial signal level, when the device is configured.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 22be9ddc79 drivers: gpio_sx1509b: fix consistency issue in toggle implementation
The cached state of the output must be managed under mutex, but the
original toggle implementation read the current state outside the
mutex and used it to update the state.  Rework the internal API so
that toggle is done within the mutex, distinct from masked set.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Daniel Leung 2de126e40d drivers: gpio_pca95xx: factor device declaration into macros
This factors the common bits of device declaration into macros
so it would be easier to add new instances.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung e6bbc49a7a gpio: pca95xx: convert kconfig to DTS
This converts configuration of the driver to DTS.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung 5e678c2e6a drivers: gpio_pca95xx: no longer support config by port
Remove support for GPIO_ACCESS_BY_PORT in the config function
as configuration by port is going away.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung b2e1058ca3 drivers: gpio_pca95xx: guard read/write with semaphore
Since the GPIO expander is a I2C device, any read/write to
the registers has high latency. Therefore, semaphore is
introduced to prevent multiple threads to manipulate
the GPIOs at the same time.

Also make sure that we are not doing I2C transactions
within ISRs.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung 04db241fb7 drivers: gpio_pca95xx: update cache after successful write
Only update the internal register cache after successful write,
or else it would get out of sync with hardware.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung 1c474e5364 drivers: gpio_pca95xx: endianness awareness
The register pair for each port in the GPIO expander are
port 0 first then port 1. This would not work for big
endian systems with the u16_t port value. So need to
swap the byte ordering on such system.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung 698f587e3a drivers: gpio_pca95xx: roll header file into source file
The structures defined in the header file are only used by
the driver source file, and should not be used by others.
So roll the header file into the source file so it won't
get #include.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung 74e6795f6a drivers: gpio_pca95xx: use I2C burst write
Use I2C burst write to write 2 bytes to each pair of registers
instead of 2 separate transactions of writing 1 byte.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung eafd0d9d21 drivers: gpio: rename PCAL9535A to PCA95XX
PCA95XX is a series of compatible I2C-based GPIO expanders,
with common registers on input/output, polarity and configuration.
This renames the original PCAL9535A driver to PCA95XX to indicate
that it can support this series. Additional features on variants
are guarded by kconfigs.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung dfce0617f4 drivers: gpio_pcal9535a: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Nathaniel Graff 3c986e970d drivers: gpio_sifive: Disable interrupts
The interrupt functionality of this driver is incomplete,
but for the sake of not slowing down the GPIO API refactor,
I'm just returning -ENOTSUP until we can track down the issue.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2020-02-05 12:00:36 +01:00
Nathaniel Graff be1cbd4aa7 drivers: gpio_sifive: Update for new GPIO API
Update the Sifive GPIO driver for new API

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2020-02-05 12:00:36 +01:00
Peter Bigot 3f04133e58 drivers: gpio: sx1509b: relax conditions on pin specification
The 1pin test fails to pass because it expects to be able to
manipulate more than 16 pins.  Since the intent is to filter invalid
pins at the wrapper level remove the validation performed within the
driver.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 2f3c43251f drivers: gpio: utils: filter pin notifications based on callback
Some drivers masked the set of signaled pins based on enabled
interrupts, some did not.  For those that did not the 2-pin test could
fail.  The documentation does not imply that pins unrelated to the
callback participate in the notification process, so do the filtering
in the generic callback loop.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 4feff71aab drivers: gpio: gecko: fix interrupt clear
In order to reliably detect interrupts the interrupt must be
acknowledged before the callback is invoked.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 5d30d5cb03 drivers: gpio: sam: fix pull reconfiguration
In the fine print of the manual it's stated that attempts to enable a
pull in one direction while the pull in the other direction is enabled
are ignored.  This has been confirmed.  Change logic to disable both
pulls, then enable the one that's configured, if any.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 8c8f8bbb48 drivers: gpio: rv32m1: fix interrupt clear
In order to reliably detect interrupts the interrupt must be
acknowledged before the callback is invoked.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Kumar Gala ab859fabc1 drivers: stellaris: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Mohamed ElShahawi fef3ebaa69 drivers: gpio_esp32: update to use new GPIO API
- Updates gpio driver and device tree files to the new GPIO Config flags
- Implements the new port_* APIs
- Update I2C and PWM Drivers to use new GPIO config
- Add esp32.overlay to gpio_basic_api test
- refactor convert_int_type, regs struct
- remove config_polarity
- add kConfig notes

Tests:
- samples/basic/blinky
- samples/basic/button
- tests/drivers/gpio/gpio_basic_api
- tests/drivers/gpio/gpio_api_1pin

Board:
- esp32 DevKitC V4

Note about interrupts:
The ESP32 requires specifying a CPU interrupt to be used for GPIO
interrupt signals.  CPU interrupts can be either level or edge (or
special) triggered, but not both.
Please check gpio/Kconfig.esp32 for more info.

Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
2020-02-05 12:00:36 +01:00
Kumar Gala 8f4da10356 drivers: mmio32: update to use new GPIO API
As the mmio32 is more of a library than a proper driver, just implement
the new port functions and have pin_interrupt_configure marked pretty
much as not supported.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Maureen Helm 03c3b4bed5 gpio: Update rv32m1 gpio driver to use new gpio api
Updates the rv32m1 gpio driver and all associated boards to use new
device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle and pin_interrupt_configure functions recently
added to the gpio api.

Assumes the gpio api layer handles translating logical flags to physical
flags.

Stops quietly reconfiguring pinmuxes to gpio mode. The pinmux must now
be configured explicitly in the board's pinmux.c or in the application.

Tested with:
- samples/basic/blinky
- samples/basic/button
- tests/drivers/gpio/gpio_api_1pin

On boards:
- rv32m1_vega_ri5cy

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski 73fcc07281 drivers: gpio_mcux: clean up interrupt code
Remove redundant interrupt code from gpio_mcux_configure, move the rest
to gpio_mcux_pin_interrupt_configure.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Peter Bigot 746f7e37e7 drivers: gpio_sam0: update to new GPIO API
Drop the port access, rework to separate interrupt and pin
configuration, add new API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Kumar Gala 9aa1dc11ce drivers: gpio_cmsdk_ahb: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

We treat GPIO_INT_MODE_LEVEL as not supported as the hardware doesn't
seem to handle level interrupts as one would expect.  Looking into this
further to determine if its a HW bug or some misconfiguration in the
software.

We don't support dynamic setting of PULL_UP/PULL_DOWN config as this is
handled by pinctrl for the current boards we support the CMSDK AHB
driver on.

Tested on musca-a board.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Andrei Gansari 9b0931e54a drivers: gpio_mcux_lpc GPIO interrupts
LPC GPIO architecture uses multiple devices.
GPIO input is routed via INPUTMUX to the PINT
device which roots the interrupt to NVIC.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-02-05 12:00:36 +01:00
Andrei Gansari abfc81541a gpio: Update mcux lpc driver to use new gpio api
Updates the mcux lpc driver and all associated boards to use new
device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle functions recently added to the gpio api.
ISR functions to be added later.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-02-05 12:00:36 +01:00
Erwan Gouriou 78d7b2106a drivers/interrup_controller: stm32: stm32_exti_enable could be void
stm32_exti_enable was returning errors on line > 32 or line pointing
to non implemented line. Both conditions are hard-coded, hence there
is no use to detect them dynamically in the code.
Check them with assert. As a consequence, function could now be void.

Additionally, enable exti irq line only if both checks are passed.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Erwan Gouriou 29e9780ad1 drivers/interrupt_controller: stm32: Clean set api from unused arg
Argument 'port' in stm32_exti_set_callback function is not
used, remove it.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
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
Erwan Gouriou eecc384b22 drivers/gpio: stm32: various clean up
Perform few clean up in stm32 gpio driver:
*Clean up uint32_t occurrences left over.
*Move function gpio_stm32_flags_to_conf from const to static
and remove useless parameter check
*Rework error handling in functoin gpio_stm32_config
*Remove gpio_stm32_int_enabled_port function and have direct call
to gpio_stm32_get_exti_source

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Erwan Gouriou a6801f7ff4 drivers/gpio: stm32: Update to new GPIO api
Update STM32 GPIO driver to support new GPIO API.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Stanislav Poboril 6422e1a36b gpio: Update imx gpio driver to use new gpio api
Updates the imx gpio driver and all associated boards to use new
device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle and pin_interrupt_configure functions recently
added to the gpio api.

Assumes the gpio api layer handles translating logical flags to physical
flags.

Tested with:
- samples/basic/blinky
- samples/basic/button
- tests/drivers/gpio/gpio_api_1pin
- tests/drivers/gpio/gpio_basic_api

On boards:
- udoo_neo_full_m4

Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
2020-02-05 12:00:36 +01:00
Maureen Helm 5f09966380 gpio: Update mcux igpio driver to use new gpio api
Updates the mcux igpio driver and all associated boards to use new
device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle and pin_interrupt_configure functions recently
added to the gpio api.

Assumes the gpio api layer handles translating logical flags to physical
flags.

Removes port configuration support since that feature is deprecated in
the new gpio api.

Tested with:
- samples/basic/blinky
- samples/basic/button
- tests/drivers/gpio/gpio_api_1pin

On boards:
- mimxrt1015_evk
- mimxrt1020_evk
- mimxrt1050_evk
- mimxrt1060_evk
- mimxrt1064_evk

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-05 12:00:36 +01:00
Henrik Brix Andersen c7382c80a0 drivers: gpio_ht16k33: update to use new GPIO API
Implement the new GPIO driver APIs for the HT16K33 and update the
driver to use the new GPIO flags.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-02-05 12:00:36 +01:00
Vincent Wan 5edb7288ad drivers: gpio: cc32xx: add assertions to check number of pins
On the TI CC32xx, the GPIO peripheral supports only 8 pins per port.
We should add assertions where appropriate to verify this.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 12:00:36 +01:00
Vincent Wan 4fce4749a2 gpio: Update cc13x2/cc26x2 gpio driver to use new gpio api
Updates the cc13x2/cc26x2 gpio driver and all associated boards to use
new device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle and pin_interrupt_configure functions recently
added to the gpio api.

Tested with:

samples/basic/blinky
samples/basic/button
tests/drivers/gpio/gpio_api_1pin
tests/drivers/gpio/gpio_basic_api

On board:

cc1352r1_launchxl

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 12:00:36 +01:00
Vincent Wan d5850ac686 gpio: Update cc32xx gpio driver to use new gpio api
Updates the cc32xx gpio driver and all associated boards to use new
device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle and pin_interrupt_configure functions recently
added to the gpio api.

Tested with:

samples/basic/blinky
samples/basic/button
tests/drivers/gpio/gpio_api_1pin
tests/drivers/gpio/gpio_basic_api

On boards:

cc3220sf_launchxl
cc3235sf_launchxl

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 12:00:36 +01:00
Peter Bigot dfa7ef2c4d drivers: gpio_sx1509b: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API.

Tested on external SX1509B breakout board and Thingy:52.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Daniel Leung f8f1a91cf7 drivers: gpio_dw: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

The interrupt triggering on both edges is a remnant from the old
Quark SE which has a customized DesignWare GPIO block. So remove
the support for both edges as the board is no longer supported.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Peter Bigot 79c04b4ea6 drivers: gpio_mcux: fix handling of unsupported configurations
The MCUX GPIO peripheral must be configured as either input or output.
Reject attempts to configure disconnected or bidirectional.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Daniel Leung 4307a86243 drivers: gpio_mchp_xec: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Kumar Gala 9736d8dee2 drivers: gpio_sx1509b: 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 01d74c6393 drivers: gpio_stm32: 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 049dd625db drivers: gpio_stellaris: 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 d33ba46751 drivers: gpio_sifive: 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 dce2251043 drivers: gpio_sam0: 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 88c23b9f9d drivers: gpio_rv32m1: 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 d408fa0411 drivers: gpio_pcal9535a: 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 cc4723ca5d drivers: gpio_mcux_lpc: 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 d91cb6ec7c drivers: gpio_mchp_xec: 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 af66e1dccd drivers: gpio_intel_apl: 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 dfbb8fa5f1 drivers: gpio_imx: 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 bd06f0835a drivers: gpio_ht16k33: 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 22042ad75c drivers: gpio_esp32: 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 bcdc057503 drivers: gpio_dw: 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 5a34407daa drivers: gpio_cmsdk_ahb: 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 be17245419 drivers: gpio_cc32xx: 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 f30e4efd7a drivers: gpio_cc13xx_cc26xx: 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 3231b22767 drivers: gpio_nrfx: Update for handling local layer in core
Remove handling for GPIO_INT_LEVELS_LOGICAL in driver now that we do
that in gpio_pin_interrupt_configure and gpio_pin_configure.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala 7e6d9ffb31 drivers: gpio_sam: Update for handling local layer in core
Remove handling for GPIO_INT_LEVELS_LOGICAL in driver now that we do
that in gpio_pin_interrupt_configure and gpio_pin_configure.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala 31139f834a drivers: gpio_gecko: Update for handling local layer in core
Remove handling for GPIO_INT_LEVELS_LOGICAL in driver now that we do
that in gpio_pin_interrupt_configure and gpio_pin_configure.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala bd8141832e drivers: gpio_mcux: Update for handling local layer in core
Remove handling for GPIO_INT_LEVELS_LOGICAL in driver now that we do
that in gpio_pin_interrupt_configure and gpio_pin_configure.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala 7989f5cd6b drivers: gpio_mcux: Fix interrupt handling
Change when we clear interrupt status to happen before we handle the
callbacks.  As the callbacks might manipluate the GPIO state and cause
a GPIO interrupt.  If we clear interrupt status after than we might
miss an interrupt.

Also only clear interrupts for interrupts that are we have enabled and
that were reported when we read from the interrupt status.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski 30a97ce28e drivers: gpio_mcux: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Tested on frdm_k64f board.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski ff90b2c1d6 drivers: gpio_nrfx: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Tested on nrf52840_pca10056 board.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski 39effb4397 drivers: gpio_sam: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Tested on sam_e70_xplained board.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski 1fdc3bed14 drivers: gpio_gecko: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Tested on efr32_slwstk6061a board.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
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
Gerson Fernando Budke 4a1bb71694 drivers: gpio: Add samv71 defines
Enable samv71 MCU gpio specifics.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 13:56:42 -05:00
Tomasz Bursztyka 82ecefc11c drivers/gpio: Fix indentation in DW driver
Commit ID c490219d1e introduced wrong indentation there.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Peter Bigot 5e2b24a5e4 treewide: use full path to led/ht16k33.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot 5e470ec3bf treewide: use full path to gpio/gpio_mmio32.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot 0b0d2e640b treewide: use full path to clock_control/stm32_clock_control.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot 4147188bbb treewide: use full path to clock_control/arm_clock_control.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot 19381a7e12 treewide: use full path to adc/lmp90xxx.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Kumar Gala b1602c8e39 arm: Removed support for CC2650
The SoC, driver, and board support for the CC2650 and CC2650 Sensortag
aren't currently supported and we are removing them as such.  If anyone
is interesting in supporting this platform we can easily recovery it
from git.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-01-18 09:27:55 -06:00
Maureen Helm 9e14543c19 drivers: gpio: Refactor mcux igpio driver to use generated dts macros
Refactors the mcux igpio driver to use generated device tree macros
directly. Removes now unused dts fixup macros from i.mx rt socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-14 11:10:27 -05:00
Ryan QIAN df12b9ee7f driver: gpio: gpio_mcux_igpio: check presence of IRQ macro first
- Check presence of GPIO IRQ related macros before enabling IRQ

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2020-01-09 16:29:22 -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
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
Tomasz Bursztyka c30600d4ab drivers/interrupt_controller: Adopt file naming as other drivers
Pattern being <domain>_<model>.<c/h>.
Here interrupt_controller as a domain would be far too long so
shortening it to "intc", as DTS does actually.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-12-18 21:49:46 +01: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
Piotr Mienkowski 8f0aa32ad5 soc: gecko: Enable SWO output during SoC initialization
Enable SWO debug output during system initialization and not as part of
GPIO driver initialization. After the modification the logger output
becomes available earlier during the boot process. Also, it's not
necessary anymore to build full GPIO driver only to enable SWO. This may
be critical when building small images.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-11-19 13:56:06 -05:00
Christian Taedcke 5ddc46e477 gpio: silabs gecko: Add support for more ports
The gecko gpio driver can now utilize ports a to k.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2019-11-13 12:05:48 -06:00
Christian Taedcke 0ae98c1caf gpio: silabs gecko: Use macro for port initialization
This removes a lot of copy-and-paste.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2019-11-13 12:05:48 -06:00
Marcin Niestroj dfda0cb114 gpio: stm32: support disabling and reenabling interrupts on gpio pin
Up to now interrupts could be only configured once, with no way to
disable them in runtime.

Allow interrupts to be disabled in runtime and then properly reenabled
on user request. This allows to ignore interrupts when software is not
expecting them.

The improvement over previously reverted patch [1] is that we disable
interrupts only when we configure port for which interrupt line was
previously selected. This for example prevents to disable interrupts
line 2 in case PA2 was previously configured as interrupt source, but we
are currently configuring PB2 as output.

[1] 0951ce2d34 ("gpio: stm32: support disabling and reenabling
  interrupts on pin")

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-13 12:05:48 -06:00
Marcin Niestroj 7edcbedc70 gpio: stm32: split helper functions from gpio_stm32_enable_int()
This patch doesn't change functionality, but is only related to improved
readability and reusability.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-13 12:05:48 -06:00
Marcin Niestroj 09a57a5e81 gpio: stm32: statify gpio_stm32_enable_int()
This allows compiler to inline function body and reduce overall code
size.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-13 12:05:48 -06:00
Erwan Gouriou dd0d567e8b drivers/gpio: stm32: Rework configure function exit for dual core
With dual core handling introduction, we now need to take care to
always release lock before exiting function.
Rework gpio_stm32_config to take this into account.
Additionally, since ENOSYS usage is resevred to system calls
handling, replace with EIO.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-11-13 12:05:48 -06:00
Peter A. Bigot 7dca60dfcb drivers: gpio: fix sifive interrupt management
The translation to encoded multi-level interrupts failed to account
for the GPIO interrupt number being encoded in at bit position 8,
and being offset by 1 in the base encoding.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-12 07:08:18 -06:00
Andrzej Głąbek b1d5eed262 drivers: nrfx: Update implementations after switching to nrfx 2.0.0
Update calls to nrfx HAL functions to reflect API changes introduced in
nrfx 2.0.0. All these functions are now called with the first parameter
pointing to the structure of registers of the relevant peripheral.
Also a few functions got renamed:
- nrf_gpiote_int_is_enabled to nrf_gpiote_int_enable_check
- nrf_gpiote_event_is_set to nrf_gpiote_event_check
- nrf_rng_event_get to nrf_rng_event_check
- nrf_rng_int_get to nrf_rng_int_enable_check
- nrf_rtc_event_pending to nrf_rtc_event_check
- nrf_rtc_int_is_enabled to nrf_rtc_int_enable_check
- nrf_timer_cc_read to nrf_timer_cc_get
- nrf_timer_cc_write to nrf_timer_cc_set

Default configuration values were removed from nrfx_config files,
so the drivers pwm_nrfx and spi_nrfx_spis no longer can use those.

Function nrfx_pwm_init() now takes one more parameter - context pointer
that is passed to the event handler, not used in the pwm_nrfx driver.

HALs for UART and UARTE now allow configuration of the parity type
and the number of stop bits, for SoCs that provide the corresponding
registers.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-11-08 14:54:12 +01:00
Benjamin Valentin 224174bc99 gpio: sam0: provide PORT_PMUX_PMUXE_A_Val define
SAMD5x/SAME5x header files do not provide this define anymore.
On SAMD2x it was 0, this is still valid.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2019-11-06 17:49:28 -08:00
Benjamin Valentin 82ec48b471 gpio: sam0: Add support for PORTD
Some devices like SAME54 have an additional GPIO bank.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-11-06 17:49:28 -08:00
Anas Nashif 7984f6c363 drivers: gpio: remove altera gpio driver
Remove unsupported driver.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-11-06 10:56:41 -05:00
Ulf Magnusson bd6e04411e kconfig: Clean up header comments and make them consistent
Use this short header style in all Kconfig files:

    # <description>

    # <copyright>
    # <license>

    ...

Also change all <description>s from

    # Kconfig[.extension] - Foo-related options

to just

    # Foo-related options

It's clear enough that it's about Kconfig.

The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)

    git ls-files '*Kconfig*' | \
        xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05:00
Ulf Magnusson 975de21858 kconfig: Global whitespace/consistency cleanup
Clean up space errors and use a consistent style throughout the Kconfig
files. This makes reading the Kconfig files more distraction-free, helps
with grepping, and encourages the same style getting copied around
everywhere (meaning another pass hopefully won't be needed).

Go for the most common style:

 - Indent properties with a single tab, including for choices.

   Properties on choices work exactly the same syntactically as
   properties on symbols, so not sure how the no-indentation thing
   happened.

 - Indent help texts with a tab followed by two spaces

 - Put a space between 'config' and the symbol name, not a tab. This
   also helps when grepping for definitions.

 - Do '# A comment' instead of '#A comment'

I tweaked Kconfiglib a bit to find most of the stuff.

Some help texts were reflowed to 79 columns with 'gq' in Vim as well,
though not all, because I was afraid I'd accidentally mess up
formatting.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-01 15:53:23 +01:00
Kumar Gala 48e946db21 gpio: sx1509b: remove non-DTS support
Now that all I2C bus drivers support DTS we can remove the non-DTS
driver support.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-23 15:34:28 -05:00
Ulf Magnusson 677f1e6db9 kconfig: Turn pointless/confusing 'menuconfig's into 'config's
Defining a symbol with 'menuconfig' just tells the menuconfig to display
any dependent symbols that immediately follow it in a separate menu.
'menuconfig' has no effect on symbol values.

Making a symbol that doesn't have any dependent symbols after it a
'menuconfig' should be avoided, because then you end up with an empty
menu, which is shown as e.g.

    [*] Enable foo ---

This is how it would be shown if there were children but they all
happened to be invisible as well.

With a regular 'config', it turns into

    [*] Enable foo

Change all pointless 'menuconfig's to 'config's.

See the section on 'menuconfig' on the Kconfig - Tips and Best Practices
page as well.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-22 13:53:06 -05:00
Richard Osterloh f7bad922f0 drivers: gpio: Add STM32G4X gpio support
Add GPIO driver support for STM32G4X SoC series.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 18:44:24 -07:00
Jose Alberto Meza 4c095b5cbc drivers: gpio: xec: Ensure GPIO input is enabled
All GPIOs except VCI pins come in default GPIO mode and  input disabled
Need to explicitly enable input apart from setting direction.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-09-30 13:42:58 -07: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
Anas Nashif 8c2a63ab7d drivers: gpio: remove qmsi gpio driver
No users of this driver after dropping quark platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Anas Nashif 6bdfe5dc16 drivers: gpio: remove sch gpio driver
Was used on galileo which was removed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Piotr Mienkowski f98084131e drivers: clean up flags in gpio_intel_apl driver
Modify the way we test for flags as a precursor to the new GPIO API.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-09-18 13:28:58 +08:00
Peter A. Bigot dc553f8fde drivers: gpio: fix misuse of u8_t where bool is intended
GPIO configuration flags will move and some that used to be in the low
8 bits are now higher, resulting in implicit constant conversion
overflows.  Use a boolean data type to hold boolean values.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-09-18 13:28:58 +08:00
Erwan Gouriou c9dcf37e6c Revert "gpio: stm32: support disabling and reenabling interrupts on pin"
This reverts commit 0951ce2d34.

This change introduces regression on GPIO interrupts handling
when several GPIOs are configured.

Fixes #19177

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-09-16 05:44:15 -05:00
Piotr Mienkowski b914ba8831 drivers: remove gpio_atmel_sam3 driver
The gpio_atmel_sam3 is no longer required since the gpio_sam, common
SAM family GPIO driver, provides improved functionality.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-09-12 13:25:30 -05:00
Piotr Mienkowski 17b3ead21a drivers: fix #ifdef in gpio_sam driver
- prefix SOC_SERIES_ defines with CONFIG_
- exclude pull down configuration on sam3x series

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-09-12 13:25:30 -05:00
Marcin Niestroj 0951ce2d34 gpio: stm32: support disabling and reenabling interrupts on pin
Up to now interrupts could be only configured once, with no way to
disable them in runtime.

Allow interrupts to be disabled in runtime and then properly reenabled
on user request. This allows to ignore interrupts when software is not
expecting them.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-09-12 08:41:44 -05:00
Andy Ross 346cce31d8 kernel: Port remaining buildable syscalls to new API
These calls are buildable on common sanitycheck platforms, but are not
invoked at runtime in any tests accessible to CI.  The changes are
mostly mechanical, so the risk is low, but this commit is separated
from the main API change to allow for more careful review.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-09-12 11:31:50 +08:00
Chris Schramm ed9c1ce55d drivers/gpio: pcal9535a: fix i2c write
writing to both port registers of pcal9535a
was broken

fixes #17625

Signed-off-by: Chris Schramm <schramm@makaio.com>
2019-09-10 15:09:53 -05:00
Kumar Gala 95f78bcacf interrupt: Convert RISC-V plic to use multi-level irq support
Utilize the multi-level irq infrastructure and replace custom handling
for PLIC on riscv-privilege SoCs.  The old code offset IRQs in drivers
and various places with RISCV_MAX_GENERIC_IRQ.  Instead utilize Zephyr's
encoded IRQ and replace offsets in drivers with the IRQ define from DTS.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-10 07:34:57 -05:00
Charles E. Youse 68f45fd6d4 drivers/gpio/gpio_dw: remove support for legacy PCI interface
Only Quark SoCs used this IP block hanging off a PCI bus, and the PCI
support is written for the deprecated legacy PCI subsystem, so remove.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-08 22:09:10 -04:00
Marcin Niestroj c62b57fbd4 gpio: stm32: fix build for stm32l0x with no GPIOH
Some smaller stm32l0x MCUs, such as stm32l011x, do not have GPIOH
port. Fix build for those by checking LL_SYSCFG_EXTI_PORTH macro.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-08-26 09:48:54 -05:00
Anas Nashif ab9c528734 gpio: remove unused qmsi driver
This driver was used by the sensor subsystem in Arudino 101. Remove as
the board was dropped.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-08-21 09:52:01 -04:00
Andrzej Głąbek c542a4c56f drivers: gpio_nrfx: Correct the way the callbacks are fired
Add additional masking of the pins with fired callback triggers
against the currently enabled callbacks, in order to not call
handlers for callbacks that got disabled in some other callback
handlers that were called in the same ISR execution.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-08-14 14:49:55 +02:00
Nicolas Pitre 75bf3c5368 riscv: freedom: rename RISCV32 to RISCV
This code is common to 32- and 64-bit builds.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-08-08 00:29:24 -04:00
Nicolas Pitre e5981f2b71 drivers: sifiv: make them 64-bit compatible
Make those drivers compatible with a 64-bit build.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-08-08 00:29:24 -04:00
Ulf Magnusson d1dff7129b drivers: gpio: Remove redundant GPIO dep. from GPIO_HT16K33
GPIO_HT16K33 is defined in drivers/gpio/Kconfig.ht16k33, which is
source'd within an 'if GPIO' in drivers/gpio/Kconfig.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 08:14:10 -05:00
Findlay Feng 4b18a079d9 drivers: gpio: add stm32f1x SWJ configuration
Add the serial wire JTAG configuration of the stm32f1x family.
Before gpio is initialized, you can choose to turn off the debug pin to
make the used pins available.

Signed-off-by: Findlay Feng <i@fengch.me>
2019-08-05 13:22:34 +02:00