[PATCH] regmap: regmap-w1: Fix build troubles

2017-07-07 Thread Alex A. Mihaylov
Fixes: cc5d0db390b0 ("regmap: Add 1-Wire bus support") Commit de0d6dbdbdb2 ("w1: Add subsystem kernel public interface") Fix place off w1.h header file Cosmetic: Fix company name (local to international) Signed-off-by: Alex A. Mihaylov <minimum...@rambler.ru> --- drive

[PATCH] regmap: regmap-w1: Fix build troubles

2017-07-07 Thread Alex A. Mihaylov
Fixes: cc5d0db390b0 ("regmap: Add 1-Wire bus support") Commit de0d6dbdbdb2 ("w1: Add subsystem kernel public interface") Fix place off w1.h header file Cosmetic: Fix company name (local to international) Signed-off-by: Alex A. Mihaylov --- drivers/base/regmap/regmap-w

[PATCH] power: power_supply: Add support for MAX1721x standalone fuel gauge

2017-07-06 Thread Alex A. Mihaylov
The MAX17211 monitor a single cell pack. The MAX17215 monitor and balance a 2S or 3S pack or monitor a multiple-series cell pack. Both device use 1-Wire interfce. Signed-off-by: Alex A. Mihaylov <minimum...@rambler.ru> --- drivers/power/supply/Kconfig| 13 + drivers/power/

[PATCH] regmap: regmap-w1: Fix build troubles

2017-07-06 Thread Alex A. Mihaylov
Fixes: cc5d0db390b0 ("regmap: Add 1-Wire bus support") Commit de0d6dbdbdb2 ("w1: Add subsystem kernel public interface") Fix place off w1.h header file Cosmetic: Fix company name (local to international) Signed-off-by: Alex A. Mihaylov <minimum...@rambler.ru> --- drive

[PATCH] power: power_supply: Add support for MAX1721x standalone fuel gauge

2017-07-06 Thread Alex A. Mihaylov
The MAX17211 monitor a single cell pack. The MAX17215 monitor and balance a 2S or 3S pack or monitor a multiple-series cell pack. Both device use 1-Wire interfce. Signed-off-by: Alex A. Mihaylov --- drivers/power/supply/Kconfig| 13 + drivers/power/supply/Makefile | 1

[PATCH] regmap: regmap-w1: Fix build troubles

2017-07-06 Thread Alex A. Mihaylov
Fixes: cc5d0db390b0 ("regmap: Add 1-Wire bus support") Commit de0d6dbdbdb2 ("w1: Add subsystem kernel public interface") Fix place off w1.h header file Cosmetic: Fix company name (local to international) Signed-off-by: Alex A. Mihaylov --- drivers/base/regmap/regmap-w

[PATCH] power_supply: add max1721x_battery driver

2017-06-13 Thread Alex A. Mihaylov
Maxim Integrated MAX17211/MAX17215 Standalone Fuel Gauge IC with 1-Wire interface. MAX17215 sinle cell version, MAX17211 multicell with cell ballancing. This driver use regmap-w1 infrastucture. Waiting for other patches for 1-Wire. This time for review only. Signed-off-by: Alex A. Mihaylov

[PATCH] power_supply: add max1721x_battery driver

2017-06-13 Thread Alex A. Mihaylov
Maxim Integrated MAX17211/MAX17215 Standalone Fuel Gauge IC with 1-Wire interface. MAX17215 sinle cell version, MAX17211 multicell with cell ballancing. This driver use regmap-w1 infrastucture. Waiting for other patches for 1-Wire. This time for review only. Signed-off-by: Alex A. Mihaylov

[PATCH] w1: Fix slave count on 1-Wire bus (resend)

2017-06-13 Thread Alex A. Mihaylov
1-Wire bus have very fast algorith for exchange with single slave device. Fix incorrect count of slave devices on connect second slave device. This case on slave device probe() step we need use generic (multislave) functions for read/write device. Signed-off-by: Alex A. Mihaylov <mini

[PATCH] w1: Fix slave count on 1-Wire bus (resend)

2017-06-13 Thread Alex A. Mihaylov
1-Wire bus have very fast algorith for exchange with single slave device. Fix incorrect count of slave devices on connect second slave device. This case on slave device probe() step we need use generic (multislave) functions for read/write device. Signed-off-by: Alex A. Mihaylov --- drivers/w1

Re: [PATCH 3/3] power: supply: Add support MAX1721x battery monitor

2017-06-08 Thread Alex A. Mihaylov
08.06.17 15:48, Sebastian Reichel wrote: On Fri, Jun 02, 2017 at 10:06:29AM +0300, Alex A. Mihaylov wrote: diff --git a/drivers/power/supply/max1721x_battery.c b/drivers/power/supply/max1721x_battery.c new file mode 100644 index 00..aa0effec3d --- /dev/null +++ b/drivers/power/supply

Re: [PATCH 3/3] power: supply: Add support MAX1721x battery monitor

2017-06-08 Thread Alex A. Mihaylov
08.06.17 15:48, Sebastian Reichel wrote: On Fri, Jun 02, 2017 at 10:06:29AM +0300, Alex A. Mihaylov wrote: diff --git a/drivers/power/supply/max1721x_battery.c b/drivers/power/supply/max1721x_battery.c new file mode 100644 index 00..aa0effec3d --- /dev/null +++ b/drivers/power/supply

[PATCH 1/3] regmap: Add 1-Wire bus support

2017-06-02 Thread Alex A. Mihaylov
-Wire) support + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov <minimum...@rambler.ru> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free So

[PATCH 2/3] w1: MAX1721x Stanalone Fuel Gauge - add 1-Wire slave drivers

2017-06-02 Thread Alex A. Mihaylov
x 00..017ec3e159 --- /dev/null +++ b/drivers/w1/slaves/w1_max1721x.c @@ -0,0 +1,73 @@ +/* + * 1-Wire implementation for Maxim Semiconductor + * MAX17211/MAX17215 standalone fuel gauge chip + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov <minimum...@rambler

[PATCH 1/3] regmap: Add 1-Wire bus support

2017-06-02 Thread Alex A. Mihaylov
-Wire) support + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation + */ + +#include

[PATCH 2/3] w1: MAX1721x Stanalone Fuel Gauge - add 1-Wire slave drivers

2017-06-02 Thread Alex A. Mihaylov
x 00..017ec3e159 --- /dev/null +++ b/drivers/w1/slaves/w1_max1721x.c @@ -0,0 +1,73 @@ +/* + * 1-Wire implementation for Maxim Semiconductor + * MAX17211/MAX17215 standalone fuel gauge chip + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov + * + * Use consistent with

[PATCH 3/3] power: supply: Add support MAX1721x battery monitor

2017-06-02 Thread Alex A. Mihaylov
X17215 Standalone Fuel Gauge IC + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov <minimum...@rambler.ru> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * publish

[PATCH 0/3] Battery monitor MAX1721x with w1-regmap and w1-slave (resend)

2017-06-02 Thread Alex A. Mihaylov
Codding style fix. Maillist message subject fix. Soryy for all. It's hard to be stuppid :-( Alex A. Mihaylov (3): regmap: Add 1-Wire bus support w1: MAX1721x Stanalone Fuel Gauge - add 1-Wire slave drivers power: supply: Add support MAX1721x battery monitor drivers/base/regmap/Kconfig

[PATCH 3/3] power: supply: Add support MAX1721x battery monitor

2017-06-02 Thread Alex A. Mihaylov
X17215 Standalone Fuel Gauge IC + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foun

[PATCH 0/3] Battery monitor MAX1721x with w1-regmap and w1-slave (resend)

2017-06-02 Thread Alex A. Mihaylov
Codding style fix. Maillist message subject fix. Soryy for all. It's hard to be stuppid :-( Alex A. Mihaylov (3): regmap: Add 1-Wire bus support w1: MAX1721x Stanalone Fuel Gauge - add 1-Wire slave drivers power: supply: Add support MAX1721x battery monitor drivers/base/regmap/Kconfig

[3/3] power: supply: Add support MAX1721x battery monitor

2017-06-01 Thread Alex A. Mihaylov
X17215 Standalone Fuel Gauge IC + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov <minimum...@rambler.ru> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * publish

[1/3] regmap: Add 1-Wire bus support

2017-06-01 Thread Alex A. Mihaylov
-Wire) support + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov <minimum...@rambler.ru> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free So

[2/3] w1: MAX1721x Stanalone Fuel Gauge - add 1-Wire slave drivers

2017-06-01 Thread Alex A. Mihaylov
x 00..017ec3e159 --- /dev/null +++ b/drivers/w1/slaves/w1_max1721x.c @@ -0,0 +1,73 @@ +/* + * 1-Wire implementation for Maxim Semiconductor + * MAX17211/MAX17215 standalone fuel gauge chip + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov <minimum...@rambler

[3/3] power: supply: Add support MAX1721x battery monitor

2017-06-01 Thread Alex A. Mihaylov
X17215 Standalone Fuel Gauge IC + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foun

[1/3] regmap: Add 1-Wire bus support

2017-06-01 Thread Alex A. Mihaylov
-Wire) support + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation + */ + +#include

[2/3] w1: MAX1721x Stanalone Fuel Gauge - add 1-Wire slave drivers

2017-06-01 Thread Alex A. Mihaylov
x 00..017ec3e159 --- /dev/null +++ b/drivers/w1/slaves/w1_max1721x.c @@ -0,0 +1,73 @@ +/* + * 1-Wire implementation for Maxim Semiconductor + * MAX17211/MAX17215 standalone fuel gauge chip + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov + * + * Use consistent with

[0/3] Battery monitor MAX1721x with w1-regmap and w1-slave (resend v2)

2017-06-01 Thread Alex A. Mihaylov
Coding style fixes. Alex A. Mihaylov (3): regmap: Add 1-Wire bus support w1: MAX1721x Stanalone Fuel Gauge - add 1-Wire slave drivers power: supply: Add support MAX1721x battery monitor drivers/base/regmap/Kconfig | 6 +- drivers/base/regmap/Makefile| 1

[0/3] Battery monitor MAX1721x with w1-regmap and w1-slave (resend v2)

2017-06-01 Thread Alex A. Mihaylov
Coding style fixes. Alex A. Mihaylov (3): regmap: Add 1-Wire bus support w1: MAX1721x Stanalone Fuel Gauge - add 1-Wire slave drivers power: supply: Add support MAX1721x battery monitor drivers/base/regmap/Kconfig | 6 +- drivers/base/regmap/Makefile| 1

[PATCH] w1: Fix slave count on 1-Wire bus (resend)

2017-05-30 Thread Alex A. Mihaylov
1-Wire bus have very fast algorith for exchange with single slave device. Fix incorrect count of slave devices on connect second slave device. This case on slave device probe() step we need use generic (multislave) functions for read/write device. Signed-off-by: Alex A. Mihaylov <mini

[PATCH] w1: Fix slave count on 1-Wire bus (resend)

2017-05-30 Thread Alex A. Mihaylov
1-Wire bus have very fast algorith for exchange with single slave device. Fix incorrect count of slave devices on connect second slave device. This case on slave device probe() step we need use generic (multislave) functions for read/write device. Signed-off-by: Alex A. Mihaylov --- drivers/w1

[PATCH 2/3] w1: MAX1721x Stanalone Fuel Gauge - add 1-Wire slave drivers

2017-05-30 Thread Alex A. Mihaylov
Add support for Maxim Semiconductor MAX17211/MAX17215 Standlone Fuel Gauge 1-Wire family 0x26 Signed-off-by: Alex A. Mihaylov <minimum...@rambler.ru> --- drivers/w1/slaves/Kconfig | 12 + drivers/w1/slaves/Makefile | 1 + drivers/w1/slaves/w1_max1721x.c

[PATCH 2/3] w1: MAX1721x Stanalone Fuel Gauge - add 1-Wire slave drivers

2017-05-30 Thread Alex A. Mihaylov
Add support for Maxim Semiconductor MAX17211/MAX17215 Standlone Fuel Gauge 1-Wire family 0x26 Signed-off-by: Alex A. Mihaylov --- drivers/w1/slaves/Kconfig | 12 + drivers/w1/slaves/Makefile | 1 + drivers/w1/slaves/w1_max1721x.c | 73 drivers/w1

[PATCH 0/3] Battery monitor MAX1721x with w1-regmap and w1-slave (resend)

2017-05-30 Thread Alex A. Mihaylov
Again resend patches. All wishes are realized. Alex A. Mihaylov (3): regmap: Add 1-Wire bus support w1: MAX1721x Stanalone Fuel Gauge - add 1-Wire slave drivers power: supply: Add support MAX1721x battery monitor drivers/base/regmap/Kconfig | 6 +- drivers/base/regmap

[PATCH 0/3] Battery monitor MAX1721x with w1-regmap and w1-slave (resend)

2017-05-30 Thread Alex A. Mihaylov
Again resend patches. All wishes are realized. Alex A. Mihaylov (3): regmap: Add 1-Wire bus support w1: MAX1721x Stanalone Fuel Gauge - add 1-Wire slave drivers power: supply: Add support MAX1721x battery monitor drivers/base/regmap/Kconfig | 6 +- drivers/base/regmap

[PATCH 3/3] power: supply: Add support MAX1721x battery monitor

2017-05-30 Thread Alex A. Mihaylov
Add support for battery monitor MAX1721x chips (power_supply class). Maxim Semiconductor MAX1721x Standalone Fuel Gauge battery monitor. MAX17211 used for singlecell, MAX17215 for multicell batteryes. Signed-off-by: Alex A. Mihaylov <minimum...@rambler.ru> --- drivers/power/supply/K

[PATCH 1/3] regmap: Add 1-Wire bus support

2017-05-30 Thread Alex A. Mihaylov
Add basic support regmap (register map access) API for 1-Wire bus Signed-off-by: Alex A. Mihaylov <minimum...@rambler.ru> --- drivers/base/regmap/Kconfig | 6 +- drivers/base/regmap/Makefile| 1 + drivers/base/regmap/regmap-w1.c | 239 i

[PATCH 3/3] power: supply: Add support MAX1721x battery monitor

2017-05-30 Thread Alex A. Mihaylov
Add support for battery monitor MAX1721x chips (power_supply class). Maxim Semiconductor MAX1721x Standalone Fuel Gauge battery monitor. MAX17211 used for singlecell, MAX17215 for multicell batteryes. Signed-off-by: Alex A. Mihaylov --- drivers/power/supply/Kconfig| 14 ++ drivers

[PATCH 1/3] regmap: Add 1-Wire bus support

2017-05-30 Thread Alex A. Mihaylov
Add basic support regmap (register map access) API for 1-Wire bus Signed-off-by: Alex A. Mihaylov --- drivers/base/regmap/Kconfig | 6 +- drivers/base/regmap/Makefile| 1 + drivers/base/regmap/regmap-w1.c | 239 include/linux/regmap.h

Re: [PATCH 1/3] regmap: Add OneWire (W1) bus support

2017-05-29 Thread Alex A. Mihaylov
29.05.17 16:13, Mark Brown пишет: + int ret = -ENODEV; + + mutex_lock(>master->bus_mutex); + if (!w1_reset_select_slave(sl)) { + w1_write_8(sl->master, W1_CMD_READ_DATA); + w1_write_8(sl->master, reg); + *val = w1_read_8(sl->master); +

Re: [PATCH 1/3] regmap: Add OneWire (W1) bus support

2017-05-29 Thread Alex A. Mihaylov
29.05.17 16:13, Mark Brown пишет: + int ret = -ENODEV; + + mutex_lock(>master->bus_mutex); + if (!w1_reset_select_slave(sl)) { + w1_write_8(sl->master, W1_CMD_READ_DATA); + w1_write_8(sl->master, reg); + *val = w1_read_8(sl->master); +

[PATCH] w1: Fix slave count on W1 bus

2017-05-28 Thread Alex A. Mihaylov
OneWire bus have very fast algorith for exchange with single slave device. Fix incorrect count of slave devices on connect second slave device. This case on probe() step we need use generic (multislave) functions for read/write slave device. Signed-off-by: Alex A. Mihaylov <minimum...@rambler

[PATCH] w1: Fix slave count on W1 bus

2017-05-28 Thread Alex A. Mihaylov
OneWire bus have very fast algorith for exchange with single slave device. Fix incorrect count of slave devices on connect second slave device. This case on probe() step we need use generic (multislave) functions for read/write slave device. Signed-off-by: Alex A. Mihaylov --- drivers/w1/w1.c

[PATCH 2/3] w1: Add Maxim Semiconductor MAX1721x W1 slave drivers

2017-05-28 Thread Alex A. Mihaylov
Add support Maxim Semiconductor MAX17211/MAX17215 OneWire family 0x26 Signed-off-by: Alex A. Mihaylov <minimum...@rambler.ru> --- drivers/w1/slaves/Kconfig | 12 + drivers/w1/slaves/Makefile | 1 + drivers/w1/slaves/w1_max1721x.c | 73 driv

[PATCH 3/3] power: supply: Add support MAX1721x battery monitor

2017-05-28 Thread Alex A. Mihaylov
Add support for battery monitor MAX1721x chips (power_supply class). Maxim Semiconductor MAX1721x Standalone Fuel Gauge battery monitor. MAX17211 used for singlecell batteryes, MAX17215 for multicell. Signed-off-by: Alex A. Mihaylov <minimum...@rambler.ru> --- drivers/power/supply/K

[PATCH 1/3] regmap: Add OneWire (W1) bus support

2017-05-28 Thread Alex A. Mihaylov
Add basic support regmap (register map access) API for OneWire (W1) bus Signed-off-by: Alex A. Mihaylov <minimum...@rambler.ru> --- drivers/base/regmap/Kconfig | 6 +- drivers/base/regmap/Makefile| 1 + drivers/base/regmap/regmap-w1.c

[PATCH 0/3] Battery monitor MAX1721x with w1-regmap and w1-slave

2017-05-28 Thread Alex A. Mihaylov
regmap: Add OneWire (W1) bus support w1: Add Maxim Semiconductor MAX1721X W1 slave drivers power: supply: Add support MAX1721x battery monitor drivers/base/regmap/Kconfig | 6 +- drivers/base/regmap/Makefile| 1 + drivers/base/regmap/regmap-w1.c | 241

[PATCH 2/3] w1: Add Maxim Semiconductor MAX1721x W1 slave drivers

2017-05-28 Thread Alex A. Mihaylov
Add support Maxim Semiconductor MAX17211/MAX17215 OneWire family 0x26 Signed-off-by: Alex A. Mihaylov --- drivers/w1/slaves/Kconfig | 12 + drivers/w1/slaves/Makefile | 1 + drivers/w1/slaves/w1_max1721x.c | 73 drivers/w1/slaves/w1_max1721x.h

[PATCH 3/3] power: supply: Add support MAX1721x battery monitor

2017-05-28 Thread Alex A. Mihaylov
Add support for battery monitor MAX1721x chips (power_supply class). Maxim Semiconductor MAX1721x Standalone Fuel Gauge battery monitor. MAX17211 used for singlecell batteryes, MAX17215 for multicell. Signed-off-by: Alex A. Mihaylov --- drivers/power/supply/Kconfig| 14 ++ drivers

[PATCH 1/3] regmap: Add OneWire (W1) bus support

2017-05-28 Thread Alex A. Mihaylov
Add basic support regmap (register map access) API for OneWire (W1) bus Signed-off-by: Alex A. Mihaylov --- drivers/base/regmap/Kconfig | 6 +- drivers/base/regmap/Makefile| 1 + drivers/base/regmap/regmap-w1.c | 241 include/linux/regmap.h

[PATCH 0/3] Battery monitor MAX1721x with w1-regmap and w1-slave

2017-05-28 Thread Alex A. Mihaylov
regmap: Add OneWire (W1) bus support w1: Add Maxim Semiconductor MAX1721X W1 slave drivers power: supply: Add support MAX1721x battery monitor drivers/base/regmap/Kconfig | 6 +- drivers/base/regmap/Makefile| 1 + drivers/base/regmap/regmap-w1.c | 241

Re: [PATCH 1/4] Introduce regmap infrastructure over Maxim/Dalas OneWire (W1) bus

2017-05-26 Thread Alex A. Mihaylov
Alex, it is up to you to decide whether you want to push your regmap version or not, I will not object against, but in my personal opinion your first version version was much cleaner. I don't know. First edition (without regmap) was very simple. I think anyone could understand how this

Re: [PATCH 1/4] Introduce regmap infrastructure over Maxim/Dalas OneWire (W1) bus

2017-05-26 Thread Alex A. Mihaylov
Alex, it is up to you to decide whether you want to push your regmap version or not, I will not object against, but in my personal opinion your first version version was much cleaner. I don't know. First edition (without regmap) was very simple. I think anyone could understand how this

Re: [PATCH 1/4] Introduce regmap infrastructure over Maxim/Dalas OneWire (W1) bus

2017-05-26 Thread Alex A. Mihaylov
This looks mostly fine, a couple of small things and like I said in reply to Greg please use subject lines matching the style for the subsystem - this makes it a lot easier for people to identify relevant patches. + int ret = -ENODEV; + + + if (reg > 255) + return

Re: [PATCH 1/4] Introduce regmap infrastructure over Maxim/Dalas OneWire (W1) bus

2017-05-26 Thread Alex A. Mihaylov
This looks mostly fine, a couple of small things and like I said in reply to Greg please use subject lines matching the style for the subsystem - this makes it a lot easier for people to identify relevant patches. + int ret = -ENODEV; + + + if (reg > 255) + return

[PATCH 4/4] Fix W1 slave exchange with second device on probe step

2017-05-25 Thread Alex A. Mihaylov
Signed-off-by: Alex A. Mihaylov <minimum...@rambler.ru> --- drivers/w1/w1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 90a3d93..5b8b976 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -731,6 +731,7

[PATCH 4/4] Fix W1 slave exchange with second device on probe step

2017-05-25 Thread Alex A. Mihaylov
Signed-off-by: Alex A. Mihaylov --- drivers/w1/w1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 90a3d93..5b8b976 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -731,6 +731,7 @@ int w1_attach_slave_device(struct w1_master

[PATCH 3/4] Introduce Maxim Semiconductor MAX17211/MAX17215 Standalone Fuel Gauge IC support for power_supply class driver

2017-05-25 Thread Alex A. Mihaylov
Signed-off-by: Alex A. Mihaylov <minimum...@rambler.ru> --- drivers/power/supply/Kconfig| 14 ++ drivers/power/supply/Makefile | 1 + drivers/power/supply/max1721x_battery.c | 357 3 files changed, 372 insertions(+) create mode

[PATCH 3/4] Introduce Maxim Semiconductor MAX17211/MAX17215 Standalone Fuel Gauge IC support for power_supply class driver

2017-05-25 Thread Alex A. Mihaylov
Signed-off-by: Alex A. Mihaylov --- drivers/power/supply/Kconfig| 14 ++ drivers/power/supply/Makefile | 1 + drivers/power/supply/max1721x_battery.c | 357 3 files changed, 372 insertions(+) create mode 100644 drivers/power/supply

[PATCH 2/4] Introduce new OneWire (W1) family 0x26 with slave device Maxim Semconductor MAX17211/MAX17215 Fuel Gauge IC

2017-05-25 Thread Alex A. Mihaylov
Signed-off-by: Alex A. Mihaylov <minimum...@rambler.ru> --- drivers/w1/slaves/Kconfig | 12 + drivers/w1/slaves/Makefile | 1 + drivers/w1/slaves/w1_max1721x.c | 73 drivers/w1/slaves/w1_max1721x.h

[PATCH 2/4] Introduce new OneWire (W1) family 0x26 with slave device Maxim Semconductor MAX17211/MAX17215 Fuel Gauge IC

2017-05-25 Thread Alex A. Mihaylov
Signed-off-by: Alex A. Mihaylov --- drivers/w1/slaves/Kconfig | 12 + drivers/w1/slaves/Makefile | 1 + drivers/w1/slaves/w1_max1721x.c | 73 drivers/w1/slaves/w1_max1721x.h | 102 drivers/w1/w1_family.h

[PATCH 1/4] Introduce regmap infrastructure over Maxim/Dalas OneWire (W1) bus

2017-05-25 Thread Alex A. Mihaylov
Signed-off-by: Alex A. Mihaylov <minimum...@rambler.ru> --- drivers/base/regmap/Kconfig | 6 +- drivers/base/regmap/Makefile| 1 + drivers/base/regmap/regmap-w1.c | 241 include/linux/regmap.h | 34 ++ 4 files change

[PATCH 1/4] Introduce regmap infrastructure over Maxim/Dalas OneWire (W1) bus

2017-05-25 Thread Alex A. Mihaylov
Signed-off-by: Alex A. Mihaylov --- drivers/base/regmap/Kconfig | 6 +- drivers/base/regmap/Makefile| 1 + drivers/base/regmap/regmap-w1.c | 241 include/linux/regmap.h | 34 ++ 4 files changed, 281 insertions(+), 1 deletion

[PATCH 0/4] Maxim Semiconductor MAX1721x power_supply driver

2017-05-25 Thread Alex A. Mihaylov
Maxim Semiconductor MAX1721x series chip is standalone fuel gauge for singlecell (MAX17211) or multicell (MAX17215) batteries. This device use OneWire (W1) interface with W1-Family code 0x26 PATCHES: 1. Introduce regmap infrastructure over Maxim/Dalas OneWire (W1) bus 2. Introduce new OneWire

[PATCH 0/4] Maxim Semiconductor MAX1721x power_supply driver

2017-05-25 Thread Alex A. Mihaylov
Maxim Semiconductor MAX1721x series chip is standalone fuel gauge for singlecell (MAX17211) or multicell (MAX17215) batteries. This device use OneWire (W1) interface with W1-Family code 0x26 PATCHES: 1. Introduce regmap infrastructure over Maxim/Dalas OneWire (W1) bus 2. Introduce new OneWire

[RFC 2/2] MAX1721x Standalone Fuel Gauge IC power_supply class driver

2017-05-08 Thread Alex A. Mihaylov
721x_battery.c new file mode 100644 index 000..5b0bbb0 --- /dev/null +++ b/drivers/power/supply/max1721x_battery.c @@ -0,0 +1,361 @@ +/* + * 1-wire client/driver for the Maxim Semicondactor + * MAX17211/MAX17215 Standalone Fuel Gauge IC + * + * Copyright (C) 2017 OAO Radioavionica + * Autho

[RFC 2/2] MAX1721x Standalone Fuel Gauge IC power_supply class driver

2017-05-08 Thread Alex A. Mihaylov
721x_battery.c new file mode 100644 index 000..5b0bbb0 --- /dev/null +++ b/drivers/power/supply/max1721x_battery.c @@ -0,0 +1,361 @@ +/* + * 1-wire client/driver for the Maxim Semicondactor + * MAX17211/MAX17215 Standalone Fuel Gauge IC + * + * Copyright (C) 2017 OAO Radioavionica

[RFC 1/2] Basic support for regmap ifrastucture over Maxim/Dalas OneWire Bus

2017-05-08 Thread Alex A. Mihaylov
a/drivers/base/regmap/regmap-w1.c b/drivers/base/regmap/regmap-w1.c new file mode 100644 index 000..6d042cb --- /dev/null +++ b/drivers/base/regmap/regmap-w1.c @@ -0,0 +1,241 @@ +/* + * Register map access API - W1 (OneWire) support + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex

[RFC 0/2] Again w1-regman and power_supply MAX1721x

2017-05-08 Thread Alex A. Mihaylov
ys/class/thermal/thermal_zoneX/type also placed "26-HexDigString", instead of "chip-battery.X.auto". I can rename "26-HexDigString" to "battery-26-HexDigString" or "26-HexDigString-battery", but this exceeded 20 chars thermal zone device name. So

[RFC 1/2] Basic support for regmap ifrastucture over Maxim/Dalas OneWire Bus

2017-05-08 Thread Alex A. Mihaylov
a/drivers/base/regmap/regmap-w1.c b/drivers/base/regmap/regmap-w1.c new file mode 100644 index 000..6d042cb --- /dev/null +++ b/drivers/base/regmap/regmap-w1.c @@ -0,0 +1,241 @@ +/* + * Register map access API - W1 (OneWire) support + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex

[RFC 0/2] Again w1-regman and power_supply MAX1721x

2017-05-08 Thread Alex A. Mihaylov
ys/class/thermal/thermal_zoneX/type also placed "26-HexDigString", instead of "chip-battery.X.auto". I can rename "26-HexDigString" to "battery-26-HexDigString" or "26-HexDigString-battery", but this exceeded 20 chars thermal zone device name. So

[PATCH 3/3] Introduce Maxim Semiconductor MAX17211/MAX17215 Standalone Fuel Gauge IC support for power_supply class driver.

2017-05-04 Thread Alex A. Mihaylov
l +++ b/drivers/power/supply/max1721x_battery.c @@ -0,0 +1,357 @@ +/* + * 1-wire client/driver for the Maxim Semicondactor + * MAX17211/MAX17215 Standalone Fuel Gauge IC + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov <minimum...@rambler.ru> + * + * This program is f

[PATCH 3/3] Introduce Maxim Semiconductor MAX17211/MAX17215 Standalone Fuel Gauge IC support for power_supply class driver.

2017-05-04 Thread Alex A. Mihaylov
l +++ b/drivers/power/supply/max1721x_battery.c @@ -0,0 +1,357 @@ +/* + * 1-wire client/driver for the Maxim Semicondactor + * MAX17211/MAX17215 Standalone Fuel Gauge IC + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov + * + * This program is free software; you can r

[PATCH 0/3] w1-regmap infrastructure and MAX1721x power_suply

2017-05-04 Thread Alex A. Mihaylov
1. Introduce regmap infrastructure over Maxim/Dalas OneWire (W1) bus 2. Introduce new OneWire (W1) family: 0x26 with slave device Maxim Semconductor MAX17211/MAX17215 Fuel Gauge IC 3. Introduce Maxim Semiconductor MAX17211/MAX17215 Standalone Fuel Gauge IC support for power_supply

[PATCH 0/3] w1-regmap infrastructure and MAX1721x power_suply

2017-05-04 Thread Alex A. Mihaylov
1. Introduce regmap infrastructure over Maxim/Dalas OneWire (W1) bus 2. Introduce new OneWire (W1) family: 0x26 with slave device Maxim Semconductor MAX17211/MAX17215 Fuel Gauge IC 3. Introduce Maxim Semiconductor MAX17211/MAX17215 Standalone Fuel Gauge IC support for power_supply

[PATCH 1/3] Introduce regmap infrastructure over Maxim/Dalas OneWire (W1) bus

2017-05-04 Thread Alex A. Mihaylov
a/drivers/base/regmap/regmap-w1.c b/drivers/base/regmap/regmap-w1.c new file mode 100644 index 000..6d042cb --- /dev/null +++ b/drivers/base/regmap/regmap-w1.c @@ -0,0 +1,241 @@ +/* + * Register map access API - W1 (OneWire) support + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex

[PATCH 2/3] Introduce new OneWire (W1) family: 0x26 with slave device Maxim Semconductor MAX17211/MAX17215 Fuel Gauge IC

2017-05-04 Thread Alex A. Mihaylov
implementation for Maxim Semiconductor + * MAX17211/MAX17215 standalone fuel gauge chip + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov <minimum...@rambler.ru> + * + * Use consistent with the GNU GPL is permitted, + * provided that this copyright notice is + * preserved

[PATCH 1/3] Introduce regmap infrastructure over Maxim/Dalas OneWire (W1) bus

2017-05-04 Thread Alex A. Mihaylov
a/drivers/base/regmap/regmap-w1.c b/drivers/base/regmap/regmap-w1.c new file mode 100644 index 000..6d042cb --- /dev/null +++ b/drivers/base/regmap/regmap-w1.c @@ -0,0 +1,241 @@ +/* + * Register map access API - W1 (OneWire) support + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex

[PATCH 2/3] Introduce new OneWire (W1) family: 0x26 with slave device Maxim Semconductor MAX17211/MAX17215 Fuel Gauge IC

2017-05-04 Thread Alex A. Mihaylov
implementation for Maxim Semiconductor + * MAX17211/MAX17215 standalone fuel gauge chip + * + * Copyright (C) 2017 OAO Radioavionica + * Author: Alex A. Mihaylov + * + * Use consistent with the GNU GPL is permitted, + * provided that this copyright notice is + * preserved in its entirety in all

Re: [PATCH 1/2] Add support for OneWire (W1) devices family 0x26 (MAX17211/MAX17215)

2017-05-01 Thread Alex A. Mihaylov
Hi! 30.04.17 23:53, Sebastian Reichel wrote:: Slave device provide software layer for access to internal registers MAX17211/MAX17215 chip. Please convert this to regmap.There is no generic w1 handler, but you can provide custom read/write functions. I think regmap be overkill for this

Re: [PATCH 1/2] Add support for OneWire (W1) devices family 0x26 (MAX17211/MAX17215)

2017-05-01 Thread Alex A. Mihaylov
Hi! 30.04.17 23:53, Sebastian Reichel wrote:: Slave device provide software layer for access to internal registers MAX17211/MAX17215 chip. Please convert this to regmap.There is no generic w1 handler, but you can provide custom read/write functions. I think regmap be overkill for this

Re: [PATCH 1/2] Add support for OneWire (W1) devices family 0x26 (MAX17211/MAX17215)

2017-04-29 Thread Alex A. Mihaylov
Hi, Slave device provide software layer for access to internal registers MAX17211/MAX17215 chip. Please convert this to regmap.There is no generic w1 handler, but you can provide custom read/write functions. I think regmap be overkill for this driver. Here we need access to a small number

Re: [PATCH 1/2] Add support for OneWire (W1) devices family 0x26 (MAX17211/MAX17215)

2017-04-29 Thread Alex A. Mihaylov
Hi, Slave device provide software layer for access to internal registers MAX17211/MAX17215 chip. Please convert this to regmap.There is no generic w1 handler, but you can provide custom read/write functions. I think regmap be overkill for this driver. Here we need access to a small number

[PATCH 1/2] Add support for OneWire (W1) devices family 0x26 (MAX17211/MAX17215)

2017-04-29 Thread Alex A. Mihaylov
-git a/drivers/w1/slaves/w1_max1721x.c b/drivers/w1/slaves/w1_max1721x.c new file mode 100644 index 000..bb73e90 --- /dev/null +++ b/drivers/w1/slaves/w1_max1721x.c @@ -0,0 +1,121 @@ +/* + * 1-Wire implementation for the max17211 chip + * + * Copyright © 2017, Alex A. Mihaylov <minimum...@rambler

[PATCH 1/2] Add support for OneWire (W1) devices family 0x26 (MAX17211/MAX17215)

2017-04-29 Thread Alex A. Mihaylov
-git a/drivers/w1/slaves/w1_max1721x.c b/drivers/w1/slaves/w1_max1721x.c new file mode 100644 index 000..bb73e90 --- /dev/null +++ b/drivers/w1/slaves/w1_max1721x.c @@ -0,0 +1,121 @@ +/* + * 1-Wire implementation for the max17211 chip + * + * Copyright © 2017, Alex A. Mihaylov + * + * Use consistent with

[PATCH 2/2] Add driver for MAX17211/MAX17215 fuel gauge

2017-04-29 Thread Alex A. Mihaylov
y\n"); + return PTR_ERR(info->bat); + } + + return 0; +} + +static int max1721x_battery_remove(struct platform_device *pdev) +{ + struct max17211_device_info *info = platform_get_drvdata(pdev); + + power_supply_unregister(info->bat); + + return 0; +} + +

[PATCH 0/2] Add support for MAX1721x fuel gauge chips

2017-04-29 Thread Alex A. Mihaylov
Maxim Semiconductor MAX17211/MAX17215 is M5 Fuel Gauge Monitor with OneWire (W1) interface. This patch provide W1 family, MAX17211x slave device and MAX17211x battery power_supply class device. Alex A. Mihaylov (2): Add support for OneWire (W1) devices family 0x26 (MAX17211/MAX17215) Add

[PATCH 0/2] Add support for MAX1721x fuel gauge chips

2017-04-29 Thread Alex A. Mihaylov
Maxim Semiconductor MAX17211/MAX17215 is M5 Fuel Gauge Monitor with OneWire (W1) interface. This patch provide W1 family, MAX17211x slave device and MAX17211x battery power_supply class device. Alex A. Mihaylov (2): Add support for OneWire (W1) devices family 0x26 (MAX17211/MAX17215) Add

[PATCH 2/2] Add driver for MAX17211/MAX17215 fuel gauge

2017-04-29 Thread Alex A. Mihaylov
PTR_ERR(info->bat); + } + + return 0; +} + +static int max1721x_battery_remove(struct platform_device *pdev) +{ + struct max17211_device_info *info = platform_get_drvdata(pdev); + + power_supply_unregister(info->bat); + + return 0; +} + +static struct platform_driv