Commit graph

9 commits

Author SHA1 Message Date
Piotr Mienkowski 4b194eb4fc gpio: remove deprecated API functions/macros
This commit removes API functions and macros which were deprecated in
2.2 release. GPIO drivers are updated accordingly.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-06-16 19:13:05 +02:00
Peter Bigot fe266f9d2c gpio: restore missing legacy devicetree direction flag
GPIO_DIR_OUT is deprecated but allowed in devicetree bindings because
some in-tree bindings provided it in the past.  GPIO_DIR_IN was the
former explicit way of representing the default direction.  Put it
back so symmetry is maintained.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-13 22:50:45 +02:00
Peter Bigot 52aa8edbd0 gpio: support logic-level output at initialization
Extend the physical level GPIO_OUTPUT_{HIGH,LOW} configuration with
GPIO_OUTPUT_{ACTIVE,INACTIVE} for logic level initialization.

This enables use of device-tree configuration flags in calls to
gpio_pin_configure() to set the logic level without having to
determine the corresponding physical level.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 2b150bff4f gpio: avoid disabling interrupts when supporting legacy code
gpio_pin_interrupt_configure() is invoked from within
gpio_pin_configure() to support legacy code that combines pin and
interrupt configuration.  Expressing a disabled interrupt by a zero
value for interrupt flags causes this invocation to disable interrupts
when the intent is to change only a pin configuration, such as pull
direction.

Support a distinction between explicitly disabling interrupts and
leaving the interrupt configuration unchanged.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
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
Kumar Gala 58ec6fd30f gpio: remove unused GPIO_INT_CLOCK_SYNC flag
GPIO_INT_CLOCK_SYNC wasn't implemented by anything, so remove it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-03 08:23:24 -05:00
Flavio Ceolin 67ca176754 headers: Fix headers across the project
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-17 15:49:26 -04:00
Sebastian Bøe 1f22a418ca gpio: doc: Be explicit about how EDGE and DOUBLE_EDGE work together
Be explicit about how EDGE and DOUBLE_EDGE interact, see PR #6807 for
details.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-12 11:51:14 -04:00
Erwan Gouriou 4fe3a9776f dts: gpio: create gpio dt-bingings and inlude in stm32 dtsi files
Create a dt-bindings/gpio.h file.
Bindings definitions are extracted from existing gpio.h.
gpio dt-bindings file is required because existing gpio.h file could
not be parsed by dts parser.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-04-13 13:36:45 -05:00