summaryrefslogtreecommitdiffstats
path: root/drivers/reset
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/driver-macro' into masterSascha Hauer2020-10-142-10/+2
|\
| * treewide: Use driver macroSascha Hauer2020-09-292-10/+2
| | | | | | | | | | | | | | 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>
* | reset: remove dead initializationAhmad Fatoum2020-10-021-1/+1
|/ | | | | | | | rstc is never read before written, so just drop the initializer. Reported-by: clang-analyzer-10 Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: stm32mp: depend on ARCH_STM32MP for SoC driversAhmad Fatoum2020-07-141-0/+1
| | | | | | | | | The i2c, MCI and reset controller peripherals are STM32-specific. There is no reason to ask uses on oldconfig about it, thus make them depend on ARCH_STM32MP || COMPILE_TEST. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: fix typo in Kconfig defaultAhmad Fatoum2020-04-291-1/+1
| | | | | | | We don't have a config SOC_IMX7D, but have an ARCH_IMX7. Fix this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: remove duplicate imx8mq-reset.h and use correct definesLucas Stach2020-03-231-6/+6
| | | | | | | | | | | | The defines in the Barebox copy of imx8mq-reset.h had a typo, which has been fixed in the upstream Linux version of this file. So depending on include ordering the reset driver using those defines would fail to compile. Use the typo fixed versions of the define in the driver and remove the duplicate include file, as we also have the proper upstream version now. Reported-by: Giorgio Dal Molin <giorgio.nicole@arcor.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: stm32: migrate restart reason and handler from stm32_iwdgAhmad Fatoum2020-02-191-4/+113
| | | | | | | | | | | | | The watchdog driver will remain unprobed if the driver or the OF node is disabled, but the reset reason is useful even then. System reset and reset source determination is achieved with the RCC peripheral for which we have a reset controller driver. Move the code over there, so reset reason and reset are available always. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: add reset controller driver for STM32 RCCAhmad Fatoum2019-07-153-0/+115
| | | | | | | | | On the STM32MP, reset of the I2C, SPI and USB IPs occurs over the RCC. This driver adds support for the controller, so it may be reused by other drivers. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: imx7: Add support for i.MX8MQ IP block variantAndrey Smirnov2019-02-111-0/+122
| | | | | | | | | | | | | | | | | | | | | | | | Port of a Linux commit 34be9b453608fa4475d2b48ee27df2023f08ef2d Add bits and pieces needed to support IP block variant found on i.MX8MQ SoCs. Cc: p.zabel@pengutronix.de Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: cphealy@gmail.com Cc: l.stach@pengutronix.de Cc: Leonard Crestez <leonard.crestez@nxp.com> Cc: "A.s. Dong" <aisheng.dong@nxp.com> Cc: Richard Zhu <hongxing.zhu@nxp.com> Cc: Rob Herring <robh@kernel.org> Cc: devicetree@vger.kernel.org Cc: linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: imx7: Add plubming to support multiple IP variantsAndrey Smirnov2019-02-111-14/+36
| | | | | | | | | | | | | | | | | | | | | | | | Port of a Linux commit cffaab878178c7842ab38690070d665adb3f41fd In order to enable supporting i.MX8MQ with this driver, convert it to expect variant specific bits to be passed via driver data. Cc: p.zabel@pengutronix.de Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: cphealy@gmail.com Cc: l.stach@pengutronix.de Cc: Leonard Crestez <leonard.crestez@nxp.com> Cc: "A.s. Dong" <aisheng.dong@nxp.com> Cc: Richard Zhu <hongxing.zhu@nxp.com> Cc: Rob Herring <robh@kernel.org> Cc: devicetree@vger.kernel.org Cc: linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: Constify "ops" in struct reset_controller_devAndrey Smirnov2019-02-111-1/+1
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: Mark local functions as staticAndrey Smirnov2019-01-181-4/+4
| | | | | | | | | There are no outside users of of_reset_control_get() or gpio_reset_control_get(), so mark them as static. This allows us to avoid "no previous prototype" warning as well. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: Add i.MX7 SRC reset driverAndrey Smirnov2019-01-183-0/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port of a Linux commit abf97755ae31aaaf35156438dd3036e96f66da83 Add reset controller driver exposing various reset faculties, implemented by System Reset Controller IP block. Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Mark Rutland <mark.rutland@arm.com> Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Linux commit 26fce0557fa639fb7bbc33e31a57cff7df25c3a0 was squashed here as well: reset: imx7: Fix always writing bits as 0 Right now the only user of reset-imx7 is pci-imx6 and the reset_control_assert and deassert calls on pciephy_reset don't toggle the PCIEPHY_BTN and PCIEPHY_G_RST bits as expected. Fix this by writing 1 or 0 respectively. The reference manual is not very clear regarding SRC_PCIEPHY_RCR but for other registers like MIPIPHY and HSICPHY the bits are explicitly documented as "1 means assert, 0 means deassert". The values are still reversed for IMX7_RESET_PCIE_CTRL_APPS_EN. Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: socfpga: add missing driver nameSteffen Trumtrar2018-08-081-0/+1
| | | | | | | | | The driver_d is missing the name property. When the reset driver is used in a non-of setup, this will result in an error during device_registration where the dev->name is matched to the driver->name. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: reset-socfpga: sync driver with linuxSteffen Trumtrar2018-01-111-10/+10
| | | | | | | Sync the SoCFPGA reset driver with Linux v4.14-rc1. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: import socfpga-reset driver from linuxSteffen Trumtrar2016-10-182-0/+125
| | | | | | | Port the linux v4.8-rc1 reset-socfpga driver to barebox. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: fix non GPIO resetLucas Stach2016-01-111-0/+1
| | | | | | | | | | The reset controller structure is zero initialized in the OF reset case, but as 0 is also a valid GPIO number the current code tries to assert/deassert the GPIO instead of calling into the reset controller device. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: Add gpio reset supportSascha Hauer2015-11-231-1/+79
| | | | | | | | | If a device has the reset-gpios property we can support this through the reset controller API, so drivers do not have to open code the support for this property each time themselves as done a few dozen times in the kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: Allow dummy reset linesSascha Hauer2015-11-231-3/+20
| | | | | | | | | Treat NULL as a dummy reset line which is returned by the reset core when there is no reset line connected to a device (that is, no reset is described in the device tree). With this consumers can just use the reset functions without having to check for existence. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset: add reset controller frameworkLucas Stach2014-05-153-0/+250
Add stripped sown version of the reset controller framework from the Linux kernel. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>