- 29 8月, 2017 6 次提交
-
-
由 Hans de Goede 提交于
On some devices the USB Type-C port power (USB PD 2.0) negotiation is done by a separate port-controller IC, while the current limit is controlled through another (charger) IC. It has been decided to model this by modelling the external Type-C power brick (adapter/charger) as a power-supply class device which supplies the charger-IC, with its voltage-now and current-max representing the negotiated voltage and max current draw. This commit adds a power_supply_set_input_current_limit_from_supplier helper function which charger power-supply drivers can call to get the max-current from their supplier and have this applied through their set_property call-back to their input-current-limit. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Hans de Goede 提交于
Fix drivers/power/supply/max17042_battery.c:1059:6: warning: 'acpi_id' may be used uninitialized in this function. No idea why my gcc version did not catch this. Reported-by: Nkbuild test robot <fengguang.wu@intel.com> Signed-off-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Markus Elfring 提交于
power: supply: core: Delete two error messages for a failed memory allocation in power_supply_check_supplies() Omit extra messages for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Bhumika Goyal 提交于
Make these const as they are only passed as an argument to the function device_create_file and device_remove_file and the corresponding arguments are of type const. Done using Coccinelle. Signed-off-by: NBhumika Goyal <bhumirks@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Hans de Goede 提交于
On some x86/ACPI boards the DSDT defines an ACPI event handler for the max17047 IRQ, this causes several problems: 1) We need to share the IRQ to avoid an error getting it 2) Even of we are willing to share, we may fail to share because some DSDTs claim it exclusivly 3) If we are unable to share the IRQ, or the IRQ is only listed as an ACPI event source and not in the max1704 firmware node, then the charge threshold IRQ (which is used to give an IRQ every 1 percent charge change) becomes a problem, the ACPI event handler will not update this to the next 1 percent threshold, so the IRQ keeps firing and we get an IRQ storm pegging 1 CPU core. This happens despite the max17042 driver not setting the charge threshold because Windows uses it and leaves it set on reboot. So if we are unable to get the IRQ we need to reprogram the charge threshold to its disabled setting. This commit fixes al of the above, while at it it also makes the error msg when being unable to get the IRQ consistent with other messages. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Hans de Goede 提交于
Some x86 devices enumerate a max17047 fuel-gauge through a MAX17047 ACPI firmware-node, add support for this. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
- 13 8月, 2017 1 次提交
-
-
由 Colin Ian King 提交于
Don't populate various read only arrays on the stack but make them static const, making the object code smaller and saves 148 bytes overall: Before: text data bss dec hex filename 11940 4496 64 16500 4074 lp8788-charger.o After: text data bss dec hex filename 11472 4816 64 16352 3fe0 lp8788-charger.o Signed-off-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
- 12 8月, 2017 3 次提交
-
-
由 Christophe JAILLET 提交于
Use 'sizeof(*var)' instead of the equivalent 'sizeof(data structure type)' because it is less verbose. Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Christophe JAILLET 提交于
Update a comment which is no more up to date since commit 2ed9e9b6. Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Christophe JAILLET 提交于
'devm_kzalloc()' can return NULL. Return -ENOMEM in this case in order to avoid a NULL pointer dereference later on. Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
- 09 8月, 2017 2 次提交
-
-
由 Hans de Goede 提交于
Commit 2848e039 ("power: supply: Make power_supply_am_i_supplied return -ENODEV if there are no suppliers") was supposed to make power_supply_am_i_supplied() return -ENODEV when there are no supplies which supply the supply passed to it. But instead it will only return -ENODEV when there are no supplies at all as data->count++; is incremented on every call of the iterator, rather then only when __power_supply_is_supplied_by returns true. This commit fixes this. Fixes: 2848e039 ("power: supply: Make power_supply_am_i_supplied ...") Signed-off-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Bhumika Goyal 提交于
Add const to bin_attribute structures as they are only passed to the functions sysfs_{remove/create}_bin_file or device_{remove/create}_bin_file. The corresponding parameters passed are of type const, so declare the structures to be const. Done using Coccinelle: @m disable optional_qualifier@ identifier s; position p; @@ static struct bin_attribute s@p={...}; @okay1@ position p; identifier m.s; @@ ( sysfs_create_bin_file(...,&s@p,...) | sysfs_remove_bin_file(...,&s@p,...) ) @bad@ position p!={m.p,okay1.p}; identifier m.s; @@ s@p @change depends on !bad disable optional_qualifier@ identifier m.s; @@ static +const struct bin_attribute s={...}; Same script was modified for device_{create/remove}_bin_file functions. Signed-off-by: NBhumika Goyal <bhumirks@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
- 25 7月, 2017 8 次提交
-
-
由 Andrew F. Davis 提交于
When the BQ27xxx driver was originally written the w1 subsystem only allowed device drivers for w1 attached devices to live in the w1 subsystem. Kernel driver subsystems expect that the driver for a device live in the directory of the subsystem for which it implements functionality, not in the directory of the bus that it is attached. To work around this, the BQ27xxx driver was implemented as a platform device driver and the interface driver would instantiate this device from within the w1 directory, then pass a w1 read callback as platform data. As we can now have the w1 interface driver in the power/supply directory (like we do already with the i2c interface driver) we can remove this middle-layer platform driver. Signed-off-by: NAndrew F. Davis <afd@ti.com> Acked-by: NPali Rohár <pali.rohar@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Andrew F. Davis 提交于
The HDQ interface driver should be in this folder just like the I2C interface driver. Move this driver out of drivers/w1/slave and into drivers/power/supply. Signed-off-by: NAndrew F. Davis <afd@ti.com> Acked-by: NPali Rohár <pali.rohar@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Dragos Bogdan 提交于
LTC2944 is compatible with LTC2943, but uses different voltage and current computing constants. Signed-off-by: NDragos Bogdan <dragos.bogdan@analog.com> Signed-off-by: NLadislav Michl <ladis@linux-mips.org> Tested-by: NDragos Bogdan <dragos.bogdan@analog.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Ladislav Michl 提交于
LTC2942 is pin compatible with LTC2941 providing additional informations about battery voltage and temperature. It can be runtime detected using bit A7 in the Status register. Signed-off-by: NLadislav Michl <ladis@linux-mips.org> Acked-by: NRob Herring <robh@kernel.org> Acked-by: NDragos Bogdan <dragos.bogdan@analog.com> Tested-by: NDragos Bogdan <dragos.bogdan@analog.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Ladislav Michl 提交于
In order to support LTC2942 which has temperature registers at different offsets than LTC2943 use following register naming scheme (prefixes): - LTC294X_ common registers - LTC2942_ chips specific registers - LTC2943_ specific registers LTC2944 is compatible with LTC2943 but uses different constants to compute voltage and current, so replace num_regs misused for device indentification with real device id to discriminate between those two. There are no functional changes. Signed-off-by: NLadislav Michl <ladis@linux-mips.org> Acked-by: NDragos Bogdan <dragos.bogdan@analog.com> Tested-by: NDragos Bogdan <dragos.bogdan@analog.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Phil Reid 提交于
At least with the Inspired Energy compatible batteries a delay is required after setting the capacity mode bit from amp to watts or the reverse. Setting the bit and then immediately pooling the status register results in an unknown error being returned in the register. Add the delay results in and ok status being return. This was also seen when reading the charge and energy registers where the wrong value was returned for the requested mode. Signed-off-by: NPhil Reid <preid@electromag.com.au> Tested-by: NMichael Heinemann <committed@heine.so> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Phil Reid 提交于
Sort the header includes prior to adding to the list. Signed-off-by: NPhil Reid <preid@electromag.com.au> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Phil Reid 提交于
checkpatch issued an error in having the FSF address in the comment. As address may change and Linux already includes a copy. Signed-off-by: NPhil Reid <preid@electromag.com.au> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
- 24 7月, 2017 6 次提交
-
-
由 Alex A. Mihaylov 提交于
The MAX17211 monitor a single cell pack. The MAX17215 monitor and balance a 2S or 3S pack or monitor a multiple-series cell pack. Both device use 1-Wire interfce. Signed-off-by: NAlex A. Mihaylov <minimumlaw@rambler.ru> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Arvind Yadav 提交于
attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const. File size before: text data bss dec hex filename 2673 400 0 3073 c01 power/supply/pcf50633-charger.o File size After adding 'const': text data bss dec hex filename 2737 336 0 3073 bed power/supply/pcf50633-charger.o Signed-off-by: NArvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Rob Herring 提交于
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: NRob Herring <robh@kernel.org> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Cc: Sebastian Reichel <sre@kernel.org> Cc: linux-pm@vger.kernel.org Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Sergei Shtylyov 提交于
of_irq_get() may return any negative error number as well as 0 on failure, while the driver only checks for -EPROBE_DEFER, blithely continuing with the call to devm_request_irq() -- that function expects *unsigned int*, so would probably fail anyway when a large IRQ number resulting from a conversion of a negative error number is passed to it... This, however, is incorrect behavior -- error number is not IRQ number. Check for 'irq <= 0' instead and return -ENXIO from probe if of_irq_get() returned 0. Fixes: a09209ac ("power: supply: act8945a_charger: Add status change update support") Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Arnd Bergmann 提交于
When CONFIG_OMAP_USB2 is set to 'm' and the charger driver is built-in, we get this link failure: drivers/power/supply/cpcap-charger.o: In function `cpcap_charger_probe': cpcap-charger.c:(.text+0x48c): undefined reference to `omap_usb2_set_comparator' drivers/power/supply/cpcap-charger.o: In function `cpcap_charger_remove': cpcap-charger.c:(.text+0x774): undefined reference to `omap_usb2_set_comparator' This adds a dependency to prevent that problem, while still allowing compile-testing with the OMAP_USB2 driver completely disabled. Fixes: 0c9888e3 ("power: supply: cpcap-charger: Add minimal CPCAP PMIC battery charger") Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Michael Heinemann 提交于
The capacity mode bit is bit 15. Currently it is written as default initialized enum and never shifted. This leads to a behaviour where the BATTERY_MODE is not correctly recognized and set again. This commit initializes the enum accordingly. Signed-off-by: NMichael Heinemann <committed@heine.so> Tested-by: NPhil Reid <preid@electromag.com.au> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
- 04 7月, 2017 2 次提交
-
-
由 H. Nikolaus Schaller 提交于
This fixes an issue if both this twl4030_charger driver and phy-twl4030-usb are compiled as modules and loaded in random order. It has been observed on GTA04 and OpenPandora devices that in worst case the boot process hangs and in best case the AC detection fails with a warning. Therefore we add deferred probing checks for the usb_phy and the iio channel for AC detection. Signed-off-by: NH. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 H. Nikolaus Schaller 提交于
And initialize workers and notifiers as soon as possible. This avoids a potential race if irqs are enabled and triggered too early before the worker is properly set up. Suggested-by: NGrygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: NH. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
- 28 6月, 2017 1 次提交
-
-
由 David Wu 提交于
This adds the necessary data for handling io voltage domains on the rk3228. Signed-off-by: NDavid Wu <david.wu@rock-chips.com> Reviewed-by: NHeiko Stuebner <heiko@sntech.de> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 15 6月, 2017 8 次提交
-
-
由 Shawn Nematbakhsh 提交于
According to the smart battery spec (1), the CAPACITY_MODE bit does not influence the value read from RelativeStateOfCharge(), so don't bother changing CAPACITY_MODE when doing such a read. (1) - Smart Battery Data Specification, Rev 1.1, Dec. 11, 1998 Signed-off-by: NShawn Nematbakhsh <shawnn@chromium.org> Reviewed-by: NGuenter Roeck <groeck@chromium.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Shawn Nematbakhsh 提交于
A subset of smart battery commands return charge or energy depending on the CAPACITY_MODE bit setting of BatteryMode(). In order to unambiguously read a charge or energy value, it is necessary to ensure that CAPACITY_MODE is set as desired, and not changed for the duration of the attribute read. Signed-off-by: NShawn Nematbakhsh <shawnn@chromium.org> Reviewed-by: NGuenter Roeck <groeck@chromium.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Phil Reid 提交于
i2c_smbus commands handle the correct byte order for smbus transactions internally. This will currently result in incorrect operation on big endian systems. Signed-off-by: NPhil Reid <preid@electromag.com.au> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Phil Reid 提交于
i2c_smbus commands handle the correct byte order for smbus transactions internally. This will currently result in incorrect operation on big endian systems. Signed-off-by: NPhil Reid <preid@electromag.com.au> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Tony Lindgren 提交于
Otherwise cpcap-battery won't probe properly with the power-supplies property configured but will fail with "Not all required supplies found, defer probe". Cc: Marcel Partap <mpartap@gmx.net> Cc: Michael Scott <michael.scott@linaro.org> Signed-off-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 H. Nikolaus Schaller 提交于
This is in prepraration for EPROBE_DEFER handling because it is quite likely that geting the (madc) iio channel is deferred more often than later steps. Signed-off-by: NH. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 H. Nikolaus Schaller 提交于
Suggested-by: NSebastian Reichel <sre@kernel.org> Signed-off-by: NH. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
由 Arvind Yadav 提交于
File size before: text data bss dec hex filename 4240 200 80 4520 11a8 drivers/power/supply/power_supply_core.o File size After adding 'const': text data bss dec hex filename 4296 136 80 4512 11a0 drivers/power/supply/power_supply_core.o Signed-off-by: NArvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-
- 12 6月, 2017 1 次提交
-
-
由 Andy Shevchenko 提交于
Use sysfs_match_string() helper instead of open coded variant. Cc: Sebastian Reichel <sre@kernel.org> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
- 09 6月, 2017 2 次提交
-
-
由 Andrew F. Davis 提交于
Like other subsystems we should be able to define slave devices outside of the w1 directory. To do this we move public facing interface definitions to include/linux/w1.h and rename the internal definition file to w1_internal.h. As w1_family.h and w1_int.h contained almost entirely public driver interface definitions we simply removed these files and moved the remaining definitions into w1_internal.h. With this we can now start to move slave devices out of w1/slaves and into the subsystem based on the function they implement, again like other drivers. Signed-off-by: NAndrew F. Davis <afd@ti.com> Reviewed-by: NSebastian Reichel <sre@kernel.org> Acked-by: NEvgeniy Polyakov <zbr@ioremap.net> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bjorn Andersson 提交于
Move the reboot-mode.h include file into include/linux to allow drivers outside drivers/power/reset to implement reboot-mode. Signed-off-by: NBjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
-