summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/driver-macro' into masterSascha Hauer2020-10-1417-92/+19
|\
| * treewide: Use driver macroSascha Hauer2020-09-2917-92/+19
| | | | | | | | | | | | | | 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>
* | driver: migrate some from dev_get_drvdata to device_get_match_dataAhmad Fatoum2020-10-094-7/+7
|/ | | | | | | | The dev_get_drvdata instances here all store a valid pointer in the match data and can be readily converted. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl-single: Support 2 pinctrl-cells in ,pins modeTrent Piepho2020-09-141-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 5.9rc-1 dts update pulled in a change that broke all TI AM33xx platforms. This fixes that. Previously, when using pinctrl-single,pins, the value of "#pinctrl-cells" was always 1, which indicates one data cell per pin, which contains the value to to program into the pinctrl register. In kernel v5.9-rc1, commit a13395418888 ("pinctrl: single: parse #pinctrl-cells = 2"), added support for 2 data cells per pin. The two cells get ORed together to produce one register value. Then commit 27c90e5e48d0 ("ARM: dts: am33xx-l4: change #pinctrl-cells from 1 to 2"), changed the dts files to use two cells for am33xx and changed the AM33XX_PADCONF() macro to produce two data cells instead of ORing the two values together. The pinctrl driver will now do the OR to produce the same value that was in one cell before. I don't see what this accomplishes, but there it is. The dts update pulled in the latter change, but not the former, leaving Barebox's pinctrl-single driver unable to correctly use the am33xx pinctrl data. This commit adds support for the 2 cell format. It would be easier to just change the dts files back, since this change doesn't appear actually accomplish anything, but then the dts source would be out of sync with the kernel. Signed-off-by: Trent Piepho <tpiepho@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: imx-iomux-v3: Add i.MX8MP compatibleSascha Hauer2020-07-141-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-05-146-18/+0
|\
| * treewide: remove references to CREDITSUwe Kleine-König2020-04-276-18/+0
| | | | | | | | | | | | | | | | The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97 ("Remove the CREDITS file"). Remove references to it from several files. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/kconfig'Sascha Hauer2020-05-142-17/+0
|\ \
| * | treewide: Kconfig: remove some unused symbolsAhmad Fatoum2020-04-292-17/+0
| |/ | | | | | | | | | | | | | | All these symbols are defined, but unused anywhere in the barebox tree. Remove them. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | drivers: add COMPILE_TEST prompts to some on-by-default driversAhmad Fatoum2020-05-081-4/+4
| | | | | | | | | | | | | | | | | | | | Many clock source and GPIO controller drivers don't have a prompt, but are instead default y if their respective platform is enabled. Maintain this behavior, but add a prompt for when COMPILE_TEST is enabled, so they can be included in test builds. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | drivers: mark first batch of compilable drivers for COMPILE_TESTAhmad Fatoum2020-05-081-2/+2
|/ | | | | | | | | All of these drivers have a runtime dependency on SoC peripherals, but can nevertheless be compile-tested. Add COMPILE_TEST as an alternate dependency. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/stm32'Sascha Hauer2020-03-181-2/+2
|\
| * phy: remove unused init_data parameterAhmad Fatoum2020-02-251-2/+2
| | | | | | | | | | | | | | | | Linux has since migrated to a new lookup API that lacks the init_data parameter. As it's unused in barebox, follow suit. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2020-03-181-0/+2
|\ \
| * | iomux: Add i.MX8MM supportSascha Hauer2020-02-191-0/+2
| |/ | | | | | | | | | | Just add the compatible string, nothing more to do. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / pinctrl-single: fix parsing of `pinctrl-single,bits` propertyPeter Mamonov2020-03-161-1/+1
|/ | | | | | | | | According to dts/Bindings/pinctrl/pinctrl-single.txt:113 the correct order of parameters is <offset, value, mask>. Fixes: f7e0cae43 ('pinctrl-single: Handle "pinctrl-single,function-mask" dt property') Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-02-181-19/+62
|\
| * pinctrl-single: Handle "pinctrl-single,function-mask" dt propertySiméon Marijon2020-01-201-19/+62
| | | | | | | | | | | | | | | | | | | | | | Implement linux behavior regarding "pinctrl-single,function-mask" and "pinctrl-single,bits". It allows multiple pins control per register. (linux sha1: 4e7e8017a80e1810100c9b416b86e3baef900285) Signed-off-by: Simeon Marijon <simeon@marijon.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | pinctrl: imx-v3: Support for imx6ull-iomuxc-snvsChristian Eggers2020-01-201-1/+7
|/ | | | | Signed-off-by: Christian Eggers <ceggers@arri.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: at91pio4 depends on OFDEVICELucas Stach2019-12-021-0/+1
| | | | | | | | Some of the selected options require OFDEVICE to be enabled. As the driver is only used of DT probed systems it's okay to depend on OFDEVICE. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: tegra: mark drvdata as maybe unusedLucas Stach2019-12-021-2/+2
| | | | | | | | If the driver is only built for one of the two supported SoCs we end up with some unused structures. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: at91pio4: move to correct location in KconfigLucas Stach2019-12-021-10/+9
| | | | | | | | | The driver also depends on PINCTRL, so we should only allow it to be enabled if this option is selected. We can also drop the OFDEVICE dependency then, as this is required for PINCTRL. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> 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-063-4/+4
| | | | | | | | | | | | | 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: add gpio and pinctrl driver for sama5d2 PIO4Ahmad Fatoum2019-10-144-0/+333
| | | | | | | | | | | | The sama5d2 features a GPIO and pin controller different than the one we support in barebox. The device tree bindings are different as well, so it makes sense to have a separate driver for it. Add the pin control and GPIO driver as well as some helpers usable from PBL, should we want to do pinmuxing that early. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: i.MX iomux-v1: Add i.MX1 supportSascha Hauer2019-08-141-0/+2
| | | | | | This adds the device tree compatible for the i.MX1 iomux. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: i.MX iomux-v1: Make base address initialization unnecessarySascha Hauer2019-08-142-19/+11
| | | | | | | | | | | | So far we have imx_gpio_mode() to configure a pinmux entry for the older i.MX pinmuxes. For this to work imx_iomuxv1_init() must be called beforehand to configure the base address. Simplify this by introducing SoC specific variants of imx_gpio_mode() which also pass the base address. This makes initialization of the base address unnecessary and the functions usable for PBL. Consequently also compile the code for PBL. 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-203-0/+432
| | | | | | | | | | | | | 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>
* ARM: at91: replace __raw_{readl, writel} of peripherals with readl, writelAhmad Fatoum2019-05-241-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Use the potentially endianness-changing readl, writel and siblings directly. They looks prettier and are the correct thing to do, as even if the CPU is in big-endian mode, the peripherals are little-endian. Unlike Linux, barebox readl,writel are the same Linux' {readl,writel}_relaxed (they don't imply memory barriers) and thus there shouldn't be any functional change. Patch was generated by a mass search and replace. I looked it over, adjust some whitespace and further verified by reviewing the output of git diff HEAD~1 --word-diff | \ perl -pe 's/\[-(.*?)__raw_/{+$1/; s/-\]\{\+/+}{+/;' \ -e 's/(\{\+.*?\+\})\1/__ALL_IS_WELL__/' | grep '+}{+' which filters out the common case of lines where a single __raw_{readT,writeT} had its __raw_ prefix stripped without any further changes. Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: surround Kconfig file paths with double quotesMasahiro Yamada2019-03-211-1/+1
| | | | | | | | | Based on Linux commit 8636a1f9677db4f883f29a072f401303acfc2edd This will be needed when you sync Kconfig with Linux 5.0 or later. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: bcm2835: register the pin controller.Tomaz Solc2019-02-191-1/+51
| | | | | | | This adds hooks for the pin controller driver to the existing bcm2835_set_function(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: bcm2835: move existing code from gpio.Tomaz Solc2019-02-193-0/+169
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Kconfig: add pin controllers submenu.Tomaz Solc2019-02-191-0/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: imx-v3: imx8mq does use the old bindingLucas Stach2019-01-151-4/+0
| | | | | | | | The upstream discussion concluded on using the same binding as on previous i.MX SoCs. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/missing-prototypes'Sascha Hauer2018-12-071-8/+1
|\
| * pinctrl: at91: Add missing includeSascha Hauer2018-11-121-8/+1
| | | | | | | | | | | | | | | | mach/iomux.h provides prototypes for functions that the pinctrl driver implements, so include it. With this we have a duplicate definition of enum at91_mux so remove it from the pinctrl driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | pinctrl: tegra30: fix "Possible null pointer dereference: group" warningOleksij Rempel2018-11-211-2/+2
|/ | | | | | | | The code is correct but it takes more seconds for me to understand. And static code analyzer do not understand it at all. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2018-11-091-2/+2
|\
| * pinctrl: at91: Do not print registration messagesSascha Hauer2018-11-021-2/+2
| | | | | | | | | | | | Turn registration messages into dev_dbg. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | pinctrl: tree-wide probe devices during core_initcallMarco Felsch2018-10-1914-15/+15
|/ | | | | | | | | | | | | Since commit 37e6bee7e5 ("gpiolib: Add support for GPIO "hog" nodes") barebox can handle hog-gpios. To work correctly the pinctrl driver must be initialised first. Reorder all pinctrl drivers so they will be called first. find drivers/pinctrl/ -type f -name *.c \ -exec sed -i 's/\bpostcore_initcall\b/core_initcall/' "{}" +; Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: imx-iomux-v3: fix compiler warningRoland Hieber2018-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Fix a warning while compiling with GCC 5.4.0 (OSELAS.Toolchain 2016.02): drivers/pinctrl/imx-iomux-v3.c: In function 'imx_iomux_v3_set_state': drivers/pinctrl/imx-iomux-v3.c:153:13: warning: 'share_conf_val' may be used uninitialized in this function [-Wmaybe-uninitialized] conf_val &= ~IMX_PAD_SION; we have the pattern: if (share_conf) share_conf_val = ...; ... if (share_conf) use(share_conf_val); GCC 5.4.0 doesn't recognize this so explicitly initialize share_conf_val. Signed-off-by: Roland Hieber <rohieb@rohieb.name> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: i.MX: Add code to parse "input-enable"Andrey Smirnov2018-08-131-0/+3
| | | | | | | | Add code to parse "input-enable" and intepret it as SION bit. This is needed for I2C configuration on i.MX8MQ EVK board. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: i.MX: Add support for i.MX8Andrey Smirnov2018-06-111-6/+50
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl-vf610: Make use of BIT macroAndrey Smirnov2018-04-111-3/+3
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: do not dereference a device tree property directlySascha Hauer2018-01-311-12/+6
| | | | | | | Use of_get_property() rather than of_find_property() to avoid dereferencing a struct property directly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove checks for xzalloc() returning NULLUwe Kleine-König2017-09-261-2/+0
| | | | | | | xzalloc() either returns memory or panics, so checking for NULL is useless. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: mxs: fix error message to mention right property nameUwe Kleine-König2017-09-261-1/+1
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>