diff options
author | Daniel Mack <daniel@zonque.org> | 2018-07-06 07:35:51 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2018-07-11 18:09:09 +0200 |
commit | bf49735537374c02fd4111bd5463e372f69c41f8 (patch) | |
tree | 380a984714c0cca718040a2e26d128fe5b2b6108 /drivers/w1/slaves/w1_ds2760.h | |
parent | fae68031f7fbc8b6db58d87830ba7ed1d696fbb1 (diff) | |
download | linux-bf49735537374c02fd4111bd5463e372f69c41f8.tar.gz |
power: supply: ds2760_battery: merge ds2760 supply driver with its w1 slave companion
This patch removes the w1 slave driver that used to register the w1 family
and instanciate a platform device at runtime. The code now lives in the
supply driver instead to avoid that level of indirection.
The old device name "ds2760-battery.0" is preserved, so userspace
applications can access the same virtual device nodes as before.
Note that because the w1 core does not currently have a framework for
suspend/resume, the driver now registers a PM notifier callback.
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Diffstat (limited to 'drivers/w1/slaves/w1_ds2760.h')
-rw-r--r-- | drivers/w1/slaves/w1_ds2760.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/drivers/w1/slaves/w1_ds2760.h b/drivers/w1/slaves/w1_ds2760.h deleted file mode 100644 index 24168c94eeae..000000000000 --- a/drivers/w1/slaves/w1_ds2760.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 1-Wire implementation for the ds2760 chip - * - * Copyright © 2004-2005, Szabolcs Gyurko <szabolcs.gyurko@tlt.hu> - * - * Use consistent with the GNU GPL is permitted, - * provided that this copyright notice is - * preserved in its entirety in all copies and derived works. - * - */ - -#ifndef __w1_ds2760_h__ -#define __w1_ds2760_h__ - -/* Known commands to the DS2760 chip */ -#define W1_DS2760_SWAP 0xAA -#define W1_DS2760_READ_DATA 0x69 -#define W1_DS2760_WRITE_DATA 0x6C -#define W1_DS2760_COPY_DATA 0x48 -#define W1_DS2760_RECALL_DATA 0xB8 -#define W1_DS2760_LOCK 0x6A - -/* Number of valid register addresses */ -#define DS2760_DATA_SIZE 0x40 - -#define DS2760_PROTECTION_REG 0x00 - -#define DS2760_STATUS_REG 0x01 -#define DS2760_STATUS_IE (1 << 2) -#define DS2760_STATUS_SWEN (1 << 3) -#define DS2760_STATUS_RNAOP (1 << 4) -#define DS2760_STATUS_PMOD (1 << 5) - -#define DS2760_EEPROM_REG 0x07 -#define DS2760_SPECIAL_FEATURE_REG 0x08 -#define DS2760_VOLTAGE_MSB 0x0c -#define DS2760_VOLTAGE_LSB 0x0d -#define DS2760_CURRENT_MSB 0x0e -#define DS2760_CURRENT_LSB 0x0f -#define DS2760_CURRENT_ACCUM_MSB 0x10 -#define DS2760_CURRENT_ACCUM_LSB 0x11 -#define DS2760_TEMP_MSB 0x18 -#define DS2760_TEMP_LSB 0x19 -#define DS2760_EEPROM_BLOCK0 0x20 -#define DS2760_ACTIVE_FULL 0x20 -#define DS2760_EEPROM_BLOCK1 0x30 -#define DS2760_STATUS_WRITE_REG 0x31 -#define DS2760_RATED_CAPACITY 0x32 -#define DS2760_CURRENT_OFFSET_BIAS 0x33 -#define DS2760_ACTIVE_EMPTY 0x3b - -extern int w1_ds2760_read(struct device *dev, char *buf, int addr, - size_t count); -extern int w1_ds2760_write(struct device *dev, char *buf, int addr, - size_t count); -extern int w1_ds2760_store_eeprom(struct device *dev, int addr); -extern int w1_ds2760_recall_eeprom(struct device *dev, int addr); - -#endif /* !__w1_ds2760_h__ */ |