summaryrefslogtreecommitdiffstats
path: root/drivers/power/avs/smartreflex.c
AgeCommit message (Collapse)AuthorFilesLines
2020-10-16PM: AVS: smartreflex Move driver to soc specific driversUlf Hansson1-1045/+0
The avs drivers are all SoC specific drivers that doesn't share any code. Instead they are located in a directory, mostly to keep similar functionality together. From a maintenance point of view, it makes better sense to collect SoC specific drivers like these, into the SoC specific directories. Therefore, let's move the smartreflex driver for OMAP to the ti directory. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Nishanth Menon <nm@ti.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2019-11-13power: avs: smartreflex: Remove superfluous cast in debugfs_create_file() callGeert Uytterhoeven1-1/+1
There is no need to cast a typed pointer to a void pointer when calling a function that accepts the latter. Remove it, as the cast prevents further compiler checks. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2019-06-18power: avs: smartreflex: no need to check return value of debugfs_create ↵Greg Kroah-Hartman1-30/+11
functions When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. And even when not checking the return value, no need to cast away the call to (void), as these functions were never a "must check" type of a function, so remove that odd cast. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-12-12PM / AVS: SmartReflex: Switch to SPDX Licence IDNishanth Menon1-4/+1
Fix up licensing to be inline with Linux conventions. Signed-off-by: Nishanth Menon <nm@ti.com> Acked-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-12-12PM / AVS: SmartReflex: NULL check before some freeing functions is not neededThomas Meyer1-2/+1
NULL check before some freeing functions is not needed. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Reviewed-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-10-09PM / AVS: SmartReflex: remove unused functionUwe Kleine-König1-31/+0
omap_sr_register_pmic() was introduced in 2010 in commit 984aa6dbf4ca ("OMAP3: PM: Adding smartreflex driver support.") . There was never any caller of this function in mainline resulting in a warning sr_init: No PMIC hook to init smartreflex for each machine where this driver is enabled. So remove the unused function and the pr_warn. Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-07-07headers: separate linux/mod_devicetable.h from linux/platform_device.hRandy Dunlap1-0/+1
At over 4000 #includes, <linux/platform_device.h> is the 9th most #included header file in the Linux kernel. It does not need <linux/mod_devicetable.h>, so drop that header and explicitly add <linux/mod_devicetable.h> to source files that need it. 4146 #include <linux/platform_device.h> After this patch, there are 225 files that use <linux/mod_devicetable.h>, for a reduction of around 3900 times that <linux/mod_devicetable.h> does not have to be read & parsed. 225 #include <linux/mod_devicetable.h> This patch was build-tested on 20 different arch-es. It also makes these drivers SubmitChecklist#1 compliant. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: kbuild test robot <lkp@intel.com> # drivers/media/platform/vimc/ Reported-by: kbuild test robot <lkp@intel.com> # drivers/pinctrl/pinctrl-u300.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-28PM / AVS: SmartReflex: Prepare to use device tree based probingTony Lindgren1-7/+34
We are currently probing smartreflex with omap_device while we are already probing smartreflex related interconnect target module with ti-sysc driver and dts data. Before we can flip things on for ti-sysc, we need to prepare the smartreflex driver a bit: 1. The smartreflex clock is really for the whole interconnect target module. So it may be configured at the parent device level with ti-sysc 2. With ti-sysc, we have the child device manage interconnect target module directly if pm_runtime_irq_safe() is set and there is only one child. In that case nobody else is going to call pm_runtime_get and put, so we need to add these calls to idle smartreflex properly after probe if not fully configured 3. With ti-sysc, the parent driver may rebind. So we want to use platform_driver_register() and don't want probe to be __init Note that this patch depends on the related changes to ti-sysc driver and omap_device probing to prevent both ti-sysc and omap_device to try to probe smartreflex. Cc: linux-pm@vger.kernel.org Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2017-10-11PM / AVS: Use %pS printk format for direct addressesHelge Deller1-5/+5
Use the %pS instead of the %pF printk format specifier for printing symbols from direct addresses. This is needed for the ia64, ppc64 and parisc64 architectures. Signed-off-by: Helge Deller <deller@gmx.de> Acked-by: Nishanth Menon <nm@ti.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-02-27scripts/spelling.txt: add "intialization" pattern and fix typo instancesMasahiro Yamada1-3/+3
Fix typos and add the following to the scripts/spelling.txt: intialization||initialization The "inintialization" in drivers/acpi/spcr.c is a different pattern but I fixed it as well in this commit. Link: http://lkml.kernel.org/r/1481573103-11329-16-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-09-13PM / AVS: SmartReflex: Neaten loggingJoe Perches1-61/+54
Use a more common logging style. Miscellanea: o Use pr_warn o Coalesce formats adding missing spaces o Argument alignment o Remove unnecessary OOM messages as k.alloc does stack dumps Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Nishanth Menon <nm@ti.com> [khilman: update shortlog] Signed-off-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-06-10PM / AVS: SmartReflex: use devm_* API to initialize SmartReflexAndrii Tseglytskyi1-55/+21
Use of of devm_* API for resource allocation provides benefits such as auto handling of resource free. This reduces possibility have memory leaks in case of wrong error handling. All direct release calls should be removed to avoid races. Reported-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com> Signed-off-by: Kevin Hilman <khilman@linaro.org>
2013-06-10PM / AVS: SmartReflex: use omap_sr * for enable/disable interfaceAndrii Tseglytskyi1-12/+11
SmartReflex driver interface is natively divided to two parts: - external SmartReflex interface - interface between SmartReflex driver and SmartReflex Class Functions which belong to AVS class interface can use struct omap_sr* instead of struct voltatedomain*, to provide a direct connection between SR driver and SR class. This allows us to optimize and not do additional lookups where none is required. sr_enable() and sr_disable() are interface functions between SR driver and SR class. They are typically used by Class driver to enable/disable SmartReflex hardware module. Now they take struct omap_sr* as input parameter. Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com> Acked-by: Nishanth Menon <nm@ti.com> Signed-off-by: Kevin Hilman <khilman@linaro.org>
2013-06-10PM / AVS: SmartReflex: use omap_sr * for minmax interfacesAndrii Tseglytskyi1-7/+7
SmartReflex driver interface is natively divided to two parts: - external SmartReflex interface - interface between SmartReflex driver and SmartReflex Class Functions which belong to AVS class interface can use struct omap_sr* instead of struct voltatedomain*, to provide a direct connection between SR driver and SR class. This allows us to optimize and not do additional lookups where none is required. sr_configure_minmax() is interface function between SR driver and SR class. It is typically used by Class driver to configure MINMAXAVG module inside SmartReflex module. Now it takes struct omap_sr* as input parameter. Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com> Acked-by: Nishanth Menon <nm@ti.com> Signed-off-by: Kevin Hilman <khilman@linaro.org>
2013-06-10PM / AVS: SmartReflex: use omap_sr * for errgen interfacesAndrii Tseglytskyi1-13/+13
SmartReflex driver interface is natively divided to two parts: - external SmartReflex interface - interface between SmartReflex driver and SmartReflex Class Functions which belong to AVS class interface can use struct omap_sr* instead of struct voltatedomain*, to provide a direct connection between SR driver and SR class. This allows us to optimize and not do additional lookups where none is required. sr_disable_errgen() and sr_configure_errgen() are interface functions between SR driver and SR class. They are typically used by Class driver to configure error generator module during SmartReflex enable/disable sequence. Now they take struct omap_sr* as input parameter. Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com> Acked-by: Nishanth Menon <nm@ti.com> Signed-off-by: Kevin Hilman <khilman@linaro.org>
2013-06-10PM / AVS: SmartReflex: fix driver nameAndrii Tseglytskyi1-1/+2
DRIVER_NAME was undefined for SmartReflex. Now it is defined with valid value "smartreflex". It is needed to define proper value for: MODULE_ALIAS("platform:" DRIVER_NAME); Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com> Acked-by: Nishanth Menon <nm@ti.com> Signed-off-by: Kevin Hilman <khilman@linaro.org>
2013-06-10PM / AVS: SmartReflex: disable runtime PM on driver removeAndrii Tseglytskyi1-0/+1
Runtime PM should be disabled for device on driver remove, otherwise runtime PM will be not balanced, and this will cause an error message, on next driver probe. Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com> Acked-by: Nishanth Menon <nm@ti.com> Signed-off-by: Kevin Hilman <khilman@linaro.org>
2013-06-10PM / AVS: SmartReflex: disable errgen before vpbound disableNishanth Menon1-3/+8
vpboundsintr_en is available inside the IP block as an re-sycned version and one which is not. Due to this, there is an 1 sysclk cycle window where the SR_SInterruptz signal could be asserted low. IF, intr_en is cleared on the exact same cycle as the irqclr, an additional pulse is generated which indicates for VP that an additional adjustment of voltage is required. This results in VP doing two voltage adjustments for the SRERR (based on configuration, upto 4 steps), instead of the needed 1 step. Due to the unexpected pulse from AVS which breaks the AVS-VP communication protocol, VP also ends up in a stuck condition by entering a state where VP module remains non-responsive to any futher AVS adjustment events. This creates the symptom called "TRANXDONE Timeout" scenario. By disabling errgen prior to disable of intr_en, this situation can be avoided. Signed-off-by: Vincent Bour <v-bour@ti.com> Signed-off-by: Leonardo Affortunati <l-affortunati@ti.com> Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com> Signed-off-by: Kevin Hilman <khilman@linaro.org>
2012-12-17ARM: OMAP2+: Drop plat/cpu.h for omap2plusTony Lindgren1-2/+0
The cpu_is_omap macros are now local to arch/arm/mach-omap2 in soc.h and plat/cpu.h can finally be dropped for omap2+. Thanks everybody for help with fixing the drivers. Note that we can now also remove the unused plat/cpu.h from smartreflex.c and isp.c as they will cause compile errors with ARCH_MULTIPLATFORM enabled. Cc: Kevin Hilman <khilman@deeprootsystems.com> Acked-by: Jean Pihet <jean.pihet@newoldbits.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-12-13Merge tag 'pm-merge' of ↵Linus Torvalds1-37/+17
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC power management and clock changes from Olof Johansson: "This branch contains a largeish set of updates of power management and clock setup. The bulk of it is for OMAP/AM33xx platforms, but also a few around hotplug/suspend/resume on Exynos. It includes a split-up of some of the OMAP clock data into separate files which adds to the diffstat, but gross delta is fairly reasonable." * tag 'pm-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (60 commits) ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h ASoC: OMAP: mcbsp fixes for enabling ARM multiplatform support watchdog: OMAP: fixup for ARM multiplatform support ARM: EXYNOS: Add flush_cache_all in suspend finisher ARM: EXYNOS: Remove scu_enable from cpuidle ARM: EXYNOS: Fix soft reboot hang after suspend/resume ARM: EXYNOS: Add support for rtc wakeup ARM: EXYNOS: fix the hotplug for Cortex-A15 ARM: OMAP2+: omap_device: Correct resource handling for DT boot ARM: OMAP2+: hwmod: Add possibility to count hwmod resources based on type ARM: OMAP2+: hwmod: Add support for per hwmod/module context lost count ARM: OMAP2+: PRM: initialize some PRM functions early ARM: OMAP2+: voltage: fixup oscillator handling when CONFIG_PM=n ARM: OMAP4: USB: power down MUSB PHY during boot ARM: OMAP2+: clock: Cleanup !CONFIG_COMMON_CLK parts ARM: OMAP2xxx: clock: drop obsolete clock data ARM: OMAP2: clock: Cleanup !CONFIG_COMMON_CLK parts ARM: OMAP3+: DPLL: drop !CONFIG_COMMON_CLK sections ARM: AM33xx: clock: drop obsolete clock data ARM: OMAP3xxx: clk: drop obsolete clock data ...
2012-11-28power: remove use of __devexitBill Pemberton1-2/+2
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Anton Vorontsov <cbou@mail.ru> Cc: David Woodhouse <dwmw2@infradead.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28power: remove use of __devexit_pBill Pemberton1-2/+2
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Anton Vorontsov <cbou@mail.ru> Cc: David Woodhouse <dwmw2@infradead.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-15ARM: OMAP: SmartReflex: pass device dependent data via platform dataJean Pihet1-37/+17
Remove the device dependent code (ex. cpu_is_xxx()) and settings from the driver code and instead pass them via the platform data. This allows a clean separation of the driver code and the platform code, as required by the move of the platform header files to include/linux/platform_data. Note about the smartreflex functional clocks: the smartreflex fclks are derived from sys_clk and have the same name as the main_clk from the hwmod entry, in order for the SmartReflex driver to request the fclk (using clk_get(dev, "fck")). Signed-off-by: Jean Pihet <j-pihet@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-10-08Merge tag 'for_3.7-fixes-pm' of ↵Tony Lindgren1-4/+4
git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-v3.7-rc1/fixes-pm OMAP PM related fixes for v3.7-rc
2012-10-02ARM: OMAP: SmartReflex: fix error path in init functionJean Pihet1-4/+4
Fix the error handling path in omap_sr_probe to correctly de-allocate resources in case of problems. Signed-off-by: Jean Pihet <j-pihet@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-09-12ARM: OMAP2+: Remove hardcoded IRQs and enable SPARSE_IRQTony Lindgren1-0/+2
Remove hardcoded IRQs in irqs.h and related files as these are no longer needed. Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-05-31ARM: OMAP: SmartReflex: Move smartreflex driver to drivers/Jean Pihet1-0/+1126
After a clean-up of the interfaces the OMAP Smartreflex IP driver is now a generic driver. Move it to drivers/power/avs/. The build is controlled by the following Kconfig options: . CONFIG_POWER_AVS: general knob for Adaptive Voltage Scaling support, . CONFIG_POWER_AVS_OMAP: AVS(Adaptive Voltage Scaling) support on OMAP containing the version 1 or version 2 of the SmartReflex IP, . CONFIG_POWER_AVS_OMAP_CLASS3: Class 3 implementation of Smartreflex. Signed-off-by: Jean Pihet <j-pihet@ti.com> Signed-off-by: J Keerthy <j-keerthy@ti.com> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by: Kevin Hilman <khilman@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>