Commit graph

522 commits

Author SHA1 Message Date
Gerard Marull-Paretas a1e983fef0 drivers: pinmux: drop driver class
Pinctrl is the new pinmux.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-02-23 16:56:04 -05:00
Gerard Marull-Paretas d76f4f2c8a drivers: pinmux: mchp_xec: drop driver
Drop Microchip XEC driver in favor of pinctrl.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-02-23 16:56:04 -05:00
Gerard Marull-Paretas 9ca624eb13 drivers: pinmux: mcux: drop driver
Drop the MCUX driver in favor of Kinetis pinctrl driver.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-02-23 16:56:04 -05:00
Gerard Marull-Paretas 099012a59f drivers: pinmux: lpc11u6x: drop driver
Drop LPC11U6X pinmux driver in favor of pinctrl.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-02-23 16:56:04 -05:00
Gerard Marull-Paretas 33372b9e48 drivers: pinmux: mcux_lpc: drop driver
Drop MCUX LPC pinmux driver in favor of pinctrl.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-02-23 16:56:04 -05:00
Gerard Marull-Paretas d925c660ed drivers: pinmux: stm32: drop driver
Drop STM32 pinmux driver in favor of pinctrl. Some definitions located
in pinmux headers were used by the pinctrl driver, so they have been
moved there.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-02-23 16:56:04 -05:00
Gerard Marull-Paretas f1539b48cf drivers: pinmux: rv32m1: drop driver
Drop RV32M1 pinmux driver in favor of pinctrl.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-02-23 16:56:04 -05:00
Gerard Marull-Paretas e63b0bb3fe include: add missing errno.h include
With the incoming removal of kernel.h/types.h from init.h, lots of files
start to show compile errors because they relied on indirect
definitions, including errno.h.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-11 18:05:17 +02:00
Andrei Emeltchenko 2e56f955db trivial: Remove empty files
Remove empty files.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-09-30 09:41:55 +00:00
Fabio Baltieri 681372bb3d board: v2m_beetle: drop CONFIG_PINMUX=y
There's no actual pinmux subsystem driver for v2m_beetle, and
CONFIG_PINMUX is only used as a proxy to build pinmux.c.

Drop the config and change the file to be built unconditionally (same as
mps2_an521 and mps2_an385.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-18 12:13:14 +00:00
Anas Nashif 8d04b86dc6 pinmux: remove s1000 i2s driver
Remove intel_s1000_crb pinmux driver. The board is no longer available
or supported in the zephyr tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-13 16:19:51 -04:00
Evgeniy Paltsev 3b0517bbd3 ARC: HSDK: remove pinmux_hsdk driver
Pinmux is depricated (see #39740) and shouldn't be used anymore

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2022-05-18 17:20:26 +02:00
Gerard Marull-Paretas fb60aab245 drivers: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all drivers to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:58:21 +02:00
Tim Lin 4cf45f4770 ITE: drivers/pinmux: Remove it8xxx2 pinmux driver
Remove the driver related it8xxx2 pinmux.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-05-06 11:32:40 +02:00
Glauber Maroto Ferreira 84c6edd247 esp32: driver: pinmux: driver removal
Removal of ESP32's pinmux driver since it
was deprecated by pinctrl.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-04-20 13:27:47 +02:00
Vaishnav Achath 98f1a98cf5 drivers: pinmux: remove cc13xx_cc26xx pinmux driver
all the consumers of the obsolete pinmux driver is
updated to use pinctrl API, this commit removes
the pinmux driver and assosciated sections.

Signed-off-by: Vaishnav Achath <vaishnav@beagleboard.org>
2022-04-18 18:19:46 -04:00
Gerson Fernando Budke 0521aa0fbc drivers: pinmux: Drop sam0 pinmux in favor of pinctrl
Drop sam0 pinmux driver and all related entries in favor to use new
pinctrl API.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-03-24 15:45:37 -07:00
Dino Li 0d9c1c2516 it8xxx2: pinmux: correct i2c3 alt function locate on GPF2/F3
Enable the alt function with setting both bit5@0xf016f1 and
bit6@0xf02046 bits will cause internal leakage.
Only bit6@0xf02046 bit is required to enable the alt function,
so fix it.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2022-03-24 08:17:16 -04:00
Filip Kokosinski 0a9e8a5463 drivers: pinmux: remove SiFive pinmux driver
After transitioning to the new pinctrl driver, it is now obsolete.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-03-24 10:46:34 +01:00
Georgij Cernysiov 44e6fee5d7 drivers: pinmux: stm32: fix MAPR remap
- Move SWJ_CFG initialization into pinmux.
- Don't disable the AFIO clock after SWJ_CFG
  initialization.
- Apply '111' to the SWJ_CFG bits upon remap
  application, that fixes the remap usage.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-03-16 10:26:37 +01:00
Gerard Marull-Paretas 95fb0ded6b kconfig: remove Enable from boolean prompts
According to Kconfig guidelines, boolean prompts must not start with
"Enable...". The following command has been used to automate the changes
in this patch:

sed -i "s/bool \"[Ee]nables\? \(\w\)/bool \"\U\1/g" **/Kconfig*

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-09 15:35:54 +01:00
Sylvio Alves a4a2b9f1cd pinmux: esp32: check only for pullup
Current implementation checks for pulldown and
pullup. As pinmux configuration is related to PU only,
this PR checks for PU feature instead of PD.
This also fix missing PU check when PD is present.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-03-07 10:54:18 +01:00
Yuriy Vynnychek a8619169c4 drivers: pinmux: remove Telink B91 driver
Removed Telink B91 driver since it is replaced by Pincrl.

Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
2022-02-21 19:41:44 -05:00
Sylvio Alves dce4f6a5f5 drivers: pinmux: esp32: check pullup/pulldown configuration
There are some pins that do not support internal pullup/pulldown.
This PR make sure to check that and return error if needed.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-02-15 12:58:37 -05:00
Gerard Marull-Paretas ccdaf45ba5 drivers: pinmux: drop DEV_DATA/DEV_CFG usage
Stop using redundant DEV_DATA/DEV_CFG macros and use dev->data and
dev->config instead.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-19 18:16:02 +01:00
Tim Lin 45b6aa4c3b ITE: drivers/i2c: add the compatibility of GPIO F2/F3 for i2c3
The default I2C channel 3 is used by alternate function of GPIO H1/H2
Krabby uses GPIO F2/F3 as I2C channel 3, so we need to add the
compatibility of the GPIO F2/F3.

TEST=test on it8xxx2_evb:
zmake configure -b zephyr/projects/it8xxx2_evb/

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-01-11 11:49:16 +01:00
Gerard Marull-Paretas a9ae700695 drivers: gpio: stm32: introduce gpio_stm32_configure_raw
Make gpio32_stm32_configure use runtime PM API (so that it can be used
externally without further effort). The raw version of the function (no
PM put/get) has been introduced for internal use.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-16 10:41:04 +01:00
Gerard Marull-Paretas 392b20f2a5 drivers: pinmux: stm32: remove runtime PM get/put guards
The PM runtime API (get/put) provides an inline implementation when not
built-in. Such implementation always returns 1, so it is safe to not
guard PM runtime calls and check for < 0.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-16 10:41:04 +01:00
Sylvio Alves f00a0a9e06 drivers: pinmux: esp32: use rtcio to control pull up/down
Set pinmux driver to use RTCIO interface for to handle
dedicated IOs pull-up/down configuration.
Without this, some GPIOS won't have pull-up enabled
properly.

Also, current implementation automatically disables
output pin when input pin is set. It also performs the
oppositte. This PR changes it only to enable what is
requested, either input or output.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-12-08 17:19:21 -05:00
Erwan Gouriou 6026d3c5bf drivers/pinmux|pinctrl: stm32f1: Fix broken cast in remap
remap information is coded in 10 bits, uint16_t should be used
to cast it.

Fixes #40688

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-26 10:25:41 -05:00
Erwan Gouriou 097cb02e59 drivers/pinmux: stm32f1: Rework pinmux remap information encoding
Aim of this change is to remove the need for the pinmux driver
on stm32f1 series to access the base address of the pinmux owner
device.

This is achieved by a modification in the device tree pin definition.
Instead of providing a generic information on type of the remap
(such as NO_REMAP, PARTIAL_REMAP, FULL_REMAP), the remap field
encodes all the information required to perform the remap register
configuration:
-Address of the targeted remap register in AFIO peripheral
-Position of the remap configuration in the remap register
-Mask used for the remap configuration encoding
-Value of the expected remap configuration.

All the possible remap configurations are encoded and predefined
in a new stm32f1-afio.h dt-bindings include.

To match this new configuration, all stm32f1 -pinctrl.dtsi should
be regenerated to use these new remap definitions.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-23 10:37:01 -05:00
Erwan Gouriou c35ed25a63 drivers/pinmux: stm32: Rework pinmux macro definitions
Review pinmux macro definition to a more portable format,
in preparation for new remap information encoding on stm32f1 series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-23 10:37:01 -05:00
Sylvio Alves d5aa5c2a77 drivers: esp32: uart: use hal functions
In order to have Espressif SoCs working with
the same uart drivers, all low level functions
are now replaced to hal_espressif HAL calls.

This also changes pinmux, gpio and uart
init order to meet its dependencies.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-11-03 16:47:32 -04:00
Gerard Marull-Paretas 1cee284a46 pm: device: runtime: use pm_device_runtime* namespace
Move all PM device runtime API calls from pm_device* to the
pm_device_runtime* namespace.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-03 16:37:33 -04:00
Sylvio Alves 7c10e0d947 pinmux: esp32: add missing pull down call
When configuring pin as pull up, pull down needs
to be disabled first.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-10-21 10:53:34 -04:00
Gerard Marull-Paretas f3fbff6ecb drivers: pinmux: stm32: remove unused init priority
The device initialization priority is not used, so remove it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-10-07 15:38:53 -04:00
Erwan Gouriou e1b905d6bc drivers: pinmux: stm32: add support for PA11/12 remap.
STM32G0/F0 SoCs allow to remap PA11/12 to PA9/10. Some boards
were manually configuring this remap. This patch centralizes this
functionality to the pinmux driver, allowing boards to enable the
remap directly in board dts file.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-10-07 15:38:53 -04:00
Felipe Neves 9768e98001 drivers: gpio_esp32: added support for esp32c3
in the gpio drivers and pinmux for esp32 chip series

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-10-05 19:24:38 -04:00
Gerard Marull-Paretas f371ae3cc5 drivers: pinmux: stm32: remove pre-DT API
Remove APIs used in the pre-DT era. In case manual access is required,
`stm32_dt_pinctrl_configure` can still be used as a shortcut with data
initialized in the expected format.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-10-04 20:36:17 -04:00
Francois Ramu e763061876 drivers: pinmux stm32F1 remap IP without changing the SWJ_CFG
Change the REMAP bits of the AFIO_MAPR of the stm32F1x soc
with local MACRO without changing the SWJ_CFG (write-only bits).
The serial wire JTAG configuration is taken from the Z_AFIO_REMAP
(value of the CONFIG_GPIO_STM32_SWJ_xxx))
and not read from the MAPR register.
It accesses to the MAPR register directly instead of LL functions.
Note that Remapping on the MAPR2 is not to change.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-10-04 11:44:22 -04:00
Gerard Marull-Paretas 222a21dd72 drivers: pinmux: stm32: use DEVICE_DT_GET_OR_NULL
Use existing Devicetree macro to obtain optional references to GPIO
ports.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-28 20:00:00 -04:00
Torsten Rasmussen 34e346de14 Revert "drivers: pinmux: build as static library"
This reverts commit 43309296b8.

Fixes: #38403

The referred commit introduced `zephyr_library()` for pinmux drivers but
also resulting in #38403 because several boards has `CONFIG_PINMUX=y`
without selecting any pinmux drivers from `drivers/pinmux` thus
generating the following warning:
> No SOURCES given to Zephyr library: drivers__pinmux
>
> Excluding target from build.

This commit reverts the changes so that this warning disappears.
This results in pinmux drivers from `drivers/pinmux` to be located in
libzephyr.a which is messy, but has been so for a long time, even before
Zephyr 1.14 LTS.

The future pinctrl API will be designed in such a way that this problem
will not occur. Thus the old behavior is acceptable until the transition
to pinctrl API has completed.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-09-28 14:33:16 +02:00
Gerard Marull-Paretas 051e9989bb drivers: pinmux: stm32: fix remap equality check
The equality check for remap was not being performed since the local
variable remap was assigned to the value being checked just before the
check. Some minor simplifications have been performed (fixed variable
types).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-07 07:56:21 -04:00
Gerard Marull-Paretas d092945e86 drivers: pinmux: stm32: remove redundant include
stddef.h is already included by zephyr/types.h.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-06 12:23:30 -04:00
Gerard Marull-Paretas 5ef11520f2 drivers: pinmux: stm32: remove declaration of missing function
stm32_get_port_clock function is not defined anywhere, so remove its
declaration.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-06 12:23:30 -04:00
Gerard Marull-Paretas 902f963151 drivers: pinmux: stm32: remove unused pinmux struct
The struct stm32_pinmux_conf structure (and stm32_pin_func_t type)
are not used, so remove them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-06 12:23:30 -04:00
Glauber Maroto Ferreira 219fe5339d esp32s2: drivers: pinmux: add pinmux support
on top of esp32 pinmux driver code.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-08-27 17:34:41 -04:00
Glauber Maroto Ferreira 17f3792abf esp32: drivers: pinmux: code refactoring
to make use of Espressif's hal in order to ease both
driver maintenance and code reuse between socs.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-08-27 17:34:41 -04:00
Daniel Leung 43309296b8 drivers: pinmux: build as static library
Instead of putting object files inside libzephyr.a,
simply build a separate static library as most other
driver types are doing this already.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-17 06:06:03 -04:00
Scott Worley 2070c0997f Microchip: MEC172x: Update pinmux driver
Update the Microchip XEC pinmux driver to use system I/O
routine for read/write of registers instead of direct use
of volatile and CMSIS defines. Add GPIO port number to
bindings instead of using hard coded value from chip headers.
Modify SoC DTSI pinmux syntax, requires "pinmux: pinumx {..."
or the DT macros will not work. Since pinmux is used by MEC152x
we update its chip pinmux DT.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-08-03 19:04:56 -04:00