summaryrefslogtreecommitdiffstats
path: root/drivers/reset
Commit message (Collapse)AuthorAgeFilesLines
* reset: Add Oxford Semiconductor Reset Controller driverNeil Armstrong2016-04-013-0/+140
| | | | | | | | | Add System reset controller driver for Oxford Semiconductor OXNAS SoC Family. CC: Ma Haijun <mahaijuns@gmail.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: lpc18xx: get rid of global variables for restart notifierJoachim Eastwood2016-03-301-12/+10
| | | | | | | | | Moving the notifier_block into the drivers priv struct allows us to retrive the priv struct with container_of and remove the global variables. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: Add support for shared reset controlsHans de Goede2016-03-301-11/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some SoCs some hw-blocks share a reset control. Add support for this setup by adding new: reset_control_get_shared() devm_reset_control_get_shared() devm_reset_control_get_shared_by_index() methods to get a reset_control. Note that this patch omits adding of_ variants, if these are needed later they can be easily added. This patch also changes the behavior of the existing exclusive reset_control_get() variants, if these are now called more then once for the same reset_control they will return -EBUSY. To catch existing drivers triggering this error (there should not be any) a WARN_ON(1) is added in this path. When a reset_control is shared, the behavior of reset_control_assert / deassert is changed, for shared reset_controls these will work like the clock-enable/disable and regulator-on/off functions. They will keep a deassert_count, and only (re-)assert the reset after reset_control_assert has been called as many times as reset_control_deassert was called. Calling reset_control_assert without first calling reset_control_deassert is not allowed on a shared reset control. Calling reset_control_reset is also not allowed on a shared reset control. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: Share struct reset_control between reset_control_get callsHans de Goede2016-03-301-21/+63
| | | | | | | | | | | | Now that struct reset_control no longer stores the device pointer for the device calling reset_control_get we can share a single struct reset_control when multiple calls to reset_control_get are made for the same reset line (same id / index). This is a preparation patch for adding support for shared reset lines. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: Make [of_]reset_control_get[_foo] functions wrappersHans de Goede2016-03-301-67/+17
| | | | | | | | | | | | | With both the regular, _by_index and _optional variants we already have quite a few variants of [of_]reset_control_get[_foo], the upcoming addition of shared reset lines support makes this worse. This commit changes all the variants into wrappers around common core functions. For completeness sake this commit also adds a new devm_get_reset_control_by_index wrapper. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: sti: Make reset_control_ops constPhilipp Zabel2016-02-101-1/+1
| | | | | | The syscfg_reset_ops structure is never modified. Make it const. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: zynq: Make reset_control_ops constPhilipp Zabel2016-02-101-1/+1
| | | | | | The zynq_reset_ops structure is never modified. Make it const. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: socfpga: Make reset_control_ops constPhilipp Zabel2016-02-101-1/+1
| | | | | | The socfpga_reset_ops structure is never modified. Make it const. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: hi6220: Make reset_control_ops constPhilipp Zabel2016-02-101-1/+1
| | | | | | The hi6220_reset_ops structure is never modified. Make it const. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: ath79: Make reset_control_ops constPhilipp Zabel2016-02-101-1/+1
| | | | | | | The ath79_reset_ops structure is never modified. Make it const. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Alban Bedel <albeu@free.fr>
* reset: lpc18xx: Make reset_control_ops constPhilipp Zabel2016-02-081-1/+1
| | | | | | | The lpc18xx_rgu_ops structure is never modified. Make it const. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Joachim Eastwood <manabian@gmail.com>
* reset: sunxi: Make reset_control_ops constPhilipp Zabel2016-02-081-1/+1
| | | | | | | The sunxi_reset_ops structure is never modified. Make it const. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
* reset: img: Make reset_control_ops constPhilipp Zabel2016-02-081-1/+1
| | | | | | | The pistachio_reset_ops structure is never modified. Make it const. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: James Hartley <james.hartley@imgtec.com>
* reset: berlin: Make reset_control_ops constPhilipp Zabel2016-02-081-1/+1
| | | | | | | The berlin_reset_ops structure is never modified. Make it const. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
* reset: berlin: drop DT cell size checkPhilipp Zabel2016-02-051-3/+0
| | | | | | | Now that the DT cell size check has been moved to the core, there is no need to check again. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: img: Add Pistachio reset controller driverDamien Horsley2016-02-052-0/+155
| | | | | | | | Add reset controller driver for Pistachio SoC Signed-off-by: Damien Horsley <Damien.Horsley@imgtec.com> Signed-off-by: James Hartley <james.hartley@imgtec.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: hisilicon: check return value of reset_controller_register()Masahiro Yamada2016-01-251-3/+1
| | | | | | | | | The newly added hisilicon reset driver missed the subsystem-wide fixup by commit d1f15aa09558 ("reset: check return value of reset_controller_register()"). So fix it now. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: Move DT cell size check to the coreMaxime Ripard2016-01-251-3/+5
| | | | | | | | | | | | The core currently doesn't check that the DT cell size matches what the driver declares, which means that every xlate function needs to duplicate that check. Make sure that of_reset_control_get checks for this to avoid duplication and errors. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: remove unnecessary local variable initialization from ↵Philipp Zabel2016-01-251-1/+1
| | | | | | | | | of_reset_control_get_by_index There is no need to initialize rstc, as it is unconditionally assigned the return value of a kzalloc call before use. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: hi6220: fix modular buildArnd Bergmann2015-12-121-0/+1
| | | | | | | | | | We need to include <linux/module.h> to build the driver as a loadable module: drivers/reset/hisilicon/hi6220_reset.c:108:1: warning: data definition has no type or storage class postcore_initcall(hi6220_reset_init); Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* reset: ath79: Add system restart supportAlban Bedel2015-11-251-1/+29
| | | | | | | | Add a system restart handler that use the FULL_CHIP_RESET bit of the reset controller. Signed-off-by: Alban Bedel <albeu@free.fr> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: hi6220: Reset driver for hisilicon hi6220 SoCChen Feng2015-11-205-0/+116
| | | | | | | | Add reset driver for hi6220-hikey board,this driver supply deassert of IP on hi6220 SoC. Signed-off-by: Chen Feng <puck.chen@hisilicon.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: remove unused device pointer from struct reset_controlPhilipp Zabel2015-11-181-8/+1
| | | | | | | | Commit 0c5b2b915a58 ("reset: Mark function as static and remove unused function in core.c") removed the only user of the device pointer in struct reset_control. As it is now unused, remove it. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: check return value of reset_controller_register()Masahiro Yamada2015-11-164-9/+4
| | | | | | | | | Currently, reset_controller_register() always return 0, but it would be better to check its return code. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: remove redundant $(CONFIG_RESET_CONTROLLER) from MakefileMasahiro Yamada2015-11-161-1/+1
| | | | | | | | | | | The directory drivers/reset/ is guarded by CONFIG_RESET_CONTROLLER in driver/Makefile. CONFIG_RESET_CONTROLLER is boolean, so it always evaluates to 'y' in drivers/reset/Makefile. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: use ENOTSUPP instead of ENOSYSPhilipp Zabel2015-11-161-4/+4
| | | | | | | | ENOSYS is reserved to report invalid syscalls to userspace. Consistently return ENOTSUPP to indicate that the driver doesn't support the functionality or the reset framework is not enabled at all. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: sunxi: mark the of_device_id array as __initconstPhilipp Zabel2015-11-161-1/+1
| | | | | | | Since this array is static const, it should be marked as __initconst. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
* reset: sti: add a missing blank line after declarationPhilipp Zabel2015-11-161-1/+3
| | | | | | | This just fixes a checkpatch warning, no functional change. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
* reset: sti: Provide ops .status() call-backLee Jones2015-11-161-0/+23
| | | | | Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: sti: Add support for resetting co-processorsLee Jones2015-11-161-0/+5
| | | | | Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: Fix of_reset_control_get() for consistent return valuesAlban Bedel2015-11-161-1/+4
| | | | | | | | | | | | | | | | When of_reset_control_get() is called without connection ID it returns -ENOENT when the 'resets' property doesn't exists or is an empty entry. However when a connection ID is given it returns -EINVAL when the 'resets' property doesn't exists or the requested name can't be found. This is because the error code returned by of_property_match_string() is just passed down as an index to of_parse_phandle_with_args(), which then returns -EINVAL. To get a consistent return value with both code paths we must return -ENOENT when of_property_match_string() fails. Signed-off-by: Alban Bedel <albeu@free.fr> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: add of_reset_control_get_by_index()Vince Hsu2015-11-161-11/+29
| | | | | | | | | | | Add of_reset_control_get_by_index() to allow the drivers to get reset device without knowing its name. Signed-off-by: Vince Hsu <vinceh@nvidia.com> [jonathanh@nvidia.com: Updated stub function to return -ENOTSUPP instead of -ENOSYS which should only be used for system calls.] Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* reset: ath79: Fix missing spin_lock_initAxel Lin2015-09-011-0/+1
| | | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Alban Bedel <albeu@free.fr> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* Merge branch 'reset/ath79' into reset/nextPhilipp Zabel2015-08-162-0/+129
|\
| * reset: Add a driver for the reset controller on the AR71XX/AR9XXXAlban Bedel2015-08-042-0/+129
| | | | | | | | | | | | | | | | | | The AR71XX/AR9XXX SoC have a simple reset controller with one bit per reset line. Signed-off-by: Alban Bedel <albeu@free.fr> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* | reset: reset-zynq: Adding support for Xilinx Zynq reset controller.Moritz Fischer2015-08-042-0/+156
| | | | | | | | | | | | | | | | | | | | This adds a reset controller driver to control the Xilinx Zynq AP-SoC's various resets. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* | reset: socfpga: Update reset-socfpga to read the altr,modrst-offset propertyDinh Nguyen2015-08-031-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | In order for the Arria10 to be able to re-use the reset driver for SoCFPGA Cyclone5/Arria5, we need to read the 'altr,modrst-offset' property from the device tree entry. The 'altr,modrst-offset' property is the first register into the reset manager that is used for bringing peripherals out of reset. The driver assumes a modrst-offset of 0x10 in order to support legacy Cyclone5/Arria5 hardware. Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
* | reset: add driver for lpc18xx rguJoachim Eastwood2015-08-032-0/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add reset driver for the Reset Generation Unit (RGU) found on NXP LPC18xx and LPC43xx devies. This reset controller features up to 64 reset lines connected to different blocks and peripheral in the SoC. Most reset lines on the controller are self clearing except for those dealing with the Cortex-M0 cores on LPC43xx devices. This driver also registers a restart handler that can be used to reset the entire device. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* | reset: sti: constify of_device_id arrayFabian Frederick2015-08-033-3/+3
| | | | | | | | | | | | | | | | | | | | of_device_id is always used as const. (See driver.of_match_table and open firmware functions) Signed-off-by: Fabian Frederick <fabf@skynet.be> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Acked-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* | ARM: STi: DT: Move reset controller constants into common locationPhilipp Zabel2015-08-033-3/+3
|/ | | | | | | | | By popular vote, the DT binding includes for reset controllers are located in include/dt-bindings/reset/. Move the STi reset constants in there, too, to avoid confusion. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Patrice Chotard <patrice.chotard@st.com>
* reset: berlin: drop arch_initcall initializationAntoine Tenart2015-05-181-70/+1
| | | | | | | | | With proper platform driver probing for berlin reset driver, drop the arch_initcall workaround. Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
* reset: berlin: convert to a platform driverAntoine Tenart2015-05-181-1/+52
| | | | | | | | | | | | | The Berlin reset controller was introduced without being a platform driver because of a needed DT rework: the node describing the reset controller also describes the pinctrl and clk controllers... Prepare conversion by adding a platform driver probe to a new compatible "marvell,berlin2-reset" with syscon regmap. Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
* reset: sunxi: fix spinlock initializationTyler Baker2015-01-161-0/+4
| | | | | | | | | | | | | | | | | | Call spin_lock_init() before the spinlocks are used, both in early init and probe functions preventing a lockdep splat. I have been observing lockdep complaining [1] during boot on my a80 optimus [2] when CONFIG_PROVE_LOCKING has been enabled. This patch resolves the splat, and has been tested on a few other sunxi platforms without issue. [1] http://storage.kernelci.org/next/next-20150107/arm-multi_v7_defconfig+CONFIG_PROVE_LOCKING=y/lab-tbaker/boot-sun9i-a80-optimus.html [2] http://kernelci.org/boot/?a80-optimus Signed-off-by: Tyler Baker <tyler.baker@linaro.org> Cc: <stable@vger.kernel.org> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Olof Johansson <olof@lixom.net>
* Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds2014-12-144-4/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
| * reset: sti: drop owner assignment from platform_driversWolfram Sang2014-10-202-2/+0
| | | | | | | | | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| * reset: drop owner assignment from platform_driversWolfram Sang2014-10-202-2/+0
| | | | | | | | | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* | Merge tag 'reset-for-3.19-2' of git://git.pengutronix.de/git/pza/linux into ↵Arnd Bergmann2014-12-045-0/+193
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | next/drivers Pull "Reset controller changes for v3.19" from Philipp Zabel: This adds a new driver for the sti soc family, and creates a reset_control_status interface, which is added to the existing drivers. * tag 'reset-for-3.19-2' of git://git.pengutronix.de/git/pza/linux: reset: add socfpga_reset_status reset: sti: Document sti-picophyreset controllers bindings. reset: stih407: Add softreset, powerdown and picophy controllers reset: stih407: Add reset controllers DT bindings reset: add reset_control_status helper function Signed-off-by: Arnd Bergmann <arnd@arndb.de>
| * | reset: add socfpga_reset_statusDinh Nguyen2014-11-041-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Populate the reset_status callback for SOCFPGA. Signed-off-by: Alan Tull <atull@opensource.altera.com> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
| * | Merge tag 'sti-reset-for-v3.19-1' of ↵Philipp Zabel2014-11-033-0/+163
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.stlinux.com/devel/kernel/linux-sti into reset/for_v3.19 STi reset controller updates for v3.19. This tag adds support to STiH407 reset controllers: 1. st,stih407-powerdown 2. st,stih407-softreset 3. st,stih407-picophyreset
| | * | reset: stih407: Add softreset, powerdown and picophy controllersPeter Griffin2014-10-313-0/+163
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds softreset, powerdown and picophy reset controllers for the STiH407 SoC. With this patch three new devices are registered: - 1. st,stih407-powerdown 2. st,stih407-softreset 3. st,stih407-picophyreset All three devices use system configuration registers mapped via regmap to perform the reset or powerdown. The powerdown controller also has an acknowledgement. A separate picophy reset controller manages the different reset channels within the picophy, which have a different polarity to the other system softresets. Managing these different picophy softreset channels is necessary to correctly handle resuming from suspend when USB2 devices are plugged into the USB3 port. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com>
OpenPOWER on IntegriCloud