summaryrefslogtreecommitdiff
path: root/drivers/power
AgeCommit message (Collapse)Author
2015-06-16drivers/power: Convert non-modular syscon-reboot to use builtin_platform_driverPaul Gortmaker
This file depends on Kconfig options all of which are a bool, so we use the appropriate registration function, which avoids us relying on an implicit inclusion of <module.h> which we are doing currently. While this currently works, we really don't want to be including the module.h header in non-modular code, which we'd be forced to do, pending some upcoming code relocation from init.h into module.h. So we fix it now by using the non-modular equivalent. Cc: Sebastian Reichel <sre@kernel.org> Acked-By: Sebastian Reichel <sre@kernel.org> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: linux-pm@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2015-06-15wm831x_power: Fix off-by-one at free_irq()Takeshi Yoshimura
An error handling in wm831x_power_probe() mistakenly frees a failed-to- request irq as well as other irqs. I added missing decrement of the loop counter. Signed-off-by: Takeshi Yoshimura <yos@sslab.ics.keio.ac.jp> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-06-13power_supply: rt9455_charger: Fix error reported by static analysis toolAnda-Maria Nicolae
The result of container_of macro cannot be NULL, so there is no need to check whether info is NULL. Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-06-13power_supply: bq24257: use flags argument of devm_gpiod_getUwe Kleine-König
Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions) which appeared in v3.17-rc1, the gpiod_get* functions take an additional parameter that allows to specify direction and initial value for output. Simplify driver accordingly. Furthermore this is one caller less that stops us making the flags argument to gpiod_get*() mandatory. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-06-13power_supply: bq25890: use flags argument of devm_gpiod_getUwe Kleine-König
Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions) which appeared in v3.17-rc1, the gpiod_get* functions take an additional parameter that allows to specify direction and initial value for output. Simplify driver accordingly. Furthermore this is one caller less that stops us making the flags argument to gpiod_get*() mandatory. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-06-10sbs-battery: add option to always register batteryFrans Klaver
Commit a22b41a31e53 ("sbs-battery: Probe should try talking to the device") introduced a step in probing the SBS battery, that tries to talk to the device before actually registering it, saying: this driver doesn't actually try talking to the device at probe time, so if it's incorrectly configured in the device tree or platform data (or if the battery has been removed from the system), then probe will succeed and every access will sit there and time out. The end result is a possibly laggy system that thinks it has a battery but can never read status, which isn't very useful. Which is of course reasonable. However, it is also very well possible for a device to boot up on wall-power and be connected to a battery later on. This is a scenario that the driver supported before said patch was applied, and even easily achieved by booting up with the battery attached and removing it later on. sbs-battery's 'present' sysfs file can be used to determine if the device is available or not. So with automated device detection lacking for now, in some cases it is possible that one wants to register a battery, even if none are attached at the moment. To facilitate this, add a module parameter that can be used to configure forced loading module loading time. If set, the battery will always be registered without checking the sanity of the connection. Signed-off-by: Frans Klaver <frans.klaver@xsens.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-06-10power: Add devm_power_supply_get_by_phandle() helper functionHans de Goede
This commit adds a resource-managed version of the power_supply_get_by_phandle() function. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-06-10power_supply: max17042: Add OF support for setting thresholdsKrzysztof Kozlowski
The commit edd4ab055931 ("power: max17042_battery: add HEALTH and TEMP_* properties support") added support for setting voltage and temperature thresholds with platform data. For DeviceTree default of 0 was always used. This caused reporting battery health always as over voltage or over heated. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Fixes: edd4ab055931 ("power: max17042_battery: add HEALTH and TEMP_* properties support") Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-06-10power_supply: sysfs: Bring back write to writeable propertiesKrzysztof Kozlowski
The fix for NULL pointer exception related to calling uevent for not finished probe caused to set all writeable properties as non-writeable. This was caused by checking if property is writeable before the initial increase of power supply usage counter and in the same time using wrapper over property_is_writeable(). The wrapper returns ENODEV if the usage counter is still 0. The call trace looked like: device probe: power_supply_register() use_cnt = 0; device_add() create sysfs entries power_supply_attr_is_visible() power_supply_property_is_writeable() if (use_cnt == 0) return -ENODEV; use_cnt++; Replace the usage of wrapper with direct call to property_is_writeable() from driver. This should be safe call during device probe because implementations of this callback just return 0/1 for different properties and they do not access any of the driver's internal data. Fixes: 8e59c7f23410 ("power_supply: Fix NULL pointer dereference during bq27x00_battery probe") Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-06-03power_supply: rt9455_charger: Check if CONFIG_USB_PHY is enabledAnda-Maria Nicolae
If CONFIG_USB_PHY is not enabled, struct notifier_block is not defined and compilation fails. Therefore, the functions that process USB event notifications are defined only if CONFIG_USB_PHY is enabled. There is no need to define these functions if CONFIG_USB_PHY is not enabled, since no USB notifications are received in this case. Also, since rt9455_set_boost_voltage_before_boost_mode() function is called only if USB_EVENT_ID notification is received, this function should also be defined only if CONFIG_USB_PHY is enabled. Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-06-02power: reset: gpio-restart: increase priority slightlyHeiko Stübner
gpio-restart uses a priority of 128 and currently most soc-level restart mechanisms use the same - with some exceptions even using 192. But while the soc-level restarts are provided by the soc itself, gpio-restarts will most of the time be board-specfic and be used when some special board condition makes the soc-level restart only a second choice. The problem at hand manifested itself on the rk3288-veyron devices. While the soc-level restart can sucessfully restart all other rockchip boards I have, the veyron devices use an external restart mechanism that seems to not only reset the soc but also some external needed components. With both restart handlers having priority 128 in my tests the soc-specific variant took precedent in all cases. While it could restart the soc sucessfully in all cases, firmware then got an issue when talking to an external component, resulting in the device being put into recovery mode. So, give the board-specific restart handler a slight push and move it to priority 129 to make it more important than the generic soc-specific restart-handler. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-06-02power_supply: bq25890: make chip_id intLaurentiu Palcu
Smatch static checker correctly detected an impossible condition because chip_id was declared as u8, instead of int: drivers/power/bq25890_charger.c:843 bq25890_probe() warn: impossible condition '(bq->chip_id < 0) => (0-255 < 0)' Also, while at it, fix the return value too. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-06-02Merge tag 'usb-for-v4.2' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: patches for v4.2 merge window - dwc2 adds hibernation support - preparation for sunxi glue to musb driver - new ULPI bus - new ULPI PHY driver for TUSB1210 - musb patches to support multiple DMA engines on same binary - support for R-Car E2 on renesas_usbhs Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-05-30power_supply: Add support for Richtek RT9455 battery chargerAnda-Maria Nicolae
Based on the datasheet found here: http://www.richtek.com/download_ds.jsp?p=RT9455 Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-29power_supply: 88pm860x_charger: Do not call free_irq() twiceTakeshi Yoshimura
My static checker detected double free_irq() in pm860x_charger_remove(). Unloading this module always causes a warning. This patch removes the first redundant free_irq() call. Signed-off-by: Takeshi Yoshimura <yos@sslab.ics.keio.ac.jp> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-29power: bq24190_charger: Change first_time flag reset conditionThomas Elste
The initial register reset of BQ24190 generates a charger status change whose propagation via power_supply_changed is prevented using a flag. This flag gets never reset so all following events are ignored as well leading for example to userspace not detecting charger connects/disconnects. Therefor change the reset condition of first_time flag, so only the propagation of the first charger status change is prevented. Signed-off-by: Thomas Elste <thomas.elste@imms.de> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-28kernel/params: constify struct kernel_param_ops usesLuis R. Rodriguez
Most code already uses consts for the struct kernel_param_ops, sweep the kernel for the last offending stragglers. Other than include/linux/moduleparam.h and kernel/params.c all other changes were generated with the following Coccinelle SmPL patch. Merge conflicts between trees can be handled with Coccinelle. In the future git could get Coccinelle merge support to deal with patch --> fail --> grammar --> Coccinelle --> new patch conflicts automatically for us on patches where the grammar is available and the patch is of high confidence. Consider this a feature request. Test compiled on x86_64 against: * allnoconfig * allmodconfig * allyesconfig @ const_found @ identifier ops; @@ const struct kernel_param_ops ops = { }; @ const_not_found depends on !const_found @ identifier ops; @@ -struct kernel_param_ops ops = { +const struct kernel_param_ops ops = { }; Generated-by: Coccinelle SmPL Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Junio C Hamano <gitster@pobox.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Kees Cook <keescook@chromium.org> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: cocci@systeme.lip6.fr Cc: linux-kernel@vger.kernel.org Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-05-26power: twl4030_charger: find associated phy by more reliable means.NeilBrown
twl4030_charger currently finds the associated phy using usb_get_phy() which will return the first USB2 phy. If your platform has multiple such phys (as mine does), this is not reliable (and reliably fails on the GTA04). Change to use devm_usb_get_phy_by_node(), having found the node by looking for an appropriately named sibling in device-tree. This makes usb-charging dependent on correct device-tree configuration. Acked-By: Sebastian Reichel <sre@kernel.org> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-05-24power: axp288_charger: axp288 charger driverRamakrishna Pallala
This patch adds new power supply charger driver support for X-Power AXP288 PMIC integrated charger. This driver interfaces with the axp20x mfd driver as a cell and listens to extcon cable events for setting up charging. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-23power: max17042_battery: add HEALTH and TEMP_* properties supportRamakrishna Pallala
This patch adds the support for following battery properties to max17042 fuel gauge driver. POWER_SUPPLY_PROP_TEMP_ALERT_MIN POWER_SUPPLY_PROP_TEMP_ALERT_MAX POWER_SUPPLY_PROP_TEMP_MIN POWER_SUPPLY_PROP_TEMP_MAX POWER_SUPPLY_PROP_HEALTH Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-23power_supply: Add support for TI BQ25890 charger chipLaurentiu Palcu
More details about the chip can be found here: http://www.ti.com/product/bq25890 Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-23power_supply: charger-manager: Add parent for power supplyKrzysztof Kozlowski
The 'parent' argument passed to power_supply_register() is now used to postpone callbacks to the driver until the driver's probe end. Pass current device from charger-manager to utilize that. This will move created power supply from virtual to platform devices. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-23power_supply: Use wrappers to avoid races when registering power supplyKrzysztof Kozlowski
Use wrappers over get_property() and set_property() internally in power supply and for sysfs interface. The wrappers provide safe access if power supply is not yet registered or t is being destroyed. In case of syfs the theoretical race could happen between ending of driver's probe and parallel sysfs access: some_driver_probe() userspace ==================================== =========================== drv->psy = power_supply_register() device_add() sysfs entries are created atomic_inc(&psy->use_cnt); store on sysfs attributes drv->set_property() dereference of drv->psy drv->psy = returned psy; For leds the race could happen between power supply being destroyed and ongoing power_supply_changed_work(). Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-23power: reset: ltc2952: use _optional variant of devm_gpiod_getUwe Kleine-König
devm_gpiod_get_optional returns NULL if devm_gpiod_get would return an ENOENT error pointer. There is no semantic change intended. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-23power: reset: gpio-poweroff: let devm_gpiod_get set direction of gpioUwe Kleine-König
Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions) which appeared in v3.17-rc1, the gpiod_get* functions take an additional parameter that allows to specify direction and initial value for output. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-23power_supply: bq2415x_charger: Add ACPI supportAnda-Maria Nicolae
Replace of_property_read_u32() with device_property_read_u32(), which is a wrapper over ACPI and device tree enumeration methods. When ACPI enumeration is used, automode is not supported. Therefore, bq2415x_charger does not update its input current automatically, depending on the USB port type that is connected to. Input current may be updated via sysfs. Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-23power_supply: bq2415x_charger: Fix coding style issuesAnda-Maria Nicolae
This patch fixes the following issues reported by checkpatch.pl: - use -EINVAL instead of -ENOSYS, to fix warning message: "ENOSYS means 'invalid syscall nr' and nothing else" - remove unnecessary log message - split lines whose length is greater than 80 characters - if an arm statement uses braces, add braces to the other arms of the respective statement, too - match alignment with open parenthesis Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-23power: at91-reset: Constify platform_device_idKrzysztof Kozlowski
The platform_device_id is not modified by the driver and core uses it as const. Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-23power: axp288_fuel_gauge: Constify platform_device_idKrzysztof Kozlowski
The platform_device_id is not modified by the driver and core uses it as const. Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-23power_supply: Add TI BQ24257 charger driverLaurentiu Palcu
Based on the datasheet found here: http://www.ti.com/lit/ds/symlink/bq24257.pdf Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-21power_supply: Fix possible NULL pointer dereference on early ueventKrzysztof Kozlowski
Don't call the power_supply_changed() from power_supply_register() when parent is still probing because it may lead to accessing parent too early. In bq27x00_battery this caused NULL pointer exception because uevent of power_supply_changed called back the the get_property() method provided by the driver. The get_property() method accessed pointer which should be returned by power_supply_register(). Starting from bq27x00_battery_probe(): di->bat = power_supply_register() power_supply_changed() kobject_uevent() power_supply_uevent() power_supply_show_property() power_supply_get_property() bq27x00_battery_get_property() dereference of di->bat which is NULL here The dereference of di->bat (value returned by power_supply_register()) is the currently visible problem. However calling back the methods provided by driver before ending the probe may lead to accessing other driver-related data which is not yet initialized. The call to power_supply_changed() is postponed till probing ends - mutex of parent device is released. Reported-by: H. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Fixes: 297d716f6260 ("power_supply: Change ownership from driver to core") Tested-By: Dr. H. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-21power_supply: Fix NULL pointer dereference during bq27x00_battery probeKrzysztof Kozlowski
Power supply is often registered during probe of a driver. The power_supply_register() returns pointer to newly allocated structure as return value. However before returning the power_supply_register() calls back the get_property() method provided by the driver through uevent. In that time the driver probe is still in progress and driver did not assigned pointer to power supply to its local variables. This leads to NULL pointer dereference from get_property() function. Starting from bq27x00_battery_probe(): di->bat = power_supply_register() device_add() kobject_uevent() power_supply_uevent() power_supply_show_property() power_supply_get_property() bq27x00_battery_get_property() dereference of (di->bat) which is NULL here The first uevent of power supply (the one coming from device creation) should not call back to the driver. To prevent that from happening, increment the atomic use counter at the end of power_supply_register(). This means that power_supply_get_property() will return -ENODEV. IMPORTANT: The patch has impact on this first uevent sent from power supply because it will not contain properties from power supply. The uevent with properties will be sent later after indicating that power supply has changed. This also has a race now, but will be fixed in other patches. Reported-by: H. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Fixes: 297d716f6260 ("power_supply: Change ownership from driver to core") Tested-By: Dr. H. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-19Merge branch 'linus' into timers/coreThomas Gleixner
Make sure the upstream fixes are applied before adding further modifications.
2015-05-01power: bq27x00_battery: Add missing MODULE_ALIASMarek Belisko
Without MODULE_ALIAS bq27x00_battery module won't get loaded automatically. Signed-off-by: Marek Belisko <marek@goldelico.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-05-01power: reset: Add MFD_SYSCON depends for brcmstbFlorian Fainelli
The Broadcom STB reboot driver depends on MFD_SYSCON, it uses syscon_regmap_lookup_by_phandle() which will not lookup syscon phandles if MFD_SYSCON is disabled, and instead will return -ENOSYS since it is turned into an inline stub. Fixes: 030494e75064c ("power: reset: Add reboot driver for brcmstb") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-04-30power: reset: ltc2952: Remove bogus hrtimer_start() return value checksThomas Gleixner
The return value of hrtimer_start() tells whether the timer was inactive or active already when hrtimer_start() was called. The code emits a bogus warning if the timer was active already claiming that the timer could not be started. Remove it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Sebastian Reichel <sre@kernel.org> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Frans Klaver <frans.klaver@xsens.com> Cc: "René Moll" <linux@r-moll.nl> Cc: Wolfram Sang <wsa@the-dreams.de> Cc: linux-pm@vger.kernel.org Acked-by: Frans Klaver <frans.klaver@xsens.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-04-30power_supply: fix oops in collie_battery driverDmitry Eremin-Solenikov
Fix an oops happening due to typo in 297d716f6260cc9421d971b124ca196b957ee [power_supply: Change ownership from driver to core]. Unable to handle kernel NULL pointer dereference at virtual address 00000050 pgd = c0004000 [00000050] *pgd=00000000 Internal error: Oops: 17 [#1] ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.1.0-rc1+ #35 Hardware name: Sharp-Collie task: c381a720 ti: c381e000 task.ti: c381e000 PC is at collie_bat_get_property+0x10/0x258 LR is at collie_bat_get_property+0x10/0x258 pc : [<c0235d28>] lr : [<c0235d28>] psr: 20000013 sp : c381fd60 ip : 00000001 fp : 00000000 r10: c37b84c0 r9 : c068c9b8 r8 : c37b84a0 r7 : c37b84c0 r6 : c381fd84 r5 : 00000000 r4 : 00000000 r3 : c0369380 r2 : c381fd84 r1 : 00000000 r0 : 00000000 Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 0000717f Table: c3784000 DAC: 00000017 Process swapper (pid: 1, stack limit = 0xc381e190) Stack: (0xc381fd60 to 0xc3820000) fd60: c0369380 00000000 c37c0000 c068c9b8 c37b84c0 c0234380 00000000 c0234bc0 fd80: c042fcec c37b84a0 c0357c64 00000000 c37b84c0 c37c0000 c37b84a0 c0234e98 fda0: c37be020 00000000 ff0a0004 c37b84c8 c37be020 c37b84c0 c042fcec c383dbc0 fdc0: c0364060 00000000 00000000 c01be6a8 00000000 c015b220 c37b84c8 c381fdf0 fde0: c37b84c8 c37b84c8 c37b84c8 c37be020 c041e278 c015b478 c04a45b4 c0045290 fe00: c381a720 c0345d50 00000001 c37bf020 c0e511d8 c00453c0 c0688058 c37b84c8 fe20: 00000000 c37b84c0 c37780c0 c0e511d8 c38e2f60 c0e52d24 c04a45b4 c01be134 fe40: c37b8550 c37b8550 00000000 c0347a8c c37b84a0 00000000 c37b84c0 c0369380 fe60: c37780c0 00000001 00000061 c02347a0 00000001 c0e52e6c c068d144 c37b77a0 fe80: 00000000 c068d164 00000000 c0235b3c 00000000 c067fbb4 00000000 c068d1e4 fea0: 00000000 00000000 00000000 00000000 00000000 00000000 c37b77a0 c068d144 fec0: c3778020 c06953c0 c049de68 c01d5f54 c0688800 c3778020 c068d144 c0688700 fee0: c06953c0 c01d6000 c0675b80 c0675b80 c37b77a0 c0009624 c381a720 c000d8dc ff00: 00000001 c381ff54 c048a500 c00453c0 c00095a0 20000153 ffffffff c000d8dc ff20: c049cbd0 00000001 c04aa064 00000007 c04a9fb0 00000006 c06953c0 c06953c0 ff40: c048a590 c04a45c0 c04a9ffc 00000006 c06953c0 c06953c0 c048a590 c04a45c0 ff60: 00000061 c048adf8 00000006 00000006 c048a590 c0036450 00000001 00000000 ff80: c00363ec 00000000 c033ee7c 00000000 00000000 00000000 00000000 00000000 ffa0: 00000000 c033ee84 00000000 c000a3c8 00000000 00000000 00000000 00000000 ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [<c0235d28>] (collie_bat_get_property) from [<c0234380>] (power_supply_get_property+0x1c/0x28) [<c0234380>] (power_supply_get_property) from [<c0234bc0>] (power_supply_show_property+0x50/0x1dc) [<c0234bc0>] (power_supply_show_property) from [<c0234e98>] (power_supply_uevent+0x9c/0x1cc) [<c0234e98>] (power_supply_uevent) from [<c01be6a8>] (dev_uevent+0xb4/0x1d0) [<c01be6a8>] (dev_uevent) from [<c015b478>] (kobject_uevent_env+0x1cc/0x4f8) [<c015b478>] (kobject_uevent_env) from [<c01be134>] (device_add+0x374/0x524) [<c01be134>] (device_add) from [<c02347a0>] (__power_supply_register+0x120/0x180) [<c02347a0>] (__power_supply_register) from [<c0235b3c>] (collie_bat_probe+0xe8/0x1b4) [<c0235b3c>] (collie_bat_probe) from [<c01d5f54>] (ucb1x00_add_dev+0x30/0x88) [<c01d5f54>] (ucb1x00_add_dev) from [<c01d6000>] (ucb1x00_register_driver+0x54/0x78) [<c01d6000>] (ucb1x00_register_driver) from [<c0009624>] (do_one_initcall+0x84/0x1f4) [<c0009624>] (do_one_initcall) from [<c048adf8>] (kernel_init_freeable+0xf8/0x1b4) [<c048adf8>] (kernel_init_freeable) from [<c033ee84>] (kernel_init+0x8/0xec) [<c033ee84>] (kernel_init) from [<c000a3c8>] (ret_from_fork+0x14/0x2c) Code: e92d40f8 e1a05001 e1a06002 ebfff9bc (e5903050) ---[ end trace 447ee06b251d66b2 ]--- Fixes: 297d716f6260 ("power_supply: Change ownership from driver to core") Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-04-30power/reset: at91: fix return value check in at91_reset_platform_probe()Wei Yongjun
In case of error, the function devm_ioremap() returns NULL not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: ecfe64d8c55f ("power: reset: Add AT91 reset driver") Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-04-30axp288_fuel_gauge: Add original author detailsRamakrishna Pallala
Add the original author details of the axp288_fuel_gauge driver. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Acked-by: Todd Brandt <todd.e.brandt@linux.intel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-04-23power: reset: ltc2952: Remove bogus hrtimer_start() return value checksThomas Gleixner
The return value of hrtimer_start() tells whether the timer was inactive or active already when hrtimer_start() was called. The code emits a bogus warning if the timer was active already claiming that the timer could not be started. Remove it along with the bogus comment in the else path. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Frans Klaver <frans.klaver@xsens.com> Cc: Sebastian Reichel <sre@kernel.org> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Wolfram Sang <wsa@the-dreams.de> Cc: linux-pm@vger.kernel.org
2015-04-06power: twl4030_madc_battery: Add missing MODULE_ALIASMarek Belisko
Without MODULE_ALIAS twl4030_madc_battery won't get loaded automatically. Signed-off-by: Marek Belisko <marek@goldelico.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-04-06power: twl4030-madc-battery: Convert to iio consumer.Marek Belisko
Because of added iio error handling private data allocation was converted to managed to simplify code. Signed-off-by: Marek Belisko <marek@goldelico.com> Reviewed-By: Sebastian Reichel <sre@debian.org> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-04-06power: reset: Add generic SYSCON register mapped poweroff.Moritz Fischer
Add a generic SYSCON register mapped poweroff mechanism. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-04-06power: max17042_battery: add missed blankBeomho Seo
This patch add missed blank line after decalations. Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-04-06power: max17042_battery: Use reg type instead of chip typeBeomho Seo
Currently, max17042 battery driver choose register map by MAX17042_DevName register. But it is return IC specific firmware version. So other maxim chip hard to use this drvier. This patch choose chip type from driver_data. Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-03-26power/reset: at91: big endian fixes for atsama5d3xBen Dooks
Fix the passing of big endian data to routines that will be writing it to the bus in the wrong order. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-03-24power_supply: charger-manager: Fix dereferencing of ERR_PTRKrzysztof Kozlowski
If power_supply_register() fails do not dereference returned ERR_PTR. The pointer was dereferenced to print name of battery which registration failed. Instead use the name from the power supply description passed to the power_supply_register() function. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-03-20power: constify of_device_id arrayFabian Frederick
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> [for vexpress] Acked-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-03-20power/reset/rmobile-reset.c: Fix !HAS_IOMEM buildRichard Weinberger
Fixes: drivers/power/reset/rmobile-reset.c: In function ‘rmobile_reset_probe’: drivers/power/reset/rmobile-reset.c:61:2: error: implicit declaration of function ‘iounmap’ [-Werror=implicit-function-declaration] iounmap(sysc_base2); Signed-off-by: Richard Weinberger <richard@nod.at> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-03-20power_supply: 88pm860x_charger: Fix possible NULL pointer dereference and ↵Krzysztof Kozlowski
use of initialized variable Do not put reference to power supply in early exit paths of pm860x_done_handler() because: 1. it is not yet initialized, 2. it is NULL. This fixes possible NULL pointer dereference and following build warning: drivers/power/88pm860x_charger.c: In function ‘pm860x_done_handler’: drivers/power/88pm860x_charger.c:516:18: warning: ‘psy’ may be used uninitialized in this function [-Wmaybe-uninitialized] Additionally this puts the power supply reference before unlocking mutex. This actually is not needed (there is no race here) but has logical sense and makes the exit paths cleaner. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>