summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply
AgeCommit message (Collapse)AuthorFilesLines
2018-04-03Merge tag 'for-v4.17' of ↵Linus Torvalds8-173/+274
git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: - Microsemi Ocelot reset support - Spreadtrum SC27xx reset support - generic gpio charger: lot's of cleanups - axp20x fuel gauge: add AXP813 support - misc fixes, including one devicetree change for the Nokia N900, that has been Acked-by Tony Lindgren * tag 'for-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (27 commits) power: reset: at91-reset: Switch from the pr_*() to the dev_*() logging functions power: reset: at91-poweroff: Remove redundant dev_err call in at91_poweroff_probe() power: reset: at91-poweroff: Switch from the pr_*() to the dev_*() logging functions power: reset: make function sc27xx_poweroff_shutdown static power: supply: da9150-fg: remove VLA usage ARM: dts: omap3-n900: Add link between battery and charger power: supply: bq2415x: add DT referencing support power: supply: bq27xxx: support missing supplier device max17042: propagate of_node to power supply device power: supply: axp288_fuel_gauge: Fix full status reporting power: supply: axp288_fuel_gauge: Do not register FG on ECS EF20EA power: reset: gpio-poweroff: Support for timeout from device property dt-bindings: power: reset: gpio-poweroff: Add 'timeout-ms' property power: reset: Add Spreadtrum SC27xx PMIC power off support power: supply: axp20x_battery: add support for AXP813 dt-bindings: power: supply: axp20x: add AXP813 battery DT binding power: supply: axp20x_battery: use data struct for variant specific code power: supply: gpio-charger: Remove pdata from gpio_charger power: supply: gpio-charger: Use GPIOF_ACTIVE_LOW for legacy setup power: supply: gpio-charger: Remove redundant dev_err call in probe function ...
2018-03-12Merge branch 'fixes' into for-nextSebastian Reichel3-5/+6
Merge for-stable fixes branch into for-next development branch. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-12power: supply: da9150-fg: remove VLA usageGustavo A. R. Silva1-2/+2
In preparation to enabling -Wvla, remove VLA usage and replace it with fixed-length arrays. DA9150_QIF_LONG_SIZE (4 bytes) is the biggest size of an attribute which can be accessed [1]. Fixed as part of the directive to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 [1] https://marc.info/?l=kernel-hardening&m=152059600524753&w=2 Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-12power: supply: bq2415x: add DT referencing supportSebastian Reichel1-1/+4
Add support for using bq2415x together with power_supply_am_i_supplied(). Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-12power: supply: bq27xxx: support missing supplier deviceSebastian Reichel1-1/+1
power_supply_am_i_supplied() can return negative error codes. In this case we should assume, that no charger is connected and the battery should be marked as DISCHARGING instead of NOT_CHARGING. Reported-by: Merlijn Wajer <merlijn@wizzup.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-12max17042: propagate of_node to power supply devicePierre Bourdon1-0/+1
max17042_get_status uses the core power_supply_am_i_supplied. That function relies on DT properties to figure out the power supply topology, and will error out without DT. Fixes max17042 battery status being reported as "unknown". Signed-off-by: Pierre Bourdon <delroth@google.com> Signed-off-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-09power: supply: axp288_fuel_gauge: Fix full status reportingHans de Goede1-12/+35
Commit 2b5a4b4bf222 ("power: supply: axp288_fuel_gauge: Rework get_status()"), switched from 0A current detection to using the capacity register for full detection. It turns out this fixes full reporting on some devices which keep trickle charging long after the capacity register reach 100%, but breaks it on some other devices where the charger stops charging before the capacity register reaches 100%. This commit fixes this by also checking for 0A current when the reported capacity is above 90%. Fixes: 2b5a4b4bf222 ("psy: axp288_fuel_gauge: Rework get_status()") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-09power: supply: axp288_fuel_gauge: Do not register FG on ECS EF20EACarlo Caione1-0/+6
The ECS EF20EA laptop ships an AXP288 but it is actually using a different, separate FG chip for AC and battery monitoring. On this laptop we need to keep using the regular ACPI driver and disable the AXP288 FG to avoid reporting two batteries to userspace. Signed-off-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-09power: supply: axp20x_battery: add support for AXP813Quentin Schulz1-0/+42
The X-Powers AXP813 PMIC has got some slight differences from AXP20X/AXP22X PMICs: - the maximum voltage supplied by the PMIC is 4.35 instead of 4.36/4.24 for AXP20X/AXP22X, - the constant charge current formula is different, It also has a bit to tell whether the battery percentage returned by the PMIC is valid. Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-09power: supply: axp20x_battery: use data struct for variant specific codeQuentin Schulz1-35/+67
We used to use IDs to select a function or a feature depending on the variant. It's easier to maintain the code by adding data structure storing the few differences between variants so that we don't add a pile of if conditions. Let's use this data structure and update the code to use it. Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> [updated POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN write property to use the introduced set_max_voltage() callback] Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-09power: supply: gpio-charger: Remove pdata from gpio_chargerLadislav Michl1-54/+41
Platform data are now used only during probe time, so remove them from gpio_charger structure and consolidate probing function accordingly. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> [Replace of_property_read_string with dev_property_read_string] Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-09power: supply: gpio-charger: Use GPIOF_ACTIVE_LOW for legacy setupLadislav Michl1-9/+8
Setting GPIOF_ACTIVE_LOW flag based on platform data gpio_active_low makes return value of gpiod_get_value_cansleep directly usable. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-03-09power: supply: gpio-charger: Remove redundant dev_err call in probe functionLadislav Michl1-3/+1
There is an error message within devm_kzalloc already. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-02-22power: supply: ltc2941-battery-gauge: Fix temperature unitsLadislav Michl1-4/+4
Temperature is measured in tenths of degree Celsius. Fixes: 085bc24d1553 ("Add LTC2941/LTC2943 Battery Gauge Driver") Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-02-21power: add to_power_supply macro to the APIOgnjen Galic3-11/+1
This patch adds the to_power_supply macro to upcast a device to a power_supply struct. This is needed because the same piece of code using container_of is used in various other places, so we abstract away such low-level operations via a macro. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Ognjen Galic <smclt30p@gmail.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-02-13power: supply: gpio-charger: use helper variable to access device infoLadislav Michl1-22/+20
Using explicit struct device variable makes code a bit more readable. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-02-13power: supply: gpio-charger: Drop driver remove functionLadislav Michl1-36/+7
Simplify error unwinding using devm_* allocators. This also makes driver remove function empty, so remove it. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-02-12power: supply: ltc2941-battery-gauge: Add charge empty and full propertiesLadislav Michl1-9/+50
Add properties for charge empty and charge full thresholds. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-23power: supply: max17042_battery: Always fall back to default platform-dataHans de Goede1-9/+18
It is possible to have CONFIG_OF enabled on x86 builds, where we have no firmware provided max17042_platform_data. The CONFIG_OF implementation of max17042_get_pdata would return NULL in this case, causing the probe to fail. Instead always fallback to the default platform-data, as used on x86 sofar, when there is no firmware provided pdata, independent of CONFIG_OF. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-22power: supply: max17042_battery: Check battery current for status when suppliedHans de Goede1-2/+25
Even though the system is supplied, it may still be discharging if the supply is e.g. only delivering 5V 0.5A. Check the avg battery current if available for more accurate status reporting. Cc: James <kernel@madingley.org> Suggested-by: James <kernel@madingley.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-09power: supply: axp288_fuel_gauge: Do not register our psy on (some) HDMI sticksHans de Goede1-0/+35
The Intel Compute Stick (Cherry Trail version) and the Meegopad T08 HDMI stick, both use an axp288 PMIC. They also both have this wired up in such a way that the detection logic in the PMIC claims that a valid battery is present, resuling in GNOME and KDE showing a full-battery in their status bar and power-settings, while these devices do not have a battery. For lack of a better fix add a DMI blacklist and do not register the axp288_fuel_gauge psy on devices on the blacklist. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-09power: supply: axp288_fuel_gauge: Optimize get_current()Hans de Goede1-13/+8
First check the discharge current, and when that is non 0 use that without also checking the charge current (which will be 0 then). This makes get_current() do only 1 i2c read instead of 2 when on battery. This is esp. important given the pmic i2c bus mutex stuff used on boards with an axp288 because the SoC's own punit also may access the axp288, which makes i2c accesses more expensive then normal. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-09power: supply: axp288_fuel_gauge: Rework get_status()Hans de Goede1-21/+22
Relying on the (dis)charge current reporting for reporting FULL back to userspace does not work really well and often leads to the reported status getting stuck at e.g. 98/99% (the fuelgauge is not perfect) for hours. What happens is that when the battery is full the axp288 keeps charging it with a very low current. Until it is really really full and once really really full, some inaccuracies in the adc lead to it then sometimes reporting a small discharging rate, even though an external pwr source is used. So we end up with a status of "charging" for hours after the battery is actually already full and sometimes this then flip-flops to discharging. This commit fixes this by first checking if a valid Vbus is present and if it is present using the fuel-gauge's reported percentage to check for a full battery. This commit also changes how get_status() determines if the battery is charging or discharging when not reporting it as full. We still use the current direction for this, but instead of reading 4 extra registers for this (2 16 bit regs), simplify things by using the current-direction bit in the power-status register, which already gets read anyways. This also reduces the amount of i2c reads to 1 when on battery and 2 when a valid Vbus is present. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08power: supply: account for const type of of_device_id.dataJulia Lawall1-4/+4
This driver creates two const structures that it stores in the data field of an of_device_id array. The data field of an of_device_id structure has type const void *, so there is no need for a const-discarding cast when putting const values into such a structure. Furthermore, adding const to the declaration of the location that receives a const value from such a field ensures that the compiler will continue to check that the value is not modified. The const-discarding cast on the extraction from the data field is thus no longer needed. Done using Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08bq24190: Simplify code in property_is_writeablePavel Machek1-7/+2
Simplify function that should be trivial. Signed-off-by: Pavel machek <pavel@ucw.cz> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08power: supply: axp288_fuel_gauge: Get iio-channels once during bootHans de Goede1-43/+67
Get iio-channels once during boot, delaying the probe if the axp288_adc drivers has not loaded yet, instead of getting them on demand each time we need them. This fixes the following errors in dmesg: axp288_fuel_gauge axp288_fuel_gauge: ADC charge current read failed:-19 Which were caused by the ondemand iio-channel read code not finding the channel when the axp288_adc driver had not loaded yet. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08power: supply: axp288_charger: Properly stop work on probe-error / removeHans de Goede1-0/+13
Properly stop any work we may have queued on probe-errors / remove. Rather then adding a remove driver callback for this, and goto style error handling to probe, use a devm_action for this. The devm_action gets registered before we register any of the extcon notifiers which may queue the work, devm does cleanup in reverse order, so this ensures that the notifiers are removed before we cancel the work. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08power: supply: axp288_charger: Simplify extcon cable handlingHans de Goede1-41/+10
Simplify extcon cable handling using the new devm_extcon_register_notifier_all function to listen to all cables in one go. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08power: supply: axp288_charger: Use the right property for the input current ↵Hans de Goede1-2/+8
limit Use the right property for the input current limit and make it writable. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08power: supply: axp288_charger: Pick lower input current limit not higherHans de Goede1-35/+17
The code before this commit would pick 900 mA when asking for an input current limit of 600mA, rather then 500 mA, not good. While touching almost all code using the silly xxxMA defines anyways, also get rid of these simply typing out the numbers and switch the unit to uA as that is the psy class standard unit for currents. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08power: supply: axp288_charger: Do not cache input current limit valueHans de Goede1-12/+36
The hardware may change this underneath us. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08power: supply: axp288_charger: Remove no longer needed lockingHans de Goede1-19/+5
Now that we use regmap to do read-modify-write ops everywhere, we can rely on the regmap lock and no longer need our own lock. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08power: supply: axp288_charger: Use regmap_update_bits to set the input limitsHans de Goede1-10/+4
Use regmap_update_bits in axp288_charger_set_vbus_inlmt, instead of DIY code. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08power: supply: axp288_charger: Cleanup some double empty linesHans de Goede1-2/+0
While we are doing cleanups, also remove some double blank lines. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08power: supply: axp288_charger: Remove charger-enabled state trackingHans de Goede1-7/+0
The extcon code is the only one to trigger our worker (outside of the initial run) and we can rely on it to only call us if things have changed, so there is no need to track the charger-enabled state. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08power: supply: axp288_charger: Add missing newlines to some messagesHans de Goede1-3/+3
Add missing (terminating) "\n"-s to some dev_dbg messages. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-01-08power: supply: axp288_charger: Do not stop + restart charging at bootHans de Goede1-51/+30
Before this commit we were relying solely on the extcon interface for cable detection, including to determine if a cable providing vbus is connected at all. This caused us to turn off charging at boot, because when we run the initial state processing the axp288-extcon driver is still running charger-type detection most of the time, so all charger cable types read as disconnected when we run the initial state processing. This commit reworks the axp288_charger_extcon_evt_worker flow to use the VBUS_VALID bit from the PWR_INPUT_STATUS register to determine if we should turn charging on/off. Note this is the same bit as we use for the online property. If VBUS_VALID is set, but the extcon code has not completed the charger type detection yet, we now simply bail leaving things as configured by the BIOS (we will get a notifier call when the extcon code is done and reschedule the axp288_charger_extcon_evt_worker). The extcon code is the only one to trigger the worker (outside of the initial run) and we can rely on it to only call us if things have changed, so while we are completely refactoring axp288_charger_extcon_evt_worker, also remove the code to check if the state has changed. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-12-08Add support for bq27521 battery monitorPavel Machek2-2/+39
This adds basic support for BQ27521 battery monitor, used in Nokia N9 and N950. In particular, battery voltage is important to be able to tell when the battery is almost empty. Emptying battery on N950 is pretty painful, as flasher needs to be used to recover phone in such case. Signed-off-by: Pavel Machek <pavel@ucw.cz> Acked-by: Andrew F. Davis <afd@ti.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-12-01power: supply: bq24190_charger: Remove extcon handlingHans de Goede1-107/+10
Now that drivers/i2c/busses/i2c-cht-wc.c uses "input-current-limit-from-supplier" instead of "extcon-name" the last user of the bq24190 extcon code is gone, remove it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-12-01power: ltc2941-battery-gauge: Disable continuous monitoring on shutdownMike Looijmans1-0/+25
The driver sets the fuel gauge to continuous monitoring on startup, for the models that support this. When the board shuts down, the chip remains in that mode, causing a few mA drain on the battery every 2 or 10 seconds. This patch registers a shutdown handler that turns off the monitoring to prevent this battery drain. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-12-01power: supply: cpcap-battery: Fix platform_get_irq_byname's error checkingArvind Yadav1-2/+2
The platform_get_irq_byname() function returns -1 if an error occurs. zero or positive number on success. platform_get_irq_byname() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-12-01power: supply: ab8500_charger: Bail out in case of error in ↵Christophe JAILLET1-1/+3
'ab8500_charger_init_hw_registers()' If an error occurs when we enable the backup battery charging, we should go through the error handling path directly. Before commit db43e6c473b5 ("ab8500-bm: Add usb power path support") this was the case, but this commit has added some code between the last test and the 'out' label. So, in case of error, this added code is executed and the error may be silently ignored. Fix it by adding the missing 'goto out', as done in all other error handling paths. Fixes: db43e6c473b5 ("ab8500-bm: Add usb power path support") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-12-01power: supply: ab8500_charger: Fix an error handling pathChristophe JAILLET1-1/+1
'ret' is know to be 0 at this point, because it has not been updated by the the previous call to 'abx500_mask_and_set_register_interruptible()'. Fix it by updating 'ret' before checking if an error occurred. Fixes: 84edbeeab67c ("ab8500-charger: AB8500 charger driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-12-01power: supply: charger-manager: Fix typo in conditionRyosuke Saito1-1/+1
Should be discharging_max_duration_ms, not charging_max_duration_ms. Signed-off-by: Ryosuke Saito <raitosyo@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-12-01power: supply: sbs-message: double left shift bug in sbsm_select()Dan Carpenter1-1/+1
The original code does this: "1 << (1 << 11)" which is undefined in C. Fixes: dbc4deda03fe ("power: Adds support for Smart Battery System Manager") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-11-15Merge tag 'for-v4.15' of ↵Linus Torvalds6-9/+4
git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: - misc minor fixes * tag 'for-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: power: supply: cpcap-charger: fix incorrect return value check power: supply: replace pr_* with dev_* power: supply: pcf50633-charger: remove redundant variable charging_start power: supply: generic-adc-battery: remove redundant variable pdata power: supply: max8997: Improve a size determination in probe
2017-11-15Merge branch 'for-linus' of ↵Linus Torvalds1-1/+1
ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina: "The usual rocket-science from trivial tree for 4.15" * 'for-linus' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: MAINTAINERS: relinquish kconfig MAINTAINERS: Update my email address treewide: Fix typos in Kconfig kfifo: Fix comments init/Kconfig: Fix module signing document location misc: ibmasm: Return error on error path HID: logitech-hidpp: fix mistake in printk, "feeback" -> "feedback" MAINTAINERS: Correct path to uDraw PS3 driver tracing: Fix doc mistakes in trace sample tracing: Kconfig text fixes for CONFIG_HWLAT_TRACER MIPS: Alchemy: Remove reverted CONFIG_NETLINK_MMAP from db1xxx_defconfig mm/huge_memory.c: fixup grammar in comment lib/xz: Add fall-through comments to a switch statement
2017-11-14Merge branch 'i2c/for-4.15' of ↵Linus Torvalds4-18/+477
ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "This contains two bigger than usual tree-wide changes this time. They all have proper acks, caused no merge conflicts in linux-next where they have been for a while. They are namely: - to-gpiod conversion of the i2c-gpio driver and its users (touching arch/* and drivers/mfd/*) - adding a sbs-manager based on I2C core updates to SMBus alerts (touching drivers/power/*) Other notable changes: - i2c_boardinfo can now carry a dev_name to be used when the device is created. This is because some devices in ACPI world need fixed names to find the regulators. - the designware driver got a long discussed overhaul of its PM handling. img-scb and davinci got PM support, too. - at24 driver has way better OF support. And it has a new maintainer. Thanks Bartosz for stepping up! The rest is regular driver updates and fixes" * 'i2c/for-4.15' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (55 commits) ARM: sa1100: simpad: Correct I2C GPIO offsets i2c: aspeed: Deassert reset in probe eeprom: at24: Add OF device ID table MAINTAINERS: new maintainer for AT24 driver i2c: nuc900: remove platform_data, too i2c: thunderx: Remove duplicate NULL check i2c: taos-evm: Remove duplicate NULL check i2c: Make i2c_unregister_device() NULL-aware i2c: xgene-slimpro: Support v2 i2c: mpc: remove useless variable initialization i2c: omap: Trigger bus recovery in lockup case i2c: gpio: Add support for named gpios in DT dt-bindings: i2c: i2c-gpio: Add support for named gpios i2c: gpio: Local vars in probe i2c: gpio: Augment all boardfiles to use open drain i2c: gpio: Enforce open drain through gpiolib gpio: Make it possible for consumers to enforce open drain i2c: gpio: Convert to use descriptors power: supply: sbs-message: fix some code style issues power: supply: sbs-battery: remove unchecked return var ...
2017-11-13Merge tag 'usb-4.15-rc1' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB/PHY updates from Greg KH: "Here is the big set of USB and PHY driver updates for 4.15-rc1. There is the usual amount of gadget and xhci driver updates, along with phy and chipidea enhancements. There's also a lot of SPDX tags and license boilerplate cleanups as well, which provide some churn in the diffstat. Other major thing is the typec code that moved out of staging and into the "real" part of the drivers/usb/ tree, which was nice to see happen. All of these have been in linux-next with no reported issues for a while" * tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (263 commits) usb: gadget: f_fs: Fix use-after-free in ffs_free_inst USB: usbfs: compute urb->actual_length for isochronous usb: core: message: remember to reset 'ret' to 0 when necessary USB: typec: Remove remaining redundant license text USB: typec: add SPDX identifiers to some files USB: renesas_usbhs: rcar?.h: add SPDX tags USB: chipidea: ci_hdrc_tegra.c: add SPDX line USB: host: xhci-debugfs: add SPDX lines USB: add SPDX identifiers to all remaining Makefiles usb: host: isp1362-hcd: remove a couple of redundant assignments USB: adutux: remove redundant variable minor usb: core: add a new usb_get_ptm_status() helper usb: core: add a 'type' parameter to usb_get_status() usb: core: introduce a new usb_get_std_status() helper usb: core: rename usb_get_status() 'type' argument to 'recip' usb: core: add Status Type definitions USB: gadget: Remove redundant license text USB: gadget: function: Remove redundant license text USB: gadget: udc: Remove redundant license text USB: gadget: legacy: Remove redundant license text ...
2017-11-13power: supply: cpcap-charger: fix incorrect return value checkPan Bian1-1/+1
Function platform_get_irq_byname() returns a negative error code on failure, and a zero or positive number on success. However, in function cpcap_usb_init_irq(), positive IRQ numbers are also taken as error cases. Use "if (irq < 0)" instead of "if (!irq)" to validate the return value of platform_get_irq_byname(). Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>