Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: move power supply drivers to power/supply

This moves all power supply drivers from drivers/power/
to drivers/power/supply/. The intention is a cleaner
source tree, since drivers/power/ also contains frameworks
unrelated to power supply, like adaptive voltage scaling.

Signed-off-by: Sebastian Reichel <sre@kernel.org>

+1045 -1037
+2 -2
Documentation/power/power_supply_class.txt
··· 39 39 manner. Results for different power supplies and machines are also directly 40 40 comparable. 41 41 42 - See drivers/power/ds2760_battery.c and drivers/power/pda_power.c for the 43 - example how to declare and handle attributes. 42 + See drivers/power/supply/ds2760_battery.c and drivers/power/supply/pda_power.c 43 + for the example how to declare and handle attributes. 44 44 45 45 46 46 Units
+25 -16
MAINTAINERS
··· 3751 3751 F: drivers/mfd/da903x.c 3752 3752 F: drivers/mfd/da90??-*.c 3753 3753 F: drivers/mfd/da91??-*.c 3754 - F: drivers/power/da9052-battery.c 3755 - F: drivers/power/da91??-*.c 3754 + F: drivers/power/supply/da9052-battery.c 3755 + F: drivers/power/supply/da91??-*.c 3756 3756 F: drivers/regulator/da903x.c 3757 3757 F: drivers/regulator/da9???-regulator.[ch] 3758 3758 F: drivers/rtc/rtc-da90??.c ··· 7451 7451 M: Krzysztof Kozlowski <k.kozlowski@samsung.com> 7452 7452 L: linux-pm@vger.kernel.org 7453 7453 S: Supported 7454 - F: drivers/power/max14577_charger.c 7455 - F: drivers/power/max77693_charger.c 7454 + F: drivers/power/supply/max14577_charger.c 7455 + F: drivers/power/supply/max77693_charger.c 7456 7456 7457 7457 MAXIM MAX77802 MULTIFUNCTION PMIC DEVICE DRIVERS 7458 7458 M: Javier Martinez Canillas <javier@osg.samsung.com> ··· 8323 8323 F: include/linux/power/bq2415x_charger.h 8324 8324 F: include/linux/power/bq27xxx_battery.h 8325 8325 F: include/linux/power/isp1704_charger.h 8326 - F: drivers/power/bq2415x_charger.c 8327 - F: drivers/power/bq27xxx_battery.c 8328 - F: drivers/power/bq27xxx_battery_i2c.c 8329 - F: drivers/power/isp1704_charger.c 8330 - F: drivers/power/rx51_battery.c 8326 + F: drivers/power/supply/bq2415x_charger.c 8327 + F: drivers/power/supply/bq27xxx_battery.c 8328 + F: drivers/power/supply/bq27xxx_battery_i2c.c 8329 + F: drivers/power/supply/isp1704_charger.c 8330 + F: drivers/power/supply/rx51_battery.c 8331 8331 8332 8332 NTB DRIVER CORE 8333 8333 M: Jon Mason <jdmason@kudzu.us> ··· 9334 9334 F: Documentation/devicetree/bindings/power/ 9335 9335 F: Documentation/devicetree/bindings/power_supply/ 9336 9336 F: include/linux/power_supply.h 9337 - F: drivers/power/ 9338 - X: drivers/power/avs/ 9337 + F: drivers/power/supply/ 9339 9338 9340 9339 POWER STATE COORDINATION INTERFACE (PSCI) 9341 9340 M: Mark Rutland <mark.rutland@arm.com> ··· 10321 10322 TI BQ27XXX POWER SUPPLY DRIVER 10322 10323 R: Andrew F. Davis <afd@ti.com> 10323 10324 F: include/linux/power/bq27xxx_battery.h 10324 - F: drivers/power/bq27xxx_battery.c 10325 - F: drivers/power/bq27xxx_battery_i2c.c 10325 + F: drivers/power/supply/bq27xxx_battery.c 10326 + F: drivers/power/supply/bq27xxx_battery_i2c.c 10326 10327 10327 10328 TIMEKEEPING, CLOCKSOURCE CORE, NTP, ALARMTIMER 10328 10329 M: John Stultz <john.stultz@linaro.org> ··· 11328 11329 S: Supported 11329 11330 F: drivers/mfd/syscon.c 11330 11331 11332 + SYSTEM RESET/SHUTDOWN DRIVERS 11333 + M: Sebastian Reichel <sre@kernel.org> 11334 + M: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> 11335 + M: David Woodhouse <dwmw2@infradead.org> 11336 + L: linux-pm@vger.kernel.org 11337 + T: git git://git.infradead.org/battery-2.6.git 11338 + S: Maintained 11339 + F: Documentation/devicetree/bindings/power/reset/ 11340 + F: drivers/power/reset/ 11341 + 11331 11342 SYSV FILESYSTEM 11332 11343 M: Christoph Hellwig <hch@infradead.org> 11333 11344 S: Maintained ··· 11686 11677 TI LP8727 CHARGER DRIVER 11687 11678 M: Milo Kim <milo.kim@ti.com> 11688 11679 S: Maintained 11689 - F: drivers/power/lp8727_charger.c 11680 + F: drivers/power/supply/lp8727_charger.c 11690 11681 F: include/linux/platform_data/lp8727.h 11691 11682 11692 11683 TI LP8788 MFD DRIVER ··· 11695 11686 F: drivers/iio/adc/lp8788_adc.c 11696 11687 F: drivers/leds/leds-lp8788.c 11697 11688 F: drivers/mfd/lp8788*.c 11698 - F: drivers/power/lp8788-charger.c 11689 + F: drivers/power/supply/lp8788-charger.c 11699 11690 F: drivers/regulator/lp8788-*.c 11700 11691 F: include/linux/mfd/lp8788*.h 11701 11692 ··· 12771 12762 F: drivers/mfd/arizona* 12772 12763 F: drivers/mfd/wm*.c 12773 12764 F: drivers/mfd/cs47l24* 12774 - F: drivers/power/wm83*.c 12765 + F: drivers/power/supply/wm83*.c 12775 12766 F: drivers/rtc/rtc-wm83*.c 12776 12767 F: drivers/regulator/wm8*.c 12777 12768 F: drivers/video/backlight/wm83*_bl.c
drivers/power/88pm860x_battery.c drivers/power/supply/88pm860x_battery.c
drivers/power/88pm860x_charger.c drivers/power/supply/88pm860x_charger.c
+2 -516
drivers/power/Kconfig
··· 1 - menuconfig POWER_SUPPLY 2 - bool "Power supply class support" 3 - help 4 - Say Y here to enable power supply class support. This allows 5 - power supply (batteries, AC, USB) monitoring by userspace 6 - via sysfs and uevent (if available) and/or APM kernel interface 7 - (if selected below). 8 - 9 - if POWER_SUPPLY 10 - 11 - config POWER_SUPPLY_DEBUG 12 - bool "Power supply debug" 13 - help 14 - Say Y here to enable debugging messages for power supply class 15 - and drivers. 16 - 17 - config PDA_POWER 18 - tristate "Generic PDA/phone power driver" 19 - depends on !S390 20 - help 21 - Say Y here to enable generic power driver for PDAs and phones with 22 - one or two external power supplies (AC/USB) connected to main and 23 - backup batteries, and optional builtin charger. 24 - 25 - config APM_POWER 26 - tristate "APM emulation for class batteries" 27 - depends on APM_EMULATION 28 - help 29 - Say Y here to enable support APM status emulation using 30 - battery class devices. 31 - 32 - config GENERIC_ADC_BATTERY 33 - tristate "Generic battery support using IIO" 34 - depends on IIO 35 - help 36 - Say Y here to enable support for the generic battery driver 37 - which uses IIO framework to read adc. 38 - 39 - config MAX8925_POWER 40 - tristate "MAX8925 battery charger support" 41 - depends on MFD_MAX8925 42 - help 43 - Say Y here to enable support for the battery charger in the Maxim 44 - MAX8925 PMIC. 45 - 46 - config WM831X_BACKUP 47 - tristate "WM831X backup battery charger support" 48 - depends on MFD_WM831X 49 - help 50 - Say Y here to enable support for the backup battery charger 51 - in the Wolfson Microelectronics WM831x PMICs. 52 - 53 - config WM831X_POWER 54 - tristate "WM831X PMU support" 55 - depends on MFD_WM831X 56 - help 57 - Say Y here to enable support for the power management unit 58 - provided by Wolfson Microelectronics WM831x PMICs. 59 - 60 - config WM8350_POWER 61 - tristate "WM8350 PMU support" 62 - depends on MFD_WM8350 63 - help 64 - Say Y here to enable support for the power management unit 65 - provided by the Wolfson Microelectronics WM8350 PMIC. 66 - 67 - config TEST_POWER 68 - tristate "Test power driver" 69 - help 70 - This driver is used for testing. It's safe to say M here. 71 - 72 - config BATTERY_88PM860X 73 - tristate "Marvell 88PM860x battery driver" 74 - depends on MFD_88PM860X 75 - help 76 - Say Y here to enable battery monitor for Marvell 88PM860x chip. 77 - 78 - config BATTERY_ACT8945A 79 - tristate "Active-semi ACT8945A charger driver" 80 - depends on MFD_ACT8945A || COMPILE_TEST 81 - help 82 - Say Y here to enable support for power supply provided by 83 - Active-semi ActivePath ACT8945A charger. 84 - 85 - config BATTERY_DS2760 86 - tristate "DS2760 battery driver (HP iPAQ & others)" 87 - depends on W1 && W1_SLAVE_DS2760 88 - help 89 - Say Y here to enable support for batteries with ds2760 chip. 90 - 91 - config BATTERY_DS2780 92 - tristate "DS2780 battery driver" 93 - depends on HAS_IOMEM 94 - select W1 95 - select W1_SLAVE_DS2780 96 - help 97 - Say Y here to enable support for batteries with ds2780 chip. 98 - 99 - config BATTERY_DS2781 100 - tristate "DS2781 battery driver" 101 - depends on HAS_IOMEM 102 - select W1 103 - select W1_SLAVE_DS2781 104 - help 105 - If you enable this you will have the DS2781 battery driver support. 106 - 107 - The battery monitor chip is used in many batteries/devices 108 - as the one who is responsible for charging/discharging/monitoring 109 - Li+ batteries. 110 - 111 - If you are unsure, say N. 112 - 113 - config BATTERY_DS2782 114 - tristate "DS2782/DS2786 standalone gas-gauge" 115 - depends on I2C 116 - help 117 - Say Y here to enable support for the DS2782/DS2786 standalone battery 118 - gas-gauge. 119 - 120 - config BATTERY_PMU 121 - tristate "Apple PMU battery" 122 - depends on PPC32 && ADB_PMU 123 - help 124 - Say Y here to expose battery information on Apple machines 125 - through the generic battery class. 126 - 127 - config BATTERY_OLPC 128 - tristate "One Laptop Per Child battery" 129 - depends on X86_32 && OLPC 130 - help 131 - Say Y to enable support for the battery on the OLPC laptop. 132 - 133 - config BATTERY_TOSA 134 - tristate "Sharp SL-6000 (tosa) battery" 135 - depends on MACH_TOSA && MFD_TC6393XB && TOUCHSCREEN_WM97XX 136 - help 137 - Say Y to enable support for the battery on the Sharp Zaurus 138 - SL-6000 (tosa) models. 139 - 140 - config BATTERY_COLLIE 141 - tristate "Sharp SL-5500 (collie) battery" 142 - depends on SA1100_COLLIE && MCP_UCB1200 143 - help 144 - Say Y to enable support for the battery on the Sharp Zaurus 145 - SL-5500 (collie) models. 146 - 147 - config BATTERY_IPAQ_MICRO 148 - tristate "iPAQ Atmel Micro ASIC battery driver" 149 - depends on MFD_IPAQ_MICRO 150 - help 151 - Choose this option if you want to monitor battery status on 152 - Compaq/HP iPAQ h3100 and h3600. 153 - 154 - config BATTERY_WM97XX 155 - bool "WM97xx generic battery driver" 156 - depends on TOUCHSCREEN_WM97XX=y 157 - help 158 - Say Y to enable support for battery measured by WM97xx aux port. 159 - 160 - config BATTERY_SBS 161 - tristate "SBS Compliant gas gauge" 162 - depends on I2C 163 - help 164 - Say Y to include support for SBS battery driver for SBS-compliant 165 - gas gauges. 166 - 167 - config BATTERY_BQ27XXX 168 - tristate "BQ27xxx battery driver" 169 - help 170 - Say Y here to enable support for batteries with BQ27xxx chips. 171 - 172 - config BATTERY_BQ27XXX_I2C 173 - tristate "BQ27xxx I2C support" 174 - depends on BATTERY_BQ27XXX 175 - depends on I2C 176 - default y 177 - help 178 - Say Y here to enable support for batteries with BQ27xxx chips 179 - connected over an I2C bus. 180 - 181 - config BATTERY_DA9030 182 - tristate "DA9030 battery driver" 183 - depends on PMIC_DA903X 184 - help 185 - Say Y here to enable support for batteries charger integrated into 186 - DA9030 PMIC. 187 - 188 - config BATTERY_DA9052 189 - tristate "Dialog DA9052 Battery" 190 - depends on PMIC_DA9052 191 - help 192 - Say Y here to enable support for batteries charger integrated into 193 - DA9052 PMIC. 194 - 195 - config CHARGER_DA9150 196 - tristate "Dialog Semiconductor DA9150 Charger support" 197 - depends on MFD_DA9150 198 - depends on DA9150_GPADC 199 - depends on IIO 200 - help 201 - Say Y here to enable support for charger unit of the DA9150 202 - Integrated Charger & Fuel-Gauge IC. 203 - 204 - This driver can also be built as a module. If so, the module will be 205 - called da9150-charger. 206 - 207 - config BATTERY_DA9150 208 - tristate "Dialog Semiconductor DA9150 Fuel Gauge support" 209 - depends on MFD_DA9150 210 - help 211 - Say Y here to enable support for the Fuel-Gauge unit of the DA9150 212 - Integrated Charger & Fuel-Gauge IC 213 - 214 - This driver can also be built as a module. If so, the module will be 215 - called da9150-fg. 216 - 217 - config AXP288_CHARGER 218 - tristate "X-Powers AXP288 Charger" 219 - depends on MFD_AXP20X && EXTCON_AXP288 220 - help 221 - Say yes here to have support X-Power AXP288 power management IC (PMIC) 222 - integrated charger. 223 - 224 - config AXP288_FUEL_GAUGE 225 - tristate "X-Powers AXP288 Fuel Gauge" 226 - depends on MFD_AXP20X && IIO 227 - help 228 - Say yes here to have support for X-Power power management IC (PMIC) 229 - Fuel Gauge. The device provides battery statistics and status 230 - monitoring as well as alerts for battery over/under voltage and 231 - over/under temperature. 232 - 233 - config BATTERY_MAX17040 234 - tristate "Maxim MAX17040 Fuel Gauge" 235 - depends on I2C 236 - help 237 - MAX17040 is fuel-gauge systems for lithium-ion (Li+) batteries 238 - in handheld and portable equipment. The MAX17040 is configured 239 - to operate with a single lithium cell 240 - 241 - config BATTERY_MAX17042 242 - tristate "Maxim MAX17042/17047/17050/8997/8966 Fuel Gauge" 243 - depends on I2C 244 - select REGMAP_I2C 245 - help 246 - MAX17042 is fuel-gauge systems for lithium-ion (Li+) batteries 247 - in handheld and portable equipment. The MAX17042 is configured 248 - to operate with a single lithium cell. MAX8997 and MAX8966 are 249 - multi-function devices that include fuel gauages that are compatible 250 - with MAX17042. This driver also supports max17047/50 chips which are 251 - improved version of max17042. 252 - 253 - config BATTERY_Z2 254 - tristate "Z2 battery driver" 255 - depends on I2C && MACH_ZIPIT2 256 - help 257 - Say Y to include support for the battery on the Zipit Z2. 258 - 259 - config BATTERY_S3C_ADC 260 - tristate "Battery driver for Samsung ADC based monitoring" 261 - depends on S3C_ADC 262 - help 263 - Say Y here to enable support for iPAQ h1930/h1940/rx1950 battery 264 - 265 - config BATTERY_TWL4030_MADC 266 - tristate "TWL4030 MADC battery driver" 267 - depends on TWL4030_MADC 268 - help 269 - Say Y here to enable this dumb driver for batteries managed 270 - through the TWL4030 MADC. 271 - 272 - config CHARGER_88PM860X 273 - tristate "Marvell 88PM860x Charger driver" 274 - depends on MFD_88PM860X && BATTERY_88PM860X 275 - help 276 - Say Y here to enable charger for Marvell 88PM860x chip. 277 - 278 - config CHARGER_PCF50633 279 - tristate "NXP PCF50633 MBC" 280 - depends on MFD_PCF50633 281 - help 282 - Say Y to include support for NXP PCF50633 Main Battery Charger. 283 - 284 - config BATTERY_JZ4740 285 - tristate "Ingenic JZ4740 battery" 286 - depends on MACH_JZ4740 287 - depends on MFD_JZ4740_ADC 288 - help 289 - Say Y to enable support for the battery on Ingenic JZ4740 based 290 - boards. 291 - 292 - This driver can be build as a module. If so, the module will be 293 - called jz4740-battery. 294 - 295 - config BATTERY_INTEL_MID 296 - tristate "Battery driver for Intel MID platforms" 297 - depends on INTEL_SCU_IPC && SPI 298 - help 299 - Say Y here to enable the battery driver on Intel MID 300 - platforms. 301 - 302 - config BATTERY_RX51 303 - tristate "Nokia RX-51 (N900) battery driver" 304 - depends on TWL4030_MADC 305 - help 306 - Say Y here to enable support for battery information on Nokia 307 - RX-51, also known as N900 tablet. 308 - 309 - config CHARGER_ISP1704 310 - tristate "ISP1704 USB Charger Detection" 311 - depends on USB_PHY 312 - depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y' 313 - help 314 - Say Y to enable support for USB Charger Detection with 315 - ISP1707/ISP1704 USB transceivers. 316 - 317 - config CHARGER_MAX8903 318 - tristate "MAX8903 Battery DC-DC Charger for USB and Adapter Power" 319 - help 320 - Say Y to enable support for the MAX8903 DC-DC charger and sysfs. 321 - The driver supports controlling charger-enable and current-limit 322 - pins based on the status of charger connections with interrupt 323 - handlers. 324 - 325 - config CHARGER_TWL4030 326 - tristate "OMAP TWL4030 BCI charger driver" 327 - depends on IIO && TWL4030_CORE 328 - help 329 - Say Y here to enable support for TWL4030 Battery Charge Interface. 330 - 331 - config CHARGER_LP8727 332 - tristate "TI/National Semiconductor LP8727 charger driver" 333 - depends on I2C 334 - help 335 - Say Y here to enable support for LP8727 Charger Driver. 336 - 337 - config CHARGER_LP8788 338 - tristate "TI LP8788 charger driver" 339 - depends on MFD_LP8788 340 - depends on LP8788_ADC 341 - depends on IIO 342 - help 343 - Say Y to enable support for the LP8788 linear charger. 344 - 345 - config CHARGER_GPIO 346 - tristate "GPIO charger" 347 - depends on GPIOLIB || COMPILE_TEST 348 - help 349 - Say Y to include support for chargers which report their online status 350 - through a GPIO pin. 351 - 352 - This driver can be build as a module. If so, the module will be 353 - called gpio-charger. 354 - 355 - config CHARGER_MANAGER 356 - bool "Battery charger manager for multiple chargers" 357 - depends on REGULATOR 358 - select EXTCON 359 - help 360 - Say Y to enable charger-manager support, which allows multiple 361 - chargers attached to a battery and multiple batteries attached to a 362 - system. The charger-manager also can monitor charging status in 363 - runtime and in suspend-to-RAM by waking up the system periodically 364 - with help of suspend_again support. 365 - 366 - config CHARGER_MAX14577 367 - tristate "Maxim MAX14577/77836 battery charger driver" 368 - depends on MFD_MAX14577 369 - help 370 - Say Y to enable support for the battery charger control sysfs and 371 - platform data of MAX14577/77836 MUICs. 372 - 373 - config CHARGER_MAX77693 374 - tristate "Maxim MAX77693 battery charger driver" 375 - depends on MFD_MAX77693 376 - help 377 - Say Y to enable support for the Maxim MAX77693 battery charger. 378 - 379 - config CHARGER_MAX8997 380 - tristate "Maxim MAX8997/MAX8966 PMIC battery charger driver" 381 - depends on MFD_MAX8997 && REGULATOR_MAX8997 382 - help 383 - Say Y to enable support for the battery charger control sysfs and 384 - platform data of MAX8997/LP3974 PMICs. 385 - 386 - config CHARGER_MAX8998 387 - tristate "Maxim MAX8998/LP3974 PMIC battery charger driver" 388 - depends on MFD_MAX8998 && REGULATOR_MAX8998 389 - help 390 - Say Y to enable support for the battery charger control sysfs and 391 - platform data of MAX8998/LP3974 PMICs. 392 - 393 - config CHARGER_QCOM_SMBB 394 - tristate "Qualcomm Switch-Mode Battery Charger and Boost" 395 - depends on MFD_SPMI_PMIC || COMPILE_TEST 396 - depends on OF 397 - depends on EXTCON 398 - help 399 - Say Y to include support for the Switch-Mode Battery Charger and 400 - Boost (SMBB) hardware found in Qualcomm PM8941 PMICs. The charger 401 - is an integrated, single-cell lithium-ion battery charger. DT 402 - configuration is required for loading, see the devicetree 403 - documentation for more detail. The base name for this driver is 404 - 'pm8941_charger'. 405 - 406 - config CHARGER_BQ2415X 407 - tristate "TI BQ2415x battery charger driver" 408 - depends on I2C 409 - help 410 - Say Y to enable support for the TI BQ2415x battery charger 411 - PMICs. 412 - 413 - You'll need this driver to charge batteries on e.g. Nokia 414 - RX-51/N900. 415 - 416 - config CHARGER_BQ24190 417 - tristate "TI BQ24190 battery charger driver" 418 - depends on I2C 419 - depends on GPIOLIB || COMPILE_TEST 420 - help 421 - Say Y to enable support for the TI BQ24190 battery charger. 422 - 423 - config CHARGER_BQ24257 424 - tristate "TI BQ24250/24251/24257 battery charger driver" 425 - depends on I2C 426 - depends on GPIOLIB || COMPILE_TEST 427 - depends on REGMAP_I2C 428 - help 429 - Say Y to enable support for the TI BQ24250, BQ24251, and BQ24257 battery 430 - chargers. 431 - 432 - config CHARGER_BQ24735 433 - tristate "TI BQ24735 battery charger support" 434 - depends on I2C 435 - depends on GPIOLIB || COMPILE_TEST 436 - help 437 - Say Y to enable support for the TI BQ24735 battery charger. 438 - 439 - config CHARGER_BQ25890 440 - tristate "TI BQ25890 battery charger driver" 441 - depends on I2C 442 - depends on GPIOLIB || COMPILE_TEST 443 - select REGMAP_I2C 444 - help 445 - Say Y to enable support for the TI BQ25890 battery charger. 446 - 447 - config CHARGER_SMB347 448 - tristate "Summit Microelectronics SMB347 Battery Charger" 449 - depends on I2C 450 - select REGMAP_I2C 451 - help 452 - Say Y to include support for Summit Microelectronics SMB347 453 - Battery Charger. 454 - 455 - config CHARGER_TPS65090 456 - tristate "TPS65090 battery charger driver" 457 - depends on MFD_TPS65090 458 - help 459 - Say Y here to enable support for battery charging with TPS65090 460 - PMIC chips. 461 - 462 - config CHARGER_TPS65217 463 - tristate "TPS65217 battery charger driver" 464 - depends on MFD_TPS65217 465 - help 466 - Say Y here to enable support for battery charging with TPS65217 467 - PMIC chips. 468 - 469 - config BATTERY_GAUGE_LTC2941 470 - tristate "LTC2941/LTC2943 Battery Gauge Driver" 471 - depends on I2C 472 - help 473 - Say Y here to include support for LTC2941 and LTC2943 Battery 474 - Gauge IC. The driver reports the charge count continuously, and 475 - measures the voltage and temperature every 10 seconds. 476 - 477 - config AB8500_BM 478 - bool "AB8500 Battery Management Driver" 479 - depends on AB8500_CORE && AB8500_GPADC 480 - help 481 - Say Y to include support for AB8500 battery management. 482 - 483 - config BATTERY_GOLDFISH 484 - tristate "Goldfish battery driver" 485 - depends on GOLDFISH || COMPILE_TEST 486 - depends on HAS_IOMEM 487 - help 488 - Say Y to enable support for the battery and AC power in the 489 - Goldfish emulator. 490 - 491 - config BATTERY_RT5033 492 - tristate "RT5033 fuel gauge support" 493 - depends on MFD_RT5033 494 - help 495 - This adds support for battery fuel gauge in Richtek RT5033 PMIC. 496 - The fuelgauge calculates and determines the battery state of charge 497 - according to battery open circuit voltage. 498 - 499 - config CHARGER_RT9455 500 - tristate "Richtek RT9455 battery charger driver" 501 - depends on I2C 502 - depends on GPIOLIB || COMPILE_TEST 503 - select REGMAP_I2C 504 - help 505 - Say Y to enable support for Richtek RT9455 battery charger. 506 - 507 - config AXP20X_POWER 508 - tristate "AXP20x power supply driver" 509 - depends on MFD_AXP20X 510 - help 511 - This driver provides support for the power supply features of 512 - AXP20x PMIC. 513 - 514 - endif # POWER_SUPPLY 515 - 516 - source "drivers/power/reset/Kconfig" 517 1 source "drivers/power/avs/Kconfig" 2 + source "drivers/power/reset/Kconfig" 3 + source "drivers/power/supply/Kconfig"
+1 -74
drivers/power/Makefile
··· 1 - subdir-ccflags-$(CONFIG_POWER_SUPPLY_DEBUG) := -DDEBUG 2 - 3 - power_supply-y := power_supply_core.o 4 - power_supply-$(CONFIG_SYSFS) += power_supply_sysfs.o 5 - power_supply-$(CONFIG_LEDS_TRIGGERS) += power_supply_leds.o 6 - 7 - obj-$(CONFIG_POWER_SUPPLY) += power_supply.o 8 - obj-$(CONFIG_GENERIC_ADC_BATTERY) += generic-adc-battery.o 9 - 10 - obj-$(CONFIG_PDA_POWER) += pda_power.o 11 - obj-$(CONFIG_APM_POWER) += apm_power.o 12 - obj-$(CONFIG_AXP20X_POWER) += axp20x_usb_power.o 13 - obj-$(CONFIG_MAX8925_POWER) += max8925_power.o 14 - obj-$(CONFIG_WM831X_BACKUP) += wm831x_backup.o 15 - obj-$(CONFIG_WM831X_POWER) += wm831x_power.o 16 - obj-$(CONFIG_WM8350_POWER) += wm8350_power.o 17 - obj-$(CONFIG_TEST_POWER) += test_power.o 18 - 19 - obj-$(CONFIG_BATTERY_88PM860X) += 88pm860x_battery.o 20 - obj-$(CONFIG_BATTERY_ACT8945A) += act8945a_charger.o 21 - obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o 22 - obj-$(CONFIG_BATTERY_DS2780) += ds2780_battery.o 23 - obj-$(CONFIG_BATTERY_DS2781) += ds2781_battery.o 24 - obj-$(CONFIG_BATTERY_DS2782) += ds2782_battery.o 25 - obj-$(CONFIG_BATTERY_GAUGE_LTC2941) += ltc2941-battery-gauge.o 26 - obj-$(CONFIG_BATTERY_GOLDFISH) += goldfish_battery.o 27 - obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o 28 - obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o 29 - obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o 30 - obj-$(CONFIG_BATTERY_COLLIE) += collie_battery.o 31 - obj-$(CONFIG_BATTERY_IPAQ_MICRO) += ipaq_micro_battery.o 32 - obj-$(CONFIG_BATTERY_WM97XX) += wm97xx_battery.o 33 - obj-$(CONFIG_BATTERY_SBS) += sbs-battery.o 34 - obj-$(CONFIG_BATTERY_BQ27XXX) += bq27xxx_battery.o 35 - obj-$(CONFIG_BATTERY_BQ27XXX_I2C) += bq27xxx_battery_i2c.o 36 - obj-$(CONFIG_BATTERY_DA9030) += da9030_battery.o 37 - obj-$(CONFIG_BATTERY_DA9052) += da9052-battery.o 38 - obj-$(CONFIG_CHARGER_DA9150) += da9150-charger.o 39 - obj-$(CONFIG_BATTERY_DA9150) += da9150-fg.o 40 - obj-$(CONFIG_BATTERY_MAX17040) += max17040_battery.o 41 - obj-$(CONFIG_BATTERY_MAX17042) += max17042_battery.o 42 - obj-$(CONFIG_BATTERY_Z2) += z2_battery.o 43 - obj-$(CONFIG_BATTERY_RT5033) += rt5033_battery.o 44 - obj-$(CONFIG_CHARGER_RT9455) += rt9455_charger.o 45 - obj-$(CONFIG_BATTERY_S3C_ADC) += s3c_adc_battery.o 46 - obj-$(CONFIG_BATTERY_TWL4030_MADC) += twl4030_madc_battery.o 47 - obj-$(CONFIG_CHARGER_88PM860X) += 88pm860x_charger.o 48 - obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o 49 - obj-$(CONFIG_BATTERY_JZ4740) += jz4740-battery.o 50 - obj-$(CONFIG_BATTERY_INTEL_MID) += intel_mid_battery.o 51 - obj-$(CONFIG_BATTERY_RX51) += rx51_battery.o 52 - obj-$(CONFIG_AB8500_BM) += ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o abx500_chargalg.o pm2301_charger.o 53 - obj-$(CONFIG_CHARGER_ISP1704) += isp1704_charger.o 54 - obj-$(CONFIG_CHARGER_MAX8903) += max8903_charger.o 55 - obj-$(CONFIG_CHARGER_TWL4030) += twl4030_charger.o 56 - obj-$(CONFIG_CHARGER_LP8727) += lp8727_charger.o 57 - obj-$(CONFIG_CHARGER_LP8788) += lp8788-charger.o 58 - obj-$(CONFIG_CHARGER_GPIO) += gpio-charger.o 59 - obj-$(CONFIG_CHARGER_MANAGER) += charger-manager.o 60 - obj-$(CONFIG_CHARGER_MAX14577) += max14577_charger.o 61 - obj-$(CONFIG_CHARGER_MAX77693) += max77693_charger.o 62 - obj-$(CONFIG_CHARGER_MAX8997) += max8997_charger.o 63 - obj-$(CONFIG_CHARGER_MAX8998) += max8998_charger.o 64 - obj-$(CONFIG_CHARGER_QCOM_SMBB) += qcom_smbb.o 65 - obj-$(CONFIG_CHARGER_BQ2415X) += bq2415x_charger.o 66 - obj-$(CONFIG_CHARGER_BQ24190) += bq24190_charger.o 67 - obj-$(CONFIG_CHARGER_BQ24257) += bq24257_charger.o 68 - obj-$(CONFIG_CHARGER_BQ24735) += bq24735-charger.o 69 - obj-$(CONFIG_CHARGER_BQ25890) += bq25890_charger.o 70 1 obj-$(CONFIG_POWER_AVS) += avs/ 71 - obj-$(CONFIG_CHARGER_SMB347) += smb347-charger.o 72 - obj-$(CONFIG_CHARGER_TPS65090) += tps65090-charger.o 73 - obj-$(CONFIG_CHARGER_TPS65217) += tps65217_charger.o 74 2 obj-$(CONFIG_POWER_RESET) += reset/ 75 - obj-$(CONFIG_AXP288_FUEL_GAUGE) += axp288_fuel_gauge.o 76 - obj-$(CONFIG_AXP288_CHARGER) += axp288_charger.o 3 + obj-$(CONFIG_POWER_SUPPLY) += supply/
drivers/power/ab8500_bmdata.c drivers/power/supply/ab8500_bmdata.c
drivers/power/ab8500_btemp.c drivers/power/supply/ab8500_btemp.c
drivers/power/ab8500_charger.c drivers/power/supply/ab8500_charger.c
drivers/power/ab8500_fg.c drivers/power/supply/ab8500_fg.c
drivers/power/abx500_chargalg.c drivers/power/supply/abx500_chargalg.c
drivers/power/act8945a_charger.c drivers/power/supply/act8945a_charger.c
drivers/power/apm_power.c drivers/power/supply/apm_power.c
drivers/power/axp20x_usb_power.c drivers/power/supply/axp20x_usb_power.c
drivers/power/axp288_charger.c drivers/power/supply/axp288_charger.c
drivers/power/axp288_fuel_gauge.c drivers/power/supply/axp288_fuel_gauge.c
drivers/power/bq2415x_charger.c drivers/power/supply/bq2415x_charger.c
drivers/power/bq24190_charger.c drivers/power/supply/bq24190_charger.c
drivers/power/bq24257_charger.c drivers/power/supply/bq24257_charger.c
drivers/power/bq24735-charger.c drivers/power/supply/bq24735-charger.c
drivers/power/bq25890_charger.c drivers/power/supply/bq25890_charger.c
drivers/power/bq27xxx_battery.c drivers/power/supply/bq27xxx_battery.c
drivers/power/bq27xxx_battery_i2c.c drivers/power/supply/bq27xxx_battery_i2c.c
drivers/power/charger-manager.c drivers/power/supply/charger-manager.c
drivers/power/collie_battery.c drivers/power/supply/collie_battery.c
drivers/power/da9030_battery.c drivers/power/supply/da9030_battery.c
drivers/power/da9052-battery.c drivers/power/supply/da9052-battery.c
drivers/power/da9150-charger.c drivers/power/supply/da9150-charger.c
drivers/power/da9150-fg.c drivers/power/supply/da9150-fg.c
+2 -2
drivers/power/ds2760_battery.c drivers/power/supply/ds2760_battery.c
··· 28 28 #include <linux/platform_device.h> 29 29 #include <linux/power_supply.h> 30 30 31 - #include "../w1/w1.h" 32 - #include "../w1/slaves/w1_ds2760.h" 31 + #include "../../w1/w1.h" 32 + #include "../../w1/slaves/w1_ds2760.h" 33 33 34 34 struct ds2760_device_info { 35 35 struct device *dev;
+219 -218
drivers/power/ds2780_battery.c drivers/power/supply/ds2781_battery.c
··· 1 1 /* 2 - * 1-wire client/driver for the Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC 2 + * 1-wire client/driver for the Maxim/Dallas DS2781 Stand-Alone Fuel Gauge IC 3 3 * 4 - * Copyright (C) 2010 Indesign, LLC 4 + * Author: Renata Sayakhova <renata@oktetlabs.ru> 5 5 * 6 - * Author: Clifton Barnes <cabarnes@indesign-llc.com> 7 - * 8 - * Based on ds2760_battery and ds2782_battery drivers 6 + * Based on ds2780_battery drivers 9 7 * 10 8 * This program is free software; you can redistribute it and/or modify 11 9 * it under the terms of the GNU General Public License version 2 as ··· 19 21 #include <linux/power_supply.h> 20 22 #include <linux/idr.h> 21 23 22 - #include "../w1/w1.h" 23 - #include "../w1/slaves/w1_ds2780.h" 24 + #include "../../w1/w1.h" 25 + #include "../../w1/slaves/w1_ds2781.h" 24 26 25 27 /* Current unit measurement in uA for a 1 milli-ohm sense resistor */ 26 - #define DS2780_CURRENT_UNITS 1563 28 + #define DS2781_CURRENT_UNITS 1563 27 29 /* Charge unit measurement in uAh for a 1 milli-ohm sense resistor */ 28 - #define DS2780_CHARGE_UNITS 6250 30 + #define DS2781_CHARGE_UNITS 6250 29 31 /* Number of bytes in user EEPROM space */ 30 - #define DS2780_USER_EEPROM_SIZE (DS2780_EEPROM_BLOCK0_END - \ 31 - DS2780_EEPROM_BLOCK0_START + 1) 32 + #define DS2781_USER_EEPROM_SIZE (DS2781_EEPROM_BLOCK0_END - \ 33 + DS2781_EEPROM_BLOCK0_START + 1) 32 34 /* Number of bytes in parameter EEPROM space */ 33 - #define DS2780_PARAM_EEPROM_SIZE (DS2780_EEPROM_BLOCK1_END - \ 34 - DS2780_EEPROM_BLOCK1_START + 1) 35 + #define DS2781_PARAM_EEPROM_SIZE (DS2781_EEPROM_BLOCK1_END - \ 36 + DS2781_EEPROM_BLOCK1_START + 1) 35 37 36 - struct ds2780_device_info { 38 + struct ds2781_device_info { 37 39 struct device *dev; 38 40 struct power_supply *bat; 39 41 struct power_supply_desc bat_desc; ··· 45 47 CURRENT_AVG, 46 48 }; 47 49 48 - static const char model[] = "DS2780"; 50 + static const char model[] = "DS2781"; 49 51 static const char manufacturer[] = "Maxim/Dallas"; 50 52 51 - static inline struct ds2780_device_info * 52 - to_ds2780_device_info(struct power_supply *psy) 53 + static inline struct ds2781_device_info * 54 + to_ds2781_device_info(struct power_supply *psy) 53 55 { 54 56 return power_supply_get_drvdata(psy); 55 57 } ··· 59 61 return dev_get_drvdata(dev); 60 62 } 61 63 62 - static inline int ds2780_battery_io(struct ds2780_device_info *dev_info, 64 + static inline int ds2781_battery_io(struct ds2781_device_info *dev_info, 63 65 char *buf, int addr, size_t count, int io) 64 66 { 65 - return w1_ds2780_io(dev_info->w1_dev, buf, addr, count, io); 67 + return w1_ds2781_io(dev_info->w1_dev, buf, addr, count, io); 66 68 } 67 69 68 - static inline int ds2780_read8(struct ds2780_device_info *dev_info, u8 *val, 70 + static int w1_ds2781_read(struct ds2781_device_info *dev_info, char *buf, 71 + int addr, size_t count) 72 + { 73 + return ds2781_battery_io(dev_info, buf, addr, count, 0); 74 + } 75 + 76 + static inline int ds2781_read8(struct ds2781_device_info *dev_info, u8 *val, 69 77 int addr) 70 78 { 71 - return ds2780_battery_io(dev_info, val, addr, sizeof(u8), 0); 79 + return ds2781_battery_io(dev_info, val, addr, sizeof(u8), 0); 72 80 } 73 81 74 - static int ds2780_read16(struct ds2780_device_info *dev_info, s16 *val, 82 + static int ds2781_read16(struct ds2781_device_info *dev_info, s16 *val, 75 83 int addr) 76 84 { 77 85 int ret; 78 86 u8 raw[2]; 79 87 80 - ret = ds2780_battery_io(dev_info, raw, addr, sizeof(raw), 0); 88 + ret = ds2781_battery_io(dev_info, raw, addr, sizeof(raw), 0); 81 89 if (ret < 0) 82 90 return ret; 83 91 ··· 92 88 return 0; 93 89 } 94 90 95 - static inline int ds2780_read_block(struct ds2780_device_info *dev_info, 91 + static inline int ds2781_read_block(struct ds2781_device_info *dev_info, 96 92 u8 *val, int addr, size_t count) 97 93 { 98 - return ds2780_battery_io(dev_info, val, addr, count, 0); 94 + return ds2781_battery_io(dev_info, val, addr, count, 0); 99 95 } 100 96 101 - static inline int ds2780_write(struct ds2780_device_info *dev_info, u8 *val, 97 + static inline int ds2781_write(struct ds2781_device_info *dev_info, u8 *val, 102 98 int addr, size_t count) 103 99 { 104 - return ds2780_battery_io(dev_info, val, addr, count, 1); 100 + return ds2781_battery_io(dev_info, val, addr, count, 1); 105 101 } 106 102 107 - static inline int ds2780_store_eeprom(struct device *dev, int addr) 103 + static inline int ds2781_store_eeprom(struct device *dev, int addr) 108 104 { 109 - return w1_ds2780_eeprom_cmd(dev, addr, W1_DS2780_COPY_DATA); 105 + return w1_ds2781_eeprom_cmd(dev, addr, W1_DS2781_COPY_DATA); 110 106 } 111 107 112 - static inline int ds2780_recall_eeprom(struct device *dev, int addr) 108 + static inline int ds2781_recall_eeprom(struct device *dev, int addr) 113 109 { 114 - return w1_ds2780_eeprom_cmd(dev, addr, W1_DS2780_RECALL_DATA); 110 + return w1_ds2781_eeprom_cmd(dev, addr, W1_DS2781_RECALL_DATA); 115 111 } 116 112 117 - static int ds2780_save_eeprom(struct ds2780_device_info *dev_info, int reg) 113 + static int ds2781_save_eeprom(struct ds2781_device_info *dev_info, int reg) 118 114 { 119 115 int ret; 120 116 121 - ret = ds2780_store_eeprom(dev_info->w1_dev, reg); 117 + ret = ds2781_store_eeprom(dev_info->w1_dev, reg); 122 118 if (ret < 0) 123 119 return ret; 124 120 125 - ret = ds2780_recall_eeprom(dev_info->w1_dev, reg); 121 + ret = ds2781_recall_eeprom(dev_info->w1_dev, reg); 126 122 if (ret < 0) 127 123 return ret; 128 124 ··· 130 126 } 131 127 132 128 /* Set sense resistor value in mhos */ 133 - static int ds2780_set_sense_register(struct ds2780_device_info *dev_info, 129 + static int ds2781_set_sense_register(struct ds2781_device_info *dev_info, 134 130 u8 conductance) 135 131 { 136 132 int ret; 137 133 138 - ret = ds2780_write(dev_info, &conductance, 139 - DS2780_RSNSP_REG, sizeof(u8)); 134 + ret = ds2781_write(dev_info, &conductance, 135 + DS2781_RSNSP, sizeof(u8)); 140 136 if (ret < 0) 141 137 return ret; 142 138 143 - return ds2780_save_eeprom(dev_info, DS2780_RSNSP_REG); 139 + return ds2781_save_eeprom(dev_info, DS2781_RSNSP); 144 140 } 145 141 146 142 /* Get RSGAIN value from 0 to 1.999 in steps of 0.001 */ 147 - static int ds2780_get_rsgain_register(struct ds2780_device_info *dev_info, 143 + static int ds2781_get_rsgain_register(struct ds2781_device_info *dev_info, 148 144 u16 *rsgain) 149 145 { 150 - return ds2780_read16(dev_info, rsgain, DS2780_RSGAIN_MSB_REG); 146 + return ds2781_read16(dev_info, rsgain, DS2781_RSGAIN_MSB); 151 147 } 152 148 153 149 /* Set RSGAIN value from 0 to 1.999 in steps of 0.001 */ 154 - static int ds2780_set_rsgain_register(struct ds2780_device_info *dev_info, 150 + static int ds2781_set_rsgain_register(struct ds2781_device_info *dev_info, 155 151 u16 rsgain) 156 152 { 157 153 int ret; 158 154 u8 raw[] = {rsgain >> 8, rsgain & 0xFF}; 159 155 160 - ret = ds2780_write(dev_info, raw, 161 - DS2780_RSGAIN_MSB_REG, sizeof(raw)); 156 + ret = ds2781_write(dev_info, raw, 157 + DS2781_RSGAIN_MSB, sizeof(raw)); 162 158 if (ret < 0) 163 159 return ret; 164 160 165 - return ds2780_save_eeprom(dev_info, DS2780_RSGAIN_MSB_REG); 161 + return ds2781_save_eeprom(dev_info, DS2781_RSGAIN_MSB); 166 162 } 167 163 168 - static int ds2780_get_voltage(struct ds2780_device_info *dev_info, 164 + static int ds2781_get_voltage(struct ds2781_device_info *dev_info, 169 165 int *voltage_uV) 170 166 { 171 167 int ret; 172 - s16 voltage_raw; 168 + char val[2]; 169 + int voltage_raw; 173 170 171 + ret = w1_ds2781_read(dev_info, val, DS2781_VOLT_MSB, 2 * sizeof(u8)); 172 + if (ret < 0) 173 + return ret; 174 174 /* 175 175 * The voltage value is located in 10 bits across the voltage MSB 176 176 * and LSB registers in two's compliment form ··· 184 176 * Bits 2 - 0 of the voltage value are in bits 7 - 5 of the 185 177 * voltage LSB register 186 178 */ 187 - ret = ds2780_read16(dev_info, &voltage_raw, 188 - DS2780_VOLT_MSB_REG); 189 - if (ret < 0) 190 - return ret; 179 + voltage_raw = (val[0] << 3) | 180 + (val[1] >> 5); 191 181 192 - /* 193 - * DS2780 reports voltage in units of 4.88mV, but the battery class 194 - * reports in units of uV, so convert by multiplying by 4880. 195 - */ 196 - *voltage_uV = (voltage_raw / 32) * 4880; 182 + /* DS2781 reports voltage in units of 9.76mV, but the battery class 183 + * reports in units of uV, so convert by multiplying by 9760. */ 184 + *voltage_uV = voltage_raw * 9760; 185 + 197 186 return 0; 198 187 } 199 188 200 - static int ds2780_get_temperature(struct ds2780_device_info *dev_info, 201 - int *temperature) 189 + static int ds2781_get_temperature(struct ds2781_device_info *dev_info, 190 + int *temp) 202 191 { 203 192 int ret; 204 - s16 temperature_raw; 193 + char val[2]; 194 + int temp_raw; 205 195 196 + ret = w1_ds2781_read(dev_info, val, DS2781_TEMP_MSB, 2 * sizeof(u8)); 197 + if (ret < 0) 198 + return ret; 206 199 /* 207 200 * The temperature value is located in 10 bits across the temperature 208 201 * MSB and LSB registers in two's compliment form ··· 214 205 * Bits 2 - 0 of the temperature value are in bits 7 - 5 of the 215 206 * temperature LSB register 216 207 */ 217 - ret = ds2780_read16(dev_info, &temperature_raw, 218 - DS2780_TEMP_MSB_REG); 219 - if (ret < 0) 220 - return ret; 208 + temp_raw = ((val[0]) << 3) | 209 + (val[1] >> 5); 210 + *temp = temp_raw + (temp_raw / 4); 221 211 222 - /* 223 - * Temperature is measured in units of 0.125 degrees celcius, the 224 - * power_supply class measures temperature in tenths of degrees 225 - * celsius. The temperature value is stored as a 10 bit number, plus 226 - * sign in the upper bits of a 16 bit register. 227 - */ 228 - *temperature = ((temperature_raw / 32) * 125) / 100; 229 212 return 0; 230 213 } 231 214 232 - static int ds2780_get_current(struct ds2780_device_info *dev_info, 215 + static int ds2781_get_current(struct ds2781_device_info *dev_info, 233 216 enum current_types type, int *current_uA) 234 217 { 235 218 int ret, sense_res; ··· 232 231 * The units of measurement for current are dependent on the value of 233 232 * the sense resistor. 234 233 */ 235 - ret = ds2780_read8(dev_info, &sense_res_raw, DS2780_RSNSP_REG); 234 + ret = ds2781_read8(dev_info, &sense_res_raw, DS2781_RSNSP); 236 235 if (ret < 0) 237 236 return ret; 238 237 ··· 243 242 sense_res = 1000 / sense_res_raw; 244 243 245 244 if (type == CURRENT_NOW) 246 - reg_msb = DS2780_CURRENT_MSB_REG; 245 + reg_msb = DS2781_CURRENT_MSB; 247 246 else if (type == CURRENT_AVG) 248 - reg_msb = DS2780_IAVG_MSB_REG; 247 + reg_msb = DS2781_IAVG_MSB; 249 248 else 250 249 return -EINVAL; 251 250 ··· 258 257 * Bits 7 - 0 of the current value are in bits 7 - 0 of the current 259 258 * LSB register 260 259 */ 261 - ret = ds2780_read16(dev_info, &current_raw, reg_msb); 260 + ret = ds2781_read16(dev_info, &current_raw, reg_msb); 262 261 if (ret < 0) 263 262 return ret; 264 263 265 - *current_uA = current_raw * (DS2780_CURRENT_UNITS / sense_res); 264 + *current_uA = current_raw * (DS2781_CURRENT_UNITS / sense_res); 266 265 return 0; 267 266 } 268 267 269 - static int ds2780_get_accumulated_current(struct ds2780_device_info *dev_info, 268 + static int ds2781_get_accumulated_current(struct ds2781_device_info *dev_info, 270 269 int *accumulated_current) 271 270 { 272 271 int ret, sense_res; ··· 277 276 * The units of measurement for accumulated current are dependent on 278 277 * the value of the sense resistor. 279 278 */ 280 - ret = ds2780_read8(dev_info, &sense_res_raw, DS2780_RSNSP_REG); 279 + ret = ds2781_read8(dev_info, &sense_res_raw, DS2781_RSNSP); 281 280 if (ret < 0) 282 281 return ret; 283 282 284 283 if (sense_res_raw == 0) { 285 284 dev_err(dev_info->dev, "sense resistor value is 0\n"); 286 - return -ENXIO; 285 + return -EINVAL; 287 286 } 288 287 sense_res = 1000 / sense_res_raw; 289 288 ··· 295 294 * Bits 7 - 0 of the ACR value are in bits 7 - 0 of the ACR 296 295 * LSB register 297 296 */ 298 - ret = ds2780_read16(dev_info, &current_raw, DS2780_ACR_MSB_REG); 297 + ret = ds2781_read16(dev_info, &current_raw, DS2781_ACR_MSB); 299 298 if (ret < 0) 300 299 return ret; 301 300 302 - *accumulated_current = current_raw * (DS2780_CHARGE_UNITS / sense_res); 301 + *accumulated_current = current_raw * (DS2781_CHARGE_UNITS / sense_res); 303 302 return 0; 304 303 } 305 304 306 - static int ds2780_get_capacity(struct ds2780_device_info *dev_info, 305 + static int ds2781_get_capacity(struct ds2781_device_info *dev_info, 307 306 int *capacity) 308 307 { 309 308 int ret; 310 309 u8 raw; 311 310 312 - ret = ds2780_read8(dev_info, &raw, DS2780_RARC_REG); 311 + ret = ds2781_read8(dev_info, &raw, DS2781_RARC); 313 312 if (ret < 0) 314 313 return ret; 315 314 316 315 *capacity = raw; 317 - return raw; 318 - } 319 - 320 - static int ds2780_get_status(struct ds2780_device_info *dev_info, int *status) 321 - { 322 - int ret, current_uA, capacity; 323 - 324 - ret = ds2780_get_current(dev_info, CURRENT_NOW, &current_uA); 325 - if (ret < 0) 326 - return ret; 327 - 328 - ret = ds2780_get_capacity(dev_info, &capacity); 329 - if (ret < 0) 330 - return ret; 331 - 332 - if (capacity == 100) 333 - *status = POWER_SUPPLY_STATUS_FULL; 334 - else if (current_uA == 0) 335 - *status = POWER_SUPPLY_STATUS_NOT_CHARGING; 336 - else if (current_uA < 0) 337 - *status = POWER_SUPPLY_STATUS_DISCHARGING; 338 - else 339 - *status = POWER_SUPPLY_STATUS_CHARGING; 340 - 341 316 return 0; 342 317 } 343 318 344 - static int ds2780_get_charge_now(struct ds2780_device_info *dev_info, 319 + static int ds2781_get_status(struct ds2781_device_info *dev_info, int *status) 320 + { 321 + int ret, current_uA, capacity; 322 + 323 + ret = ds2781_get_current(dev_info, CURRENT_NOW, &current_uA); 324 + if (ret < 0) 325 + return ret; 326 + 327 + ret = ds2781_get_capacity(dev_info, &capacity); 328 + if (ret < 0) 329 + return ret; 330 + 331 + if (power_supply_am_i_supplied(dev_info->bat)) { 332 + if (capacity == 100) 333 + *status = POWER_SUPPLY_STATUS_FULL; 334 + else if (current_uA > 50000) 335 + *status = POWER_SUPPLY_STATUS_CHARGING; 336 + else 337 + *status = POWER_SUPPLY_STATUS_NOT_CHARGING; 338 + } else { 339 + *status = POWER_SUPPLY_STATUS_DISCHARGING; 340 + } 341 + return 0; 342 + } 343 + 344 + static int ds2781_get_charge_now(struct ds2781_device_info *dev_info, 345 345 int *charge_now) 346 346 { 347 347 int ret; ··· 356 354 * Bits 7 - 0 of the RAAC value are in bits 7 - 0 of the RAAC 357 355 * LSB register 358 356 */ 359 - ret = ds2780_read16(dev_info, &charge_raw, DS2780_RAAC_MSB_REG); 357 + ret = ds2781_read16(dev_info, &charge_raw, DS2781_RAAC_MSB); 360 358 if (ret < 0) 361 359 return ret; 362 360 ··· 364 362 return 0; 365 363 } 366 364 367 - static int ds2780_get_control_register(struct ds2780_device_info *dev_info, 365 + static int ds2781_get_control_register(struct ds2781_device_info *dev_info, 368 366 u8 *control_reg) 369 367 { 370 - return ds2780_read8(dev_info, control_reg, DS2780_CONTROL_REG); 368 + return ds2781_read8(dev_info, control_reg, DS2781_CONTROL); 371 369 } 372 370 373 - static int ds2780_set_control_register(struct ds2780_device_info *dev_info, 371 + static int ds2781_set_control_register(struct ds2781_device_info *dev_info, 374 372 u8 control_reg) 375 373 { 376 374 int ret; 377 375 378 - ret = ds2780_write(dev_info, &control_reg, 379 - DS2780_CONTROL_REG, sizeof(u8)); 376 + ret = ds2781_write(dev_info, &control_reg, 377 + DS2781_CONTROL, sizeof(u8)); 380 378 if (ret < 0) 381 379 return ret; 382 380 383 - return ds2780_save_eeprom(dev_info, DS2780_CONTROL_REG); 381 + return ds2781_save_eeprom(dev_info, DS2781_CONTROL); 384 382 } 385 383 386 - static int ds2780_battery_get_property(struct power_supply *psy, 384 + static int ds2781_battery_get_property(struct power_supply *psy, 387 385 enum power_supply_property psp, 388 386 union power_supply_propval *val) 389 387 { 390 388 int ret = 0; 391 - struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 389 + struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 392 390 393 391 switch (psp) { 394 392 case POWER_SUPPLY_PROP_VOLTAGE_NOW: 395 - ret = ds2780_get_voltage(dev_info, &val->intval); 393 + ret = ds2781_get_voltage(dev_info, &val->intval); 396 394 break; 397 395 398 396 case POWER_SUPPLY_PROP_TEMP: 399 - ret = ds2780_get_temperature(dev_info, &val->intval); 397 + ret = ds2781_get_temperature(dev_info, &val->intval); 400 398 break; 401 399 402 400 case POWER_SUPPLY_PROP_MODEL_NAME: ··· 408 406 break; 409 407 410 408 case POWER_SUPPLY_PROP_CURRENT_NOW: 411 - ret = ds2780_get_current(dev_info, CURRENT_NOW, &val->intval); 409 + ret = ds2781_get_current(dev_info, CURRENT_NOW, &val->intval); 412 410 break; 413 411 414 412 case POWER_SUPPLY_PROP_CURRENT_AVG: 415 - ret = ds2780_get_current(dev_info, CURRENT_AVG, &val->intval); 413 + ret = ds2781_get_current(dev_info, CURRENT_AVG, &val->intval); 416 414 break; 417 415 418 416 case POWER_SUPPLY_PROP_STATUS: 419 - ret = ds2780_get_status(dev_info, &val->intval); 417 + ret = ds2781_get_status(dev_info, &val->intval); 420 418 break; 421 419 422 420 case POWER_SUPPLY_PROP_CAPACITY: 423 - ret = ds2780_get_capacity(dev_info, &val->intval); 421 + ret = ds2781_get_capacity(dev_info, &val->intval); 424 422 break; 425 423 426 424 case POWER_SUPPLY_PROP_CHARGE_COUNTER: 427 - ret = ds2780_get_accumulated_current(dev_info, &val->intval); 425 + ret = ds2781_get_accumulated_current(dev_info, &val->intval); 428 426 break; 429 427 430 428 case POWER_SUPPLY_PROP_CHARGE_NOW: 431 - ret = ds2780_get_charge_now(dev_info, &val->intval); 429 + ret = ds2781_get_charge_now(dev_info, &val->intval); 432 430 break; 433 431 434 432 default: ··· 438 436 return ret; 439 437 } 440 438 441 - static enum power_supply_property ds2780_battery_props[] = { 439 + static enum power_supply_property ds2781_battery_props[] = { 442 440 POWER_SUPPLY_PROP_STATUS, 443 441 POWER_SUPPLY_PROP_VOLTAGE_NOW, 444 442 POWER_SUPPLY_PROP_TEMP, ··· 451 449 POWER_SUPPLY_PROP_CHARGE_NOW, 452 450 }; 453 451 454 - static ssize_t ds2780_get_pmod_enabled(struct device *dev, 452 + static ssize_t ds2781_get_pmod_enabled(struct device *dev, 455 453 struct device_attribute *attr, 456 454 char *buf) 457 455 { 458 456 int ret; 459 457 u8 control_reg; 460 458 struct power_supply *psy = to_power_supply(dev); 461 - struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 459 + struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 462 460 463 461 /* Get power mode */ 464 - ret = ds2780_get_control_register(dev_info, &control_reg); 462 + ret = ds2781_get_control_register(dev_info, &control_reg); 465 463 if (ret < 0) 466 464 return ret; 467 465 468 466 return sprintf(buf, "%d\n", 469 - !!(control_reg & DS2780_CONTROL_REG_PMOD)); 467 + !!(control_reg & DS2781_CONTROL_PMOD)); 470 468 } 471 469 472 - static ssize_t ds2780_set_pmod_enabled(struct device *dev, 470 + static ssize_t ds2781_set_pmod_enabled(struct device *dev, 473 471 struct device_attribute *attr, 474 472 const char *buf, 475 473 size_t count) ··· 477 475 int ret; 478 476 u8 control_reg, new_setting; 479 477 struct power_supply *psy = to_power_supply(dev); 480 - struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 478 + struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 481 479 482 480 /* Set power mode */ 483 - ret = ds2780_get_control_register(dev_info, &control_reg); 481 + ret = ds2781_get_control_register(dev_info, &control_reg); 484 482 if (ret < 0) 485 483 return ret; 486 484 ··· 494 492 } 495 493 496 494 if (new_setting) 497 - control_reg |= DS2780_CONTROL_REG_PMOD; 495 + control_reg |= DS2781_CONTROL_PMOD; 498 496 else 499 - control_reg &= ~DS2780_CONTROL_REG_PMOD; 497 + control_reg &= ~DS2781_CONTROL_PMOD; 500 498 501 - ret = ds2780_set_control_register(dev_info, control_reg); 499 + ret = ds2781_set_control_register(dev_info, control_reg); 502 500 if (ret < 0) 503 501 return ret; 504 502 505 503 return count; 506 504 } 507 505 508 - static ssize_t ds2780_get_sense_resistor_value(struct device *dev, 506 + static ssize_t ds2781_get_sense_resistor_value(struct device *dev, 509 507 struct device_attribute *attr, 510 508 char *buf) 511 509 { 512 510 int ret; 513 511 u8 sense_resistor; 514 512 struct power_supply *psy = to_power_supply(dev); 515 - struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 513 + struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 516 514 517 - ret = ds2780_read8(dev_info, &sense_resistor, DS2780_RSNSP_REG); 515 + ret = ds2781_read8(dev_info, &sense_resistor, DS2781_RSNSP); 518 516 if (ret < 0) 519 517 return ret; 520 518 ··· 522 520 return ret; 523 521 } 524 522 525 - static ssize_t ds2780_set_sense_resistor_value(struct device *dev, 523 + static ssize_t ds2781_set_sense_resistor_value(struct device *dev, 526 524 struct device_attribute *attr, 527 525 const char *buf, 528 526 size_t count) ··· 530 528 int ret; 531 529 u8 new_setting; 532 530 struct power_supply *psy = to_power_supply(dev); 533 - struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 531 + struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 534 532 535 533 ret = kstrtou8(buf, 0, &new_setting); 536 534 if (ret < 0) 537 535 return ret; 538 536 539 - ret = ds2780_set_sense_register(dev_info, new_setting); 537 + ret = ds2781_set_sense_register(dev_info, new_setting); 540 538 if (ret < 0) 541 539 return ret; 542 540 543 541 return count; 544 542 } 545 543 546 - static ssize_t ds2780_get_rsgain_setting(struct device *dev, 544 + static ssize_t ds2781_get_rsgain_setting(struct device *dev, 547 545 struct device_attribute *attr, 548 546 char *buf) 549 547 { 550 548 int ret; 551 549 u16 rsgain; 552 550 struct power_supply *psy = to_power_supply(dev); 553 - struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 551 + struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 554 552 555 - ret = ds2780_get_rsgain_register(dev_info, &rsgain); 553 + ret = ds2781_get_rsgain_register(dev_info, &rsgain); 556 554 if (ret < 0) 557 555 return ret; 558 556 559 557 return sprintf(buf, "%d\n", rsgain); 560 558 } 561 559 562 - static ssize_t ds2780_set_rsgain_setting(struct device *dev, 560 + static ssize_t ds2781_set_rsgain_setting(struct device *dev, 563 561 struct device_attribute *attr, 564 562 const char *buf, 565 563 size_t count) ··· 567 565 int ret; 568 566 u16 new_setting; 569 567 struct power_supply *psy = to_power_supply(dev); 570 - struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 568 + struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 571 569 572 570 ret = kstrtou16(buf, 0, &new_setting); 573 571 if (ret < 0) ··· 579 577 return -EINVAL; 580 578 } 581 579 582 - ret = ds2780_set_rsgain_register(dev_info, new_setting); 580 + ret = ds2781_set_rsgain_register(dev_info, new_setting); 583 581 if (ret < 0) 584 582 return ret; 585 583 586 584 return count; 587 585 } 588 586 589 - static ssize_t ds2780_get_pio_pin(struct device *dev, 587 + static ssize_t ds2781_get_pio_pin(struct device *dev, 590 588 struct device_attribute *attr, 591 589 char *buf) 592 590 { 593 591 int ret; 594 592 u8 sfr; 595 593 struct power_supply *psy = to_power_supply(dev); 596 - struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 594 + struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 597 595 598 - ret = ds2780_read8(dev_info, &sfr, DS2780_SFR_REG); 596 + ret = ds2781_read8(dev_info, &sfr, DS2781_SFR); 599 597 if (ret < 0) 600 598 return ret; 601 599 602 - ret = sprintf(buf, "%d\n", sfr & DS2780_SFR_REG_PIOSC); 600 + ret = sprintf(buf, "%d\n", sfr & DS2781_SFR_PIOSC); 603 601 return ret; 604 602 } 605 603 606 - static ssize_t ds2780_set_pio_pin(struct device *dev, 604 + static ssize_t ds2781_set_pio_pin(struct device *dev, 607 605 struct device_attribute *attr, 608 606 const char *buf, 609 607 size_t count) ··· 611 609 int ret; 612 610 u8 new_setting; 613 611 struct power_supply *psy = to_power_supply(dev); 614 - struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 612 + struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 615 613 616 614 ret = kstrtou8(buf, 0, &new_setting); 617 615 if (ret < 0) ··· 622 620 return -EINVAL; 623 621 } 624 622 625 - ret = ds2780_write(dev_info, &new_setting, 626 - DS2780_SFR_REG, sizeof(u8)); 623 + ret = ds2781_write(dev_info, &new_setting, 624 + DS2781_SFR, sizeof(u8)); 627 625 if (ret < 0) 628 626 return ret; 629 627 630 628 return count; 631 629 } 632 630 633 - static ssize_t ds2780_read_param_eeprom_bin(struct file *filp, 631 + static ssize_t ds2781_read_param_eeprom_bin(struct file *filp, 634 632 struct kobject *kobj, 635 633 struct bin_attribute *bin_attr, 636 634 char *buf, loff_t off, size_t count) 637 635 { 638 636 struct device *dev = container_of(kobj, struct device, kobj); 639 637 struct power_supply *psy = to_power_supply(dev); 640 - struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 638 + struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 641 639 642 - return ds2780_read_block(dev_info, buf, 643 - DS2780_EEPROM_BLOCK1_START + off, count); 640 + return ds2781_read_block(dev_info, buf, 641 + DS2781_EEPROM_BLOCK1_START + off, count); 644 642 } 645 643 646 - static ssize_t ds2780_write_param_eeprom_bin(struct file *filp, 644 + static ssize_t ds2781_write_param_eeprom_bin(struct file *filp, 647 645 struct kobject *kobj, 648 646 struct bin_attribute *bin_attr, 649 647 char *buf, loff_t off, size_t count) 650 648 { 651 649 struct device *dev = container_of(kobj, struct device, kobj); 652 650 struct power_supply *psy = to_power_supply(dev); 653 - struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 651 + struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 654 652 int ret; 655 653 656 - ret = ds2780_write(dev_info, buf, 657 - DS2780_EEPROM_BLOCK1_START + off, count); 654 + ret = ds2781_write(dev_info, buf, 655 + DS2781_EEPROM_BLOCK1_START + off, count); 658 656 if (ret < 0) 659 657 return ret; 660 658 661 - ret = ds2780_save_eeprom(dev_info, DS2780_EEPROM_BLOCK1_START); 659 + ret = ds2781_save_eeprom(dev_info, DS2781_EEPROM_BLOCK1_START); 662 660 if (ret < 0) 663 661 return ret; 664 662 665 663 return count; 666 664 } 667 665 668 - static struct bin_attribute ds2780_param_eeprom_bin_attr = { 666 + static struct bin_attribute ds2781_param_eeprom_bin_attr = { 669 667 .attr = { 670 668 .name = "param_eeprom", 671 669 .mode = S_IRUGO | S_IWUSR, 672 670 }, 673 - .size = DS2780_PARAM_EEPROM_SIZE, 674 - .read = ds2780_read_param_eeprom_bin, 675 - .write = ds2780_write_param_eeprom_bin, 671 + .size = DS2781_PARAM_EEPROM_SIZE, 672 + .read = ds2781_read_param_eeprom_bin, 673 + .write = ds2781_write_param_eeprom_bin, 676 674 }; 677 675 678 - static ssize_t ds2780_read_user_eeprom_bin(struct file *filp, 676 + static ssize_t ds2781_read_user_eeprom_bin(struct file *filp, 679 677 struct kobject *kobj, 680 678 struct bin_attribute *bin_attr, 681 679 char *buf, loff_t off, size_t count) 682 680 { 683 681 struct device *dev = container_of(kobj, struct device, kobj); 684 682 struct power_supply *psy = to_power_supply(dev); 685 - struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 683 + struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 686 684 687 - return ds2780_read_block(dev_info, buf, 688 - DS2780_EEPROM_BLOCK0_START + off, count); 685 + return ds2781_read_block(dev_info, buf, 686 + DS2781_EEPROM_BLOCK0_START + off, count); 687 + 689 688 } 690 689 691 - static ssize_t ds2780_write_user_eeprom_bin(struct file *filp, 690 + static ssize_t ds2781_write_user_eeprom_bin(struct file *filp, 692 691 struct kobject *kobj, 693 692 struct bin_attribute *bin_attr, 694 693 char *buf, loff_t off, size_t count) 695 694 { 696 695 struct device *dev = container_of(kobj, struct device, kobj); 697 696 struct power_supply *psy = to_power_supply(dev); 698 - struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 697 + struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 699 698 int ret; 700 699 701 - ret = ds2780_write(dev_info, buf, 702 - DS2780_EEPROM_BLOCK0_START + off, count); 700 + ret = ds2781_write(dev_info, buf, 701 + DS2781_EEPROM_BLOCK0_START + off, count); 703 702 if (ret < 0) 704 703 return ret; 705 704 706 - ret = ds2780_save_eeprom(dev_info, DS2780_EEPROM_BLOCK0_START); 705 + ret = ds2781_save_eeprom(dev_info, DS2781_EEPROM_BLOCK0_START); 707 706 if (ret < 0) 708 707 return ret; 709 708 710 709 return count; 711 710 } 712 711 713 - static struct bin_attribute ds2780_user_eeprom_bin_attr = { 712 + static struct bin_attribute ds2781_user_eeprom_bin_attr = { 714 713 .attr = { 715 714 .name = "user_eeprom", 716 715 .mode = S_IRUGO | S_IWUSR, 717 716 }, 718 - .size = DS2780_USER_EEPROM_SIZE, 719 - .read = ds2780_read_user_eeprom_bin, 720 - .write = ds2780_write_user_eeprom_bin, 717 + .size = DS2781_USER_EEPROM_SIZE, 718 + .read = ds2781_read_user_eeprom_bin, 719 + .write = ds2781_write_user_eeprom_bin, 721 720 }; 722 721 723 - static DEVICE_ATTR(pmod_enabled, S_IRUGO | S_IWUSR, ds2780_get_pmod_enabled, 724 - ds2780_set_pmod_enabled); 722 + static DEVICE_ATTR(pmod_enabled, S_IRUGO | S_IWUSR, ds2781_get_pmod_enabled, 723 + ds2781_set_pmod_enabled); 725 724 static DEVICE_ATTR(sense_resistor_value, S_IRUGO | S_IWUSR, 726 - ds2780_get_sense_resistor_value, ds2780_set_sense_resistor_value); 727 - static DEVICE_ATTR(rsgain_setting, S_IRUGO | S_IWUSR, ds2780_get_rsgain_setting, 728 - ds2780_set_rsgain_setting); 729 - static DEVICE_ATTR(pio_pin, S_IRUGO | S_IWUSR, ds2780_get_pio_pin, 730 - ds2780_set_pio_pin); 725 + ds2781_get_sense_resistor_value, ds2781_set_sense_resistor_value); 726 + static DEVICE_ATTR(rsgain_setting, S_IRUGO | S_IWUSR, ds2781_get_rsgain_setting, 727 + ds2781_set_rsgain_setting); 728 + static DEVICE_ATTR(pio_pin, S_IRUGO | S_IWUSR, ds2781_get_pio_pin, 729 + ds2781_set_pio_pin); 731 730 732 731 733 - static struct attribute *ds2780_attributes[] = { 732 + static struct attribute *ds2781_attributes[] = { 734 733 &dev_attr_pmod_enabled.attr, 735 734 &dev_attr_sense_resistor_value.attr, 736 735 &dev_attr_rsgain_setting.attr, ··· 739 736 NULL 740 737 }; 741 738 742 - static const struct attribute_group ds2780_attr_group = { 743 - .attrs = ds2780_attributes, 739 + static const struct attribute_group ds2781_attr_group = { 740 + .attrs = ds2781_attributes, 744 741 }; 745 742 746 - static int ds2780_battery_probe(struct platform_device *pdev) 743 + static int ds2781_battery_probe(struct platform_device *pdev) 747 744 { 748 745 struct power_supply_config psy_cfg = {}; 749 746 int ret = 0; 750 - struct ds2780_device_info *dev_info; 747 + struct ds2781_device_info *dev_info; 751 748 752 749 dev_info = devm_kzalloc(&pdev->dev, sizeof(*dev_info), GFP_KERNEL); 753 - if (!dev_info) { 754 - ret = -ENOMEM; 755 - goto fail; 756 - } 750 + if (!dev_info) 751 + return -ENOMEM; 757 752 758 753 platform_set_drvdata(pdev, dev_info); 759 754 ··· 759 758 dev_info->w1_dev = pdev->dev.parent; 760 759 dev_info->bat_desc.name = dev_name(&pdev->dev); 761 760 dev_info->bat_desc.type = POWER_SUPPLY_TYPE_BATTERY; 762 - dev_info->bat_desc.properties = ds2780_battery_props; 763 - dev_info->bat_desc.num_properties = ARRAY_SIZE(ds2780_battery_props); 764 - dev_info->bat_desc.get_property = ds2780_battery_get_property; 761 + dev_info->bat_desc.properties = ds2781_battery_props; 762 + dev_info->bat_desc.num_properties = ARRAY_SIZE(ds2781_battery_props); 763 + dev_info->bat_desc.get_property = ds2781_battery_get_property; 765 764 766 765 psy_cfg.drv_data = dev_info; 767 766 768 767 dev_info->bat = power_supply_register(&pdev->dev, &dev_info->bat_desc, 769 - &psy_cfg); 768 + &psy_cfg); 770 769 if (IS_ERR(dev_info->bat)) { 771 770 dev_err(dev_info->dev, "failed to register battery\n"); 772 771 ret = PTR_ERR(dev_info->bat); 773 772 goto fail; 774 773 } 775 774 776 - ret = sysfs_create_group(&dev_info->bat->dev.kobj, &ds2780_attr_group); 775 + ret = sysfs_create_group(&dev_info->bat->dev.kobj, &ds2781_attr_group); 777 776 if (ret) { 778 777 dev_err(dev_info->dev, "failed to create sysfs group\n"); 779 778 goto fail_unregister; 780 779 } 781 780 782 781 ret = sysfs_create_bin_file(&dev_info->bat->dev.kobj, 783 - &ds2780_param_eeprom_bin_attr); 782 + &ds2781_param_eeprom_bin_attr); 784 783 if (ret) { 785 784 dev_err(dev_info->dev, 786 785 "failed to create param eeprom bin file"); ··· 788 787 } 789 788 790 789 ret = sysfs_create_bin_file(&dev_info->bat->dev.kobj, 791 - &ds2780_user_eeprom_bin_attr); 790 + &ds2781_user_eeprom_bin_attr); 792 791 if (ret) { 793 792 dev_err(dev_info->dev, 794 793 "failed to create user eeprom bin file"); ··· 799 798 800 799 fail_remove_bin_file: 801 800 sysfs_remove_bin_file(&dev_info->bat->dev.kobj, 802 - &ds2780_param_eeprom_bin_attr); 801 + &ds2781_param_eeprom_bin_attr); 803 802 fail_remove_group: 804 - sysfs_remove_group(&dev_info->bat->dev.kobj, &ds2780_attr_group); 803 + sysfs_remove_group(&dev_info->bat->dev.kobj, &ds2781_attr_group); 805 804 fail_unregister: 806 805 power_supply_unregister(dev_info->bat); 807 806 fail: 808 807 return ret; 809 808 } 810 809 811 - static int ds2780_battery_remove(struct platform_device *pdev) 810 + static int ds2781_battery_remove(struct platform_device *pdev) 812 811 { 813 - struct ds2780_device_info *dev_info = platform_get_drvdata(pdev); 812 + struct ds2781_device_info *dev_info = platform_get_drvdata(pdev); 814 813 815 814 /* 816 815 * Remove attributes before unregistering power supply 817 816 * because 'bat' will be freed on power_supply_unregister() call. 818 817 */ 819 - sysfs_remove_group(&dev_info->bat->dev.kobj, &ds2780_attr_group); 818 + sysfs_remove_group(&dev_info->bat->dev.kobj, &ds2781_attr_group); 820 819 821 820 power_supply_unregister(dev_info->bat); 822 821 823 822 return 0; 824 823 } 825 824 826 - static struct platform_driver ds2780_battery_driver = { 825 + static struct platform_driver ds2781_battery_driver = { 827 826 .driver = { 828 - .name = "ds2780-battery", 827 + .name = "ds2781-battery", 829 828 }, 830 - .probe = ds2780_battery_probe, 831 - .remove = ds2780_battery_remove, 829 + .probe = ds2781_battery_probe, 830 + .remove = ds2781_battery_remove, 832 831 }; 833 - 834 - module_platform_driver(ds2780_battery_driver); 832 + module_platform_driver(ds2781_battery_driver); 835 833 836 834 MODULE_LICENSE("GPL"); 837 - MODULE_AUTHOR("Clifton Barnes <cabarnes@indesign-llc.com>"); 838 - MODULE_DESCRIPTION("Maxim/Dallas DS2780 Stand-Alone Fuel Gauage IC driver"); 839 - MODULE_ALIAS("platform:ds2780-battery"); 835 + MODULE_AUTHOR("Renata Sayakhova <renata@oktetlabs.ru>"); 836 + MODULE_DESCRIPTION("Maxim/Dallas DS2781 Stand-Alone Fuel Gauage IC driver"); 837 + MODULE_ALIAS("platform:ds2781-battery"); 838 +
+206 -207
drivers/power/ds2781_battery.c drivers/power/supply/ds2780_battery.c
··· 1 1 /* 2 - * 1-wire client/driver for the Maxim/Dallas DS2781 Stand-Alone Fuel Gauge IC 2 + * 1-wire client/driver for the Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC 3 3 * 4 - * Author: Renata Sayakhova <renata@oktetlabs.ru> 4 + * Copyright (C) 2010 Indesign, LLC 5 5 * 6 - * Based on ds2780_battery drivers 6 + * Author: Clifton Barnes <cabarnes@indesign-llc.com> 7 + * 8 + * Based on ds2760_battery and ds2782_battery drivers 7 9 * 8 10 * This program is free software; you can redistribute it and/or modify 9 11 * it under the terms of the GNU General Public License version 2 as ··· 21 19 #include <linux/power_supply.h> 22 20 #include <linux/idr.h> 23 21 24 - #include "../w1/w1.h" 25 - #include "../w1/slaves/w1_ds2781.h" 22 + #include "../../w1/w1.h" 23 + #include "../../w1/slaves/w1_ds2780.h" 26 24 27 25 /* Current unit measurement in uA for a 1 milli-ohm sense resistor */ 28 - #define DS2781_CURRENT_UNITS 1563 26 + #define DS2780_CURRENT_UNITS 1563 29 27 /* Charge unit measurement in uAh for a 1 milli-ohm sense resistor */ 30 - #define DS2781_CHARGE_UNITS 6250 28 + #define DS2780_CHARGE_UNITS 6250 31 29 /* Number of bytes in user EEPROM space */ 32 - #define DS2781_USER_EEPROM_SIZE (DS2781_EEPROM_BLOCK0_END - \ 33 - DS2781_EEPROM_BLOCK0_START + 1) 30 + #define DS2780_USER_EEPROM_SIZE (DS2780_EEPROM_BLOCK0_END - \ 31 + DS2780_EEPROM_BLOCK0_START + 1) 34 32 /* Number of bytes in parameter EEPROM space */ 35 - #define DS2781_PARAM_EEPROM_SIZE (DS2781_EEPROM_BLOCK1_END - \ 36 - DS2781_EEPROM_BLOCK1_START + 1) 33 + #define DS2780_PARAM_EEPROM_SIZE (DS2780_EEPROM_BLOCK1_END - \ 34 + DS2780_EEPROM_BLOCK1_START + 1) 37 35 38 - struct ds2781_device_info { 36 + struct ds2780_device_info { 39 37 struct device *dev; 40 38 struct power_supply *bat; 41 39 struct power_supply_desc bat_desc; ··· 47 45 CURRENT_AVG, 48 46 }; 49 47 50 - static const char model[] = "DS2781"; 48 + static const char model[] = "DS2780"; 51 49 static const char manufacturer[] = "Maxim/Dallas"; 52 50 53 - static inline struct ds2781_device_info * 54 - to_ds2781_device_info(struct power_supply *psy) 51 + static inline struct ds2780_device_info * 52 + to_ds2780_device_info(struct power_supply *psy) 55 53 { 56 54 return power_supply_get_drvdata(psy); 57 55 } ··· 61 59 return dev_get_drvdata(dev); 62 60 } 63 61 64 - static inline int ds2781_battery_io(struct ds2781_device_info *dev_info, 62 + static inline int ds2780_battery_io(struct ds2780_device_info *dev_info, 65 63 char *buf, int addr, size_t count, int io) 66 64 { 67 - return w1_ds2781_io(dev_info->w1_dev, buf, addr, count, io); 65 + return w1_ds2780_io(dev_info->w1_dev, buf, addr, count, io); 68 66 } 69 67 70 - static int w1_ds2781_read(struct ds2781_device_info *dev_info, char *buf, 71 - int addr, size_t count) 72 - { 73 - return ds2781_battery_io(dev_info, buf, addr, count, 0); 74 - } 75 - 76 - static inline int ds2781_read8(struct ds2781_device_info *dev_info, u8 *val, 68 + static inline int ds2780_read8(struct ds2780_device_info *dev_info, u8 *val, 77 69 int addr) 78 70 { 79 - return ds2781_battery_io(dev_info, val, addr, sizeof(u8), 0); 71 + return ds2780_battery_io(dev_info, val, addr, sizeof(u8), 0); 80 72 } 81 73 82 - static int ds2781_read16(struct ds2781_device_info *dev_info, s16 *val, 74 + static int ds2780_read16(struct ds2780_device_info *dev_info, s16 *val, 83 75 int addr) 84 76 { 85 77 int ret; 86 78 u8 raw[2]; 87 79 88 - ret = ds2781_battery_io(dev_info, raw, addr, sizeof(raw), 0); 80 + ret = ds2780_battery_io(dev_info, raw, addr, sizeof(raw), 0); 89 81 if (ret < 0) 90 82 return ret; 91 83 ··· 88 92 return 0; 89 93 } 90 94 91 - static inline int ds2781_read_block(struct ds2781_device_info *dev_info, 95 + static inline int ds2780_read_block(struct ds2780_device_info *dev_info, 92 96 u8 *val, int addr, size_t count) 93 97 { 94 - return ds2781_battery_io(dev_info, val, addr, count, 0); 98 + return ds2780_battery_io(dev_info, val, addr, count, 0); 95 99 } 96 100 97 - static inline int ds2781_write(struct ds2781_device_info *dev_info, u8 *val, 101 + static inline int ds2780_write(struct ds2780_device_info *dev_info, u8 *val, 98 102 int addr, size_t count) 99 103 { 100 - return ds2781_battery_io(dev_info, val, addr, count, 1); 104 + return ds2780_battery_io(dev_info, val, addr, count, 1); 101 105 } 102 106 103 - static inline int ds2781_store_eeprom(struct device *dev, int addr) 107 + static inline int ds2780_store_eeprom(struct device *dev, int addr) 104 108 { 105 - return w1_ds2781_eeprom_cmd(dev, addr, W1_DS2781_COPY_DATA); 109 + return w1_ds2780_eeprom_cmd(dev, addr, W1_DS2780_COPY_DATA); 106 110 } 107 111 108 - static inline int ds2781_recall_eeprom(struct device *dev, int addr) 112 + static inline int ds2780_recall_eeprom(struct device *dev, int addr) 109 113 { 110 - return w1_ds2781_eeprom_cmd(dev, addr, W1_DS2781_RECALL_DATA); 114 + return w1_ds2780_eeprom_cmd(dev, addr, W1_DS2780_RECALL_DATA); 111 115 } 112 116 113 - static int ds2781_save_eeprom(struct ds2781_device_info *dev_info, int reg) 117 + static int ds2780_save_eeprom(struct ds2780_device_info *dev_info, int reg) 114 118 { 115 119 int ret; 116 120 117 - ret = ds2781_store_eeprom(dev_info->w1_dev, reg); 121 + ret = ds2780_store_eeprom(dev_info->w1_dev, reg); 118 122 if (ret < 0) 119 123 return ret; 120 124 121 - ret = ds2781_recall_eeprom(dev_info->w1_dev, reg); 125 + ret = ds2780_recall_eeprom(dev_info->w1_dev, reg); 122 126 if (ret < 0) 123 127 return ret; 124 128 ··· 126 130 } 127 131 128 132 /* Set sense resistor value in mhos */ 129 - static int ds2781_set_sense_register(struct ds2781_device_info *dev_info, 133 + static int ds2780_set_sense_register(struct ds2780_device_info *dev_info, 130 134 u8 conductance) 131 135 { 132 136 int ret; 133 137 134 - ret = ds2781_write(dev_info, &conductance, 135 - DS2781_RSNSP, sizeof(u8)); 138 + ret = ds2780_write(dev_info, &conductance, 139 + DS2780_RSNSP_REG, sizeof(u8)); 136 140 if (ret < 0) 137 141 return ret; 138 142 139 - return ds2781_save_eeprom(dev_info, DS2781_RSNSP); 143 + return ds2780_save_eeprom(dev_info, DS2780_RSNSP_REG); 140 144 } 141 145 142 146 /* Get RSGAIN value from 0 to 1.999 in steps of 0.001 */ 143 - static int ds2781_get_rsgain_register(struct ds2781_device_info *dev_info, 147 + static int ds2780_get_rsgain_register(struct ds2780_device_info *dev_info, 144 148 u16 *rsgain) 145 149 { 146 - return ds2781_read16(dev_info, rsgain, DS2781_RSGAIN_MSB); 150 + return ds2780_read16(dev_info, rsgain, DS2780_RSGAIN_MSB_REG); 147 151 } 148 152 149 153 /* Set RSGAIN value from 0 to 1.999 in steps of 0.001 */ 150 - static int ds2781_set_rsgain_register(struct ds2781_device_info *dev_info, 154 + static int ds2780_set_rsgain_register(struct ds2780_device_info *dev_info, 151 155 u16 rsgain) 152 156 { 153 157 int ret; 154 158 u8 raw[] = {rsgain >> 8, rsgain & 0xFF}; 155 159 156 - ret = ds2781_write(dev_info, raw, 157 - DS2781_RSGAIN_MSB, sizeof(raw)); 160 + ret = ds2780_write(dev_info, raw, 161 + DS2780_RSGAIN_MSB_REG, sizeof(raw)); 158 162 if (ret < 0) 159 163 return ret; 160 164 161 - return ds2781_save_eeprom(dev_info, DS2781_RSGAIN_MSB); 165 + return ds2780_save_eeprom(dev_info, DS2780_RSGAIN_MSB_REG); 162 166 } 163 167 164 - static int ds2781_get_voltage(struct ds2781_device_info *dev_info, 168 + static int ds2780_get_voltage(struct ds2780_device_info *dev_info, 165 169 int *voltage_uV) 166 170 { 167 171 int ret; 168 - char val[2]; 169 - int voltage_raw; 172 + s16 voltage_raw; 170 173 171 - ret = w1_ds2781_read(dev_info, val, DS2781_VOLT_MSB, 2 * sizeof(u8)); 172 - if (ret < 0) 173 - return ret; 174 174 /* 175 175 * The voltage value is located in 10 bits across the voltage MSB 176 176 * and LSB registers in two's compliment form ··· 176 184 * Bits 2 - 0 of the voltage value are in bits 7 - 5 of the 177 185 * voltage LSB register 178 186 */ 179 - voltage_raw = (val[0] << 3) | 180 - (val[1] >> 5); 187 + ret = ds2780_read16(dev_info, &voltage_raw, 188 + DS2780_VOLT_MSB_REG); 189 + if (ret < 0) 190 + return ret; 181 191 182 - /* DS2781 reports voltage in units of 9.76mV, but the battery class 183 - * reports in units of uV, so convert by multiplying by 9760. */ 184 - *voltage_uV = voltage_raw * 9760; 185 - 192 + /* 193 + * DS2780 reports voltage in units of 4.88mV, but the battery class 194 + * reports in units of uV, so convert by multiplying by 4880. 195 + */ 196 + *voltage_uV = (voltage_raw / 32) * 4880; 186 197 return 0; 187 198 } 188 199 189 - static int ds2781_get_temperature(struct ds2781_device_info *dev_info, 190 - int *temp) 200 + static int ds2780_get_temperature(struct ds2780_device_info *dev_info, 201 + int *temperature) 191 202 { 192 203 int ret; 193 - char val[2]; 194 - int temp_raw; 204 + s16 temperature_raw; 195 205 196 - ret = w1_ds2781_read(dev_info, val, DS2781_TEMP_MSB, 2 * sizeof(u8)); 197 - if (ret < 0) 198 - return ret; 199 206 /* 200 207 * The temperature value is located in 10 bits across the temperature 201 208 * MSB and LSB registers in two's compliment form ··· 205 214 * Bits 2 - 0 of the temperature value are in bits 7 - 5 of the 206 215 * temperature LSB register 207 216 */ 208 - temp_raw = ((val[0]) << 3) | 209 - (val[1] >> 5); 210 - *temp = temp_raw + (temp_raw / 4); 217 + ret = ds2780_read16(dev_info, &temperature_raw, 218 + DS2780_TEMP_MSB_REG); 219 + if (ret < 0) 220 + return ret; 211 221 222 + /* 223 + * Temperature is measured in units of 0.125 degrees celcius, the 224 + * power_supply class measures temperature in tenths of degrees 225 + * celsius. The temperature value is stored as a 10 bit number, plus 226 + * sign in the upper bits of a 16 bit register. 227 + */ 228 + *temperature = ((temperature_raw / 32) * 125) / 100; 212 229 return 0; 213 230 } 214 231 215 - static int ds2781_get_current(struct ds2781_device_info *dev_info, 232 + static int ds2780_get_current(struct ds2780_device_info *dev_info, 216 233 enum current_types type, int *current_uA) 217 234 { 218 235 int ret, sense_res; ··· 231 232 * The units of measurement for current are dependent on the value of 232 233 * the sense resistor. 233 234 */ 234 - ret = ds2781_read8(dev_info, &sense_res_raw, DS2781_RSNSP); 235 + ret = ds2780_read8(dev_info, &sense_res_raw, DS2780_RSNSP_REG); 235 236 if (ret < 0) 236 237 return ret; 237 238 ··· 242 243 sense_res = 1000 / sense_res_raw; 243 244 244 245 if (type == CURRENT_NOW) 245 - reg_msb = DS2781_CURRENT_MSB; 246 + reg_msb = DS2780_CURRENT_MSB_REG; 246 247 else if (type == CURRENT_AVG) 247 - reg_msb = DS2781_IAVG_MSB; 248 + reg_msb = DS2780_IAVG_MSB_REG; 248 249 else 249 250 return -EINVAL; 250 251 ··· 257 258 * Bits 7 - 0 of the current value are in bits 7 - 0 of the current 258 259 * LSB register 259 260 */ 260 - ret = ds2781_read16(dev_info, &current_raw, reg_msb); 261 + ret = ds2780_read16(dev_info, &current_raw, reg_msb); 261 262 if (ret < 0) 262 263 return ret; 263 264 264 - *current_uA = current_raw * (DS2781_CURRENT_UNITS / sense_res); 265 + *current_uA = current_raw * (DS2780_CURRENT_UNITS / sense_res); 265 266 return 0; 266 267 } 267 268 268 - static int ds2781_get_accumulated_current(struct ds2781_device_info *dev_info, 269 + static int ds2780_get_accumulated_current(struct ds2780_device_info *dev_info, 269 270 int *accumulated_current) 270 271 { 271 272 int ret, sense_res; ··· 276 277 * The units of measurement for accumulated current are dependent on 277 278 * the value of the sense resistor. 278 279 */ 279 - ret = ds2781_read8(dev_info, &sense_res_raw, DS2781_RSNSP); 280 + ret = ds2780_read8(dev_info, &sense_res_raw, DS2780_RSNSP_REG); 280 281 if (ret < 0) 281 282 return ret; 282 283 283 284 if (sense_res_raw == 0) { 284 285 dev_err(dev_info->dev, "sense resistor value is 0\n"); 285 - return -EINVAL; 286 + return -ENXIO; 286 287 } 287 288 sense_res = 1000 / sense_res_raw; 288 289 ··· 294 295 * Bits 7 - 0 of the ACR value are in bits 7 - 0 of the ACR 295 296 * LSB register 296 297 */ 297 - ret = ds2781_read16(dev_info, &current_raw, DS2781_ACR_MSB); 298 + ret = ds2780_read16(dev_info, &current_raw, DS2780_ACR_MSB_REG); 298 299 if (ret < 0) 299 300 return ret; 300 301 301 - *accumulated_current = current_raw * (DS2781_CHARGE_UNITS / sense_res); 302 + *accumulated_current = current_raw * (DS2780_CHARGE_UNITS / sense_res); 302 303 return 0; 303 304 } 304 305 305 - static int ds2781_get_capacity(struct ds2781_device_info *dev_info, 306 + static int ds2780_get_capacity(struct ds2780_device_info *dev_info, 306 307 int *capacity) 307 308 { 308 309 int ret; 309 310 u8 raw; 310 311 311 - ret = ds2781_read8(dev_info, &raw, DS2781_RARC); 312 + ret = ds2780_read8(dev_info, &raw, DS2780_RARC_REG); 312 313 if (ret < 0) 313 314 return ret; 314 315 315 316 *capacity = raw; 316 - return 0; 317 + return raw; 317 318 } 318 319 319 - static int ds2781_get_status(struct ds2781_device_info *dev_info, int *status) 320 + static int ds2780_get_status(struct ds2780_device_info *dev_info, int *status) 320 321 { 321 322 int ret, current_uA, capacity; 322 323 323 - ret = ds2781_get_current(dev_info, CURRENT_NOW, &current_uA); 324 + ret = ds2780_get_current(dev_info, CURRENT_NOW, &current_uA); 324 325 if (ret < 0) 325 326 return ret; 326 327 327 - ret = ds2781_get_capacity(dev_info, &capacity); 328 + ret = ds2780_get_capacity(dev_info, &capacity); 328 329 if (ret < 0) 329 330 return ret; 330 331 331 - if (power_supply_am_i_supplied(dev_info->bat)) { 332 - if (capacity == 100) 333 - *status = POWER_SUPPLY_STATUS_FULL; 334 - else if (current_uA > 50000) 335 - *status = POWER_SUPPLY_STATUS_CHARGING; 336 - else 337 - *status = POWER_SUPPLY_STATUS_NOT_CHARGING; 338 - } else { 332 + if (capacity == 100) 333 + *status = POWER_SUPPLY_STATUS_FULL; 334 + else if (current_uA == 0) 335 + *status = POWER_SUPPLY_STATUS_NOT_CHARGING; 336 + else if (current_uA < 0) 339 337 *status = POWER_SUPPLY_STATUS_DISCHARGING; 340 - } 338 + else 339 + *status = POWER_SUPPLY_STATUS_CHARGING; 340 + 341 341 return 0; 342 342 } 343 343 344 - static int ds2781_get_charge_now(struct ds2781_device_info *dev_info, 344 + static int ds2780_get_charge_now(struct ds2780_device_info *dev_info, 345 345 int *charge_now) 346 346 { 347 347 int ret; ··· 354 356 * Bits 7 - 0 of the RAAC value are in bits 7 - 0 of the RAAC 355 357 * LSB register 356 358 */ 357 - ret = ds2781_read16(dev_info, &charge_raw, DS2781_RAAC_MSB); 359 + ret = ds2780_read16(dev_info, &charge_raw, DS2780_RAAC_MSB_REG); 358 360 if (ret < 0) 359 361 return ret; 360 362 ··· 362 364 return 0; 363 365 } 364 366 365 - static int ds2781_get_control_register(struct ds2781_device_info *dev_info, 367 + static int ds2780_get_control_register(struct ds2780_device_info *dev_info, 366 368 u8 *control_reg) 367 369 { 368 - return ds2781_read8(dev_info, control_reg, DS2781_CONTROL); 370 + return ds2780_read8(dev_info, control_reg, DS2780_CONTROL_REG); 369 371 } 370 372 371 - static int ds2781_set_control_register(struct ds2781_device_info *dev_info, 373 + static int ds2780_set_control_register(struct ds2780_device_info *dev_info, 372 374 u8 control_reg) 373 375 { 374 376 int ret; 375 377 376 - ret = ds2781_write(dev_info, &control_reg, 377 - DS2781_CONTROL, sizeof(u8)); 378 + ret = ds2780_write(dev_info, &control_reg, 379 + DS2780_CONTROL_REG, sizeof(u8)); 378 380 if (ret < 0) 379 381 return ret; 380 382 381 - return ds2781_save_eeprom(dev_info, DS2781_CONTROL); 383 + return ds2780_save_eeprom(dev_info, DS2780_CONTROL_REG); 382 384 } 383 385 384 - static int ds2781_battery_get_property(struct power_supply *psy, 386 + static int ds2780_battery_get_property(struct power_supply *psy, 385 387 enum power_supply_property psp, 386 388 union power_supply_propval *val) 387 389 { 388 390 int ret = 0; 389 - struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 391 + struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 390 392 391 393 switch (psp) { 392 394 case POWER_SUPPLY_PROP_VOLTAGE_NOW: 393 - ret = ds2781_get_voltage(dev_info, &val->intval); 395 + ret = ds2780_get_voltage(dev_info, &val->intval); 394 396 break; 395 397 396 398 case POWER_SUPPLY_PROP_TEMP: 397 - ret = ds2781_get_temperature(dev_info, &val->intval); 399 + ret = ds2780_get_temperature(dev_info, &val->intval); 398 400 break; 399 401 400 402 case POWER_SUPPLY_PROP_MODEL_NAME: ··· 406 408 break; 407 409 408 410 case POWER_SUPPLY_PROP_CURRENT_NOW: 409 - ret = ds2781_get_current(dev_info, CURRENT_NOW, &val->intval); 411 + ret = ds2780_get_current(dev_info, CURRENT_NOW, &val->intval); 410 412 break; 411 413 412 414 case POWER_SUPPLY_PROP_CURRENT_AVG: 413 - ret = ds2781_get_current(dev_info, CURRENT_AVG, &val->intval); 415 + ret = ds2780_get_current(dev_info, CURRENT_AVG, &val->intval); 414 416 break; 415 417 416 418 case POWER_SUPPLY_PROP_STATUS: 417 - ret = ds2781_get_status(dev_info, &val->intval); 419 + ret = ds2780_get_status(dev_info, &val->intval); 418 420 break; 419 421 420 422 case POWER_SUPPLY_PROP_CAPACITY: 421 - ret = ds2781_get_capacity(dev_info, &val->intval); 423 + ret = ds2780_get_capacity(dev_info, &val->intval); 422 424 break; 423 425 424 426 case POWER_SUPPLY_PROP_CHARGE_COUNTER: 425 - ret = ds2781_get_accumulated_current(dev_info, &val->intval); 427 + ret = ds2780_get_accumulated_current(dev_info, &val->intval); 426 428 break; 427 429 428 430 case POWER_SUPPLY_PROP_CHARGE_NOW: 429 - ret = ds2781_get_charge_now(dev_info, &val->intval); 431 + ret = ds2780_get_charge_now(dev_info, &val->intval); 430 432 break; 431 433 432 434 default: ··· 436 438 return ret; 437 439 } 438 440 439 - static enum power_supply_property ds2781_battery_props[] = { 441 + static enum power_supply_property ds2780_battery_props[] = { 440 442 POWER_SUPPLY_PROP_STATUS, 441 443 POWER_SUPPLY_PROP_VOLTAGE_NOW, 442 444 POWER_SUPPLY_PROP_TEMP, ··· 449 451 POWER_SUPPLY_PROP_CHARGE_NOW, 450 452 }; 451 453 452 - static ssize_t ds2781_get_pmod_enabled(struct device *dev, 454 + static ssize_t ds2780_get_pmod_enabled(struct device *dev, 453 455 struct device_attribute *attr, 454 456 char *buf) 455 457 { 456 458 int ret; 457 459 u8 control_reg; 458 460 struct power_supply *psy = to_power_supply(dev); 459 - struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 461 + struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 460 462 461 463 /* Get power mode */ 462 - ret = ds2781_get_control_register(dev_info, &control_reg); 464 + ret = ds2780_get_control_register(dev_info, &control_reg); 463 465 if (ret < 0) 464 466 return ret; 465 467 466 468 return sprintf(buf, "%d\n", 467 - !!(control_reg & DS2781_CONTROL_PMOD)); 469 + !!(control_reg & DS2780_CONTROL_REG_PMOD)); 468 470 } 469 471 470 - static ssize_t ds2781_set_pmod_enabled(struct device *dev, 472 + static ssize_t ds2780_set_pmod_enabled(struct device *dev, 471 473 struct device_attribute *attr, 472 474 const char *buf, 473 475 size_t count) ··· 475 477 int ret; 476 478 u8 control_reg, new_setting; 477 479 struct power_supply *psy = to_power_supply(dev); 478 - struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 480 + struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 479 481 480 482 /* Set power mode */ 481 - ret = ds2781_get_control_register(dev_info, &control_reg); 483 + ret = ds2780_get_control_register(dev_info, &control_reg); 482 484 if (ret < 0) 483 485 return ret; 484 486 ··· 492 494 } 493 495 494 496 if (new_setting) 495 - control_reg |= DS2781_CONTROL_PMOD; 497 + control_reg |= DS2780_CONTROL_REG_PMOD; 496 498 else 497 - control_reg &= ~DS2781_CONTROL_PMOD; 499 + control_reg &= ~DS2780_CONTROL_REG_PMOD; 498 500 499 - ret = ds2781_set_control_register(dev_info, control_reg); 501 + ret = ds2780_set_control_register(dev_info, control_reg); 500 502 if (ret < 0) 501 503 return ret; 502 504 503 505 return count; 504 506 } 505 507 506 - static ssize_t ds2781_get_sense_resistor_value(struct device *dev, 508 + static ssize_t ds2780_get_sense_resistor_value(struct device *dev, 507 509 struct device_attribute *attr, 508 510 char *buf) 509 511 { 510 512 int ret; 511 513 u8 sense_resistor; 512 514 struct power_supply *psy = to_power_supply(dev); 513 - struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 515 + struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 514 516 515 - ret = ds2781_read8(dev_info, &sense_resistor, DS2781_RSNSP); 517 + ret = ds2780_read8(dev_info, &sense_resistor, DS2780_RSNSP_REG); 516 518 if (ret < 0) 517 519 return ret; 518 520 ··· 520 522 return ret; 521 523 } 522 524 523 - static ssize_t ds2781_set_sense_resistor_value(struct device *dev, 525 + static ssize_t ds2780_set_sense_resistor_value(struct device *dev, 524 526 struct device_attribute *attr, 525 527 const char *buf, 526 528 size_t count) ··· 528 530 int ret; 529 531 u8 new_setting; 530 532 struct power_supply *psy = to_power_supply(dev); 531 - struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 533 + struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 532 534 533 535 ret = kstrtou8(buf, 0, &new_setting); 534 536 if (ret < 0) 535 537 return ret; 536 538 537 - ret = ds2781_set_sense_register(dev_info, new_setting); 539 + ret = ds2780_set_sense_register(dev_info, new_setting); 538 540 if (ret < 0) 539 541 return ret; 540 542 541 543 return count; 542 544 } 543 545 544 - static ssize_t ds2781_get_rsgain_setting(struct device *dev, 546 + static ssize_t ds2780_get_rsgain_setting(struct device *dev, 545 547 struct device_attribute *attr, 546 548 char *buf) 547 549 { 548 550 int ret; 549 551 u16 rsgain; 550 552 struct power_supply *psy = to_power_supply(dev); 551 - struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 553 + struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 552 554 553 - ret = ds2781_get_rsgain_register(dev_info, &rsgain); 555 + ret = ds2780_get_rsgain_register(dev_info, &rsgain); 554 556 if (ret < 0) 555 557 return ret; 556 558 557 559 return sprintf(buf, "%d\n", rsgain); 558 560 } 559 561 560 - static ssize_t ds2781_set_rsgain_setting(struct device *dev, 562 + static ssize_t ds2780_set_rsgain_setting(struct device *dev, 561 563 struct device_attribute *attr, 562 564 const char *buf, 563 565 size_t count) ··· 565 567 int ret; 566 568 u16 new_setting; 567 569 struct power_supply *psy = to_power_supply(dev); 568 - struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 570 + struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 569 571 570 572 ret = kstrtou16(buf, 0, &new_setting); 571 573 if (ret < 0) ··· 577 579 return -EINVAL; 578 580 } 579 581 580 - ret = ds2781_set_rsgain_register(dev_info, new_setting); 582 + ret = ds2780_set_rsgain_register(dev_info, new_setting); 581 583 if (ret < 0) 582 584 return ret; 583 585 584 586 return count; 585 587 } 586 588 587 - static ssize_t ds2781_get_pio_pin(struct device *dev, 589 + static ssize_t ds2780_get_pio_pin(struct device *dev, 588 590 struct device_attribute *attr, 589 591 char *buf) 590 592 { 591 593 int ret; 592 594 u8 sfr; 593 595 struct power_supply *psy = to_power_supply(dev); 594 - struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 596 + struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 595 597 596 - ret = ds2781_read8(dev_info, &sfr, DS2781_SFR); 598 + ret = ds2780_read8(dev_info, &sfr, DS2780_SFR_REG); 597 599 if (ret < 0) 598 600 return ret; 599 601 600 - ret = sprintf(buf, "%d\n", sfr & DS2781_SFR_PIOSC); 602 + ret = sprintf(buf, "%d\n", sfr & DS2780_SFR_REG_PIOSC); 601 603 return ret; 602 604 } 603 605 604 - static ssize_t ds2781_set_pio_pin(struct device *dev, 606 + static ssize_t ds2780_set_pio_pin(struct device *dev, 605 607 struct device_attribute *attr, 606 608 const char *buf, 607 609 size_t count) ··· 609 611 int ret; 610 612 u8 new_setting; 611 613 struct power_supply *psy = to_power_supply(dev); 612 - struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 614 + struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 613 615 614 616 ret = kstrtou8(buf, 0, &new_setting); 615 617 if (ret < 0) ··· 620 622 return -EINVAL; 621 623 } 622 624 623 - ret = ds2781_write(dev_info, &new_setting, 624 - DS2781_SFR, sizeof(u8)); 625 + ret = ds2780_write(dev_info, &new_setting, 626 + DS2780_SFR_REG, sizeof(u8)); 625 627 if (ret < 0) 626 628 return ret; 627 629 628 630 return count; 629 631 } 630 632 631 - static ssize_t ds2781_read_param_eeprom_bin(struct file *filp, 633 + static ssize_t ds2780_read_param_eeprom_bin(struct file *filp, 632 634 struct kobject *kobj, 633 635 struct bin_attribute *bin_attr, 634 636 char *buf, loff_t off, size_t count) 635 637 { 636 638 struct device *dev = container_of(kobj, struct device, kobj); 637 639 struct power_supply *psy = to_power_supply(dev); 638 - struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 640 + struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 639 641 640 - return ds2781_read_block(dev_info, buf, 641 - DS2781_EEPROM_BLOCK1_START + off, count); 642 + return ds2780_read_block(dev_info, buf, 643 + DS2780_EEPROM_BLOCK1_START + off, count); 642 644 } 643 645 644 - static ssize_t ds2781_write_param_eeprom_bin(struct file *filp, 646 + static ssize_t ds2780_write_param_eeprom_bin(struct file *filp, 645 647 struct kobject *kobj, 646 648 struct bin_attribute *bin_attr, 647 649 char *buf, loff_t off, size_t count) 648 650 { 649 651 struct device *dev = container_of(kobj, struct device, kobj); 650 652 struct power_supply *psy = to_power_supply(dev); 651 - struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 653 + struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 652 654 int ret; 653 655 654 - ret = ds2781_write(dev_info, buf, 655 - DS2781_EEPROM_BLOCK1_START + off, count); 656 + ret = ds2780_write(dev_info, buf, 657 + DS2780_EEPROM_BLOCK1_START + off, count); 656 658 if (ret < 0) 657 659 return ret; 658 660 659 - ret = ds2781_save_eeprom(dev_info, DS2781_EEPROM_BLOCK1_START); 661 + ret = ds2780_save_eeprom(dev_info, DS2780_EEPROM_BLOCK1_START); 660 662 if (ret < 0) 661 663 return ret; 662 664 663 665 return count; 664 666 } 665 667 666 - static struct bin_attribute ds2781_param_eeprom_bin_attr = { 668 + static struct bin_attribute ds2780_param_eeprom_bin_attr = { 667 669 .attr = { 668 670 .name = "param_eeprom", 669 671 .mode = S_IRUGO | S_IWUSR, 670 672 }, 671 - .size = DS2781_PARAM_EEPROM_SIZE, 672 - .read = ds2781_read_param_eeprom_bin, 673 - .write = ds2781_write_param_eeprom_bin, 673 + .size = DS2780_PARAM_EEPROM_SIZE, 674 + .read = ds2780_read_param_eeprom_bin, 675 + .write = ds2780_write_param_eeprom_bin, 674 676 }; 675 677 676 - static ssize_t ds2781_read_user_eeprom_bin(struct file *filp, 678 + static ssize_t ds2780_read_user_eeprom_bin(struct file *filp, 677 679 struct kobject *kobj, 678 680 struct bin_attribute *bin_attr, 679 681 char *buf, loff_t off, size_t count) 680 682 { 681 683 struct device *dev = container_of(kobj, struct device, kobj); 682 684 struct power_supply *psy = to_power_supply(dev); 683 - struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 685 + struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 684 686 685 - return ds2781_read_block(dev_info, buf, 686 - DS2781_EEPROM_BLOCK0_START + off, count); 687 - 687 + return ds2780_read_block(dev_info, buf, 688 + DS2780_EEPROM_BLOCK0_START + off, count); 688 689 } 689 690 690 - static ssize_t ds2781_write_user_eeprom_bin(struct file *filp, 691 + static ssize_t ds2780_write_user_eeprom_bin(struct file *filp, 691 692 struct kobject *kobj, 692 693 struct bin_attribute *bin_attr, 693 694 char *buf, loff_t off, size_t count) 694 695 { 695 696 struct device *dev = container_of(kobj, struct device, kobj); 696 697 struct power_supply *psy = to_power_supply(dev); 697 - struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); 698 + struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); 698 699 int ret; 699 700 700 - ret = ds2781_write(dev_info, buf, 701 - DS2781_EEPROM_BLOCK0_START + off, count); 701 + ret = ds2780_write(dev_info, buf, 702 + DS2780_EEPROM_BLOCK0_START + off, count); 702 703 if (ret < 0) 703 704 return ret; 704 705 705 - ret = ds2781_save_eeprom(dev_info, DS2781_EEPROM_BLOCK0_START); 706 + ret = ds2780_save_eeprom(dev_info, DS2780_EEPROM_BLOCK0_START); 706 707 if (ret < 0) 707 708 return ret; 708 709 709 710 return count; 710 711 } 711 712 712 - static struct bin_attribute ds2781_user_eeprom_bin_attr = { 713 + static struct bin_attribute ds2780_user_eeprom_bin_attr = { 713 714 .attr = { 714 715 .name = "user_eeprom", 715 716 .mode = S_IRUGO | S_IWUSR, 716 717 }, 717 - .size = DS2781_USER_EEPROM_SIZE, 718 - .read = ds2781_read_user_eeprom_bin, 719 - .write = ds2781_write_user_eeprom_bin, 718 + .size = DS2780_USER_EEPROM_SIZE, 719 + .read = ds2780_read_user_eeprom_bin, 720 + .write = ds2780_write_user_eeprom_bin, 720 721 }; 721 722 722 - static DEVICE_ATTR(pmod_enabled, S_IRUGO | S_IWUSR, ds2781_get_pmod_enabled, 723 - ds2781_set_pmod_enabled); 723 + static DEVICE_ATTR(pmod_enabled, S_IRUGO | S_IWUSR, ds2780_get_pmod_enabled, 724 + ds2780_set_pmod_enabled); 724 725 static DEVICE_ATTR(sense_resistor_value, S_IRUGO | S_IWUSR, 725 - ds2781_get_sense_resistor_value, ds2781_set_sense_resistor_value); 726 - static DEVICE_ATTR(rsgain_setting, S_IRUGO | S_IWUSR, ds2781_get_rsgain_setting, 727 - ds2781_set_rsgain_setting); 728 - static DEVICE_ATTR(pio_pin, S_IRUGO | S_IWUSR, ds2781_get_pio_pin, 729 - ds2781_set_pio_pin); 726 + ds2780_get_sense_resistor_value, ds2780_set_sense_resistor_value); 727 + static DEVICE_ATTR(rsgain_setting, S_IRUGO | S_IWUSR, ds2780_get_rsgain_setting, 728 + ds2780_set_rsgain_setting); 729 + static DEVICE_ATTR(pio_pin, S_IRUGO | S_IWUSR, ds2780_get_pio_pin, 730 + ds2780_set_pio_pin); 730 731 731 732 732 - static struct attribute *ds2781_attributes[] = { 733 + static struct attribute *ds2780_attributes[] = { 733 734 &dev_attr_pmod_enabled.attr, 734 735 &dev_attr_sense_resistor_value.attr, 735 736 &dev_attr_rsgain_setting.attr, ··· 736 739 NULL 737 740 }; 738 741 739 - static const struct attribute_group ds2781_attr_group = { 740 - .attrs = ds2781_attributes, 742 + static const struct attribute_group ds2780_attr_group = { 743 + .attrs = ds2780_attributes, 741 744 }; 742 745 743 - static int ds2781_battery_probe(struct platform_device *pdev) 746 + static int ds2780_battery_probe(struct platform_device *pdev) 744 747 { 745 748 struct power_supply_config psy_cfg = {}; 746 749 int ret = 0; 747 - struct ds2781_device_info *dev_info; 750 + struct ds2780_device_info *dev_info; 748 751 749 752 dev_info = devm_kzalloc(&pdev->dev, sizeof(*dev_info), GFP_KERNEL); 750 - if (!dev_info) 751 - return -ENOMEM; 753 + if (!dev_info) { 754 + ret = -ENOMEM; 755 + goto fail; 756 + } 752 757 753 758 platform_set_drvdata(pdev, dev_info); 754 759 ··· 758 759 dev_info->w1_dev = pdev->dev.parent; 759 760 dev_info->bat_desc.name = dev_name(&pdev->dev); 760 761 dev_info->bat_desc.type = POWER_SUPPLY_TYPE_BATTERY; 761 - dev_info->bat_desc.properties = ds2781_battery_props; 762 - dev_info->bat_desc.num_properties = ARRAY_SIZE(ds2781_battery_props); 763 - dev_info->bat_desc.get_property = ds2781_battery_get_property; 762 + dev_info->bat_desc.properties = ds2780_battery_props; 763 + dev_info->bat_desc.num_properties = ARRAY_SIZE(ds2780_battery_props); 764 + dev_info->bat_desc.get_property = ds2780_battery_get_property; 764 765 765 766 psy_cfg.drv_data = dev_info; 766 767 767 768 dev_info->bat = power_supply_register(&pdev->dev, &dev_info->bat_desc, 768 - &psy_cfg); 769 + &psy_cfg); 769 770 if (IS_ERR(dev_info->bat)) { 770 771 dev_err(dev_info->dev, "failed to register battery\n"); 771 772 ret = PTR_ERR(dev_info->bat); 772 773 goto fail; 773 774 } 774 775 775 - ret = sysfs_create_group(&dev_info->bat->dev.kobj, &ds2781_attr_group); 776 + ret = sysfs_create_group(&dev_info->bat->dev.kobj, &ds2780_attr_group); 776 777 if (ret) { 777 778 dev_err(dev_info->dev, "failed to create sysfs group\n"); 778 779 goto fail_unregister; 779 780 } 780 781 781 782 ret = sysfs_create_bin_file(&dev_info->bat->dev.kobj, 782 - &ds2781_param_eeprom_bin_attr); 783 + &ds2780_param_eeprom_bin_attr); 783 784 if (ret) { 784 785 dev_err(dev_info->dev, 785 786 "failed to create param eeprom bin file"); ··· 787 788 } 788 789 789 790 ret = sysfs_create_bin_file(&dev_info->bat->dev.kobj, 790 - &ds2781_user_eeprom_bin_attr); 791 + &ds2780_user_eeprom_bin_attr); 791 792 if (ret) { 792 793 dev_err(dev_info->dev, 793 794 "failed to create user eeprom bin file"); ··· 798 799 799 800 fail_remove_bin_file: 800 801 sysfs_remove_bin_file(&dev_info->bat->dev.kobj, 801 - &ds2781_param_eeprom_bin_attr); 802 + &ds2780_param_eeprom_bin_attr); 802 803 fail_remove_group: 803 - sysfs_remove_group(&dev_info->bat->dev.kobj, &ds2781_attr_group); 804 + sysfs_remove_group(&dev_info->bat->dev.kobj, &ds2780_attr_group); 804 805 fail_unregister: 805 806 power_supply_unregister(dev_info->bat); 806 807 fail: 807 808 return ret; 808 809 } 809 810 810 - static int ds2781_battery_remove(struct platform_device *pdev) 811 + static int ds2780_battery_remove(struct platform_device *pdev) 811 812 { 812 - struct ds2781_device_info *dev_info = platform_get_drvdata(pdev); 813 + struct ds2780_device_info *dev_info = platform_get_drvdata(pdev); 813 814 814 815 /* 815 816 * Remove attributes before unregistering power supply 816 817 * because 'bat' will be freed on power_supply_unregister() call. 817 818 */ 818 - sysfs_remove_group(&dev_info->bat->dev.kobj, &ds2781_attr_group); 819 + sysfs_remove_group(&dev_info->bat->dev.kobj, &ds2780_attr_group); 819 820 820 821 power_supply_unregister(dev_info->bat); 821 822 822 823 return 0; 823 824 } 824 825 825 - static struct platform_driver ds2781_battery_driver = { 826 + static struct platform_driver ds2780_battery_driver = { 826 827 .driver = { 827 - .name = "ds2781-battery", 828 + .name = "ds2780-battery", 828 829 }, 829 - .probe = ds2781_battery_probe, 830 - .remove = ds2781_battery_remove, 830 + .probe = ds2780_battery_probe, 831 + .remove = ds2780_battery_remove, 831 832 }; 832 - module_platform_driver(ds2781_battery_driver); 833 + 834 + module_platform_driver(ds2780_battery_driver); 833 835 834 836 MODULE_LICENSE("GPL"); 835 - MODULE_AUTHOR("Renata Sayakhova <renata@oktetlabs.ru>"); 836 - MODULE_DESCRIPTION("Maxim/Dallas DS2781 Stand-Alone Fuel Gauage IC driver"); 837 - MODULE_ALIAS("platform:ds2781-battery"); 838 - 837 + MODULE_AUTHOR("Clifton Barnes <cabarnes@indesign-llc.com>"); 838 + MODULE_DESCRIPTION("Maxim/Dallas DS2780 Stand-Alone Fuel Gauage IC driver"); 839 + MODULE_ALIAS("platform:ds2780-battery");
drivers/power/ds2782_battery.c drivers/power/supply/ds2782_battery.c
drivers/power/generic-adc-battery.c drivers/power/supply/generic-adc-battery.c
drivers/power/goldfish_battery.c drivers/power/supply/goldfish_battery.c
drivers/power/gpio-charger.c drivers/power/supply/gpio-charger.c
drivers/power/intel_mid_battery.c drivers/power/supply/intel_mid_battery.c
drivers/power/ipaq_micro_battery.c drivers/power/supply/ipaq_micro_battery.c
drivers/power/isp1704_charger.c drivers/power/supply/isp1704_charger.c
drivers/power/jz4740-battery.c drivers/power/supply/jz4740-battery.c
drivers/power/lp8727_charger.c drivers/power/supply/lp8727_charger.c
drivers/power/lp8788-charger.c drivers/power/supply/lp8788-charger.c
drivers/power/ltc2941-battery-gauge.c drivers/power/supply/ltc2941-battery-gauge.c
drivers/power/max14577_charger.c drivers/power/supply/max14577_charger.c
drivers/power/max17040_battery.c drivers/power/supply/max17040_battery.c
drivers/power/max17042_battery.c drivers/power/supply/max17042_battery.c
drivers/power/max77693_charger.c drivers/power/supply/max77693_charger.c
drivers/power/max8903_charger.c drivers/power/supply/max8903_charger.c
drivers/power/max8925_power.c drivers/power/supply/max8925_power.c
drivers/power/max8997_charger.c drivers/power/supply/max8997_charger.c
drivers/power/max8998_charger.c drivers/power/supply/max8998_charger.c
drivers/power/olpc_battery.c drivers/power/supply/olpc_battery.c
drivers/power/pcf50633-charger.c drivers/power/supply/pcf50633-charger.c
drivers/power/pda_power.c drivers/power/supply/pda_power.c
drivers/power/pm2301_charger.c drivers/power/supply/pm2301_charger.c
drivers/power/pm2301_charger.h drivers/power/supply/pm2301_charger.h
drivers/power/pmu_battery.c drivers/power/supply/pmu_battery.c
drivers/power/power_supply.h drivers/power/supply/power_supply.h
drivers/power/power_supply_core.c drivers/power/supply/power_supply_core.c
drivers/power/power_supply_leds.c drivers/power/supply/power_supply_leds.c
drivers/power/power_supply_sysfs.c drivers/power/supply/power_supply_sysfs.c
drivers/power/qcom_smbb.c drivers/power/supply/qcom_smbb.c
drivers/power/rt5033_battery.c drivers/power/supply/rt5033_battery.c
drivers/power/rt9455_charger.c drivers/power/supply/rt9455_charger.c
drivers/power/rx51_battery.c drivers/power/supply/rx51_battery.c
drivers/power/s3c_adc_battery.c drivers/power/supply/s3c_adc_battery.c
drivers/power/sbs-battery.c drivers/power/supply/sbs-battery.c
drivers/power/smb347-charger.c drivers/power/supply/smb347-charger.c
+514
drivers/power/supply/Kconfig
··· 1 + menuconfig POWER_SUPPLY 2 + bool "Power supply class support" 3 + help 4 + Say Y here to enable power supply class support. This allows 5 + power supply (batteries, AC, USB) monitoring by userspace 6 + via sysfs and uevent (if available) and/or APM kernel interface 7 + (if selected below). 8 + 9 + if POWER_SUPPLY 10 + 11 + config POWER_SUPPLY_DEBUG 12 + bool "Power supply debug" 13 + help 14 + Say Y here to enable debugging messages for power supply class 15 + and drivers. 16 + 17 + config PDA_POWER 18 + tristate "Generic PDA/phone power driver" 19 + depends on !S390 20 + help 21 + Say Y here to enable generic power driver for PDAs and phones with 22 + one or two external power supplies (AC/USB) connected to main and 23 + backup batteries, and optional builtin charger. 24 + 25 + config APM_POWER 26 + tristate "APM emulation for class batteries" 27 + depends on APM_EMULATION 28 + help 29 + Say Y here to enable support APM status emulation using 30 + battery class devices. 31 + 32 + config GENERIC_ADC_BATTERY 33 + tristate "Generic battery support using IIO" 34 + depends on IIO 35 + help 36 + Say Y here to enable support for the generic battery driver 37 + which uses IIO framework to read adc. 38 + 39 + config MAX8925_POWER 40 + tristate "MAX8925 battery charger support" 41 + depends on MFD_MAX8925 42 + help 43 + Say Y here to enable support for the battery charger in the Maxim 44 + MAX8925 PMIC. 45 + 46 + config WM831X_BACKUP 47 + tristate "WM831X backup battery charger support" 48 + depends on MFD_WM831X 49 + help 50 + Say Y here to enable support for the backup battery charger 51 + in the Wolfson Microelectronics WM831x PMICs. 52 + 53 + config WM831X_POWER 54 + tristate "WM831X PMU support" 55 + depends on MFD_WM831X 56 + help 57 + Say Y here to enable support for the power management unit 58 + provided by Wolfson Microelectronics WM831x PMICs. 59 + 60 + config WM8350_POWER 61 + tristate "WM8350 PMU support" 62 + depends on MFD_WM8350 63 + help 64 + Say Y here to enable support for the power management unit 65 + provided by the Wolfson Microelectronics WM8350 PMIC. 66 + 67 + config TEST_POWER 68 + tristate "Test power driver" 69 + help 70 + This driver is used for testing. It's safe to say M here. 71 + 72 + config BATTERY_88PM860X 73 + tristate "Marvell 88PM860x battery driver" 74 + depends on MFD_88PM860X 75 + help 76 + Say Y here to enable battery monitor for Marvell 88PM860x chip. 77 + 78 + config BATTERY_ACT8945A 79 + tristate "Active-semi ACT8945A charger driver" 80 + depends on MFD_ACT8945A || COMPILE_TEST 81 + help 82 + Say Y here to enable support for power supply provided by 83 + Active-semi ActivePath ACT8945A charger. 84 + 85 + config BATTERY_DS2760 86 + tristate "DS2760 battery driver (HP iPAQ & others)" 87 + depends on W1 && W1_SLAVE_DS2760 88 + help 89 + Say Y here to enable support for batteries with ds2760 chip. 90 + 91 + config BATTERY_DS2780 92 + tristate "DS2780 battery driver" 93 + depends on HAS_IOMEM 94 + select W1 95 + select W1_SLAVE_DS2780 96 + help 97 + Say Y here to enable support for batteries with ds2780 chip. 98 + 99 + config BATTERY_DS2781 100 + tristate "DS2781 battery driver" 101 + depends on HAS_IOMEM 102 + select W1 103 + select W1_SLAVE_DS2781 104 + help 105 + If you enable this you will have the DS2781 battery driver support. 106 + 107 + The battery monitor chip is used in many batteries/devices 108 + as the one who is responsible for charging/discharging/monitoring 109 + Li+ batteries. 110 + 111 + If you are unsure, say N. 112 + 113 + config BATTERY_DS2782 114 + tristate "DS2782/DS2786 standalone gas-gauge" 115 + depends on I2C 116 + help 117 + Say Y here to enable support for the DS2782/DS2786 standalone battery 118 + gas-gauge. 119 + 120 + config BATTERY_PMU 121 + tristate "Apple PMU battery" 122 + depends on PPC32 && ADB_PMU 123 + help 124 + Say Y here to expose battery information on Apple machines 125 + through the generic battery class. 126 + 127 + config BATTERY_OLPC 128 + tristate "One Laptop Per Child battery" 129 + depends on X86_32 && OLPC 130 + help 131 + Say Y to enable support for the battery on the OLPC laptop. 132 + 133 + config BATTERY_TOSA 134 + tristate "Sharp SL-6000 (tosa) battery" 135 + depends on MACH_TOSA && MFD_TC6393XB && TOUCHSCREEN_WM97XX 136 + help 137 + Say Y to enable support for the battery on the Sharp Zaurus 138 + SL-6000 (tosa) models. 139 + 140 + config BATTERY_COLLIE 141 + tristate "Sharp SL-5500 (collie) battery" 142 + depends on SA1100_COLLIE && MCP_UCB1200 143 + help 144 + Say Y to enable support for the battery on the Sharp Zaurus 145 + SL-5500 (collie) models. 146 + 147 + config BATTERY_IPAQ_MICRO 148 + tristate "iPAQ Atmel Micro ASIC battery driver" 149 + depends on MFD_IPAQ_MICRO 150 + help 151 + Choose this option if you want to monitor battery status on 152 + Compaq/HP iPAQ h3100 and h3600. 153 + 154 + config BATTERY_WM97XX 155 + bool "WM97xx generic battery driver" 156 + depends on TOUCHSCREEN_WM97XX=y 157 + help 158 + Say Y to enable support for battery measured by WM97xx aux port. 159 + 160 + config BATTERY_SBS 161 + tristate "SBS Compliant gas gauge" 162 + depends on I2C 163 + help 164 + Say Y to include support for SBS battery driver for SBS-compliant 165 + gas gauges. 166 + 167 + config BATTERY_BQ27XXX 168 + tristate "BQ27xxx battery driver" 169 + help 170 + Say Y here to enable support for batteries with BQ27xxx chips. 171 + 172 + config BATTERY_BQ27XXX_I2C 173 + tristate "BQ27xxx I2C support" 174 + depends on BATTERY_BQ27XXX 175 + depends on I2C 176 + default y 177 + help 178 + Say Y here to enable support for batteries with BQ27xxx chips 179 + connected over an I2C bus. 180 + 181 + config BATTERY_DA9030 182 + tristate "DA9030 battery driver" 183 + depends on PMIC_DA903X 184 + help 185 + Say Y here to enable support for batteries charger integrated into 186 + DA9030 PMIC. 187 + 188 + config BATTERY_DA9052 189 + tristate "Dialog DA9052 Battery" 190 + depends on PMIC_DA9052 191 + help 192 + Say Y here to enable support for batteries charger integrated into 193 + DA9052 PMIC. 194 + 195 + config CHARGER_DA9150 196 + tristate "Dialog Semiconductor DA9150 Charger support" 197 + depends on MFD_DA9150 198 + depends on DA9150_GPADC 199 + depends on IIO 200 + help 201 + Say Y here to enable support for charger unit of the DA9150 202 + Integrated Charger & Fuel-Gauge IC. 203 + 204 + This driver can also be built as a module. If so, the module will be 205 + called da9150-charger. 206 + 207 + config BATTERY_DA9150 208 + tristate "Dialog Semiconductor DA9150 Fuel Gauge support" 209 + depends on MFD_DA9150 210 + help 211 + Say Y here to enable support for the Fuel-Gauge unit of the DA9150 212 + Integrated Charger & Fuel-Gauge IC 213 + 214 + This driver can also be built as a module. If so, the module will be 215 + called da9150-fg. 216 + 217 + config AXP288_CHARGER 218 + tristate "X-Powers AXP288 Charger" 219 + depends on MFD_AXP20X && EXTCON_AXP288 220 + help 221 + Say yes here to have support X-Power AXP288 power management IC (PMIC) 222 + integrated charger. 223 + 224 + config AXP288_FUEL_GAUGE 225 + tristate "X-Powers AXP288 Fuel Gauge" 226 + depends on MFD_AXP20X && IIO 227 + help 228 + Say yes here to have support for X-Power power management IC (PMIC) 229 + Fuel Gauge. The device provides battery statistics and status 230 + monitoring as well as alerts for battery over/under voltage and 231 + over/under temperature. 232 + 233 + config BATTERY_MAX17040 234 + tristate "Maxim MAX17040 Fuel Gauge" 235 + depends on I2C 236 + help 237 + MAX17040 is fuel-gauge systems for lithium-ion (Li+) batteries 238 + in handheld and portable equipment. The MAX17040 is configured 239 + to operate with a single lithium cell 240 + 241 + config BATTERY_MAX17042 242 + tristate "Maxim MAX17042/17047/17050/8997/8966 Fuel Gauge" 243 + depends on I2C 244 + select REGMAP_I2C 245 + help 246 + MAX17042 is fuel-gauge systems for lithium-ion (Li+) batteries 247 + in handheld and portable equipment. The MAX17042 is configured 248 + to operate with a single lithium cell. MAX8997 and MAX8966 are 249 + multi-function devices that include fuel gauages that are compatible 250 + with MAX17042. This driver also supports max17047/50 chips which are 251 + improved version of max17042. 252 + 253 + config BATTERY_Z2 254 + tristate "Z2 battery driver" 255 + depends on I2C && MACH_ZIPIT2 256 + help 257 + Say Y to include support for the battery on the Zipit Z2. 258 + 259 + config BATTERY_S3C_ADC 260 + tristate "Battery driver for Samsung ADC based monitoring" 261 + depends on S3C_ADC 262 + help 263 + Say Y here to enable support for iPAQ h1930/h1940/rx1950 battery 264 + 265 + config BATTERY_TWL4030_MADC 266 + tristate "TWL4030 MADC battery driver" 267 + depends on TWL4030_MADC 268 + help 269 + Say Y here to enable this dumb driver for batteries managed 270 + through the TWL4030 MADC. 271 + 272 + config CHARGER_88PM860X 273 + tristate "Marvell 88PM860x Charger driver" 274 + depends on MFD_88PM860X && BATTERY_88PM860X 275 + help 276 + Say Y here to enable charger for Marvell 88PM860x chip. 277 + 278 + config CHARGER_PCF50633 279 + tristate "NXP PCF50633 MBC" 280 + depends on MFD_PCF50633 281 + help 282 + Say Y to include support for NXP PCF50633 Main Battery Charger. 283 + 284 + config BATTERY_JZ4740 285 + tristate "Ingenic JZ4740 battery" 286 + depends on MACH_JZ4740 287 + depends on MFD_JZ4740_ADC 288 + help 289 + Say Y to enable support for the battery on Ingenic JZ4740 based 290 + boards. 291 + 292 + This driver can be build as a module. If so, the module will be 293 + called jz4740-battery. 294 + 295 + config BATTERY_INTEL_MID 296 + tristate "Battery driver for Intel MID platforms" 297 + depends on INTEL_SCU_IPC && SPI 298 + help 299 + Say Y here to enable the battery driver on Intel MID 300 + platforms. 301 + 302 + config BATTERY_RX51 303 + tristate "Nokia RX-51 (N900) battery driver" 304 + depends on TWL4030_MADC 305 + help 306 + Say Y here to enable support for battery information on Nokia 307 + RX-51, also known as N900 tablet. 308 + 309 + config CHARGER_ISP1704 310 + tristate "ISP1704 USB Charger Detection" 311 + depends on USB_PHY 312 + depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y' 313 + help 314 + Say Y to enable support for USB Charger Detection with 315 + ISP1707/ISP1704 USB transceivers. 316 + 317 + config CHARGER_MAX8903 318 + tristate "MAX8903 Battery DC-DC Charger for USB and Adapter Power" 319 + help 320 + Say Y to enable support for the MAX8903 DC-DC charger and sysfs. 321 + The driver supports controlling charger-enable and current-limit 322 + pins based on the status of charger connections with interrupt 323 + handlers. 324 + 325 + config CHARGER_TWL4030 326 + tristate "OMAP TWL4030 BCI charger driver" 327 + depends on IIO && TWL4030_CORE 328 + help 329 + Say Y here to enable support for TWL4030 Battery Charge Interface. 330 + 331 + config CHARGER_LP8727 332 + tristate "TI/National Semiconductor LP8727 charger driver" 333 + depends on I2C 334 + help 335 + Say Y here to enable support for LP8727 Charger Driver. 336 + 337 + config CHARGER_LP8788 338 + tristate "TI LP8788 charger driver" 339 + depends on MFD_LP8788 340 + depends on LP8788_ADC 341 + depends on IIO 342 + help 343 + Say Y to enable support for the LP8788 linear charger. 344 + 345 + config CHARGER_GPIO 346 + tristate "GPIO charger" 347 + depends on GPIOLIB || COMPILE_TEST 348 + help 349 + Say Y to include support for chargers which report their online status 350 + through a GPIO pin. 351 + 352 + This driver can be build as a module. If so, the module will be 353 + called gpio-charger. 354 + 355 + config CHARGER_MANAGER 356 + bool "Battery charger manager for multiple chargers" 357 + depends on REGULATOR 358 + select EXTCON 359 + help 360 + Say Y to enable charger-manager support, which allows multiple 361 + chargers attached to a battery and multiple batteries attached to a 362 + system. The charger-manager also can monitor charging status in 363 + runtime and in suspend-to-RAM by waking up the system periodically 364 + with help of suspend_again support. 365 + 366 + config CHARGER_MAX14577 367 + tristate "Maxim MAX14577/77836 battery charger driver" 368 + depends on MFD_MAX14577 369 + help 370 + Say Y to enable support for the battery charger control sysfs and 371 + platform data of MAX14577/77836 MUICs. 372 + 373 + config CHARGER_MAX77693 374 + tristate "Maxim MAX77693 battery charger driver" 375 + depends on MFD_MAX77693 376 + help 377 + Say Y to enable support for the Maxim MAX77693 battery charger. 378 + 379 + config CHARGER_MAX8997 380 + tristate "Maxim MAX8997/MAX8966 PMIC battery charger driver" 381 + depends on MFD_MAX8997 && REGULATOR_MAX8997 382 + help 383 + Say Y to enable support for the battery charger control sysfs and 384 + platform data of MAX8997/LP3974 PMICs. 385 + 386 + config CHARGER_MAX8998 387 + tristate "Maxim MAX8998/LP3974 PMIC battery charger driver" 388 + depends on MFD_MAX8998 && REGULATOR_MAX8998 389 + help 390 + Say Y to enable support for the battery charger control sysfs and 391 + platform data of MAX8998/LP3974 PMICs. 392 + 393 + config CHARGER_QCOM_SMBB 394 + tristate "Qualcomm Switch-Mode Battery Charger and Boost" 395 + depends on MFD_SPMI_PMIC || COMPILE_TEST 396 + depends on OF 397 + depends on EXTCON 398 + help 399 + Say Y to include support for the Switch-Mode Battery Charger and 400 + Boost (SMBB) hardware found in Qualcomm PM8941 PMICs. The charger 401 + is an integrated, single-cell lithium-ion battery charger. DT 402 + configuration is required for loading, see the devicetree 403 + documentation for more detail. The base name for this driver is 404 + 'pm8941_charger'. 405 + 406 + config CHARGER_BQ2415X 407 + tristate "TI BQ2415x battery charger driver" 408 + depends on I2C 409 + help 410 + Say Y to enable support for the TI BQ2415x battery charger 411 + PMICs. 412 + 413 + You'll need this driver to charge batteries on e.g. Nokia 414 + RX-51/N900. 415 + 416 + config CHARGER_BQ24190 417 + tristate "TI BQ24190 battery charger driver" 418 + depends on I2C 419 + depends on GPIOLIB || COMPILE_TEST 420 + help 421 + Say Y to enable support for the TI BQ24190 battery charger. 422 + 423 + config CHARGER_BQ24257 424 + tristate "TI BQ24250/24251/24257 battery charger driver" 425 + depends on I2C 426 + depends on GPIOLIB || COMPILE_TEST 427 + depends on REGMAP_I2C 428 + help 429 + Say Y to enable support for the TI BQ24250, BQ24251, and BQ24257 battery 430 + chargers. 431 + 432 + config CHARGER_BQ24735 433 + tristate "TI BQ24735 battery charger support" 434 + depends on I2C 435 + depends on GPIOLIB || COMPILE_TEST 436 + help 437 + Say Y to enable support for the TI BQ24735 battery charger. 438 + 439 + config CHARGER_BQ25890 440 + tristate "TI BQ25890 battery charger driver" 441 + depends on I2C 442 + depends on GPIOLIB || COMPILE_TEST 443 + select REGMAP_I2C 444 + help 445 + Say Y to enable support for the TI BQ25890 battery charger. 446 + 447 + config CHARGER_SMB347 448 + tristate "Summit Microelectronics SMB347 Battery Charger" 449 + depends on I2C 450 + select REGMAP_I2C 451 + help 452 + Say Y to include support for Summit Microelectronics SMB347 453 + Battery Charger. 454 + 455 + config CHARGER_TPS65090 456 + tristate "TPS65090 battery charger driver" 457 + depends on MFD_TPS65090 458 + help 459 + Say Y here to enable support for battery charging with TPS65090 460 + PMIC chips. 461 + 462 + config CHARGER_TPS65217 463 + tristate "TPS65217 battery charger driver" 464 + depends on MFD_TPS65217 465 + help 466 + Say Y here to enable support for battery charging with TPS65217 467 + PMIC chips. 468 + 469 + config BATTERY_GAUGE_LTC2941 470 + tristate "LTC2941/LTC2943 Battery Gauge Driver" 471 + depends on I2C 472 + help 473 + Say Y here to include support for LTC2941 and LTC2943 Battery 474 + Gauge IC. The driver reports the charge count continuously, and 475 + measures the voltage and temperature every 10 seconds. 476 + 477 + config AB8500_BM 478 + bool "AB8500 Battery Management Driver" 479 + depends on AB8500_CORE && AB8500_GPADC 480 + help 481 + Say Y to include support for AB8500 battery management. 482 + 483 + config BATTERY_GOLDFISH 484 + tristate "Goldfish battery driver" 485 + depends on GOLDFISH || COMPILE_TEST 486 + depends on HAS_IOMEM 487 + help 488 + Say Y to enable support for the battery and AC power in the 489 + Goldfish emulator. 490 + 491 + config BATTERY_RT5033 492 + tristate "RT5033 fuel gauge support" 493 + depends on MFD_RT5033 494 + help 495 + This adds support for battery fuel gauge in Richtek RT5033 PMIC. 496 + The fuelgauge calculates and determines the battery state of charge 497 + according to battery open circuit voltage. 498 + 499 + config CHARGER_RT9455 500 + tristate "Richtek RT9455 battery charger driver" 501 + depends on I2C 502 + depends on GPIOLIB || COMPILE_TEST 503 + select REGMAP_I2C 504 + help 505 + Say Y to enable support for Richtek RT9455 battery charger. 506 + 507 + config AXP20X_POWER 508 + tristate "AXP20x power supply driver" 509 + depends on MFD_AXP20X 510 + help 511 + This driver provides support for the power supply features of 512 + AXP20x PMIC. 513 + 514 + endif # POWER_SUPPLY
+74
drivers/power/supply/Makefile
··· 1 + subdir-ccflags-$(CONFIG_POWER_SUPPLY_DEBUG) := -DDEBUG 2 + 3 + power_supply-y := power_supply_core.o 4 + power_supply-$(CONFIG_SYSFS) += power_supply_sysfs.o 5 + power_supply-$(CONFIG_LEDS_TRIGGERS) += power_supply_leds.o 6 + 7 + obj-$(CONFIG_POWER_SUPPLY) += power_supply.o 8 + obj-$(CONFIG_GENERIC_ADC_BATTERY) += generic-adc-battery.o 9 + 10 + obj-$(CONFIG_PDA_POWER) += pda_power.o 11 + obj-$(CONFIG_APM_POWER) += apm_power.o 12 + obj-$(CONFIG_AXP20X_POWER) += axp20x_usb_power.o 13 + obj-$(CONFIG_MAX8925_POWER) += max8925_power.o 14 + obj-$(CONFIG_WM831X_BACKUP) += wm831x_backup.o 15 + obj-$(CONFIG_WM831X_POWER) += wm831x_power.o 16 + obj-$(CONFIG_WM8350_POWER) += wm8350_power.o 17 + obj-$(CONFIG_TEST_POWER) += test_power.o 18 + 19 + obj-$(CONFIG_BATTERY_88PM860X) += 88pm860x_battery.o 20 + obj-$(CONFIG_BATTERY_ACT8945A) += act8945a_charger.o 21 + obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o 22 + obj-$(CONFIG_BATTERY_DS2780) += ds2780_battery.o 23 + obj-$(CONFIG_BATTERY_DS2781) += ds2781_battery.o 24 + obj-$(CONFIG_BATTERY_DS2782) += ds2782_battery.o 25 + obj-$(CONFIG_BATTERY_GAUGE_LTC2941) += ltc2941-battery-gauge.o 26 + obj-$(CONFIG_BATTERY_GOLDFISH) += goldfish_battery.o 27 + obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o 28 + obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o 29 + obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o 30 + obj-$(CONFIG_BATTERY_COLLIE) += collie_battery.o 31 + obj-$(CONFIG_BATTERY_IPAQ_MICRO) += ipaq_micro_battery.o 32 + obj-$(CONFIG_BATTERY_WM97XX) += wm97xx_battery.o 33 + obj-$(CONFIG_BATTERY_SBS) += sbs-battery.o 34 + obj-$(CONFIG_BATTERY_BQ27XXX) += bq27xxx_battery.o 35 + obj-$(CONFIG_BATTERY_BQ27XXX_I2C) += bq27xxx_battery_i2c.o 36 + obj-$(CONFIG_BATTERY_DA9030) += da9030_battery.o 37 + obj-$(CONFIG_BATTERY_DA9052) += da9052-battery.o 38 + obj-$(CONFIG_CHARGER_DA9150) += da9150-charger.o 39 + obj-$(CONFIG_BATTERY_DA9150) += da9150-fg.o 40 + obj-$(CONFIG_BATTERY_MAX17040) += max17040_battery.o 41 + obj-$(CONFIG_BATTERY_MAX17042) += max17042_battery.o 42 + obj-$(CONFIG_BATTERY_Z2) += z2_battery.o 43 + obj-$(CONFIG_BATTERY_RT5033) += rt5033_battery.o 44 + obj-$(CONFIG_CHARGER_RT9455) += rt9455_charger.o 45 + obj-$(CONFIG_BATTERY_S3C_ADC) += s3c_adc_battery.o 46 + obj-$(CONFIG_BATTERY_TWL4030_MADC) += twl4030_madc_battery.o 47 + obj-$(CONFIG_CHARGER_88PM860X) += 88pm860x_charger.o 48 + obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o 49 + obj-$(CONFIG_BATTERY_JZ4740) += jz4740-battery.o 50 + obj-$(CONFIG_BATTERY_INTEL_MID) += intel_mid_battery.o 51 + obj-$(CONFIG_BATTERY_RX51) += rx51_battery.o 52 + obj-$(CONFIG_AB8500_BM) += ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o abx500_chargalg.o pm2301_charger.o 53 + obj-$(CONFIG_CHARGER_ISP1704) += isp1704_charger.o 54 + obj-$(CONFIG_CHARGER_MAX8903) += max8903_charger.o 55 + obj-$(CONFIG_CHARGER_TWL4030) += twl4030_charger.o 56 + obj-$(CONFIG_CHARGER_LP8727) += lp8727_charger.o 57 + obj-$(CONFIG_CHARGER_LP8788) += lp8788-charger.o 58 + obj-$(CONFIG_CHARGER_GPIO) += gpio-charger.o 59 + obj-$(CONFIG_CHARGER_MANAGER) += charger-manager.o 60 + obj-$(CONFIG_CHARGER_MAX14577) += max14577_charger.o 61 + obj-$(CONFIG_CHARGER_MAX77693) += max77693_charger.o 62 + obj-$(CONFIG_CHARGER_MAX8997) += max8997_charger.o 63 + obj-$(CONFIG_CHARGER_MAX8998) += max8998_charger.o 64 + obj-$(CONFIG_CHARGER_QCOM_SMBB) += qcom_smbb.o 65 + obj-$(CONFIG_CHARGER_BQ2415X) += bq2415x_charger.o 66 + obj-$(CONFIG_CHARGER_BQ24190) += bq24190_charger.o 67 + obj-$(CONFIG_CHARGER_BQ24257) += bq24257_charger.o 68 + obj-$(CONFIG_CHARGER_BQ24735) += bq24735-charger.o 69 + obj-$(CONFIG_CHARGER_BQ25890) += bq25890_charger.o 70 + obj-$(CONFIG_CHARGER_SMB347) += smb347-charger.o 71 + obj-$(CONFIG_CHARGER_TPS65090) += tps65090-charger.o 72 + obj-$(CONFIG_CHARGER_TPS65217) += tps65217_charger.o 73 + obj-$(CONFIG_AXP288_FUEL_GAUGE) += axp288_fuel_gauge.o 74 + obj-$(CONFIG_AXP288_CHARGER) += axp288_charger.o
drivers/power/test_power.c drivers/power/supply/test_power.c
drivers/power/tosa_battery.c drivers/power/supply/tosa_battery.c
drivers/power/tps65090-charger.c drivers/power/supply/tps65090-charger.c
drivers/power/tps65217_charger.c drivers/power/supply/tps65217_charger.c
drivers/power/twl4030_charger.c drivers/power/supply/twl4030_charger.c
drivers/power/twl4030_madc_battery.c drivers/power/supply/twl4030_madc_battery.c
drivers/power/wm831x_backup.c drivers/power/supply/wm831x_backup.c
drivers/power/wm831x_power.c drivers/power/supply/wm831x_power.c
drivers/power/wm8350_power.c drivers/power/supply/wm8350_power.c
-2
drivers/power/wm97xx_battery.c drivers/power/supply/wm97xx_battery.c
··· 1 1 /* 2 - * linux/drivers/power/wm97xx_battery.c 3 - * 4 2 * Battery measurement code for WM97xx 5 3 * 6 4 * based on tosa_battery.c
drivers/power/z2_battery.c drivers/power/supply/z2_battery.c