summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-stm32.c
Commit message (Collapse)AuthorAgeFilesLines
* pinctrl: stm32: match st,stm32mp135-pinctrl DT compatibleAhmad Fatoum2023-12-051-0/+1
| | | | | | | | | The pin controller on the STM32MP13 is identical to the STM32MP15. Only the compatible is missing, so add it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231127064947.2207726-11-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Print device nodes with %pOFSascha Hauer2023-07-031-9/+6
| | | | | | | We have the %pOF format specifier for printing device nodes. Use it where appropriate. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: add MODULE_DEVICE_TABLE markersAhmad Fatoum2023-06-131-0/+1
| | | | | | | | | | | | | | | | Syncing device trees with Linux upstream can lead to breakage, when the device trees are switched to newer bindings, which are not yet supported in barebox. To make it easier to spot such issues, we want to start applying some heuristics to flag possibly problematic DT changes. One step towards being able to do that is to know what nodes barebox actually consumes. Most of the nodes have a compatible entry, which is matched by an array of of_device_id, so let's have MODULE_DEVICE_TABLE point at it for future extraction. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230612125908.1087340-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: stm32: Remove check for pins-are-numberedAhmad Fatoum2023-04-111-5/+0
| | | | | | | | | | | | Upstream has dropped this property from the device trees that we import, so drop our check for it to fix boot up on STM32MP1. Link: https://lore.kernel.org/all/20221129023401.278780-3-bero@baylibre.com/ Fixes: 03b1dd74aa6e ("dts: update to v6.3-rc1") Reported-by: David Jander <david@protonic.nl> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230331103123.1525200-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2023-01-201-9/+1
|\
| * pinctrl: stm32: fix pinctrl/gpio dependency orderingAhmad Fatoum2023-01-111-9/+1
| | | | | | | | | | | | | | | | | | | | | | pinctrl_register will apply pinctrl hogs if specified and the STM32 pinctrl driver expects the GPIO chips to be registered by then. Swap the order of registration to accommodate this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230110174104.51204-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Rename struct driver_d to driverSascha Hauer2023-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | The '_d' suffix was originally meant to distinguish barebox struct names from Linux struct names. struct driver doesn't exist in Linux, so we can rename it and remove the meaningless suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Rename struct device_d to deviceSascha Hauer2023-01-101-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Rename device_d::device_node to device_d::of_nodeSascha Hauer2023-01-101-1/+1
|/ | | | | | | | | | | | | | | | | | | | Linux struct device has the member of_node for the device_node pointer. Rename this in barebox accordingly to minimize the necessary changes when porting Linux code. This was done with the semantic patch: @@ struct device_d E; @@ - E.device_node + E.of_node @@ struct device_d *E; @@ - E->device_node + E->of_node Plus some manual adjustments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: stm32: keep GPIO bank clocks enabled throughoutAhmad Fatoum2022-07-111-33/+9
| | | | | | | | | | Mirror the Linux change of always keeping the clocks running. For barebox. This simplifies the code and improves bitbanging throughput. Origin: https://lore.kernel.org/all/20220422143608.226580-1-fabien.dessenne@foss.st.com/ Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20220708055250.1175444-2-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: stm32: use gpio-ranges instead of aliasAhmad Fatoum2022-02-231-12/+2
| | | | | | | | | | Upstream device tree doesn't feature aliases and we don't really need it, as the gpio-ranges property has a GPIO controller offset cell. Use it instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220220124736.3052502-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: stm32: replace magic values with defines for STM32_PINMODEAhmad Fatoum2022-01-141-3/+3
| | | | | | | | | Makes the code easier to follow and allows using the new macros in PBL code for early pinmuxing of e.g. the debug UART. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20220114065943.698337-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: migrate "GPL-2.0" license identifiers to SPDX 2.0Roland Hieber2021-11-221-1/+1
| | | | | | | | | | "GPL-2.0-only" was introduced in SPDX 2.0, and the old identifier "GPL-2.0" is now considered deprecated; see <https://spdx.org/licenses>. Fixes: 28f4a6a4df76f0f1581d (2021-10-30, "drivers: add missing SPDX-License-Identifier") Signed-off-by: Roland Hieber <rhi@pengutronix.de> Link: https://lore.barebox.org/20211117113851.2022669-2-rhi@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: stm32: support deep probeAhmad Fatoum2021-06-281-1/+4
| | | | | | | | | | | | | The GPIO children of the pinctrl node don't have their own compatibles and so the pinctrl driver probe takes care of the whole family. GPIO drivers when deep probe is enabled don't like that because they expect a driver to be associated with the GPIO device tree node, once the chip was registered. Make them happy by assigning the dummy driver. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628070330.13646-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Use driver macroSascha Hauer2020-09-291-5/+1
| | | | | | | We have several macros for a oneline driver registration. Add some missing and use them consistently where possible througout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: stm32: parse pinctrl nodes without subnodes as wellAhmad Fatoum2019-11-061-81/+99
| | | | | | | | | The bindings allow the pinmux node to occur directly in the node under the pin controller as well. Check for this and support both types of pinctrl specification. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: demote dev_info on successful probes to dev_dbgAhmad Fatoum2019-11-061-1/+1
| | | | | | | | | | | | | The SoC's pin controller is virtually always built and probed, so there's is little information to gain from the fact it was successfully probed. Have the success message show up as debug message to reduce probe clutter like this: NOTICE: stm32-pinctrl soc:pin-controller@50002000.of: pinctrl/gpio driver registered NOTICE: stm32-pinctrl soc:pin-controller-z@54004000.of: pinctrl/gpio driver registered Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: stm32: fix debug print of uninitialized variableAhmad Fatoum2019-11-061-3/+3
| | | | | | | | mode and alt are printed with the dev_dbg before they are initialized. Remedy this by moving the dev_dbg after them. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: stm32: fix error path when gpio chip is not foundAhmad Fatoum2019-07-091-2/+3
| | | | | | | | | | | | | | | Current error path has two issues: - PTR_ERR is applied to a NULL pointer, so even error conditions return zero, which is a valid successful return. - The return value is stored into an unsigned integer which is checked to be less than zero, so the error is never handled. Fix both issues. Fixes: f4f933a64 ("pinctrl: add driver for STM32 GPIO and pin multiplexer") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: stm32: add debug output in set_state callbackAhmad Fatoum2019-07-091-0/+3
| | | | | | | | | There's already a debug output whenever a pin is configured, extend this by printing a "header" with the node name and how many pins configurations will follow. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: add driver for STM32 GPIO and pin multiplexerAhmad Fatoum2019-06-201-0/+425
This adds driver support for the 12 GPIO banks on the STM32MP157. As they are accessible to both the Cortex-A cores as well as the Cortex-M core, modifications to these are protected by a hardware spinlock and clocks are enabled/disabled as required. All register fiddling done by the driver is collected in <soc/stm32/gpio.h>, so future PBL code may make use of it as well to chainload barebox proper. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>