2019-05-03 17:52:38

by Andrey Smirnov

[permalink] [raw]
Subject: [PATCH v6 0/3] Driver for UCS1002

Everyone:

This small series adds a driver for UCS1002 Programmable USB Port
Power Controller with Charger Emulation. See [page] for product page
and [datasheet] for device dataseet. Hopefully each individual patch
is self explanatory.

Note that this series is a revival of the upstreaming effort by Enric
Balletbo Serra last version of which can be found at [original-effort]

Feedback is welcome!

Thanks,
Andrey Smirnov

Changes since [v5]:

- Collected Reviewed-by for "power: supply: Add driver for
Microchip UCS1002" from Guenter

- Fixed Kconfig indentation issue

Changes since [v4]:

- Chagned "interrupts-extended" -> "interrupts" in DT bindings description

- Collected Reviewed-by from Rob

Changes since [v3]:

- Added a check for negative values to ucs1002_set_usb_type()

Changes since [v2]:

- Fixed a bug pointed out by Lucas

Changes since [v1]:

- Moved IRQ trigger specification to DT

- Fixed silent error paths in probe()

- Dropped error message in ucs1002_set_max_current()

- Fixed license mismatch

- Changed the driver to configure the chip to BC1.2 CDP by default

- Made other small fixes as per feedback for v1

[v5] https://lore.kernel.org/lkml/[email protected]
[v4] https://lore.kernel.org/lkml/[email protected]
[v3] https://lore.kernel.org/lkml/[email protected]
[v2] https://lore.kernel.org/lkml/[email protected]
[v1] https://lore.kernel.org/lkml/[email protected]/
[page] https://www.microchip.com/wwwproducts/en/UCS1002-2
[datasheet] https://ww1.microchip.com/downloads/en/DeviceDoc/UCS1002-2%20Data%20Sheet.pdf
[original-effort] https://lore.kernel.org/lkml/[email protected]/


Andrey Smirnov (3):
power: supply: core: Add POWER_SUPPLY_HEALTH_OVERCURRENT constant
power: supply: Add driver for Microchip UCS1002
dt-bindings: power: supply: Add bindings for Microchip UCS1002

.../power/supply/microchip,ucs1002.txt | 27 +
drivers/power/supply/Kconfig | 9 +
drivers/power/supply/Makefile | 1 +
drivers/power/supply/power_supply_sysfs.c | 2 +-
drivers/power/supply/ucs1002_power.c | 646 ++++++++++++++++++
include/linux/power_supply.h | 1 +
6 files changed, 685 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/power/supply/microchip,ucs1002.txt
create mode 100644 drivers/power/supply/ucs1002_power.c

--
2.21.0


2019-05-03 17:52:40

by Andrey Smirnov

[permalink] [raw]
Subject: [PATCH v6 1/3] power: supply: core: Add POWER_SUPPLY_HEALTH_OVERCURRENT constant

Add POWER_SUPPLY_HEALTH_OVERCURRENT constant in order to allow
singalling overcurrent condition via power supply health information.

Signed-off-by: Andrey Smirnov <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Cc: Enric Balletbo Serra <[email protected]>
Cc: Chris Healy <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/power/supply/power_supply_sysfs.c | 2 +-
include/linux/power_supply.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index 5358a80d854f..153f4a6ca57c 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -62,7 +62,7 @@ static const char * const power_supply_charge_type_text[] = {
static const char * const power_supply_health_text[] = {
"Unknown", "Good", "Overheat", "Dead", "Over voltage",
"Unspecified failure", "Cold", "Watchdog timer expire",
- "Safety timer expire"
+ "Safety timer expire", "Over current"
};

static const char * const power_supply_technology_text[] = {
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 2f9c201a54d1..bdab14c7ca4d 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -57,6 +57,7 @@ enum {
POWER_SUPPLY_HEALTH_COLD,
POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE,
POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE,
+ POWER_SUPPLY_HEALTH_OVERCURRENT,
};

enum {
--
2.21.0

2019-05-03 21:18:36

by Sebastian Reichel

[permalink] [raw]
Subject: Re: [PATCH v6 0/3] Driver for UCS1002

Hi,

On Fri, May 03, 2019 at 12:00:39PM -0500, Andrey Smirnov wrote:
> This small series adds a driver for UCS1002 Programmable USB Port
> Power Controller with Charger Emulation. See [page] for product page
> and [datasheet] for device dataseet. Hopefully each individual patch
> is self explanatory.
>
> Note that this series is a revival of the upstreaming effort by Enric
> Balletbo Serra last version of which can be found at [original-effort]

Thanks, queued (whole series).

-- Sebastian


Attachments:
(No filename) (510.00 B)
signature.asc (849.00 B)
Download all attachments