summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* power: supply: bq24257: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-12/+3
| | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: bq24190_charger: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-35/+8
| | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: lp8788: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-35/+27
| | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: ds2781: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-19/+4
| | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: ds2780: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-19/+4
| | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: bq2415x: fix race-condition in sysfs registrationSebastian Reichel2018-12-131-70/+49
| | | | | | | | | This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: core: add support for custom sysfs attributesSebastian Reichel2018-12-132-0/+4
| | | | | | | Add functionality to setup device specific sysfs attributes in a race condition free manner Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: sc27xx: Save last battery capacityYuanjiang Yu2018-12-061-1/+134
| | | | | | | | | | | Our charger manager can optimize the battery capacity periodically, so we can save last battery capacity into registers. Then next system power-on, we can read the last saved battery capacity as the initial battery capacity, which can make the battery capacity more accurate. Signed-off-by: Yuanjiang Yu <yuanjiang.yu@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: reset: at91-poweroff: move shdwc related data to one structureClaudiu Beznea2018-12-061-23/+25
| | | | | | | | | Move SHDWC realted data to only one structure to have them grouped. Inspired from commit 9be74f0d39c1 ("power: reset: at91-poweroff: make mpddrc_base part of struct shdwc"). Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: sc27xx: Add suspend/resume interfacesYuanjiang Yu2018-12-061-0/+77
| | | | | | | | | | Add fuel gauge platform suspend and resume interfaces. In suspend state, we should enable the low voltage and coulomb counter threshold interrupts to wake up system to calibrate the battery capacity in lower voltage stage. Signed-off-by: Yuanjiang Yu <yuanjiang.yu@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: sc27xx: Add fuel gauge low voltage alarmYuanjiang Yu2018-12-061-1/+170
| | | | | | | | | Add low voltage alarm support to make sure the battery capacity more accurate in lower voltage stage. Signed-off-by: Yuanjiang Yu <yuanjiang.yu@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: sc27xx: Add fuel gauge calibrationBaolin Wang2018-12-061-11/+51
| | | | | | | | | This patch adds support to read calibration values from the eFuse controller to calibrate the ADC values corresponding to current and voltage, which can make the current and voltage data more accurate. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* dt-bindings: power: supply: Add nvmem properties to calibrate FGUBaolin Wang2018-12-061-0/+4
| | | | | | | Add nvmem properties to calibrate FGU from eFuse controller. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: sc2731_charger: Free battery informationBaolin Wang2018-12-051-0/+2
| | | | | | | Free battery information in case of adding battery OCV tables. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: sc2731_charger: Avoid repeated charge/dischargeBaolin Wang2018-12-051-2/+2
| | | | | | | | Add info->charging validation to avoid repeated charge or discharge operation. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: sc2731_charger: Add charger status detectionBaolin Wang2018-12-051-0/+20
| | | | | | | | | The USB charger status can be notified before the charger driver registers the USB phy notifier, so we should check the charger status in probe() in case we missed the USB charger notification. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: sc2731_charger: Add one work to charge/dischargeBaolin Wang2018-12-051-8/+22
| | | | | | | | | Since the USB notifier context is atomic, we can not start or stop charging in atomic context. Thus this patch adds one work to help to charge or discharge. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: reset: at91-poweroff: remove at91_ramc_of_matchClaudiu.Beznea@microchip.com2018-12-051-5/+0
| | | | | | | Remove at91_ramc_of_match[] since it is not used anywhere in this code. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: reset: at91-poweroff: use one poweroff function for at91-poweroffClaudiu.Beznea@microchip.com2018-12-051-22/+27
| | | | | | | | | | | Use only one poweroff function and adapt it to work for both scenarios (with LPDDR or not). The assignement of pm_power_off was moved at the end of probe after all initializations are OK. This patch adapt the idea from commit 4e018c1e9b05 ("power: reset: at91-poweroff: use only one poweroff function"). Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: bq24190_charger: add support for bq24196 variantHeiko Stuebner2018-12-052-1/+4
| | | | | | | | | | The bq24196 is another variant of the bq24190 charger ic. Its register set is identical to the bq24192 and it even reuses the same part number (0x5). Signed-off-by: Heiko Stuebner <heiko.stuebner@bq.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: bq24190_charger: add extcon support for USB OTGBrian Masney2018-12-051-1/+36
| | | | | | | | | Add extcon support so that we can notify USB drivers of cable state changes. Based on work from Jonathan Marek. USB OTG was tested on a LG Nexus 5 (hammerhead) phone. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: bq24190_charger: add of_match for usb-otg-vbus regulatorJonathan Marek2018-12-051-0/+1
| | | | | | | | | This patch adds an of_match for the usb-otg-vbus regulator to bq24190_charger. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: bq24190_charger: add support for bq24192 variantJonathan Marek2018-12-051-2/+8
| | | | | | | | | | This patch adds support for the bq24192 variant to bq24190_charger. Signed-off-by: Jonathan Marek <jonathan@marek.ca> [masneyb@onstation.org: Changed if statement to a switch based on feedback from Sebastian Reichel.] Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* dt-bindings: power: supply: bq24190_charger: add bq24192 and usb-otg-vbusBrian Masney2018-12-051-0/+9
| | | | | | | | | Add support for the ti,bq24192 variant and a child node for the usb-otg-vbus regulator. Signed-off-by: Brian Masney <masneyb@onstation.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: reset: ocelot: switch the SI to boot modeAlexandre Belloni2018-12-051-0/+12
| | | | | | | | Switch the SI to boot mode so on a warm reboot, the SI is able to access the flash. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: reset: gpio-poweroff: add ability to specific active and inactive delaysHeiko Stuebner2018-12-052-2/+10
| | | | | | | | | | | | | Similar to gpio-reset allow to specify active and inactive delays while keeping the 100ms defaults that were used previously all the time. The dt-properties are named the same as in gpio-reset but get an "-ms" suffix as properties should contain such a suffix specifying its unit. Signed-off-by: Heiko Stuebner <heiko.stuebner@bq.com> Reviewed-by: Rob Herring <robh@kernel.org> Reviewed-by: Moritz Fischer <mdf@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: charger-manager: Make code more readableBaolin Wang2018-12-051-7/+7
| | | | | | | Make code more readable. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: charger-manager: Fix incorrect return valueBaolin Wang2018-12-051-2/+1
| | | | | | | Fix incorrect return value. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: charger-manager: Fix some misspelled wordsBaolin Wang2018-12-051-3/+3
| | | | | | | Fix some misspelled words. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: charger-manager: Remove unused index countingBaolin Wang2018-12-051-4/+0
| | | | | | | Remove unused index counting. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-charger: clean an indentation issue, remove tabColin Ian King2018-12-051-1/+1
| | | | | | | Trivial fix to clean up indentation issue, remove an extraneous tab Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* Merge tag 'psy-mfd-axp813-immutable-for-v4.21-signed' into psy-nextSebastian Reichel2018-12-053-0/+98
|\ | | | | | | | | | | | | Immutable branch between mfd and power-supply for driver changes related to axp813. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: add AC power supply driver for AXP813Oskari Lemmela2018-12-052-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | AXP813 and AXP803 PMICs can control input current and minimum voltage. Both of these values are configurable. Signed-off-by: Oskari Lemmela <oskari@lemmela.net> Reviewed-by: Quentin Schulz <quentin.schulz@bootlin.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * dt-bindings: power: supply: axp20x: add AXP813 AC power DT bindingOskari Lemmela2018-12-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | The AXP803/AXP813 AC power supply can limit input current and voltage. Signed-off-by: Oskari Lemmela <oskari@lemmela.net> Reviewed-by: Rob Herring <robh@kernel.org> Reviewed-by: Quentin Schulz <quentin.schulz@bootlin.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Tested-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: axp288: use the BIT() macroOlliver Schinagl2018-12-051-17/+18
| | | | | | | | | | | | | | | | Make use of the recommended BIT() macro for bit defines. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> Signed-off-by: Priit Laes <plaes@plaes.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: axp20x: add missing include bitops.hOlliver Schinagl2018-12-051-0/+1
| | | | | | | | | | | | | | | | | | The axp20x_usb_power driver uses BIT() operations but lacks the include for it. Include the bitops.h header file. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> Signed-off-by: Priit Laes <plaes@plaes.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: cpcap-battery: make array cpcap_battery_irqs static, shrinks ↵Colin Ian King2018-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | object size Don't populate the array cpcap_battery_irqs on the stack but instead make it static. Makes the object code smaller by 99 bytes: Before: text data bss dec hex filename 13673 2448 0 16121 3ef9 cpcap-battery.o After: text data bss dec hex filename 13510 2512 0 16022 3e96 cpcap-battery.o (gcc version 8.2.0 x86_64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: olpc_battery: correct the temperature unitsLubomir Rintel2018-11-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to [1] and [2], the temperature values are in tenths of degree Celsius. Exposing the Celsius value makes the battery appear on fire: $ upower -i /org/freedesktop/UPower/devices/battery_olpc_battery ... temperature: 236.9 degrees C Tested on OLPC XO-1 and OLPC XO-1.75 laptops. [1] include/linux/power_supply.h [2] Documentation/power/power_supply_class.txt Fixes: fb972873a767 ("[BATTERY] One Laptop Per Child power/battery driver") Cc: stable@vger.kernel.org Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power/supply: fix sc27xx_fuel_gauge build errorsRandy Dunlap2018-11-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix build errors when FUEL_GUAGE_SC27XX is enabled but IIO is either not enabled or IIO=m and FUEL_GUAGE_SC27XX=y. ld: drivers/power/supply/sc27xx_fuel_gauge.o: in function `sc27xx_fgu_get_temp': sc27xx_fuel_gauge.c:(.text+0x1d2): undefined reference to `iio_read_channel_processed' ld: drivers/power/supply/sc27xx_fuel_gauge.o: in function `sc27xx_fgu_probe': sc27xx_fuel_gauge.c:(.text+0x97f): undefined reference to `devm_iio_channel_get' Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: linux-pm@vger.kernel.org Acked-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: Add Spreadtrum SC27XX fuel gauge unit driverBaolin Wang2018-11-093-0/+664
| | | | | | | | | | | | | | | | | | | | This patch adds the Spreadtrum SC27XX serial PMICs fuel gauge support, which is used to calculate the battery capacity. Original-by: Yuanjiang Yu <yuanjiang.yu@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | dt-bindings: power: Add Spreadtrum SC27XX fuel gauge unit documentationBaolin Wang2018-11-091-0/+52
| | | | | | | | | | | | | | | | | | | | This patch adds the binding documentation for Spreadtrum SC27XX series PMICs fuel gauge unit device, which is used to calculate the battery capacity. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: core: Add some helpers to use the battery OCV capacity tableBaolin Wang2018-11-092-1/+155
| | | | | | | | | | | | | | | | | | | | | | We have introduced some battery properties to present the OCV table temperatures and OCV capacity table values. Thus this patch add OCV temperature and OCV table for battery information, as well as providing some helper functions to use the OCV capacity table for users. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | dt-bindings: power: Introduce properties to present the battery OCV capacity ↵Baolin Wang2018-11-091-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | table Some battery driver will use the open circuit voltage (OCV) value to look up the corresponding battery capacity percent in one certain degree Celsius. Thus this patch provides some battery properties to present the OCV table temperatures and OCV capacity table values. Suggested-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: core: Add one field to present the battery internal resistanceBaolin Wang2018-11-092-0/+4
| | | | | | | | | | | | | | | | | | Add one field for 'struct power_supply_battery_info' to present the battery factory internal resistance. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | dt-bindings: power: Introduce one property to present the battery internal ↵Baolin Wang2018-11-091-0/+2
|/ | | | | | | | | | | | | | resistance The internal resistance of a battery is not a constant in its life cycle, this varies over the age of the battery or temperature and so on. But we just want use one constant battery internal resistance to estimate the battery capacity. Thus this patch introduces one property to present the battery factory internal resistance for battery information. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* Linux 4.20-rc1v4.20-rc1Linus Torvalds2018-11-041-2/+2
|
* Merge tag 'tags/upstream-4.20-rc1' of git://git.infradead.org/linux-ubifsLinus Torvalds2018-11-0425-292/+2418
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull UBIFS updates from Richard Weinberger: - Full filesystem authentication feature, UBIFS is now able to have the whole filesystem structure authenticated plus user data encrypted and authenticated. - Minor cleanups * tag 'tags/upstream-4.20-rc1' of git://git.infradead.org/linux-ubifs: (26 commits) ubifs: Remove unneeded semicolon Documentation: ubifs: Add authentication whitepaper ubifs: Enable authentication support ubifs: Do not update inode size in-place in authenticated mode ubifs: Add hashes and HMACs to default filesystem ubifs: authentication: Authenticate super block node ubifs: Create hash for default LPT ubfis: authentication: Authenticate master node ubifs: authentication: Authenticate LPT ubifs: Authenticate replayed journal ubifs: Add auth nodes to garbage collector journal head ubifs: Add authentication nodes to journal ubifs: authentication: Add hashes to index nodes ubifs: Add hashes to the tree node cache ubifs: Create functions to embed a HMAC in a node ubifs: Add helper functions for authentication support ubifs: Add separate functions to init/crc a node ubifs: Format changes for authentication support ubifs: Store read superblock node ubifs: Drop write_node ...
| * ubifs: Remove unneeded semicolonDing Xiang2018-10-231-1/+1
| | | | | | | | | | | | | | delete redundant semicolon Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com> Signed-off-by: Richard Weinberger <richard@nod.at>
| * Documentation: ubifs: Add authentication whitepaperSascha Hauer2018-10-231-0/+426
| | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Richard Weinberger <richard@nod.at>
| * ubifs: Enable authentication supportSascha Hauer2018-10-233-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | With the preparations all being done this patch now enables authentication support for UBIFS. Authentication is enabled when the newly introduced auth_key and auth_hash_name mount options are passed. auth_key provides the key which is used for authentication whereas auth_hash_name provides the hashing algorithm used for this FS. Passing these options make authentication mandatory and only UBIFS images that can be authenticated with the given key are allowed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Richard Weinberger <richard@nod.at>