- 21 1月, 2015 3 次提交
-
-
由 kbuild test robot 提交于
drivers/power/max77693_charger.c:747:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci CC: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NFengguang Wu <fengguang.wu@intel.com> Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 kbuild test robot 提交于
drivers/power/max77693_charger.c:615:1-4: WARNING: end returns can be simpified Simplify a trivial if-return sequence. Possibly combine with a preceding function call. Generated by: scripts/coccinelle/misc/simple_return.cocci CC: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NFengguang Wu <fengguang.wu@intel.com> Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Pawel Moll 提交于
Now, as all VE platforms have to be booted with DT, the code handling non-DT case can be removed. Signed-off-by: NPawel Moll <pawel.moll@arm.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
- 20 1月, 2015 19 次提交
-
-
由 Krzysztof Kozlowski 提交于
Add new driver for Maxim 77693 switch-mode charger (part of max77693 MFD driver) providing power supply class information to userspace. The charger has +20V tolerant input. Current input can be set from 0 to 2.58 A. The charger can deliver up to 2.1 A to the battery or 3.5 A to the system (when supplying additional current from battery to system). The driver is configured through DTS (battery and system related settings) and sysfs entries (timers and top-off charging threshold). Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Krzysztof Kozlowski 提交于
The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const. Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Krzysztof Kozlowski 提交于
The driver mismatched 'num_supplicants' with 'num_supplies' of power_supply structure. It provided list of supplicants (power_supply.supplied_to) but did not set the number of supplicants. Instead it set the num_supplies which is used when iterating over number of supplies (power_supply.supplied_from). As a result the list of supplicants was ignored by core because its size was 0. Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Cc: <stable@vger.kernel.org> Fixes: d7bf353f ("bq24190_charger: Add support for TI BQ24190 Battery Charger") Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Dmitry Eremin-Solenikov 提交于
Teach collie_battery driver to communicate to the kernel that it can generate wakeup events. Handle enabling/disabling wakeup on battery full event in suspend/resume callbacks. Signed-off-by: NDmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Dmitry Eremin-Solenikov 提交于
enable_irq_wakeup returns 0 in case it correctly enabled the IRQ to generate the wakeup event (and thus resume should call disable_irq_wake). Currently gpio-charger driver has this logic inverted. Correct that thus correcting enable/disable_irq_wake() calls balance. Cc: stable@vger.kernel.org Signed-off-by: NDmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Beomho Seo 提交于
This patch adds device driver of Richtek PMIC. The driver support battery fuel gauge. Fuel gauge calculates and determines the battery state of charge (SOC) according to battery open circuit voltage (OCV). Also, this driver provides battery average voltage, voltage and battery present property. Cc: Sebastian Reichel <sre@kernel.org> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: NBeomho Seo <beomho.seo@samsung.com> Acked-by: NChanwoo Choi <cw00.choi@samsung.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
Currently the ltc2952 supports only one button sequence to initiate powerdown. This is not always desirable, as even prolonged button presses can happen in use. Allow ltc2952 users to pick their own power down sequence, by making the trigger input optional. Since this still means that the ltc2952 may power down the platform if the power button is pressed for about 5 seconds, we still need to make sure to start the watchdog toggle to prolong the system power for as long as we need it. This will still allow the system to control power using the kill signal. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
In ltc2952_poweroff_handler it is theoretically possible that the timer fails to start on first pass (button press), but succeeds in starting on the second (button release). This will cause the button press to be misinterpreted, and will incorrectly shut down the system. Because a picture says more than a thousand words: Expected behavior: tmr: ++++++++++ btn: -----__________----- Faulty behavior: tmr: +++++ btn: -----__________----- Legend: + timer runs _ button pressed - button depressed To prevent this from happening, check the value of the gpio before starting the timer. If the button is active, we should start the timer, else we should stop it. The situation described can now still occur if the polarity of the input pin is set incorrectly, but that at least is predictable behavior and can be detected during the first tests. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
Disable the timers when ltc2952_poweroff is removed. We don't want to risk calling functions on data that no longer exist. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
The function pointers for the timers and pm_power_off are assigned with C++ style foo = &func; Let's change it instead to the more C style foo = func; Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
ltc2952_poweroff_handler uses gotos to return from the function. Since we don't do cleanups exiting this function, just return IRQ_HANDLED on the spot and be done with it. While at it, remove the variable 'ret'. It was never used very much. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
Documentation/SubmittingDrivers suggests these be implemented even when they do nothing. On the other hand, the platform code calls these functions 'legacy'. Suspend and resume operations should go into a pm_ops structure, pointed at by the driver's pm field. This approach would lead to a lot of boiler plate, while achieving nothing. Drop the functions instead. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
As per Documentation/CodingStyle ch.4, we should keep global variables to a mininum. Move the panic state into the driver data, regardless of whether panic is a system state or not. This removes the need for the custom _init and _exit functions, so replace them with a call to the module_platform_driver() macro. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
Documentation/CodingStyle ch.4 mentions in a side node that global variables should only be used if you really need them. Reduce the use of the global instance of ltc2952_poweroff so we may eventually remove it entirely. While at it, rename ltc2952_poweroff_data to ltc2952_poweroff, just to save that little bit of typing. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
This reduces cleanup code and chance of errors. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
The three gpio's used by this driver are stored in an array of pointers. This doesn't add much besides cleanups in a loop. In fact, it makes most of the usage sites harder to read. Unroll the loop, and live with the fact that cleanups become slightly larger. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
Make use of the fact that we allocated resources can be automatically deallocated. This reduces cleanup code and chance of errors. It also removes the need for the virq member of the ltc2952_poweroff_data struct. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
Make use of the fact that the allocated resources can be automatically deallocated. This reduces cleanup code and chance of leaks. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Linus Walleij 提交于
Augment the Versatile reset driver to also handle the core module reset sequence used on the Integrator/AP and Integrator/CP. Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Sebastian Reichel <sre@kernel.org> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
- 15 12月, 2014 1 次提交
-
-
由 Rafael J. Wysocki 提交于
After commit b2b49ccb (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME within #ifdef blocks depending on CONFIG_PM may be dropped now. Do that in drivers/power/pm2301_charger.c. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 04 12月, 2014 1 次提交
-
-
由 Stefan Agner 提交于
Currently, all restart handler use the priority 128, including watchdogs. Probably most SoC have a watchdog, and some of them register it also as a restart handler. But if a SoC specifies a dedicated reboot capability using this syscon driver, this is usually the preferred reboot method. Hence, raise the priority of this driver to 192. Signed-off-by: NStefan Agner <stefan@agner.ch> Reviewed-by: NGuenter Roeck <linux@roeck-us.net> Acked-by: NMark Rutland <mark.rutland@arm.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
- 23 11月, 2014 1 次提交
-
-
由 Robin Gong 提交于
This driver register pm_power_off with snvs power off function. If your boards NOT use PMIC_ON_REQ to turn on/off external pmic, or use other pin to do, please disable the driver in dts, otherwise, your pm_power_off maybe overwrote by this driver. Signed-off-by: NRobin Gong <b38343@freescale.com> Acked-By: NSebastian Reichel <sre@kernel.org> Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
-
- 17 11月, 2014 13 次提交
-
-
由 Fabio Estevam 提交于
The SIMPLE_DEV_PM_OPS() macro already takes care of the CONFIG_PM_SLEEP=n case, so we can simplify the code a little bit. Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Guenter Roeck 提交于
Register with kernel restart handler instead of setting arm_pm_restart directly. Cc: Marc Carino <marc.ceeeee@gmail.com> Cc: Brian Norris <computersforpeace@gmail.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
Register with kernel restart handler instead of setting arm_pm_restart directly. Cc: Haojian Zhuang <haojian.zhuang@linaro.org> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
Register with kernel restart handler instead of setting arm_pm_restart directly. Move notifier registration to the end of the probe function to avoid having to implement error handling. Cc: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: NSantosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: NIvan Khoronzhuk <ivan.khoronzhuk@ti.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
Register with kernel restart handler instead of setting arm_pm_restart directly. Cc: Anders Berg <anders.berg@lsi.com> Tested-by: NAnders Berg <anders.berg@avagotech.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
Register with kernel restart handler instead of setting arm_pm_restart directly. This patch also addresses the following compile warning. drivers/power/reset/xgene-reboot.c: In function 'xgene_reboot_probe': drivers/power/reset/xgene-reboot.c:77:17: warning: assignment from incompatible pointer type [enabled by default] The warning was due to a mismatch between the type of arm_pm_restart and the restart function. Cc: Loc Ho <lho@apm.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
jiffies are not running at this stage of system shutdown, meaning an error in the reset function would never be reported. Replace with mdelay(). Cc: Loc Ho <lho@apm.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
Using a local variable dev to point to the device is simpler then repeatedly dereferencing pdev->dev. Cc: Loc Ho <lho@apm.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
Calling devm_kfree is unnecessary. Drop it. Cc: Loc Ho <lho@apm.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
It is customary to return an error code of -ENOMEM if the system is out of memory. Also, in that case, the infrastructure will report an error, so it is unnecessary to report it again. Cc: Loc Ho <lho@apm.com> Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Guenter Roeck 提交于
Use the kernel restart handler instead of setting arm_pm_restart directly. This allows for more than one restart handler in the system. Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
-
由 Robin Gong 提交于
This driver register pm_power_off with snvs power off function. If your boards NOT use PMIC_ON_REQ to turn on/off external pmic, or use other pin to do, please disable the driver in dts, otherwise, your pm_power_off maybe overwrote by this driver. Signed-off-by: NRobin Gong <b38343@freescale.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Heiko Stuebner 提交于
Add the ability to parse gpio-charger data from a devicetree node. Signed-off-by: NHeiko Stuebner <heiko.stuebner@bq.com> Reviewed-by: NDoug Anderson <dianders@chromium.org> Tested-by: NDoug Anderson <dianders@chromium.org>
-
- 13 11月, 2014 1 次提交
-
-
由 Alexandre Belloni 提交于
Move the (DDR) SDRAM controller headers to include/soc/at91 to remove the dependency on mach/ headers from the at91-reset driver. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com>
-
- 28 10月, 2014 1 次提交
-
-
由 Krzysztof Kozlowski 提交于
The charger manager obtained in probe references to power supplies for all chargers with power_supply_get_by_name() for later usage. However if such charger driver was removed then this reference would point to old power supply (from driver which was removed). This lead to accessing invalid memory which could be observed with: $ echo "max77693-charger" > /sys/bus/platform/drivers/max77693-charger/unbind $ grep . /sys/devices/virtual/power_supply/battery/charger.0/* $ grep . /sys/devices/virtual/power_supply/battery/* [ 15.339817] Unable to handle kernel paging request at virtual address 0001c12c [ 15.346187] pgd = edd08000 [ 15.348814] [0001c12c] *pgd=6dce2831, *pte=00000000, *ppte=00000000 [ 15.355075] Internal error: Oops: 80000007 [#1] PREEMPT SMP ARM [ 15.360967] Modules linked in: [ 15.364010] CPU: 2 PID: 1388 Comm: grep Not tainted 3.17.0-next-20141007-00027-ga95e761db1b0 #245 [ 15.372859] task: ee03ad00 ti: edcf6000 task.ti: edcf6000 [ 15.378241] PC is at 0x1c12c [ 15.381113] LR is at is_ext_pwr_online+0x30/0x6c [ 15.385706] pc : [<0001c12c>] lr : [<c0339fc4>] psr: a0000013 [ 15.385706] sp : edcf7e88 ip : 00000000 fp : 00000000 [ 15.397161] r10: eeb02c08 r9 : c04b1f84 r8 : eeb02c00 [ 15.402369] r7 : edc69a10 r6 : eea6ac10 r5 : eea6ac10 r4 : 00000004 [ 15.408878] r3 : 0001c12c r2 : edcf7e8c r1 : 00000004 r0 : ee914418 [ 15.415390] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user [ 15.422506] Control: 10c5387d Table: 6dd0804a DAC: 00000015 [ 15.428236] Process grep (pid: 1388, stack limit = 0xedcf6240) [ 15.434050] Stack: (0xedcf7e88 to 0xedcf8000) [ 15.438395] 7e80: ee03ad00 00000000 edcf7f80 eea6aca8 edcf7ec4 c033b7b0 [ 15.446554] 7ea0: 00000001 ee1cc3f0 00000004 c06e1e44 eebdc000 c06e1e44 eeb02c00 c0337144 [ 15.454713] 7ec0: ee2dac68 c005cffc ee1cc3c0 c06e1e44 00000fff 00001000 eebdc000 c0278ca8 [ 15.462872] 7ee0: c0278c8c ee1cc3c0 eeb7ce00 c014422c edcf7f20 00008000 ee1cc3c0 ee9a48c0 [ 15.471030] 7f00: 00000001 00000001 edcf7f80 c0142d94 c0142d70 c01060f4 00021000 ee1cc3f0 [ 15.479190] 7f20: 00000000 00000000 c06a2150 eebdc000 2e7ec000 ee9a48c0 00008000 00021000 [ 15.487349] 7f40: edcf7f80 00008000 edcf6000 00021000 00021000 c00e39a4 00000000 ee9a48c0 [ 15.495508] 7f60: 00004000 00000000 00000000 ee9a48c0 ee9a48c0 00008000 00021000 c00e3aa0 [ 15.503668] 7f80: 00000000 00000000 0001f2e0 0001f2e0 00021000 00001000 00000003 c000f364 [ 15.511826] 7fa0: 00000000 c000f1a0 0001f2e0 00021000 00000003 00021000 00008000 00000000 [ 15.519986] 7fc0: 0001f2e0 00021000 00001000 00000003 00000001 000205e8 00000000 00021000 [ 15.528145] 7fe0: 00008000 bebbe910 0000a7ad b6edc49c 60000010 00000003 aaaaaaaa aaaaaaaa [ 15.536320] [<c0339fc4>] (is_ext_pwr_online) from [<c033b7b0>] (charger_get_property+0x170/0x314) [ 15.545164] [<c033b7b0>] (charger_get_property) from [<c0337144>] (power_supply_show_property+0x48/0x20c) [ 15.554719] [<c0337144>] (power_supply_show_property) from [<c0278ca8>] (dev_attr_show+0x1c/0x48) [ 15.563577] [<c0278ca8>] (dev_attr_show) from [<c014422c>] (sysfs_kf_seq_show+0x84/0x104) [ 15.571725] [<c014422c>] (sysfs_kf_seq_show) from [<c0142d94>] (kernfs_seq_show+0x24/0x28) [ 15.579973] [<c0142d94>] (kernfs_seq_show) from [<c01060f4>] (seq_read+0x1b0/0x484) [ 15.587614] [<c01060f4>] (seq_read) from [<c00e39a4>] (vfs_read+0x88/0x144) [ 15.594552] [<c00e39a4>] (vfs_read) from [<c00e3aa0>] (SyS_read+0x40/0x8c) [ 15.601417] [<c00e3aa0>] (SyS_read) from [<c000f1a0>] (ret_fast_syscall+0x0/0x48) [ 15.608877] Code: bad PC value [ 15.611991] ---[ end trace a88fcc95208db283 ]--- The charger-manager should get reference to charger power supply on each use of get_property callback. Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Cc: <stable@vger.kernel.org> Fixes: 3bb3dbbd ("power_supply: Add initial Charger-Manager driver") Signed-off-by: NSebastian Reichel <sre@kernel.org>
-