- 06 10月, 2022 1 次提交
-
-
由 Tom Rix 提交于
cpp_check reports [drivers/power/supply/ab8500_chargalg.c:493]: (style) Variable 'ab8500_chargalg_ex_ac_enable_toggle' is assigned a value that is never used. From inspection, this variable is never used. So remove it. Fixes: 6c50a08d ("power: supply: ab8500: Drop external charger leftovers") Signed-off-by: NTom Rix <trix@redhat.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Reviewed-by: NChen Lifu <chenlifu@huawei.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 02 10月, 2022 1 次提交
-
-
由 Yuan Can 提交于
After commit 75ee3f6f("power: supply: ab8500_chargalg: Drop enable/disable sysfs"), no one use struct ab8500_chargalg_sysfs_entry, so remove it. Signed-off-by: NYuan Can <yuancan@huawei.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 17 7月, 2022 2 次提交
-
-
由 Tetsuo Handa 提交于
It seems to me that ab8500 driver is using dedicated workqueues and is not calling schedule{,_delayed}_work{,_on}(). Then, there will be no work to flush using flush_scheduled_work(). Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
Some leftover code for external chargers only used with unreleased ASIC revisions and the header file for the unsupported PM2301 was left behind in an earlier cleanup, fix it by deleting the remnants. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 10 6月, 2022 2 次提交
-
-
由 Linus Walleij 提交于
The maintenance charging is supposedly designed such that the maintenance current compensates for the battery discharge curve, and as the charging progress from CC/CV -> maintenance A -> maintenance B states, we end up on a reasonable voltage to restart ordinary CC/CV charging after the safety timer at the maintenance B state exits. However: old batteries discharge quicker, and in an old battery we might not get to the expiration of the maintenance B timer before the battery is completely depleted and the system powers off with an empty battery. This is hardly the desire of anyone leaving their phone in the charger for a few days! Introduce a second clause in both maintenance states such that we exit the state and return to ordinary CC/CV charging if the voltage drops below charge_restart_voltage_uv or 95% if this is not defined for the battery. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Reviewed-by: NMatti Vaittinen <mazziesaccount@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
The battery info contains a voltage indicating when the voltage is so low that it is time to restart the CC/CV charging. Make the AB8500 respect and prioritize this setting over the hardcoded 95% threshold. Break out the check into its own function and add some safeguards so we do not run into unpredictable side effects. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Reviewed-by: NMatti Vaittinen <mazziesaccount@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 15 3月, 2022 1 次提交
-
-
由 Linus Walleij 提交于
The HRTimer in the AB8500 charging code is using CLOCK_REALTIME to set an alarm some hours forward in time +/- 5 min for a safety timer. I have observed that this will sometimes fire sporadically early when charging a battery with the result that charging stops. As CLOCK_REALTIME can be subject to adjustments of time from sources such as NTP, this cannot be trusted and will likely for example fire events if the clock is set forward some hours by say NTP. Use CLOCK_MONOTONIC as indicated in other instances and the problem goes away. Also initialize the timer to REL mode as this is what will be used later. Fixes: 257107ae ("ab8500-chargalg: Use hrtimer") Cc: Lee Jones <lee.jones@linaro.org> Suggested-by: NMatti Vaittinen <mazziesaccount@gmail.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Reviewed-by: NMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 05 3月, 2022 2 次提交
-
-
由 Souptick Joarder (HPE) 提交于
Kernel test robot reported below warning -> drivers/power/supply/ab8500_chargalg.c:790:13: warning: variable 'delta_i_ua' set but not used [-Wunused-but-set-variable] Remove unused variable delta_i_ua. Reported-by: Nkernel test robot <lkp@intel.com> Signed-off-by: NSouptick Joarder (HPE) <jrdr.linux@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Colin Ian King 提交于
There are a few spelling mistakes in comments and in a dev_err error message. Fix them. Signed-off-by: NColin Ian King <colin.i.king@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 28 2月, 2022 2 次提交
-
-
由 Linus Walleij 提交于
The AB8500 code is using a special current and voltage setting when the battery is in "alert mode", i.e. when it is starting to go outside normal operating conditions so it is too cold or too hot. This makes sense as a way for the charging algorithm to deal with hostile environments. Add the needed members to the struct power_supply_battery_info, and switch the AB8500 charging code over to using this. Reviewed-by: NMatti Vaittineen <matti.vaittinen@fi.rohmeurope.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
Maintenance charging is the phase of keeping up the charge after the battery has charged fully using CC/CV charging. This can be done in many successive phases and is usually done with a slightly lower constant voltage than CV, and a slightly lower allowed current. Add an array of maintenance charging points each with a current, voltage and safety timer, and add helper functions to use these. Migrate the AB8500 code over. This is used in several Samsung products using the AB8500 and these batteries and their complete parameters will be added later as full examples, but the default battery in the AB8500 code serves as a reasonable example so far. Reviewed-by: NMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 12 2月, 2022 3 次提交
-
-
由 Linus Walleij 提交于
There is a sysfs ABI to enable/disable charging of different types (AC/USB). Since we don't have any userspace for this code, this sits unused and it is not used on production products either. Drop this code. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
There is a sysfs ABI to change the "charging step" of the charger i.e. limit how much we charge from userspace. Since we don't have any userspace for this code, this sits unused and it is not used on production products either. Drop this code. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
We should terminate charging when we reach the voltage_max_design_uv not overvoltage_limit_uv, this is an abuse of that struct member. The overvoltage limit is actually not configurable on the AB8500, it is fixed to 4.75 V so drop a comment about that in the code. Fixes: 2a5f4183 ("power: supply: ab8500: Standardize voltages") Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 26 1月, 2022 1 次提交
-
-
由 Greg Kroah-Hartman 提交于
There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the ab8500 power supply sysfs code to use default_groups field which has been the preferred way since aa30f47c ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Sebastian Reichel <sre@kernel.org> Cc: linux-pm@vger.kernel.org Link: https://lore.kernel.org/r/20211229140908.2523513-1-gregkh@linuxfoundation.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 04 1月, 2022 1 次提交
-
-
由 Linus Walleij 提交于
The function to retrieve battery info (from the device tree) assumes we have a static info struct that gets populated by calling into power_supply_get_battery_info(). This is awkward since I want to support tables of static battery info by just assigning a pointer to all info based on e.g. a compatible value in the device tree. We also have a mixture of static and dynamically allocated variables here. Bite the bullet and let power_supply_get_battery_info() allocate also the memory used for the very top level struct power_supply_battery_info container. Pass pointers around and lifecycle this with the psy device just like the stuff we allocate inside it. Change all current users over. As part of the change, initializers need to be added to some previously uninitialized fields in struct power_supply_battery_info. Reviewed-By: NMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 23 11月, 2021 7 次提交
-
-
由 Linus Walleij 提交于
The voltage used in the constant voltage phase of the charging exist in struct power_supply_battery_info as constant_charge_voltage_max_uv. Switch the custom property normal_vol_lvl to this and consequentially change everything that relates to this value over to using microvolts rather than millivolts so we align internal representation of current with the power core. Prefix every variable we change with *_uv to indicate the unit everywhere but also to make sure we do not miss any outlier. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
The current used in the constant current phase of the charging exist in struct power_supply_battery_info as constant_charge_current_max_ua. Switch the custom property max_out_curr to this and consequentally change everything that relates to this value over to using microamperes rather than milliamperes so we align internal representation of current with the power core. Prefix every variable we change with *_ua to indicate the unit everywhere but also to make sure we do not miss any outlier. Drop some duplicate unused defines in a header. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
The recharge capacity is the hysteresis level for a charger to restart when a battery does not support maintenance charging. All products using the AB8500 have batteries supporting maintenace charging and all code has always set this to 95%. Turn it into a constant. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
The AB8500 custom termination current can be replaced by the corresponding struct power_supply_battery_info field. Remove the struct member and amend the code to use the standard property. Add *_ua suffix for clarity and to make sure we have changed all code sites using this member. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
The nominal voltage in this charge driver corresponds to both the voltage_min_design_uv and voltage_max_design_uv of struct power_supply_battery_info so assign both if this is undefined. The overcharge max voltage (when the charger should cut off) is migrated at the same time so we move both voltages to struct power_supply_battery_info. Adjust the code to deal directly with the microvolt values instead of converting them to millivolts. Add *_uv suffixes for clarity and to make sure we have changed all code sites using this member. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
The code was going through hoops and loops to detect what battery is connected and check the resistance for this battery etc. Skip this trouble: we will support one battery (currently "unknown") then we will find the connected battery in the device tree using a compatible string. The battery resistance may be used to double-check that the right battery is connected. Convert the array of battery types into one battery type so we can next move over the properties of this one type into the standard struct power_supply_battery_info. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
Instead of storing the temperature limits in our custom struct struct ab8500_bm_data, make struct power_supply_battery_info a member of this and store the min and max temperatures inside that struct as the temp_min/temp_max and temp_alert_min/temp_alert_max respectively. The values can be assigned from the device tree, but if not present will be set to the same defaults as are currently in the code. This way we start to move over to using struct power_supply_battery_info and make it possible to move the data over to the device tree and we will move piece by piece toward using the standard info struct. Temperature hysteresis is currently not supported by the standard struct but we move the assignment here as well so that we have all parameterization in one spot. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 13 8月, 2021 1 次提交
-
-
由 Colin Ian King 提交于
Clean up a handful of checkpatch warnings: - static const char * array should probably be static const char * const - function arguments should have identifier names - else should follow close brace '}' - suspect code indent for conditional statements - unnecessary parentheses in an if condition - avoid multiple line dereference - remove debug showing function execution, ftrace can trace these better - prefer 'long' over 'long int' as the int is unnecessary Signed-off-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 16 7月, 2021 3 次提交
-
-
由 Linus Walleij 提交于
If we rename the "abx500_chargalg" supply to "ab8500_chargalg" as it should be named, the existing supplies are supplying that supply but that was obviously not working since it had the wrong name. Now that the dependency kicks in we get a bunch of NULL references from ab8500_chargalg_external_power_changed() so check that the workqueue is allocated before we try to queue work on it. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
Drop the entire idea with abx500 being abstract and different from ab8500 in the AB8500 charging drivers. This rids the two identical definitions of a slew of structs in ab8500-bm.h and makes things less confusion and easier to understand. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
The "abx500" name on the charging algorithm stems from the ambition to produce a series of these analog basebands, re-using the same charging algorithm driver. No ASICs beside AB8500 and AB8505 were ever produced so this terminology is confusing. Rename the algorithm file and symbols to reflect the more narrow scope. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 14 7月, 2021 1 次提交
-
-
由 Gustavo A. R. Silva 提交于
Fix the following fallthrough warnings: drivers/power/supply/ab8500_fg.c:1730:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] drivers/power/supply/abx500_chargalg.c:1155:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] Reported-by: NNathan Chancellor <nathan@kernel.org> Signed-off-by: NGustavo A. R. Silva <gustavoars@kernel.org>
-
- 04 6月, 2021 2 次提交
-
-
由 Linus Walleij 提交于
The code was calling ab8500_bm_of_probe() in four different spots effectively overwriting the same configuration three times. This was done because probe order was uncertain. Since we now used componentized probe, call it only once while probing the main charging component. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Linus Walleij 提交于
The driver has problems with the different components of the charging code racing with each other to probe(). This results in all four subdrivers populating battery information to ascertain that it is populated for their own needs for example. Fix this by using component probing and thus expressing to the kernel that these are dependent components. The probes can happen in any order and will only acquire resources such as state container, regulators and interrupts and initialize the data structures, but no execution happens until the .bind() callback is called. The charging driver is the main component and binds first, then bind in order the three subcomponents: ab8500-fg, ab8500-btemp and ab8500-chargalg. Do some housekeeping while we are moving the code around. Like use devm_* for IRQs so as to cut down on some boilerplate. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 22 3月, 2021 3 次提交
-
-
由 Linus Walleij 提交于
The charging algorithm header is only used locally in the power supply subsystem so push this down into drivers/power/supply and rename from the confusing "ux500_chargalg.h" to "ab8500-chargalg.h" for clarity: it is only used with the AB8500. This is another remnant of non-DT code needing to pass data from boardfiles, which we don't do anymore. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NSebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: NLee Jones <lee.jones@linaro.org>
-
由 Linus Walleij 提交于
The global definition of platform data for the battery management code has no utility after the OF conversion, move the <linux/mfd/abx500/ab8500-bm.h> to be a local file in drivers/power/supply and stop defining the platform data in drivers/power/supply/ab8500_bmdata.c and broadcast to the kernel only to have it assigned as platform data to the MFD cells and then picked back into the same subsystem that defined it in the first place. This kills off a layer of indirection. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NSebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: NLee Jones <lee.jones@linaro.org>
-
由 Linus Walleij 提交于
The core AB8500 driver and the whole platform is completely dependent on being probed from device tree so remove the non-DT probe paths. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NSebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: NLee Jones <lee.jones@linaro.org>
-
- 13 12月, 2020 1 次提交
-
-
由 Linus Walleij 提交于
Switch over to using generic dev_pm_ops since these drivers aren't even using the special power state passed to the legacy call. Cc: Marcus Cooper <codekipper@gmail.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 24 8月, 2020 1 次提交
-
-
由 Gustavo A. R. Silva 提交于
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-throughSigned-off-by: NGustavo A. R. Silva <gustavoars@kernel.org>
-
- 20 12月, 2019 1 次提交
-
-
由 Ma Feng 提交于
Fixes coccicheck warning: drivers/power/supply/abx500_chargalg.c:1826:2-3: Unneeded semicolon Reported-by: NHulk Robot <hulkci@huawei.com> Signed-off-by: NMa Feng <mafeng.ma@huawei.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 20 10月, 2019 1 次提交
-
-
由 Madhuparna Bhowmik 提交于
Fixed Code indentation error caused due to using spaces instead of tabs. The error reported by checkpatch.pl is: ERROR: code indent should use tabs where possible The warning reported by checkpatch.pl is: WARNING: please, no spaces at the start of a line Signed-off-by: NMadhuparna Bhowmik <madhuparnabhowmik04@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 31 5月, 2019 1 次提交
-
-
由 Thomas Gleixner 提交于
Based on 1 normalized pattern(s): license terms gnu general public license v2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 37 file(s). Signed-off-by: NThomas Gleixner <tglx@linutronix.de> Reviewed-by: NSteve Winslow <swinslow@gmail.com> Reviewed-by: NAlexios Zavras <alexios.zavras@intel.com> Reviewed-by: NRichard Fontana <rfontana@redhat.com> Reviewed-by: NAllison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190528170027.724130665@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 26 4月, 2018 1 次提交
-
-
由 Linus Walleij 提交于
The AB8540 was an evolved version of the AB8500, but it was never mass produced or put into products, only reference designs exist. The upstream support was never completed and it is unlikely that this will happen so drop the support for now to simplify maintenance of the AB8500. Cc: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NLee Jones <lee.jones@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
- 16 8月, 2016 1 次提交
-
-
由 Bhaktipriya Shridhar 提交于
alloc_ordered_workqueue() with WQ_MEM_RECLAIM set replaces deprecated create_singlethread_workqueue(). This is the identity conversion. The workqueue "chargalg_wq" is used for running the charging algorithm. It has multiple workitems viz &di->chargalg_periodic_work, &di->chargalg_wd_work, &di->chargalg_work per abx500_chargalg, which require ordering. It has been identity converted. Also, WQ_MEM_RECLAIM has been set to ensure forward progress under memory pressure. Signed-off-by: NBhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-