mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
power supply and reset changes for the v4.14 series
* New chip/feature support - bq27xxx: support updating battery config from DT - bq24190: support loading battery charge info from DT - LTC2941: add LTC2942/LTC2944 support - max17042: add ACPI support - max1721x: new driver * Misc - Move bq27xxx w1 driver from w1 into power-supply subsystem - Introduce power_supply_set_input_current_limit_from_supplier - constify stuff - some minor fixes -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlmxSSQACgkQ2O7X88g7 +ppf2xAAliDRdNPuxpKu69syiX+iNPaPHTqRXd41sAJlEX2IYv/avcoNFcGySplR gJYdlbx2Qd86aBaMf92h4tGihk2iNa87It9xkA+JgO3wNoKiZ+b5lk///IDk8aDF 8sknSTXJtGYse0jwBRKTT4cL1ZW/g10heUxPr8AiX8nL4QhMf0TIxXawWQteAZDE dDz/UEAqbINooD5HtP716Z0e3U6FyWTqFc6UzuR+n8c6wC6n/JA6h91ASAHUmExT aH1JuQyrmucBp8cLhP01ThSkoIdGbcZM7nJ3WQBlfDricFJXa/yThug/mHvjztJX 3U1UOZBqsb/LL9Dh5hl/D3+i+7qI29KCyUZiYUrwoiSjxM/AtOB2t4cAWmU7+PnJ V3coYC1s2DlwYcLIUiyE2zmVWIDcOuuOJhQjCdpUBTPvz83nQ0v5oXMn7VnQmWlO 8Z/IRWnW90v2D2iHmSPAwFG3ATfH0pAP8G/4Wrudti+ymSxAhXaLqQcj3HHjKjvI 3CEGOPAN9Opuof7SfkIVuoOjPzazx5GUpAZQKi8LS87KRdXN4ics3vbNB6VBDR50 FzVhJJZBTeAOJCDogInuu4gDa0L5Ikfdkhqc+nvNfcdsE2k3H8Nb//+UPiPnfgEA mEFyp9gaY08/3ylDEHxp3N/W7POrL4QelTjv0dvdKW70i7KtWpA= =iy5f -----END PGP SIGNATURE----- Merge tag 'for-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset changes from Sebastian Reichel: "New chip/feature support: - bq27xxx: support updating battery config from DT - bq24190: support loading battery charge info from DT - LTC2941: add LTC2942/LTC2944 support - max17042: add ACPI support - max1721x: new driver Misc: - Move bq27xxx w1 driver from w1 into power-supply subsystem - Introduce power_supply_set_input_current_limit_from_supplier - constify stuff - some minor fixes" * tag 'for-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (39 commits) power: supply: bq27xxx: enable writing capacity values for bq27421 power: supply: bq24190_charger: Get input_current_limit from our supplier power: supply: bq24190_charger: Export 5V boost converter as regulator power: supply: bq24190_charger: Add power_supply_battery_info support power: supply: bq24190_charger: Add property system-minimum-microvolt power: supply: bq24190_charger: Enable devicetree config dt-bindings: power: supply: Add docs for TI BQ24190 battery charger power: supply: bq27xxx: Remove duplicate chip data arrays power: supply: bq27xxx: Enable data memory update for certain chips power: supply: bq27xxx: Add chip IDs for previously shadowed chips power: supply: bq27xxx: Create single chip data table power: supply: bq24190_charger: Add ti,bq24192i to devicetree table power: supply: bq24190_charger: Add input_current_limit property power: supply: Add power_supply_set_input_current_limit_from_supplier helper power: supply: max17042_battery: Fix compiler warning power: supply: core: Delete two error messages for a failed memory allocation in power_supply_check_supplies() power: supply: make device_attribute const power: supply: max17042_battery: Fix ACPI interrupt issues power: supply: max17042_battery: Add support for ACPI enumeration power: supply: lp8788: Make several arrays static const * const ...
This commit is contained in:
commit
0ce5c79f38
27 changed files with 1471 additions and 638 deletions
|
|
@ -148,10 +148,4 @@ config W1_SLAVE_DS28E04
|
|||
|
||||
If you are unsure, say N.
|
||||
|
||||
config W1_SLAVE_BQ27000
|
||||
tristate "BQ27000 slave support"
|
||||
help
|
||||
Say Y here if you want to use a hdq
|
||||
bq27000 slave support.
|
||||
|
||||
endmenu
|
||||
|
|
|
|||
|
|
@ -16,5 +16,4 @@ obj-$(CONFIG_W1_SLAVE_DS2438) += w1_ds2438.o
|
|||
obj-$(CONFIG_W1_SLAVE_DS2760) += w1_ds2760.o
|
||||
obj-$(CONFIG_W1_SLAVE_DS2780) += w1_ds2780.o
|
||||
obj-$(CONFIG_W1_SLAVE_DS2781) += w1_ds2781.o
|
||||
obj-$(CONFIG_W1_SLAVE_BQ27000) += w1_bq27000.o
|
||||
obj-$(CONFIG_W1_SLAVE_DS28E04) += w1_ds28e04.o
|
||||
|
|
|
|||
|
|
@ -1,117 +0,0 @@
|
|||
/*
|
||||
* drivers/w1/slaves/w1_bq27000.c
|
||||
*
|
||||
* Copyright (C) 2007 Texas Instruments, Inc.
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public License
|
||||
* version 2. This program is licensed "as is" without any warranty of any
|
||||
* kind, whether express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/power/bq27xxx_battery.h>
|
||||
|
||||
#include <linux/w1.h>
|
||||
|
||||
#define W1_FAMILY_BQ27000 0x01
|
||||
|
||||
#define HDQ_CMD_READ (0)
|
||||
#define HDQ_CMD_WRITE (1<<7)
|
||||
|
||||
static int F_ID;
|
||||
module_param(F_ID, int, S_IRUSR);
|
||||
MODULE_PARM_DESC(F_ID, "1-wire slave FID for BQ device");
|
||||
|
||||
static int w1_bq27000_read(struct device *dev, unsigned int reg)
|
||||
{
|
||||
u8 val;
|
||||
struct w1_slave *sl = container_of(dev->parent, struct w1_slave, dev);
|
||||
|
||||
mutex_lock(&sl->master->bus_mutex);
|
||||
w1_write_8(sl->master, HDQ_CMD_READ | reg);
|
||||
val = w1_read_8(sl->master);
|
||||
mutex_unlock(&sl->master->bus_mutex);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static struct bq27xxx_platform_data bq27000_battery_info = {
|
||||
.read = w1_bq27000_read,
|
||||
.name = "bq27000-battery",
|
||||
.chip = BQ27000,
|
||||
};
|
||||
|
||||
static int w1_bq27000_add_slave(struct w1_slave *sl)
|
||||
{
|
||||
int ret;
|
||||
struct platform_device *pdev;
|
||||
|
||||
pdev = platform_device_alloc("bq27000-battery", -1);
|
||||
if (!pdev) {
|
||||
ret = -ENOMEM;
|
||||
return ret;
|
||||
}
|
||||
ret = platform_device_add_data(pdev,
|
||||
&bq27000_battery_info,
|
||||
sizeof(bq27000_battery_info));
|
||||
if (ret)
|
||||
goto pdev_add_failed;
|
||||
pdev->dev.parent = &sl->dev;
|
||||
|
||||
ret = platform_device_add(pdev);
|
||||
if (ret)
|
||||
goto pdev_add_failed;
|
||||
|
||||
dev_set_drvdata(&sl->dev, pdev);
|
||||
|
||||
goto success;
|
||||
|
||||
pdev_add_failed:
|
||||
platform_device_put(pdev);
|
||||
success:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void w1_bq27000_remove_slave(struct w1_slave *sl)
|
||||
{
|
||||
struct platform_device *pdev = dev_get_drvdata(&sl->dev);
|
||||
|
||||
platform_device_unregister(pdev);
|
||||
}
|
||||
|
||||
static struct w1_family_ops w1_bq27000_fops = {
|
||||
.add_slave = w1_bq27000_add_slave,
|
||||
.remove_slave = w1_bq27000_remove_slave,
|
||||
};
|
||||
|
||||
static struct w1_family w1_bq27000_family = {
|
||||
.fid = W1_FAMILY_BQ27000,
|
||||
.fops = &w1_bq27000_fops,
|
||||
};
|
||||
|
||||
static int __init w1_bq27000_init(void)
|
||||
{
|
||||
if (F_ID)
|
||||
w1_bq27000_family.fid = F_ID;
|
||||
|
||||
return w1_register_family(&w1_bq27000_family);
|
||||
}
|
||||
|
||||
static void __exit w1_bq27000_exit(void)
|
||||
{
|
||||
w1_unregister_family(&w1_bq27000_family);
|
||||
}
|
||||
|
||||
module_init(w1_bq27000_init);
|
||||
module_exit(w1_bq27000_exit);
|
||||
|
||||
MODULE_AUTHOR("Texas Instruments Ltd");
|
||||
MODULE_DESCRIPTION("HDQ/1-wire slave driver bq27000 battery monitor chip");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_BQ27000));
|
||||
Loading…
Reference in a new issue