summaryrefslogtreecommitdiffstats
path: root/drivers/power
Commit message (Collapse)AuthorAgeFilesLines
...
| * | power: reset: at91-reset/trivial: driver applies to SAMA5 family as wellNicolas Ferre2015-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This diver doesn't applies only on SAM9 SoC families but on SAMA5 families as well. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
| * | power/reset: at91-poweroff: get and use slow clockAlexandre Belloni2015-09-221-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system hang") added a workaround for the slow clock as it is not properly handled by its users. Get and use the slow clock as it is necessary for the at91 shutdown controller. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
| * | power/reset: at91-poweroff: allow compiling as a moduleAlexandre Belloni2015-09-222-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | It was not possible to compile at91-poweroff as a module. Implement .remove() to allow it. Also switch to module_platform_driver_probe() as it is not hotpluggable. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
| * | power/reset: at91-reset: get and use slow clockAlexandre Belloni2015-09-221-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system hang") added a workaround for the slow clock as it is not properly handled by its users. Get and use the slow clock as it is necessary for the at91 reset controller. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
| * | power/reset: at91-reset: allow compiling as a moduleAlexandre Belloni2015-09-222-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | It was not possible to compile at91-reset as a module. Implement .remove() to allow it. Also switch to module_platform_driver_probe() as it is not hotpluggable. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
| * | power/reset: at91-reset: remove useless at91_reset_platform_probe()Alexandre Belloni2015-09-221-44/+3
| | | | | | | | | | | | | | | | | | | | | | | | Since all the at91 platforms are now DT only, at91_reset_platform_probe() is now useless, remove it. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
| * | 88pm860x_battery: Convert to using managed resourcesVaishali Thakkar2015-09-221-26/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use managed resource functions devm_request_threaded_irq and devm_power_supply_register to simplify error handling. To be compatible with the change, various gotos are replaced with direct returns and unneeded labels are dropped. Also, remove pm860x_battery_remove as it is now redundant. Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
| * | power: Add Qualcomm SMBB driverCourtney Cavin2015-09-223-0/+964
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add the Qualcomm Switch-Mode Battery Charger and Boost driver, found in pm8941. Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
| * | power: Remove unnecessary MODULE_ALIAS() for I2C driversJavier Martinez Canillas2015-09-224-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | These drivers already have an I2C device id table that is used to create module aliases and the used MODULE_ALIAS() was either already in the I2C table so it was redundant or wasn't a valid I2C id so it was never used. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
| * | power:lp8727_charger: parsing child node after getting debounce-msMilo Kim2015-09-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to lp8727 bindings[*], charging parameter is optional. So parsing can be skipped in case those properties are undefined. However, 'debounce-ms' should be read prior to checking the properties. Otherwise, 'debounce-ms' property will be ignored even it is configured inside the DT. So, counting child is processed after updating 'debounce-ms'. [*] Documentation/devicetree/bindings/power_supply/lp8727_charger.txt Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
| * | power:lp8727_charger: use the private data instead of updating I2C device ↵Milo Kim2015-09-221-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | platform data Currently, lp8727 charger driver parses the DT and copies values into the 'cl->dev.platform_data' if 'of_node' exists. This may have architectural issue. Platform data is configurable through the DT or I2C board info inside the platform area. However, lp8727 driver changes this configuration when it is loaded. The driver should get data from the platform side and use the private data, 'lp8727_chg->pdata' instead of changing the original platform data. _probe() procedure is changed as follows. 1. lp8727_parse_dt() returns the pointer of lp8727_platform_data. The driver uses this allocated platform data. So it should keep original platform data, 'dev->platform_data'. 2. In _probe(), check the return value of lp8727_parse_dt(). If an error is found, then exit as PTR_ERR(pdata). 3. If 'of_node' is not found, then the driver just gets the platform data from the I2C device structure. 4. Map the platform data to private data structure. Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
| * | power: wm831x_power: Convert to devm_kzalloc()Mark Brown2015-09-221-5/+4
| | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sebastian Reichel <sre@kernel.org>
| * | power: Add an axp20x-usb-power driverHans de Goede2015-09-223-0/+256
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a driver for the usb power_supply bits of the axp20x PMICs. I initially started writing my own driver, before coming aware of Bruno Prémont's excellent earlier RFC with a driver for this. My driver was lacking CURRENT_MAX and VOLTAGE_MIN support Bruno's drvier has, so I've copied the code for those from his driver. Note that the AC-power-supply and battery charger bits will need separate drivers. Each one needs its own devictree child-node so that other devicetree nodes can reference the right power-supply, and thus each one will get its own mfd-cell / platform_device and platform-driver. Cc: Bruno Prémont <bonbons@linux-vserver.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | PM / AVS: rockchip-io: Fix module autoload for OF platform driverLuis de Bethencourt2015-10-141-0/+1
|/ | | | | | | | | | This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* Merge tag 'for-v4.3-rc' of ↵Linus Torvalds2015-09-171-6/+2
|\ | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply fixes from Sebastian Reichel: "twl4030-charger fixes" * tag 'for-v4.3-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: twl4030_charger: fix another compile error Revert "twl4030_charger: correctly handle -EPROBE_DEFER from devm_usb_get_phy_by_node"
| * twl4030_charger: fix another compile errorGrazvydas Ignotas2015-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_CHARGER_TWL4030=y and CONFIG_TWL4030_MADC=m we get a compile error: drivers/built-in.o: In function `twl4030_charger_update_current': twl4030_charger.c:(.text+0x504681): undefined reference to `twl4030_get_madc_conversion' Use IS_REACHABLE to fix it. Cc: NeilBrown <neil@brown.name> Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
| * Revert "twl4030_charger: correctly handle -EPROBE_DEFER from ↵Sebastian Reichel2015-09-101-5/+1
| | | | | | | | | | | | | | | | | | | | devm_usb_get_phy_by_node" Revert commit 3fc3895e4fe17ee92ae1d1bb9f04da6069e8c370, since it introduced a boot failure on some OMAP platforms. Reported-by: Kevin Hilman <khilman@kernel.org> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | Merge branch 'next' of ↵Linus Torvalds2015-09-112-2/+2
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux Pull thermal updates from Zhang Rui: - use int instead of unsigned long to represent temperature to avoid bogus overheat detection when negative temperature reported. From Sascha Hauer. - export available thermal governors information to user space via sysfs. From Wei Ni. - introduce new thermal driver for Wildcat Point platform controller hub, which uses PCH thermal sensor and associated critical and hot trip points. From Tushar Dave. - add suuport for Intel Skylake and Denlow platforms in powerclamp driver. - some small cleanups in thermal core. * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: thermal: Add Intel PCH thermal driver thermal: Add comment explaining test for critical temperature thermal: Use IS_ENABLED instead of #ifdef thermal: remove unnecessary call to thermal_zone_device_set_polling thermal: trivial: fix typo in comment thermal: consistently use int for temperatures thermal: add available policies sysfs attribute thermal/powerclamp: add cpu id for denlow platform thermal/powerclamp: add cpu id for Skylake u/y thermal/powerclamp: add cpu id for skylake h/s
| * thermal: consistently use int for temperaturesSascha Hauer2015-08-032-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The thermal code uses int, long and unsigned long for temperatures in different places. Using an unsigned type limits the thermal framework to positive temperatures without need. Also several drivers currently will report temperatures near UINT_MAX for temperatures below 0°C. This will probably immediately shut the machine down due to overtemperature if started below 0°C. 'long' is 64bit on several architectures. This is not needed since INT_MAX °mC is above the melting point of all known materials. Consistently use a plain 'int' for temperatures throughout the thermal code and the drivers. This only changes the places in the drivers where the temperature is passed around as pointer, when drivers internally use another type this is not changed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com> Reviewed-by: Darren Hart <dvhart@linux.intel.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Peter Feuerer <peter@piie.net> Cc: Punit Agrawal <punit.agrawal@arm.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Jean Delvare <jdelvare@suse.de> Cc: Peter Feuerer <peter@piie.net> Cc: Heiko Stuebner <heiko@sntech.de> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: linux-acpi@vger.kernel.org Cc: platform-driver-x86@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Darren Hart <dvhart@infradead.org> Cc: lm-sensors@lm-sensors.org Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* | Merge tag 'pm+acpi-4.3-rc1' of ↵Linus Torvalds2015-09-012-1/+60
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management and ACPI updates from Rafael Wysocki: "From the number of commits perspective, the biggest items are ACPICA and cpufreq changes with the latter taking the lead (over 50 commits). On the cpufreq front, there are many cleanups and minor fixes in the core and governors, driver updates etc. We also have a new cpufreq driver for Mediatek MT8173 chips. ACPICA mostly updates its debug infrastructure and adds a number of fixes and cleanups for a good measure. The Operating Performance Points (OPP) framework is updated with new DT bindings and support for them among other things. We have a few updates of the generic power domains framework and a reorganization of the ACPI device enumeration code and bus type operations. And a lot of fixes and cleanups all over. Included is one branch from the MFD tree as it contains some PM-related driver core and ACPI PM changes a few other commits are based on. Specifics: - ACPICA update to upstream revision 20150818 including method tracing extensions to allow more in-depth AML debugging in the kernel and a number of assorted fixes and cleanups (Bob Moore, Lv Zheng, Markus Elfring). - ACPI sysfs code updates and a documentation update related to AML method tracing (Lv Zheng). - ACPI EC driver fix related to serialized evaluations of _Qxx methods and ACPI tools updates allowing the EC userspace tool to be built from the kernel source (Lv Zheng). - ACPI processor driver updates preparing it for future introduction of CPPC support and ACPI PCC mailbox driver updates (Ashwin Chaugule). - ACPI interrupts enumeration fix for a regression related to the handling of IRQ attribute conflicts between MADT and the ACPI namespace (Jiang Liu). - Fixes related to ACPI device PM (Mika Westerberg, Srinidhi Kasagar). - ACPI device registration code reorganization to separate the sysfs-related code and bus type operations from the rest (Rafael J Wysocki). - Assorted cleanups in the ACPI core (Jarkko Nikula, Mathias Krause, Andy Shevchenko, Rafael J Wysocki, Nicolas Iooss). - ACPI cpufreq driver and ia64 cpufreq driver fixes and cleanups (Pan Xinhui, Rafael J Wysocki). - cpufreq core cleanups on top of the previous changes allowing it to preseve its sysfs directories over system suspend/resume (Viresh Kumar, Rafael J Wysocki, Sebastian Andrzej Siewior). - cpufreq fixes and cleanups related to governors (Viresh Kumar). - cpufreq updates (core and the cpufreq-dt driver) related to the turbo/boost mode support (Viresh Kumar, Bartlomiej Zolnierkiewicz). - New DT bindings for Operating Performance Points (OPP), support for them in the OPP framework and in the cpufreq-dt driver plus related OPP framework fixes and cleanups (Viresh Kumar). - cpufreq powernv driver updates (Shilpasri G Bhat). - New cpufreq driver for Mediatek MT8173 (Pi-Cheng Chen). - Assorted cpufreq driver (speedstep-lib, sfi, integrator) cleanups and fixes (Abhilash Jindal, Andrzej Hajda, Cristian Ardelean). - intel_pstate driver updates including Skylake-S support, support for enabling HW P-states per CPU and an additional vendor bypass list entry (Kristen Carlson Accardi, Chen Yu, Ethan Zhao). - cpuidle core fixes related to the handling of coupled idle states (Xunlei Pang). - intel_idle driver updates including Skylake Client support and support for freeze-mode-specific idle states (Len Brown). - Driver core updates related to power management (Andy Shevchenko, Rafael J Wysocki). - Generic power domains framework fixes and cleanups (Jon Hunter, Geert Uytterhoeven, Rajendra Nayak, Ulf Hansson). - Device PM QoS framework update to allow the latency tolerance setting to be exposed to user space via sysfs (Mika Westerberg). - devfreq support for PPMUv2 in Exynos5433 and a fix for an incorrect exynos-ppmu DT binding (Chanwoo Choi, Javier Martinez Canillas). - System sleep support updates (Alan Stern, Len Brown, SungEun Kim). - rockchip-io AVS support updates (Heiko Stuebner). - PM core clocks support fixup (Colin Ian King). - Power capping RAPL driver update including support for Skylake H/S and Broadwell-H (Radivoje Jovanovic, Seiichi Ikarashi). - Generic device properties framework fixes related to the handling of static (driver-provided) property sets (Andy Shevchenko). - turbostat and cpupower updates (Len Brown, Shilpasri G Bhat, Shreyas B Prabhu)" * tag 'pm+acpi-4.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (180 commits) cpufreq: speedstep-lib: Use monotonic clock cpufreq: powernv: Increase the verbosity of OCC console messages cpufreq: sfi: use kmemdup rather than duplicating its implementation cpufreq: drop !cpufreq_driver check from cpufreq_parse_governor() cpufreq: rename cpufreq_real_policy as cpufreq_user_policy cpufreq: remove redundant 'policy' field from user_policy cpufreq: remove redundant 'governor' field from user_policy cpufreq: update user_policy.* on success cpufreq: use memcpy() to copy policy cpufreq: remove redundant CPUFREQ_INCOMPATIBLE notifier event cpufreq: mediatek: Add MT8173 cpufreq driver dt-bindings: mediatek: Add MT8173 CPU DVFS clock bindings PM / Domains: Fix typo in description of genpd_dev_pm_detach() PM / Domains: Remove unusable governor dummies PM / Domains: Make pm_genpd_init() available to modules PM / domains: Align column headers and data in pm_genpd_summary output powercap / RAPL: disable the 2nd power limit properly tools: cpupower: Fix error when running cpupower monitor PM / OPP: Drop unlikely before IS_ERR(_OR_NULL) PM / OPP: Fix static checker warning (broken 64bit big endian systems) ...
| * | PM / AVS: rockchip-io: add io selectors and supplies for rk3368Heiko Stuebner2015-08-081-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the necessary data for handling io voltage domains on the rk3368. As interesting tidbit, the rk3368 contains two separate iodomain areas. One in the regular General Register Files (GRF) and one in PMUGRF in the pmu power domain. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| * | PM / AVS: rockchip-io: depend on CONFIG_POWER_AVSHeiko Stuebner2015-08-081-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rockchip io-domain driver currently only depends on ARCH_ROCKCHIP itself. This makes it possible to select the power-domain driver, but not the POWER_AVS class and results in the iodomain-driver not getting build in this case. So add the additional dependency, which also results in the driver config option now being placed nicely into the AVS submenu. Fixes: 662a958638bd ("PM / AVS: rockchip-io: add driver handling Rockchip io domains") Signed-off-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* | Merge tag 'regulator-v4.3' of ↵Linus Torvalds2015-08-311-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "The biggest changes in the core this time around have been some refactorings that move us towards being able to drop the list of regulators maintained by the core and instead just use the driver model list maintained for the class devices for regulators which will make the code smaller and avoid some potential bugs. Otherwise another fairly quiet release for the regulator API, highlights include: - a new API for setting voltages based on a minimum, target, maximum triplet - support for continuous voltage ranges rather than tables of explicit steps in the PWM regulator, requiring less explicit configuration - new driver support for Dialog DA9215, Maxim 77843, Mediatek MT6311 and Qualcomm RPM" * tag 'regulator-v4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (70 commits) regulator: mt6311: fix platform_no_drv_owner.cocci warnings regulator: ltc3589: Remove unnecessary MODULE_ALIAS() regulator: ad5398: Remove unnecessary MODULE_ALIAS() regulator: pfuze100: Remove unnecessary MODULE_ALIAS() regulator: core: use debug level print in regulator_check_drms regulator: lp872x: handle error case regulator: lp872x: use the private data instead of updating I2C device platform data regulator: isl9305: Export OF module alias information regulators: max77693: register driver earlier to avoid deferred probe regulator: qcom_smd: Set n_voltages for pm8941_lnldo regulator: core: Use IS_ERR_OR_NULL() regulator: core: Define regulator_set_voltage_triplet() regulator: Regulator driver for the Qualcomm RPM regulator: pbias: Fix broken pbias disable functionality regulator: core: Spelling fix regulator: core: Use class device list for regulator_list in late init regulator: core: Move more deallocation into class unregister regulator: core: Reduce rdev locking region when releasing regulator Input: Remove the max77843 haptic driver Input: max77693: Add support for Maxim 77843 ...
| * | drivers: max77693: Move state container to common headerKrzysztof Kozlowski2015-07-161-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This prepares for merging some of the drivers between max77693 and max77843 so the child MFD driver can be attached to any parent MFD main driver. Move the state container to common header file. Additionally add consistent 'i2c' prefixes to its members (of 'struct i2c_client' type). Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Acked-by: Sebastian Reichel <sre@kernel.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | bq2415x_charger: Allow to load and use driver even if notify device is not ↵Pali Rohár2015-08-211-64/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | registered yet Driver bq2415x_charger works also without notify power supply device for charger detection. But when charger detection is specified in DT, then bq2415x_charger refused to loaded with -EPROBE_DEFER. This patch rewrites code so that notify device for charger detection is checked when power supply event is received and not when registering power supply device. So this patch allows to use bq2415x_charger driver also when kernel is compiled without driver for notify power supply device. Now after this patch scheduled workqueue is called after INIT_DELAYED_WORK, so it also fix problem when scheduled workqueue was called before init. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | twl4030_charger: fix compile error when TWL4030_MADC not available.NeilBrown2015-08-071-1/+16
| | | | | | | | | | | | | | | | | | | | We can only use the madc to check for 'ac' availability if the madc has been compiled in. If not: assume always using USB. Reported-by: Tony Lindgren <tony@atomide.com> Signed-off-by: NeilBrown <neil@brown.name> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | power: bq24190_charger: Fix charge type sysfs propertyAndreas Dannenberg2015-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Access to the BQ24190's configurable charge type property (none, trickle, fast) is being masked by an incorrect power_supply_property entry. After applying this patch a new 'charge_type' property will appear in the bq24190-charger sysfs folder backed up by getters/setters already present in the driver. Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Acked-by: Dan Murphy <dmurphy@ti.com> Acked-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | power: Allow compile test of GPIO consumers if !GPIOLIBGeert Uytterhoeven2015-08-051-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer functionality only, can still be compiled if GPIOLIB is not enabled. Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where appropriate. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | power: Export I2C module alias information in missing driversJavier Martinez Canillas2015-08-052-1/+2
| | | | | | | | | | | | | | | | | | | | | | The I2C core always reports the MODALIAS uevent as "i2c:<client name" regardless if the driver was matched using the I2C id_table or the of_match_table. So the driver needs to export the I2C table and this be built into the module or udev won't have the necessary information to auto load the correct module when the device is added. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | twl4030_charger: Increase current carefully while watching voltage.NeilBrown2015-08-051-6/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The USB Battery Charging spec (BC1.2) suggests a dedicated charging port can deliver from 0.5 to 5.0A at between 4.75 and 5.25 volts. To choose the "correct" current voltage setting requires a trial and error approach: try to draw current and see if the voltage drops too low. Even with a configured Standard Downstream Port, it may not be possible to reliably pull 500mA - depending on cable quality and source quality I have reports of charging failure due to the voltage dropping too low. To address both these concerns, this patch introduce incremental current setting. The current pull from VBUS is increased in steps of 20mA every 100ms until the target is reached or until the measure voltage drops below 4.75V. If the voltage does go too low, the target current is reduced by 20mA and kept there. This applies to currents selected automatically, or to values set via sysfs. So setting a large value will cause the maximum available to be used - up to the limit of 1.7A imposed by the hardware. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | twl4030_charger: add ac/mode to match usb/modeNeilBrown2015-08-051-8/+27
| | | | | | | | | | | | | | | | | | This allows AC charging to be turned off, much like usb charging. "continuous" mode is not available though. Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | twl4030_charger: add software controlled linear charging mode.NeilBrown2015-08-051-5/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a 'continuous' option for usb charging which enables the "linear" charging mode of the twl4030. Linear charging does a good job with not-so-reliable power sources. Auto mode does not work well as it switches off when voltage drops momentarily. Care must be taken not to over-charge. It was used with a bike hub dynamo since a year or so. In that case there are automatically charging stops when the cyclist needs a break. Original-by: Andreas Kemnade <andreas@kemnade.info> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | twl4030_charger: enable manual enable/disable of usb charging.NeilBrown2015-08-051-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'off' or 'auto' to /sys/class/power/twl4030_usb/mode will now enable or disable charging from USB port. Normally this is enabled on 'plug' and disabled on 'unplug'. Unplug will still disable charging. 'plug' will only enable it if 'auto' if selected. Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | twl4030_charger: allow max_current to be managed via sysfs.NeilBrown2015-08-051-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | 'max_current' sysfs attributes are created which allow the max to be set. Whenever a current source changes, the default is restored. This will be followed by a uevent, so user-space can decide to update again. Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | twl4030_charger: distinguish between USB current and 'AC' currentNeilBrown2015-08-051-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The twl4030 charger has two current sources, 'USB' and 'AC' (presumably "Accessory Charger" because it isn't Alternating Current). If 'AC' is providing current, we should set the current limit differently to when it isn't (and so USB is used). So split 'cur' into 'usb_cur' and 'ac_cur' and use accordingly. Now we must review the current setting on any interrupt or USB event which might indicate that the charger-source has changed. Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | twl4030_charger: allow fine control of charger current.NeilBrown2015-08-051-8/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The twl4030 allows control of the incoming current. Part of this control is a 'CGAIN' setting which doubles the range for half the precision. This control affects several different current setting, so all need to be updated at once when CGAIN is changed. With this patch, all of these current setting are managed by the driver, but most are left at their default settings. The current drawn is set to 500mA if the allow_usb module parameter is set, and to 100mA otherwise. More fine control will appear in later patches. Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | twl4030_charger: split uA calculation into a function.NeilBrown2015-08-051-13/+35
| | | | | | | | | | | | | | | | | | We will need this calculation in other places, so create functions to map between register value and uA value. Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | twl4030_charger: trust phy to determine when USB power is available.NeilBrown2015-08-051-27/+6
| | | | | | | | | | | | | | | | | | | | | | The usb phy driver already determines when VBUS is available, so repeating the test in the charger driver is pointless duplication. On probe, process the last event from the phy, and from then on, do whatever the phy tells us without double-checking. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | twl4030_charger: correctly handle -EPROBE_DEFER from devm_usb_get_phy_by_nodeNeilBrown2015-08-051-1/+5
| | | | | | | | | | | | | | | | Now that twl4030_bci_probe can safely return -EPROBE_DEFER, do so when devm_usb_get_phy_by_node returns that error. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | twl4030_charger: convert to module_platform_driver instead of ..._probe.Pavel Machek2015-08-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Drivers using module_platform_driver_probe cannot return EPROBE_DEFER from the probe function, which makes them rather useless these days... Convert to module_platform_driver() so EPROBE_DEFER can be used. Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | twl4030_charger: use runtime_pm to keep usb phy active while charging.NeilBrown2015-08-051-13/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The twl4030 usb phy needs to be active while we are using the USB VBUS as a current source for charging. In particular, the usb3v1 regulator must be enabled and the PHY_PWR_PHYPWD bit must be set to keep the phy powered. commit ab37813f4093a5f59cb8e083cde277289dc72ed3 twl4030_charger: Allow charger to control the regulator that feeds it gave the charger control over the regulator, but didn't resolve the PHY_PWR_PHYPWD issue. Now that both of these are controlled by runtime_pm in phy-twl4030-usb, we can simply take a runtime_pm reference to the USB phy whenever the charger wants to use it as a current source. So this patch reverts the above commit, and adds the necessary runtime_pm calls. Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | rx51-battery: Set name to rx51-batteryPali Rohár2015-08-031-1/+1
| | | | | | | | | | | | | | | | For compatibility between board code and DT, set battery name to same value. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | power: olpc_battery: clean up eeprom read functionVladimir Zapolskiy2015-07-271-6/+1
| | | | | | | | | | | | | | | | | | The change removes redundant sysfs binary file boundary check while reading eeprom content from userspace, the check is done on caller side in fs/sysfs/file.c, if binary attribute size is not zero. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | power: ds2781_battery: clean up eeprom read/write functionsVladimir Zapolskiy2015-07-271-8/+0
| | | | | | | | | | | | | | | | | | The change removes redundant calculation of left space on eeprom while reading or writing "param_eeprom" or "user_eeprom", the checks are not needed, since this task is done on caller side in fs/sysfs/file.c Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | power: ds2780_battery: clean up eeprom read/write functionsVladimir Zapolskiy2015-07-271-18/+2
| | | | | | | | | | | | | | | | | | The change removes redundant sysfs binary file boundary checks while reading or writing "param_eeprom" or "user_eeprom", the checks are not needed, since this task is done on caller side in fs/sysfs/file.c Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | power_supply: bq24735: Convert to using managed resourcesVaishali Thakkar2015-07-271-38/+13
| | | | | | | | | | | | | | | | | | | | | | | | Use managed resource functions like devm_kasprintf and devm_power_supply_register in bq24735_charger_probe. To be compatible with the change, replace various gotos by direct returns and drop unneeded labels. Also, remove bq24735_charger_remove as it is now redundant. Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | power/reset: zx: Remove unnecessary include fileJun Nie2015-07-271-2/+0
| | | | | | | | | | | | | | | | | | Including ARM related header file cause build failure in i386 build because COMILE_TEST also involve building zx driver. Remove the unnecessary include file. Signed-off-by: Jun Nie <jun.nie@linaro.org> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | power: bq27x00_battery: Checkpatch fixesAndrew F. Davis2015-07-241-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove space before tab. Remove unnecessary line continuations. Add braces to else statement. Remove unnecessary parentheses. Remove unneeded blank lines. Remove unnecessary 'out of memory' message. Add missing line after declarations. Change use of printk to pr_err. Signed-off-by: Andrew F. Davis <afd@ti.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Acked-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | power: bq27x00_battery: Fix function parameter alignmentAndrew F. Davis2015-07-241-7/+7
| | | | | | | | | | | | | | | | | | Fix the alignment of function parameters on new lines. Signed-off-by: Andrew F. Davis <afd@ti.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Acked-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | power: bq27x00_battery: Fix lines over 80 characters longAndrew F. Davis2015-07-241-37/+37
| | | | | | | | | | | | | | | | | | Shorted lines over 80 characters long by reducing tab count. Signed-off-by: Andrew F. Davis <afd@ti.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Acked-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
OpenPOWER on IntegriCloud