* [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger
@ 2017-08-30 9:48 Hans de Goede
2017-08-30 9:48 ` [PATCH v3 01/11] i2c: Allow overriding dev_name through board_info Hans de Goede
` (11 more replies)
0 siblings, 12 replies; 22+ messages in thread
From: Hans de Goede @ 2017-08-30 9:48 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
Cc: Hans de Goede, platform-driver-x86, linux-kernel, linux-i2c,
Liam Breck, Tony Lindgren, linux-pm, devel
Hi All,
Here is v3 of my typec power-negotation hookup series. New this version:
- Drop a few patches merged into linux-power-supply.git/for-next
- Drop the "power: supply: bq24190_charger: Remove extcon handling"
patch *for now*, this can only be merged once all the other patches are
in place (and extcon handling is no longer needed)
- Address some review comments in some of the other patches, see the
per patch changelogs inside the commit messages
I believe that this series is ready for merging now and I would like to
ask the various subsys maintainers to pick up and merge these patches.
All the patches can be merged independent of eachother with the exception
of the last 2 patches:
i2c-cht-wc: Add device-properties for fusb302 integration
platform/x86: intel_cht_int33fe: Update fusb302 type string, add properties
Which should not be merged until all the other patches are in place.
For reference below is the cover letter of v2 of this patch.
Regards,
Hans
v2 series cover letter:
This series implements a number of typec changes discussed a while back:
- It exports the negotiated voltage and max-current in the form of a
power-supply class device which represents the USB Type-C power-brick
(adapter/charger)
- It adds a power_supply_set_input_current_limit_from_supplier helper
function which charger drivers can use to get the max-current from
their supplier
- It adds regulator support to the charger IC on the device I've. The
exported regulator controls the 5v boost convertor which generates the
5V USB vbus which gets output when the Type-C port is in host / power-src
mode
- It adds a bunch of misc. related fixes and glue code to tie everything
together
One thing which was undecided in the previous discussion was how to make
port-controller drivers hookup to external ICs (e.g. a non Type-C aware PMIC)
to decect the input-current-limit for USB2 power-sources (through e.g. BC1.2
detection). Since a number of existing drivers, including the one for the
PMIC used on the 2 mini laptops I'm working on, already use the extcon
framework to communicate the detected USB2 charger-type, I've decided to
simply hook into this existing code. As this patch set shows this can be
done with zero changes to the existing PMIC/extcon drivers.
With this series the GPD win and GPD pocket mini laptops both fully
support any type of Type-C charging. When hooked up with:
-A -> C cable and plugged into a regular port they charge at 5V 0.5A
-A -> C cable and plugged into a dedictaed charger they charge at 5V 2A
-C -> C cable and plugged into a fixed 5V 3A charger, at 5V 3A
-C -> C cable and plugged into a PD capable charger, which delivers max 12V, 2A
they charge at 12V, 2A
And when a Type-C to USB-A receptacle (so host mode) cable gets plugged in
the port correctly supplies 5V to any plugged in USB-A peripherals.
This is v2 of this series, which has the following changes (see
changelog inside individual patches for details):
-Add "i2c: Allow overriding dev_name through board_info" patch, this is
necessary for getting stable dev_names which are necessary for specifying
regulator-mappings through regulator_init_data
-Use regulator_init_data to specify mapping, drop "staging: typec:
fusb302: Add support for fcs,vbus-regulator-name device-property" patch
-Merged helper code for port-c related extcon / power_supply handling
directly into the fusb302 patches using the code, rather then trying
to add generic helpers even though there is only 1 user
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v3 01/11] i2c: Allow overriding dev_name through board_info
2017-08-30 9:48 [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Hans de Goede
@ 2017-08-30 9:48 ` Hans de Goede
2017-08-30 9:48 ` [PATCH v3 02/11] staging: typec: tcpm: Add get_current_limit tcpc_dev callback Hans de Goede
` (10 subsequent siblings)
11 siblings, 0 replies; 22+ messages in thread
From: Hans de Goede @ 2017-08-30 9:48 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
Cc: devel, linux-pm, Tony Lindgren, linux-kernel, platform-driver-x86,
Hans de Goede, Liam Breck, linux-i2c
For devices not instantiated through ACPI the i2c-client's device-name
gets set to <busnr>-<addr> by default, e.g. "0-0022" this means that
the device-name is dependent on the order in which the i2c-busses are
enumerated.
In some cases having a predictable constant device-name is desirable,
for example on non device-tree platforms the link between a regulator
and its consumers is specified by the platform code by setting
regulator_init_data.consumers. This array identifies the regulator's
consumers by dev_name and supply(-name). Which requires a constant
dev_name.
This commit adds a dev_name field to i2c_board_info allowing
platform code to set a contstant dev_name so that the device can
be identified by its dev_name in other platform code.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/i2c/i2c-core-base.c | 10 ++++++++--
include/linux/i2c.h | 2 ++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 45fafcc88b93..5cdf3b947c23 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -672,10 +672,16 @@ static void i2c_adapter_unlock_bus(struct i2c_adapter *adapter,
}
static void i2c_dev_set_name(struct i2c_adapter *adap,
- struct i2c_client *client)
+ struct i2c_client *client,
+ struct i2c_board_info const *info)
{
struct acpi_device *adev = ACPI_COMPANION(&client->dev);
+ if (info && info->dev_name) {
+ dev_set_name(&client->dev, "i2c-%s", info->dev_name);
+ return;
+ }
+
if (adev) {
dev_set_name(&client->dev, "i2c-%s", acpi_dev_name(adev));
return;
@@ -772,7 +778,7 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)
client->dev.of_node = info->of_node;
client->dev.fwnode = info->fwnode;
- i2c_dev_set_name(adap, client);
+ i2c_dev_set_name(adap, client, info);
if (info->properties) {
status = device_add_properties(&client->dev, info->properties);
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 701ad26fa6b4..d3655cfe9a3e 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -310,6 +310,7 @@ static inline bool i2c_detect_slave_mode(struct device *dev) { return false; }
* @type: chip type, to initialize i2c_client.name
* @flags: to initialize i2c_client.flags
* @addr: stored in i2c_client.addr
+ * @dev_name: Overrides the default <busnr>-<addr> dev_name if set
* @platform_data: stored in i2c_client.dev.platform_data
* @archdata: copied into i2c_client.dev.archdata
* @of_node: pointer to OpenFirmware device node
@@ -334,6 +335,7 @@ struct i2c_board_info {
char type[I2C_NAME_SIZE];
unsigned short flags;
unsigned short addr;
+ const char *dev_name;
void *platform_data;
struct dev_archdata *archdata;
struct device_node *of_node;
--
2.13.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v3 02/11] staging: typec: tcpm: Add get_current_limit tcpc_dev callback
2017-08-30 9:48 [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Hans de Goede
2017-08-30 9:48 ` [PATCH v3 01/11] i2c: Allow overriding dev_name through board_info Hans de Goede
@ 2017-08-30 9:48 ` Hans de Goede
2017-08-30 9:48 ` [PATCH v3 03/11] staging: typec: fusb302: Set max supply voltage to 5V Hans de Goede
` (9 subsequent siblings)
11 siblings, 0 replies; 22+ messages in thread
From: Hans de Goede @ 2017-08-30 9:48 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
Cc: Hans de Goede, platform-driver-x86, linux-kernel, linux-i2c,
Liam Breck, Tony Lindgren, linux-pm, devel
A Rp signalling the default current limit indicates that we're possibly
connected to an USB2 power-source. In some cases the type-c port-controller
may provide the capability to detect the current-limit in this case,
through e.g. BC1.2 detection.
This commit adds an optional get_current_limit tcpc_dev callback which
allows the port-controller to provide current-limit detection for when
the CC pin is pulled up with Rp.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
Changes in v2:
-s/get_usb2_current_limit/get_current_limit/
---
drivers/staging/typec/tcpm.c | 5 ++++-
drivers/staging/typec/tcpm.h | 7 +++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/typec/tcpm.c b/drivers/staging/typec/tcpm.c
index a911cad41a59..6ca73a3c7e88 100644
--- a/drivers/staging/typec/tcpm.c
+++ b/drivers/staging/typec/tcpm.c
@@ -667,7 +667,10 @@ static u32 tcpm_get_current_limit(struct tcpm_port *port)
break;
case TYPEC_CC_RP_DEF:
default:
- limit = 0;
+ if (port->tcpc->get_current_limit)
+ limit = port->tcpc->get_current_limit(port->tcpc);
+ else
+ limit = 0;
break;
}
diff --git a/drivers/staging/typec/tcpm.h b/drivers/staging/typec/tcpm.h
index 374cea44a84a..7e9a6b7b5cd6 100644
--- a/drivers/staging/typec/tcpm.h
+++ b/drivers/staging/typec/tcpm.h
@@ -109,6 +109,13 @@ struct tcpc_dev {
int (*init)(struct tcpc_dev *dev);
int (*get_vbus)(struct tcpc_dev *dev);
+ /*
+ * This optional callback gets called by the tcpm core when configured
+ * as a snk and cc=Rp-def. This allows the tcpm to provide a fallback
+ * current-limit detection method for the cc=Rp-def case. E.g. some
+ * tcpcs may include BC1.2 charger detection and use that in this case.
+ */
+ int (*get_current_limit)(struct tcpc_dev *dev);
int (*set_cc)(struct tcpc_dev *dev, enum typec_cc_status cc);
int (*get_cc)(struct tcpc_dev *dev, enum typec_cc_status *cc1,
enum typec_cc_status *cc2);
--
2.13.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v3 03/11] staging: typec: fusb302: Set max supply voltage to 5V
2017-08-30 9:48 [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Hans de Goede
2017-08-30 9:48 ` [PATCH v3 01/11] i2c: Allow overriding dev_name through board_info Hans de Goede
2017-08-30 9:48 ` [PATCH v3 02/11] staging: typec: tcpm: Add get_current_limit tcpc_dev callback Hans de Goede
@ 2017-08-30 9:48 ` Hans de Goede
2017-08-30 13:37 ` Guenter Roeck
2017-08-30 9:48 ` [PATCH v3 04/11] staging: typec: fusb302: Get max snk mv/ma/mw from device-properties Hans de Goede
` (8 subsequent siblings)
11 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2017-08-30 9:48 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
Cc: devel, linux-pm, Tony Lindgren, Yueyao (Nathan) Zhu, linux-kernel,
platform-driver-x86, Hans de Goede, Liam Breck, linux-i2c
Anything higher then 5V may damage hardware not capable of it, so
the only sane default here is 5V. If a board is able to handle a
higher voltage that should come from board specific data such as
device-tree and not be hard coded into the fusb302 code.
Cc: "Yueyao (Nathan) Zhu" <yueyao@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/staging/typec/fusb302/fusb302.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c
index 03a3809d18f0..6baed06a3c0d 100644
--- a/drivers/staging/typec/fusb302/fusb302.c
+++ b/drivers/staging/typec/fusb302/fusb302.c
@@ -1187,9 +1187,9 @@ static const struct tcpc_config fusb302_tcpc_config = {
.nr_src_pdo = ARRAY_SIZE(src_pdo),
.snk_pdo = snk_pdo,
.nr_snk_pdo = ARRAY_SIZE(snk_pdo),
- .max_snk_mv = 9000,
+ .max_snk_mv = 5000,
.max_snk_ma = 3000,
- .max_snk_mw = 27000,
+ .max_snk_mw = 15000,
.operating_snk_mw = 2500,
.type = TYPEC_PORT_DRP,
.default_role = TYPEC_SINK,
--
2.13.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v3 04/11] staging: typec: fusb302: Get max snk mv/ma/mw from device-properties
2017-08-30 9:48 [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Hans de Goede
` (2 preceding siblings ...)
2017-08-30 9:48 ` [PATCH v3 03/11] staging: typec: fusb302: Set max supply voltage to 5V Hans de Goede
@ 2017-08-30 9:48 ` Hans de Goede
2017-08-30 13:50 ` Guenter Roeck
2017-08-30 9:48 ` [PATCH v3 05/11] staging: typec: fusb302: Use client->irq as irq if set Hans de Goede
` (7 subsequent siblings)
11 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2017-08-30 9:48 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
Cc: Hans de Goede, platform-driver-x86, linux-kernel, linux-i2c,
Liam Breck, Tony Lindgren, linux-pm, devel, Rob Herring,
Frank Rowand, devicetree, Yueyao (Nathan) Zhu
This is board specific info so it should come from board config, such
as devicetree.
I've chosen to prefix these with "fcs," treating them as fusb302 driver
specific for now. We may want to revisit this and replace these with
properties which are part of a (to be written) generic type-c controller
devicetree binding.
Since this commit adds new dt-properties it also adds devicetree-bindings
documentation (which so far was absent for the fusb302 driver).
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org
Cc: "Yueyao (Nathan) Zhu" <yueyao@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Changes in v2:
-Use micro... instead of mili...
-Add devicetree bindings documentation
Changes in v3:
-Use sink rather then snk in property names
-Add Rob's Acked-by
---
.../devicetree/bindings/usb/fcs,fusb302.txt | 29 ++++++++++++++++++++++
drivers/staging/typec/fusb302/TODO | 4 +++
drivers/staging/typec/fusb302/fusb302.c | 18 +++++++++++++-
3 files changed, 50 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/usb/fcs,fusb302.txt
diff --git a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt b/Documentation/devicetree/bindings/usb/fcs,fusb302.txt
new file mode 100644
index 000000000000..472facfa5a71
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/fcs,fusb302.txt
@@ -0,0 +1,29 @@
+Fairchild FUSB302 Type-C Port controllers
+
+Required properties :
+- compatible : "fcs,fusb302"
+- reg : I2C slave address
+- interrupts : Interrupt specifier
+
+Optional properties :
+- fcs,max-sink-microvolt : Maximum voltage to negotiate when configured as sink
+- fcs,max-sink-microamp : Maximum current to negotiate when configured as sink
+- fcs,max-sink-microwatt : Maximum power to negotiate when configured as sink
+ If this is less then max-sink-microvolt *
+ max-sink-microamp then the configured current will
+ be clamped.
+- fcs,operating-sink-microwatt :
+ Minimum amount of power accepted from a sink
+ when negotiating
+
+Example:
+
+fusb302: typec-portc@54 {
+ compatible = "fcs,fusb302";
+ reg = <0x54>;
+ interrupt-parent = <&nmi_intc>;
+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+ fcs,max-sink-microvolt = <12000000>;
+ fcs,max-sink-microamp = <3000000>;
+ fcs,max-sink-microwatt = <36000000>;
+};
diff --git a/drivers/staging/typec/fusb302/TODO b/drivers/staging/typec/fusb302/TODO
index 4933a1d92c32..19b466eb585d 100644
--- a/drivers/staging/typec/fusb302/TODO
+++ b/drivers/staging/typec/fusb302/TODO
@@ -4,3 +4,7 @@ fusb302:
- Find a non-hacky way to coordinate between PM and I2C access
- Documentation? The FUSB302 datasheet provides information on the chip to help
understand the code. But it may still be helpful to have a documentation.
+- We may want to replace the "fcs,max-snk-microvolt", "fcs,max-snk-microamp",
+ "fcs,max-snk-microwatt" and "fcs,operating-snk-microwatt" device(tree)
+ properties with properties which are part of a generic type-c controller
+ devicetree binding.
diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c
index 6baed06a3c0d..1c1751c994db 100644
--- a/drivers/staging/typec/fusb302/fusb302.c
+++ b/drivers/staging/typec/fusb302/fusb302.c
@@ -90,6 +90,7 @@ struct fusb302_chip {
struct i2c_client *i2c_client;
struct tcpm_port *tcpm_port;
struct tcpc_dev tcpc_dev;
+ struct tcpc_config tcpc_config;
struct regulator *vbus;
@@ -1198,7 +1199,6 @@ static const struct tcpc_config fusb302_tcpc_config = {
static void init_tcpc_dev(struct tcpc_dev *fusb302_tcpc_dev)
{
- fusb302_tcpc_dev->config = &fusb302_tcpc_config;
fusb302_tcpc_dev->init = tcpm_init;
fusb302_tcpc_dev->get_vbus = tcpm_get_vbus;
fusb302_tcpc_dev->set_cc = tcpm_set_cc;
@@ -1684,7 +1684,9 @@ static int fusb302_probe(struct i2c_client *client,
{
struct fusb302_chip *chip;
struct i2c_adapter *adapter;
+ struct device *dev = &client->dev;
int ret = 0;
+ u32 v;
adapter = to_i2c_adapter(client->dev.parent);
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) {
@@ -1699,8 +1701,22 @@ static int fusb302_probe(struct i2c_client *client,
chip->i2c_client = client;
i2c_set_clientdata(client, chip);
chip->dev = &client->dev;
+ chip->tcpc_config = fusb302_tcpc_config;
+ chip->tcpc_dev.config = &chip->tcpc_config;
mutex_init(&chip->lock);
+ if (!device_property_read_u32(dev, "fcs,max-sink-microvolt", &v))
+ chip->tcpc_config.max_snk_mv = v / 1000;
+
+ if (!device_property_read_u32(dev, "fcs,max-sink-microamp", &v))
+ chip->tcpc_config.max_snk_ma = v / 1000;
+
+ if (!device_property_read_u32(dev, "fcs,max-sink-microwatt", &v))
+ chip->tcpc_config.max_snk_mw = v / 1000;
+
+ if (!device_property_read_u32(dev, "fcs,operating-sink-microwatt", &v))
+ chip->tcpc_config.operating_snk_mw = v / 1000;
+
ret = fusb302_debugfs_init(chip);
if (ret < 0)
return ret;
--
2.13.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v3 05/11] staging: typec: fusb302: Use client->irq as irq if set
2017-08-30 9:48 [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Hans de Goede
` (3 preceding siblings ...)
2017-08-30 9:48 ` [PATCH v3 04/11] staging: typec: fusb302: Get max snk mv/ma/mw from device-properties Hans de Goede
@ 2017-08-30 9:48 ` Hans de Goede
2017-08-30 13:56 ` Guenter Roeck
2017-08-30 9:48 ` [PATCH v3 06/11] staging: typec: fusb302: Add support for USB2 charger detection through extcon Hans de Goede
` (6 subsequent siblings)
11 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2017-08-30 9:48 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
Cc: Hans de Goede, platform-driver-x86, linux-kernel, linux-i2c,
Liam Breck, Tony Lindgren, linux-pm, devel, Yueyao (Nathan) Zhu
The fusb302 is also used on x86 systems where the platform code sets
the irq in client->irq and there is no gpio named fcs,int_n.
Cc: "Yueyao (Nathan) Zhu" <yueyao@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/staging/typec/fusb302/fusb302.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c
index 1c1751c994db..675161cf4f3a 100644
--- a/drivers/staging/typec/fusb302/fusb302.c
+++ b/drivers/staging/typec/fusb302/fusb302.c
@@ -1735,9 +1735,13 @@ static int fusb302_probe(struct i2c_client *client,
goto destroy_workqueue;
}
- ret = init_gpio(chip);
- if (ret < 0)
- goto destroy_workqueue;
+ if (client->irq) {
+ chip->gpio_int_n_irq = client->irq;
+ } else {
+ ret = init_gpio(chip);
+ if (ret < 0)
+ goto destroy_workqueue;
+ }
chip->tcpm_port = tcpm_register_port(&client->dev, &chip->tcpc_dev);
if (IS_ERR(chip->tcpm_port)) {
--
2.13.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v3 06/11] staging: typec: fusb302: Add support for USB2 charger detection through extcon
2017-08-30 9:48 [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Hans de Goede
` (4 preceding siblings ...)
2017-08-30 9:48 ` [PATCH v3 05/11] staging: typec: fusb302: Use client->irq as irq if set Hans de Goede
@ 2017-08-30 9:48 ` Hans de Goede
2017-08-30 13:58 ` Guenter Roeck
2017-08-30 9:48 ` [PATCH v3 07/11] staging: typec: fusb302: Export current-limit through a power_supply class dev Hans de Goede
` (5 subsequent siblings)
11 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2017-08-30 9:48 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
Cc: devel, linux-pm, Tony Lindgren, Yueyao (Nathan) Zhu, linux-kernel,
platform-driver-x86, Hans de Goede, Liam Breck, linux-i2c
The fusb302 port-controller relies on an external device doing USB2
charger-type detection.
The Intel Whiskey Cove PMIC with which the fusb302 is combined on some
X86/ACPI platforms already has a charger-type detection driver which
uses extcon to communicate the detected charger-type.
Rather then inventing a new API for USB2 charger-type detection
specifically for use with the tcpm code, this commit simply re-uses the
existing extcon API and uses that do USB2 charger detection.
Note that the "fcs,extcon-name" property name is only for kernel internal
use by X86/ACPI platform code and as such is NOT documented in
the fusb302 devicetree bindings.
Cc: "Yueyao (Nathan) Zhu" <yueyao@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Put extcon code directly in fusb302.c rather then introducing helpers
which are only used by fusb302.c
Changes in v3:
-Improve commit message
---
drivers/staging/typec/fusb302/fusb302.c | 49 +++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c
index 675161cf4f3a..6f007f66d597 100644
--- a/drivers/staging/typec/fusb302/fusb302.c
+++ b/drivers/staging/typec/fusb302/fusb302.c
@@ -17,6 +17,7 @@
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/errno.h>
+#include <linux/extcon.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
@@ -96,6 +97,7 @@ struct fusb302_chip {
int gpio_int_n;
int gpio_int_n_irq;
+ struct extcon_dev *extcon;
struct workqueue_struct *wq;
struct delayed_work bc_lvl_handler;
@@ -516,6 +518,38 @@ static int tcpm_get_vbus(struct tcpc_dev *dev)
return ret;
}
+static int tcpm_get_current_limit(struct tcpc_dev *dev)
+{
+ struct fusb302_chip *chip = container_of(dev, struct fusb302_chip,
+ tcpc_dev);
+ int current_limit = 0;
+ unsigned long timeout;
+
+ if (!chip->extcon)
+ return 0;
+
+ /*
+ * USB2 Charger detection may still be in progress when we get here,
+ * this can take upto 600ms, wait 800ms max.
+ */
+ timeout = jiffies + msecs_to_jiffies(800);
+ do {
+ if (extcon_get_state(chip->extcon, EXTCON_CHG_USB_SDP) == 1)
+ current_limit = 500;
+
+ if (extcon_get_state(chip->extcon, EXTCON_CHG_USB_CDP) == 1 ||
+ extcon_get_state(chip->extcon, EXTCON_CHG_USB_ACA) == 1)
+ current_limit = 1500;
+
+ if (extcon_get_state(chip->extcon, EXTCON_CHG_USB_DCP) == 1)
+ current_limit = 2000;
+
+ msleep(50);
+ } while (current_limit == 0 && time_before(jiffies, timeout));
+
+ return current_limit;
+}
+
static int fusb302_set_cc_pull(struct fusb302_chip *chip,
bool pull_up, bool pull_down)
{
@@ -1201,6 +1235,7 @@ static void init_tcpc_dev(struct tcpc_dev *fusb302_tcpc_dev)
{
fusb302_tcpc_dev->init = tcpm_init;
fusb302_tcpc_dev->get_vbus = tcpm_get_vbus;
+ fusb302_tcpc_dev->get_current_limit = tcpm_get_current_limit;
fusb302_tcpc_dev->set_cc = tcpm_set_cc;
fusb302_tcpc_dev->get_cc = tcpm_get_cc;
fusb302_tcpc_dev->set_polarity = tcpm_set_polarity;
@@ -1685,6 +1720,7 @@ static int fusb302_probe(struct i2c_client *client,
struct fusb302_chip *chip;
struct i2c_adapter *adapter;
struct device *dev = &client->dev;
+ const char *name;
int ret = 0;
u32 v;
@@ -1717,6 +1753,19 @@ static int fusb302_probe(struct i2c_client *client,
if (!device_property_read_u32(dev, "fcs,operating-sink-microwatt", &v))
chip->tcpc_config.operating_snk_mw = v / 1000;
+ /*
+ * Devicetree platforms should get extcon via phandle (not yet
+ * supported). On ACPI platforms, we get the name from a device prop.
+ * This device prop is for kernel internal use only and is expected
+ * to be set by the platform code which also registers the i2c client
+ * for the fusb302.
+ */
+ if (device_property_read_string(dev, "fcs,extcon-name", &name) == 0) {
+ chip->extcon = extcon_get_extcon_dev(name);
+ if (!chip->extcon)
+ return -EPROBE_DEFER;
+ }
+
ret = fusb302_debugfs_init(chip);
if (ret < 0)
return ret;
--
2.13.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v3 07/11] staging: typec: fusb302: Export current-limit through a power_supply class dev
2017-08-30 9:48 [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Hans de Goede
` (5 preceding siblings ...)
2017-08-30 9:48 ` [PATCH v3 06/11] staging: typec: fusb302: Add support for USB2 charger detection through extcon Hans de Goede
@ 2017-08-30 9:48 ` Hans de Goede
2017-08-30 14:01 ` Guenter Roeck
2017-08-30 9:48 ` [PATCH v3 08/11] power: supply: bq24190_charger: Export 5V boost converter as regulator Hans de Goede
` (4 subsequent siblings)
11 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2017-08-30 9:48 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
Cc: devel, linux-pm, Tony Lindgren, Yueyao (Nathan) Zhu, linux-kernel,
platform-driver-x86, Hans de Goede, Liam Breck, linux-i2c
The fusb302 Type-C port-controller cannot control the current-limit
directly, so we need to exported the limit so that another driver
(e.g. the charger driver) can pick the limit up and configure the
system accordingly.
The power-supply subsys already provides infrastructure for this,
power-supply devices have the notion of being supplied by another
power-supply and have properties through which we can export the
current-limit.
Register a power_supply and export the current-limit through the
power_supply's current-max property.
Cc: "Yueyao (Nathan) Zhu" <yueyao@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Put the psy class device code directly in fusb302.c rather then introducing
helpers which are only used by fusb302.c
-Add an online property to the psy so that upower does not mistake it for a
second battery in the system
---
drivers/staging/typec/fusb302/Kconfig | 2 +-
drivers/staging/typec/fusb302/fusb302.c | 63 +++++++++++++++++++++++++++++++--
2 files changed, 62 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/typec/fusb302/Kconfig b/drivers/staging/typec/fusb302/Kconfig
index fce099ff39fe..48a4f2fcee03 100644
--- a/drivers/staging/typec/fusb302/Kconfig
+++ b/drivers/staging/typec/fusb302/Kconfig
@@ -1,6 +1,6 @@
config TYPEC_FUSB302
tristate "Fairchild FUSB302 Type-C chip driver"
- depends on I2C
+ depends on I2C && POWER_SUPPLY
help
The Fairchild FUSB302 Type-C chip driver that works with
Type-C Port Controller Manager to provide USB PD and USB
diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c
index 6f007f66d597..cf6355f59cd9 100644
--- a/drivers/staging/typec/fusb302/fusb302.c
+++ b/drivers/staging/typec/fusb302/fusb302.c
@@ -28,6 +28,7 @@
#include <linux/of_device.h>
#include <linux/of_gpio.h>
#include <linux/pinctrl/consumer.h>
+#include <linux/power_supply.h>
#include <linux/proc_fs.h>
#include <linux/regulator/consumer.h>
#include <linux/sched/clock.h>
@@ -108,6 +109,11 @@ struct fusb302_chip {
/* lock for sharing chip states */
struct mutex lock;
+ /* psy + psy status */
+ struct power_supply *psy;
+ u32 current_limit;
+ u32 supply_voltage;
+
/* chip status */
enum toggling_mode toggling_mode;
enum src_current_status src_current_status;
@@ -876,11 +882,13 @@ static int tcpm_set_vbus(struct tcpc_dev *dev, bool on, bool charge)
chip->vbus_on = on;
fusb302_log(chip, "vbus := %s", on ? "On" : "Off");
}
- if (chip->charge_on == charge)
+ if (chip->charge_on == charge) {
fusb302_log(chip, "charge is already %s",
charge ? "On" : "Off");
- else
+ } else {
chip->charge_on = charge;
+ power_supply_changed(chip->psy);
+ }
done:
mutex_unlock(&chip->lock);
@@ -896,6 +904,11 @@ static int tcpm_set_current_limit(struct tcpc_dev *dev, u32 max_ma, u32 mv)
fusb302_log(chip, "current limit: %d ma, %d mv (not implemented)",
max_ma, mv);
+ chip->supply_voltage = mv;
+ chip->current_limit = max_ma;
+
+ power_supply_changed(chip->psy);
+
return 0;
}
@@ -1681,6 +1694,43 @@ static irqreturn_t fusb302_irq_intn(int irq, void *dev_id)
return IRQ_HANDLED;
}
+static int fusb302_psy_get_property(struct power_supply *psy,
+ enum power_supply_property psp,
+ union power_supply_propval *val)
+{
+ struct fusb302_chip *chip = power_supply_get_drvdata(psy);
+
+ switch (psp) {
+ case POWER_SUPPLY_PROP_ONLINE:
+ val->intval = chip->charge_on;
+ break;
+ case POWER_SUPPLY_PROP_VOLTAGE_NOW:
+ val->intval = chip->supply_voltage * 1000; /* mV -> µV */
+ break;
+ case POWER_SUPPLY_PROP_CURRENT_MAX:
+ val->intval = chip->current_limit * 1000; /* mA -> µA */
+ break;
+ default:
+ return -ENODATA;
+ }
+
+ return 0;
+}
+
+static enum power_supply_property fusb302_psy_properties[] = {
+ POWER_SUPPLY_PROP_ONLINE,
+ POWER_SUPPLY_PROP_VOLTAGE_NOW,
+ POWER_SUPPLY_PROP_CURRENT_MAX,
+};
+
+const struct power_supply_desc fusb302_psy_desc = {
+ .name = "fusb302-typec-source",
+ .type = POWER_SUPPLY_TYPE_USB_TYPE_C,
+ .properties = fusb302_psy_properties,
+ .num_properties = ARRAY_SIZE(fusb302_psy_properties),
+ .get_property = fusb302_psy_get_property,
+};
+
static int init_gpio(struct fusb302_chip *chip)
{
struct device_node *node;
@@ -1720,6 +1770,7 @@ static int fusb302_probe(struct i2c_client *client,
struct fusb302_chip *chip;
struct i2c_adapter *adapter;
struct device *dev = &client->dev;
+ struct power_supply_config cfg = {};
const char *name;
int ret = 0;
u32 v;
@@ -1766,6 +1817,14 @@ static int fusb302_probe(struct i2c_client *client,
return -EPROBE_DEFER;
}
+ cfg.drv_data = chip;
+ chip->psy = devm_power_supply_register(dev, &fusb302_psy_desc, &cfg);
+ if (IS_ERR(chip->psy)) {
+ ret = PTR_ERR(chip->psy);
+ dev_err(chip->dev, "Error registering power-supply: %d\n", ret);
+ return ret;
+ }
+
ret = fusb302_debugfs_init(chip);
if (ret < 0)
return ret;
--
2.13.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v3 08/11] power: supply: bq24190_charger: Export 5V boost converter as regulator
2017-08-30 9:48 [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Hans de Goede
` (6 preceding siblings ...)
2017-08-30 9:48 ` [PATCH v3 07/11] staging: typec: fusb302: Export current-limit through a power_supply class dev Hans de Goede
@ 2017-08-30 9:48 ` Hans de Goede
2017-08-30 14:46 ` Tony Lindgren
2017-08-30 9:48 ` [PATCH v3 09/11] power: supply: bq24190_charger: Get input_current_limit from our supplier Hans de Goede
` (3 subsequent siblings)
11 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2017-08-30 9:48 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
Cc: devel, linux-pm, Tony Lindgren, linux-kernel, platform-driver-x86,
Hans de Goede, Liam Breck, linux-i2c
Register the 5V boost converter as a regulator named "usb_otg_vbus".
This commit also adds support for bq24190_platform_data, through which
non device-tree platforms can pass the regulator_init_data (containing
mappings for the consumer amongst other things).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Use "usb_otg_vbus" as default name for the regulator
-Add support for passing regulator_init_data for non device-tree platforms
-Register the regulator later, to avoid it showing up and shortly later
disappearing again on probe errors (e.g. -EPROBE_DEFER).
Changes in v3:
-Add a bq24190_set_charge_mode helper and use that for the vbus_enable
and vbus_disable callbacks to reduce code duplication
---
drivers/power/supply/bq24190_charger.c | 112 +++++++++++++++++++++++++++++++++
include/linux/power/bq24190_charger.h | 18 ++++++
2 files changed, 130 insertions(+)
create mode 100644 include/linux/power/bq24190_charger.h
diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
index fa711c106b63..e606a078b0dd 100644
--- a/drivers/power/supply/bq24190_charger.c
+++ b/drivers/power/supply/bq24190_charger.c
@@ -16,6 +16,9 @@
#include <linux/of_device.h>
#include <linux/pm_runtime.h>
#include <linux/power_supply.h>
+#include <linux/power/bq24190_charger.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/machine.h>
#include <linux/workqueue.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
@@ -513,6 +516,111 @@ static int bq24190_sysfs_create_group(struct bq24190_dev_info *bdi)
static inline void bq24190_sysfs_remove_group(struct bq24190_dev_info *bdi) {}
#endif
+#ifdef CONFIG_REGULATOR
+static int bq24190_set_charge_mode(struct regulator_dev *dev, u8 val)
+{
+ struct bq24190_dev_info *bdi = rdev_get_drvdata(dev);
+ int ret;
+
+ ret = pm_runtime_get_sync(bdi->dev);
+ if (ret < 0) {
+ dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", ret);
+ pm_runtime_put_noidle(bdi->dev);
+ return ret;
+ }
+
+ ret = bq24190_write_mask(bdi, BQ24190_REG_POC,
+ BQ24190_REG_POC_CHG_CONFIG_MASK,
+ BQ24190_REG_POC_CHG_CONFIG_SHIFT, val);
+
+ pm_runtime_mark_last_busy(bdi->dev);
+ pm_runtime_put_autosuspend(bdi->dev);
+
+ return ret;
+}
+
+static int bq24190_vbus_enable(struct regulator_dev *dev)
+{
+ return bq24190_set_charge_mode(dev, BQ24190_REG_POC_CHG_CONFIG_OTG);
+}
+
+static int bq24190_vbus_disable(struct regulator_dev *dev)
+{
+ return bq24190_set_charge_mode(dev, BQ24190_REG_POC_CHG_CONFIG_CHARGE);
+}
+
+static int bq24190_vbus_is_enabled(struct regulator_dev *dev)
+{
+ struct bq24190_dev_info *bdi = rdev_get_drvdata(dev);
+ int ret;
+ u8 val;
+
+ ret = pm_runtime_get_sync(bdi->dev);
+ if (ret < 0) {
+ dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", ret);
+ pm_runtime_put_noidle(bdi->dev);
+ return ret;
+ }
+
+ ret = bq24190_read_mask(bdi, BQ24190_REG_POC,
+ BQ24190_REG_POC_CHG_CONFIG_MASK,
+ BQ24190_REG_POC_CHG_CONFIG_SHIFT, &val);
+
+ pm_runtime_mark_last_busy(bdi->dev);
+ pm_runtime_put_autosuspend(bdi->dev);
+
+ return ret ? ret : val == BQ24190_REG_POC_CHG_CONFIG_OTG;
+}
+
+static const struct regulator_ops bq24190_vbus_ops = {
+ .enable = bq24190_vbus_enable,
+ .disable = bq24190_vbus_disable,
+ .is_enabled = bq24190_vbus_is_enabled,
+};
+
+static const struct regulator_desc bq24190_vbus_desc = {
+ .name = "usb_otg_vbus",
+ .type = REGULATOR_VOLTAGE,
+ .owner = THIS_MODULE,
+ .ops = &bq24190_vbus_ops,
+ .fixed_uV = 5000000,
+ .n_voltages = 1,
+};
+
+static const struct regulator_init_data bq24190_vbus_init_data = {
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+};
+
+static int bq24190_register_vbus_regulator(struct bq24190_dev_info *bdi)
+{
+ struct bq24190_platform_data *pdata = bdi->dev->platform_data;
+ struct regulator_config cfg = { };
+ struct regulator_dev *reg;
+ int ret = 0;
+
+ cfg.dev = bdi->dev;
+ if (pdata && pdata->regulator_init_data)
+ cfg.init_data = pdata->regulator_init_data;
+ else
+ cfg.init_data = &bq24190_vbus_init_data;
+ cfg.driver_data = bdi;
+ reg = devm_regulator_register(bdi->dev, &bq24190_vbus_desc, &cfg);
+ if (IS_ERR(reg)) {
+ ret = PTR_ERR(reg);
+ dev_err(bdi->dev, "Can't register regulator: %d\n", ret);
+ }
+
+ return ret;
+}
+#else
+static int bq24190_register_vbus_regulator(struct bq24190_dev_info *bdi)
+{
+ return 0;
+}
+#endif
+
static int bq24190_set_config(struct bq24190_dev_info *bdi)
{
int ret;
@@ -1740,6 +1848,10 @@ static int bq24190_probe(struct i2c_client *client,
goto out_sysfs;
}
+ ret = bq24190_register_vbus_regulator(bdi);
+ if (ret < 0)
+ goto out_sysfs;
+
if (bdi->extcon) {
INIT_DELAYED_WORK(&bdi->extcon_work, bq24190_extcon_work);
bdi->extcon_nb.notifier_call = bq24190_extcon_event;
diff --git a/include/linux/power/bq24190_charger.h b/include/linux/power/bq24190_charger.h
new file mode 100644
index 000000000000..45ce7f116a91
--- /dev/null
+++ b/include/linux/power/bq24190_charger.h
@@ -0,0 +1,18 @@
+/*
+ * Platform data for the TI bq24190 battery charger driver.
+ *
+ * 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.
+ */
+
+#ifndef _BQ24190_CHARGER_H_
+#define _BQ24190_CHARGER_H_
+
+#include <linux/regulator/machine.h>
+
+struct bq24190_platform_data {
+ const struct regulator_init_data *regulator_init_data;
+};
+
+#endif
--
2.13.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v3 09/11] power: supply: bq24190_charger: Get input_current_limit from our supplier
2017-08-30 9:48 [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Hans de Goede
` (7 preceding siblings ...)
2017-08-30 9:48 ` [PATCH v3 08/11] power: supply: bq24190_charger: Export 5V boost converter as regulator Hans de Goede
@ 2017-08-30 9:48 ` Hans de Goede
2017-08-30 14:47 ` Tony Lindgren
2017-08-30 9:48 ` [PATCH v3 10/11] i2c-cht-wc: Add device-properties for fusb302 integration Hans de Goede
` (2 subsequent siblings)
11 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2017-08-30 9:48 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
Cc: Hans de Goede, platform-driver-x86, linux-kernel, linux-i2c,
Liam Breck, Tony Lindgren, linux-pm, devel
On some devices the USB Type-C port power (USB PD 2.0) negotiation is
done by a separate port-controller IC, while the current limit is
controlled through another (charger) IC.
It has been decided to model this by modelling the external Type-C
power brick (adapter/charger) as a power-supply class device which
supplies the charger-IC, with its voltage-now and current-max representing
the negotiated voltage and max current draw.
This commit adds support for this to the bq24190_charger driver by adding
an external_power_changed callback and calling
power_supply_set_input_current_limit_from_supplier from this callback.
This callback will only get called if the bq24190 has a parent-supply.
Note this replaces the functionality to get the current-limit from an
extcon device, which will be removed in a follow-up commit.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Wait a bit before applying current-max from our supplier as input-current-limit
the bq24190 may still be in its power-good wait-state while our supplier is
done negotating current-max and if we apply the limit to early then the
input-current-limit will be reset to 0.5A by the bq24190 after its
power-good wait is done.
Changes in v3:
-Drop the input-current-limit-from-supplier device-property, simply always
sync the input-current-limit with the parent-supply if a parent-supply is
present
---
drivers/power/supply/bq24190_charger.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
index e606a078b0dd..35ff406aca48 100644
--- a/drivers/power/supply/bq24190_charger.c
+++ b/drivers/power/supply/bq24190_charger.c
@@ -165,6 +165,7 @@ struct bq24190_dev_info {
struct extcon_dev *extcon;
struct notifier_block extcon_nb;
struct delayed_work extcon_work;
+ struct delayed_work input_current_limit_work;
char model_name[I2C_NAME_SIZE];
bool initialized;
bool irq_event;
@@ -1210,6 +1211,32 @@ static int bq24190_charger_property_is_writeable(struct power_supply *psy,
return ret;
}
+static void bq24190_input_current_limit_work(struct work_struct *work)
+{
+ struct bq24190_dev_info *bdi =
+ container_of(work, struct bq24190_dev_info,
+ input_current_limit_work.work);
+
+ power_supply_set_input_current_limit_from_supplier(bdi->charger);
+}
+
+/* Sync the input-current-limit with our parent supply (if we have one) */
+static void bq24190_charger_external_power_changed(struct power_supply *psy)
+{
+ struct bq24190_dev_info *bdi = power_supply_get_drvdata(psy);
+
+ /*
+ * The Power-Good detection may take up to 220ms, sometimes
+ * the external charger detection is quicker, and the bq24190 will
+ * reset to iinlim based on its own charger detection (which is not
+ * hooked up when using external charger detection) resulting in a
+ * too low default 500mA iinlim. Delay setting the input-current-limit
+ * for 300ms to avoid this.
+ */
+ queue_delayed_work(system_wq, &bdi->input_current_limit_work,
+ msecs_to_jiffies(300));
+}
+
static enum power_supply_property bq24190_charger_properties[] = {
POWER_SUPPLY_PROP_CHARGE_TYPE,
POWER_SUPPLY_PROP_HEALTH,
@@ -1240,6 +1267,7 @@ static const struct power_supply_desc bq24190_charger_desc = {
.get_property = bq24190_charger_get_property,
.set_property = bq24190_charger_set_property,
.property_is_writeable = bq24190_charger_property_is_writeable,
+ .external_power_changed = bq24190_charger_external_power_changed,
};
/* Battery power supply property routines */
@@ -1758,6 +1786,8 @@ static int bq24190_probe(struct i2c_client *client,
mutex_init(&bdi->f_reg_lock);
bdi->f_reg = 0;
bdi->ss_reg = BQ24190_REG_SS_VBUS_STAT_MASK; /* impossible state */
+ INIT_DELAYED_WORK(&bdi->input_current_limit_work,
+ bq24190_input_current_limit_work);
i2c_set_clientdata(client, bdi);
--
2.13.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v3 10/11] i2c-cht-wc: Add device-properties for fusb302 integration
2017-08-30 9:48 [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Hans de Goede
` (8 preceding siblings ...)
2017-08-30 9:48 ` [PATCH v3 09/11] power: supply: bq24190_charger: Get input_current_limit from our supplier Hans de Goede
@ 2017-08-30 9:48 ` Hans de Goede
2017-08-30 9:48 ` [PATCH v3 11/11] platform/x86: intel_cht_int33fe: Update fusb302 type string, add properties Hans de Goede
2017-08-31 16:26 ` [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Greg Kroah-Hartman
11 siblings, 0 replies; 22+ messages in thread
From: Hans de Goede @ 2017-08-30 9:48 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
Cc: devel, linux-pm, Tony Lindgren, linux-kernel, platform-driver-x86,
Hans de Goede, Liam Breck, linux-i2c
Add device-properties to make the bq24292i charger connected to
the bus get its input-current-limit from the fusb302 Type-C port
controller which is used on boards with the cht-wc PMIC,
as well as regulator_init_data for the 5V boost converter on
the bq24292i.
Since this means we now hook-up the bq24292i to the fusb302 Type-C port
controller add a check for the ACPI device which instantiates the fusb302.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Set board_info.dev_name
-Define and pass regulator_init_data for the bq24292i
-Add a check for the ACPI device which instantiates the fusb302
---
drivers/i2c/busses/Kconfig | 5 ++++
drivers/i2c/busses/i2c-cht-wc.c | 52 +++++++++++++++++++++++++++++++++++------
2 files changed, 50 insertions(+), 7 deletions(-)
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 79c33817e412..272ef10fb629 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -197,6 +197,11 @@ config I2C_CHT_WC
SMBus controller found in the Intel Cherry Trail Whiskey Cove PMIC
found on some Intel Cherry Trail systems.
+ Note this controller is hooked up to a TI bq24292i charger-IC,
+ combined with a FUSB302 Type-C port-controller as such it is advised
+ to also select CONFIG_CHARGER_BQ24190=m and CONFIG_TYPEC_FUSB302=m
+ (the fusb302 driver currently is in drivers/staging).
+
config I2C_NFORCE2
tristate "Nvidia nForce2, nForce3 and nForce4"
depends on PCI
diff --git a/drivers/i2c/busses/i2c-cht-wc.c b/drivers/i2c/busses/i2c-cht-wc.c
index 21312eed09e4..69a159fc661a 100644
--- a/drivers/i2c/busses/i2c-cht-wc.c
+++ b/drivers/i2c/busses/i2c-cht-wc.c
@@ -16,6 +16,7 @@
* GNU General Public License for more details.
*/
+#include <linux/acpi.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/i2c.h>
@@ -25,6 +26,7 @@
#include <linux/mfd/intel_soc_pmic.h>
#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/power/bq24190_charger.h>
#include <linux/slab.h>
#define CHT_WC_I2C_CTRL 0x5e24
@@ -232,13 +234,36 @@ static const struct irq_chip cht_wc_i2c_irq_chip = {
.name = "cht_wc_ext_chrg_irq_chip",
};
+static const char * const bq24190_suppliers[] = { "fusb302-typec-source" };
+
static const struct property_entry bq24190_props[] = {
- PROPERTY_ENTRY_STRING("extcon-name", "cht_wcove_pwrsrc"),
+ PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq24190_suppliers),
+ PROPERTY_ENTRY_BOOL("ti,input-current-limit-from-supplier"),
PROPERTY_ENTRY_BOOL("omit-battery-class"),
PROPERTY_ENTRY_BOOL("disable-reset"),
{ }
};
+static struct regulator_consumer_supply fusb302_consumer = {
+ .supply = "vbus",
+ /* Must match fusb302 dev_name in intel_cht_int33fe.c */
+ .dev_name = "i2c-fusb302",
+};
+
+static const struct regulator_init_data bq24190_vbus_init_data = {
+ .constraints = {
+ /* The name is used in intel_cht_int33fe.c do not change. */
+ .name = "cht_wc_usb_typec_vbus",
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .consumer_supplies = &fusb302_consumer,
+ .num_consumer_supplies = 1,
+};
+
+static struct bq24190_platform_data bq24190_pdata = {
+ .regulator_init_data = &bq24190_vbus_init_data,
+};
+
static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev)
{
struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent);
@@ -246,7 +271,9 @@ static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev)
struct i2c_board_info board_info = {
.type = "bq24190",
.addr = 0x6b,
+ .dev_name = "bq24190",
.properties = bq24190_props,
+ .platform_data = &bq24190_pdata,
};
int ret, reg, irq;
@@ -314,11 +341,21 @@ static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev)
if (ret)
goto remove_irq_domain;
- board_info.irq = adap->client_irq;
- adap->client = i2c_new_device(&adap->adapter, &board_info);
- if (!adap->client) {
- ret = -ENOMEM;
- goto del_adapter;
+ /*
+ * Normally the Whiskey Cove PMIC is paired with a TI bq24292i charger,
+ * connected to this i2c bus, and a max17047 fuel-gauge and a fusb302
+ * USB Type-C controller connected to another i2c bus. In this setup
+ * the max17047 and fusb302 devices are enumerated through an INT33FE
+ * ACPI device. If this device is present register an i2c-client for
+ * the TI bq24292i charger.
+ */
+ if (acpi_dev_present("INT33FE", NULL, -1)) {
+ board_info.irq = adap->client_irq;
+ adap->client = i2c_new_device(&adap->adapter, &board_info);
+ if (!adap->client) {
+ ret = -ENOMEM;
+ goto del_adapter;
+ }
}
platform_set_drvdata(pdev, adap);
@@ -335,7 +372,8 @@ static int cht_wc_i2c_adap_i2c_remove(struct platform_device *pdev)
{
struct cht_wc_i2c_adap *adap = platform_get_drvdata(pdev);
- i2c_unregister_device(adap->client);
+ if (adap->client)
+ i2c_unregister_device(adap->client);
i2c_del_adapter(&adap->adapter);
irq_domain_remove(adap->irq_domain);
--
2.13.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v3 11/11] platform/x86: intel_cht_int33fe: Update fusb302 type string, add properties
2017-08-30 9:48 [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Hans de Goede
` (9 preceding siblings ...)
2017-08-30 9:48 ` [PATCH v3 10/11] i2c-cht-wc: Add device-properties for fusb302 integration Hans de Goede
@ 2017-08-30 9:48 ` Hans de Goede
2017-08-31 16:26 ` [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Greg Kroah-Hartman
11 siblings, 0 replies; 22+ messages in thread
From: Hans de Goede @ 2017-08-30 9:48 UTC (permalink / raw)
To: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
Cc: Hans de Goede, platform-driver-x86, linux-kernel, linux-i2c,
Liam Breck, Tony Lindgren, linux-pm, devel
The fusb302 driver as merged in staging uses "typec_fusb302" as i2c-id
rather then just "fusb302" and needs us to set a number of device-
properties, adjust the intel_cht_int33fe driver accordingly.
One of the properties set is max-snk-mv which makes the fusb302 driver
negotiate up to 12V charging voltage, which is a bad idea on boards
which are not setup to handle this, so this commit also adds 2 extra
sanity checks to make sure that the expected Whiskey Cove PMIC +
TI bq24292i charger combo, which can handle 12V, is present.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Set board_info.dev_name
-Adjust for changes in other patches in this patch-set
---
drivers/platform/x86/Kconfig | 6 ++++-
drivers/platform/x86/intel_cht_int33fe.c | 44 +++++++++++++++++++++++++++++++-
2 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 80b87954f6dd..c5554577681a 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -793,7 +793,7 @@ config ACPI_CMPC
config INTEL_CHT_INT33FE
tristate "Intel Cherry Trail ACPI INT33FE Driver"
- depends on X86 && ACPI && I2C
+ depends on X86 && ACPI && I2C && REGULATOR
---help---
This driver add support for the INT33FE ACPI device found on
some Intel Cherry Trail devices.
@@ -804,6 +804,10 @@ config INTEL_CHT_INT33FE
This driver instantiates i2c-clients for these, so that standard
i2c drivers for these chips can bind to the them.
+ If you enable this driver it is advised to also select
+ CONFIG_CHARGER_BQ24190=m, CONFIG_BATTERY_MAX17042=m and
+ CONFIG_TYPEC_FUSB302=m (currently in drivers/staging).
+
config INTEL_INT0002_VGPIO
tristate "Intel ACPI INT0002 Virtual GPIO driver"
depends on GPIOLIB && ACPI
diff --git a/drivers/platform/x86/intel_cht_int33fe.c b/drivers/platform/x86/intel_cht_int33fe.c
index 5f1924fb3190..24a1662be81d 100644
--- a/drivers/platform/x86/intel_cht_int33fe.c
+++ b/drivers/platform/x86/intel_cht_int33fe.c
@@ -24,6 +24,7 @@
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/module.h>
+#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#define EXPECTED_PTYPE 4
@@ -70,12 +71,21 @@ static const struct property_entry max17047_props[] = {
{ }
};
+static const struct property_entry fusb302_props[] = {
+ PROPERTY_ENTRY_STRING("fcs,extcon-name", "cht_wcove_pwrsrc"),
+ PROPERTY_ENTRY_U32("fcs,max-sink-microvolt", 12000000),
+ PROPERTY_ENTRY_U32("fcs,max-sink-microamp", 3000000),
+ PROPERTY_ENTRY_U32("fcs,max-sink-microwatt", 36000000),
+ { }
+};
+
static int cht_int33fe_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
struct i2c_board_info board_info;
struct cht_int33fe_data *data;
struct i2c_client *max17047;
+ struct regulator *regulator;
unsigned long long ptyp;
acpi_status status;
int ret, fusb302_irq;
@@ -93,6 +103,34 @@ static int cht_int33fe_probe(struct i2c_client *client)
if (ptyp != EXPECTED_PTYPE)
return -ENODEV;
+ /* Check presence of INT34D3 (hardware-rev 3) expected for ptype == 4 */
+ if (!acpi_dev_present("INT34D3", "1", 3)) {
+ dev_err(dev, "Error PTYPE == %d, but no INT34D3 device\n",
+ EXPECTED_PTYPE);
+ return -ENODEV;
+ }
+
+ /*
+ * We expect the WC PMIC to be paired with a TI bq24292i charger-IC.
+ * We check for the bq24292i vbus regulator here, this has 2 purposes:
+ * 1) The bq24292i allows charging with up to 12V, setting the fusb302's
+ * max-snk voltage to 12V with another charger-IC is not good.
+ * 2) For the fusb302 driver to get the bq24292i vbus regulator, the
+ * regulator-map, which is part of the bq24292i regulator_init_data,
+ * must be registered before the fusb302 is instantiated, otherwise
+ * it will end up with a dummy-regulator.
+ * Note "cht_wc_usb_typec_vbus" comes from the regulator_init_data
+ * which is defined in i2c-cht-wc.c from where the bq24292i i2c-client
+ * gets instantiated. We use regulator_get_optional here so that we
+ * don't end up getting a dummy-regulator ourselves.
+ */
+ regulator = regulator_get_optional(dev, "cht_wc_usb_typec_vbus");
+ if (IS_ERR(regulator)) {
+ ret = PTR_ERR(regulator);
+ return (ret == -ENODEV) ? -EPROBE_DEFER : ret;
+ }
+ regulator_put(regulator);
+
/* The FUSB302 uses the irq at index 1 and is the only irq user */
fusb302_irq = acpi_dev_gpio_irq_get(ACPI_COMPANION(dev), 1);
if (fusb302_irq < 0) {
@@ -119,6 +157,7 @@ static int cht_int33fe_probe(struct i2c_client *client)
} else {
memset(&board_info, 0, sizeof(board_info));
strlcpy(board_info.type, "max17047", I2C_NAME_SIZE);
+ board_info.dev_name = "max17047";
board_info.properties = max17047_props;
data->max17047 = i2c_acpi_new_device(dev, 1, &board_info);
if (!data->max17047)
@@ -126,7 +165,9 @@ static int cht_int33fe_probe(struct i2c_client *client)
}
memset(&board_info, 0, sizeof(board_info));
- strlcpy(board_info.type, "fusb302", I2C_NAME_SIZE);
+ strlcpy(board_info.type, "typec_fusb302", I2C_NAME_SIZE);
+ board_info.dev_name = "fusb302";
+ board_info.properties = fusb302_props;
board_info.irq = fusb302_irq;
data->fusb302 = i2c_acpi_new_device(dev, 2, &board_info);
@@ -134,6 +175,7 @@ static int cht_int33fe_probe(struct i2c_client *client)
goto out_unregister_max17047;
memset(&board_info, 0, sizeof(board_info));
+ board_info.dev_name = "pi3usb30532";
strlcpy(board_info.type, "pi3usb30532", I2C_NAME_SIZE);
data->pi3usb30532 = i2c_acpi_new_device(dev, 3, &board_info);
--
2.13.4
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH v3 03/11] staging: typec: fusb302: Set max supply voltage to 5V
2017-08-30 9:48 ` [PATCH v3 03/11] staging: typec: fusb302: Set max supply voltage to 5V Hans de Goede
@ 2017-08-30 13:37 ` Guenter Roeck
0 siblings, 0 replies; 22+ messages in thread
From: Guenter Roeck @ 2017-08-30 13:37 UTC (permalink / raw)
To: Hans de Goede, Darren Hart, Andy Shevchenko, Wolfram Sang,
Sebastian Reichel, Greg Kroah-Hartman, Heikki Krogerus
Cc: platform-driver-x86, linux-kernel, linux-i2c, Liam Breck,
Tony Lindgren, linux-pm, devel, Yueyao (Nathan) Zhu
On 08/30/2017 02:48 AM, Hans de Goede wrote:
> Anything higher then 5V may damage hardware not capable of it, so
> the only sane default here is 5V. If a board is able to handle a
> higher voltage that should come from board specific data such as
> device-tree and not be hard coded into the fusb302 code.
>
> Cc: "Yueyao (Nathan) Zhu" <yueyao@google.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/staging/typec/fusb302/fusb302.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c
> index 03a3809d18f0..6baed06a3c0d 100644
> --- a/drivers/staging/typec/fusb302/fusb302.c
> +++ b/drivers/staging/typec/fusb302/fusb302.c
> @@ -1187,9 +1187,9 @@ static const struct tcpc_config fusb302_tcpc_config = {
> .nr_src_pdo = ARRAY_SIZE(src_pdo),
> .snk_pdo = snk_pdo,
> .nr_snk_pdo = ARRAY_SIZE(snk_pdo),
> - .max_snk_mv = 9000,
> + .max_snk_mv = 5000,
> .max_snk_ma = 3000,
> - .max_snk_mw = 27000,
> + .max_snk_mw = 15000,
> .operating_snk_mw = 2500,
> .type = TYPEC_PORT_DRP,
> .default_role = TYPEC_SINK,
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 04/11] staging: typec: fusb302: Get max snk mv/ma/mw from device-properties
2017-08-30 9:48 ` [PATCH v3 04/11] staging: typec: fusb302: Get max snk mv/ma/mw from device-properties Hans de Goede
@ 2017-08-30 13:50 ` Guenter Roeck
0 siblings, 0 replies; 22+ messages in thread
From: Guenter Roeck @ 2017-08-30 13:50 UTC (permalink / raw)
To: Hans de Goede, Darren Hart, Andy Shevchenko, Wolfram Sang,
Sebastian Reichel, Greg Kroah-Hartman, Heikki Krogerus
Cc: devel, devicetree, linux-pm, Tony Lindgren, Yueyao (Nathan) Zhu,
linux-kernel, Rob Herring, platform-driver-x86, Liam Breck,
linux-i2c, Frank Rowand
On 08/30/2017 02:48 AM, Hans de Goede wrote:
> This is board specific info so it should come from board config, such
> as devicetree.
>
> I've chosen to prefix these with "fcs," treating them as fusb302 driver
> specific for now. We may want to revisit this and replace these with
> properties which are part of a (to be written) generic type-c controller
> devicetree binding.
>
> Since this commit adds new dt-properties it also adds devicetree-bindings
> documentation (which so far was absent for the fusb302 driver).
>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Frank Rowand <frowand.list@gmail.com>
> Cc: devicetree@vger.kernel.org
> Cc: "Yueyao (Nathan) Zhu" <yueyao@google.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> Changes in v2:
> -Use micro... instead of mili...
> -Add devicetree bindings documentation
>
> Changes in v3:
> -Use sink rather then snk in property names
> -Add Rob's Acked-by
> ---
> .../devicetree/bindings/usb/fcs,fusb302.txt | 29 ++++++++++++++++++++++
> drivers/staging/typec/fusb302/TODO | 4 +++
> drivers/staging/typec/fusb302/fusb302.c | 18 +++++++++++++-
> 3 files changed, 50 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/devicetree/bindings/usb/fcs,fusb302.txt
>
> diff --git a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt b/Documentation/devicetree/bindings/usb/fcs,fusb302.txt
> new file mode 100644
> index 000000000000..472facfa5a71
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/fcs,fusb302.txt
> @@ -0,0 +1,29 @@
> +Fairchild FUSB302 Type-C Port controllers
> +
> +Required properties :
> +- compatible : "fcs,fusb302"
> +- reg : I2C slave address
> +- interrupts : Interrupt specifier
> +
> +Optional properties :
> +- fcs,max-sink-microvolt : Maximum voltage to negotiate when configured as sink
> +- fcs,max-sink-microamp : Maximum current to negotiate when configured as sink
> +- fcs,max-sink-microwatt : Maximum power to negotiate when configured as sink
> + If this is less then max-sink-microvolt *
> + max-sink-microamp then the configured current will
> + be clamped.
> +- fcs,operating-sink-microwatt :
> + Minimum amount of power accepted from a sink
> + when negotiating
> +
> +Example:
> +
> +fusb302: typec-portc@54 {
> + compatible = "fcs,fusb302";
> + reg = <0x54>;
> + interrupt-parent = <&nmi_intc>;
> + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
> + fcs,max-sink-microvolt = <12000000>;
> + fcs,max-sink-microamp = <3000000>;
> + fcs,max-sink-microwatt = <36000000>;
> +};
> diff --git a/drivers/staging/typec/fusb302/TODO b/drivers/staging/typec/fusb302/TODO
> index 4933a1d92c32..19b466eb585d 100644
> --- a/drivers/staging/typec/fusb302/TODO
> +++ b/drivers/staging/typec/fusb302/TODO
> @@ -4,3 +4,7 @@ fusb302:
> - Find a non-hacky way to coordinate between PM and I2C access
> - Documentation? The FUSB302 datasheet provides information on the chip to help
> understand the code. But it may still be helpful to have a documentation.
> +- We may want to replace the "fcs,max-snk-microvolt", "fcs,max-snk-microamp",
> + "fcs,max-snk-microwatt" and "fcs,operating-snk-microwatt" device(tree)
> + properties with properties which are part of a generic type-c controller
> + devicetree binding.
> diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c
> index 6baed06a3c0d..1c1751c994db 100644
> --- a/drivers/staging/typec/fusb302/fusb302.c
> +++ b/drivers/staging/typec/fusb302/fusb302.c
> @@ -90,6 +90,7 @@ struct fusb302_chip {
> struct i2c_client *i2c_client;
> struct tcpm_port *tcpm_port;
> struct tcpc_dev tcpc_dev;
> + struct tcpc_config tcpc_config;
>
> struct regulator *vbus;
>
> @@ -1198,7 +1199,6 @@ static const struct tcpc_config fusb302_tcpc_config = {
>
> static void init_tcpc_dev(struct tcpc_dev *fusb302_tcpc_dev)
> {
> - fusb302_tcpc_dev->config = &fusb302_tcpc_config;
> fusb302_tcpc_dev->init = tcpm_init;
> fusb302_tcpc_dev->get_vbus = tcpm_get_vbus;
> fusb302_tcpc_dev->set_cc = tcpm_set_cc;
> @@ -1684,7 +1684,9 @@ static int fusb302_probe(struct i2c_client *client,
> {
> struct fusb302_chip *chip;
> struct i2c_adapter *adapter;
> + struct device *dev = &client->dev;
> int ret = 0;
> + u32 v;
>
> adapter = to_i2c_adapter(client->dev.parent);
> if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) {
> @@ -1699,8 +1701,22 @@ static int fusb302_probe(struct i2c_client *client,
> chip->i2c_client = client;
> i2c_set_clientdata(client, chip);
> chip->dev = &client->dev;
> + chip->tcpc_config = fusb302_tcpc_config;
> + chip->tcpc_dev.config = &chip->tcpc_config;
> mutex_init(&chip->lock);
>
> + if (!device_property_read_u32(dev, "fcs,max-sink-microvolt", &v))
> + chip->tcpc_config.max_snk_mv = v / 1000;
> +
> + if (!device_property_read_u32(dev, "fcs,max-sink-microamp", &v))
> + chip->tcpc_config.max_snk_ma = v / 1000;
> +
> + if (!device_property_read_u32(dev, "fcs,max-sink-microwatt", &v))
> + chip->tcpc_config.max_snk_mw = v / 1000;
> +
> + if (!device_property_read_u32(dev, "fcs,operating-sink-microwatt", &v))
> + chip->tcpc_config.operating_snk_mw = v / 1000;
> +
> ret = fusb302_debugfs_init(chip);
> if (ret < 0)
> return ret;
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 05/11] staging: typec: fusb302: Use client->irq as irq if set
2017-08-30 9:48 ` [PATCH v3 05/11] staging: typec: fusb302: Use client->irq as irq if set Hans de Goede
@ 2017-08-30 13:56 ` Guenter Roeck
0 siblings, 0 replies; 22+ messages in thread
From: Guenter Roeck @ 2017-08-30 13:56 UTC (permalink / raw)
To: Hans de Goede, Darren Hart, Andy Shevchenko, Wolfram Sang,
Sebastian Reichel, Greg Kroah-Hartman, Heikki Krogerus
Cc: devel, linux-pm, Tony Lindgren, Yueyao (Nathan) Zhu, linux-kernel,
platform-driver-x86, Liam Breck, linux-i2c
On 08/30/2017 02:48 AM, Hans de Goede wrote:
> The fusb302 is also used on x86 systems where the platform code sets
> the irq in client->irq and there is no gpio named fcs,int_n.
>
> Cc: "Yueyao (Nathan) Zhu" <yueyao@google.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/staging/typec/fusb302/fusb302.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c
> index 1c1751c994db..675161cf4f3a 100644
> --- a/drivers/staging/typec/fusb302/fusb302.c
> +++ b/drivers/staging/typec/fusb302/fusb302.c
> @@ -1735,9 +1735,13 @@ static int fusb302_probe(struct i2c_client *client,
> goto destroy_workqueue;
> }
>
> - ret = init_gpio(chip);
> - if (ret < 0)
> - goto destroy_workqueue;
> + if (client->irq) {
> + chip->gpio_int_n_irq = client->irq;
> + } else {
> + ret = init_gpio(chip);
> + if (ret < 0)
> + goto destroy_workqueue;
> + }
>
> chip->tcpm_port = tcpm_register_port(&client->dev, &chip->tcpc_dev);
> if (IS_ERR(chip->tcpm_port)) {
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 06/11] staging: typec: fusb302: Add support for USB2 charger detection through extcon
2017-08-30 9:48 ` [PATCH v3 06/11] staging: typec: fusb302: Add support for USB2 charger detection through extcon Hans de Goede
@ 2017-08-30 13:58 ` Guenter Roeck
0 siblings, 0 replies; 22+ messages in thread
From: Guenter Roeck @ 2017-08-30 13:58 UTC (permalink / raw)
To: Hans de Goede, Darren Hart, Andy Shevchenko, Wolfram Sang,
Sebastian Reichel, Greg Kroah-Hartman, Heikki Krogerus
Cc: devel, linux-pm, Tony Lindgren, Yueyao (Nathan) Zhu, linux-kernel,
platform-driver-x86, Liam Breck, linux-i2c
On 08/30/2017 02:48 AM, Hans de Goede wrote:
> The fusb302 port-controller relies on an external device doing USB2
> charger-type detection.
>
> The Intel Whiskey Cove PMIC with which the fusb302 is combined on some
> X86/ACPI platforms already has a charger-type detection driver which
> uses extcon to communicate the detected charger-type.
>
> Rather then inventing a new API for USB2 charger-type detection
> specifically for use with the tcpm code, this commit simply re-uses the
> existing extcon API and uses that do USB2 charger detection.
>
> Note that the "fcs,extcon-name" property name is only for kernel internal
> use by X86/ACPI platform code and as such is NOT documented in
> the fusb302 devicetree bindings.
>
> Cc: "Yueyao (Nathan) Zhu" <yueyao@google.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> Changes in v2:
> -Put extcon code directly in fusb302.c rather then introducing helpers
> which are only used by fusb302.c
>
> Changes in v3:
> -Improve commit message
> ---
> drivers/staging/typec/fusb302/fusb302.c | 49 +++++++++++++++++++++++++++++++++
> 1 file changed, 49 insertions(+)
>
> diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c
> index 675161cf4f3a..6f007f66d597 100644
> --- a/drivers/staging/typec/fusb302/fusb302.c
> +++ b/drivers/staging/typec/fusb302/fusb302.c
> @@ -17,6 +17,7 @@
> #include <linux/debugfs.h>
> #include <linux/delay.h>
> #include <linux/errno.h>
> +#include <linux/extcon.h>
> #include <linux/gpio.h>
> #include <linux/i2c.h>
> #include <linux/interrupt.h>
> @@ -96,6 +97,7 @@ struct fusb302_chip {
>
> int gpio_int_n;
> int gpio_int_n_irq;
> + struct extcon_dev *extcon;
>
> struct workqueue_struct *wq;
> struct delayed_work bc_lvl_handler;
> @@ -516,6 +518,38 @@ static int tcpm_get_vbus(struct tcpc_dev *dev)
> return ret;
> }
>
> +static int tcpm_get_current_limit(struct tcpc_dev *dev)
> +{
> + struct fusb302_chip *chip = container_of(dev, struct fusb302_chip,
> + tcpc_dev);
> + int current_limit = 0;
> + unsigned long timeout;
> +
> + if (!chip->extcon)
> + return 0;
> +
> + /*
> + * USB2 Charger detection may still be in progress when we get here,
> + * this can take upto 600ms, wait 800ms max.
> + */
> + timeout = jiffies + msecs_to_jiffies(800);
> + do {
> + if (extcon_get_state(chip->extcon, EXTCON_CHG_USB_SDP) == 1)
> + current_limit = 500;
> +
> + if (extcon_get_state(chip->extcon, EXTCON_CHG_USB_CDP) == 1 ||
> + extcon_get_state(chip->extcon, EXTCON_CHG_USB_ACA) == 1)
> + current_limit = 1500;
> +
> + if (extcon_get_state(chip->extcon, EXTCON_CHG_USB_DCP) == 1)
> + current_limit = 2000;
> +
> + msleep(50);
> + } while (current_limit == 0 && time_before(jiffies, timeout));
> +
> + return current_limit;
> +}
> +
> static int fusb302_set_cc_pull(struct fusb302_chip *chip,
> bool pull_up, bool pull_down)
> {
> @@ -1201,6 +1235,7 @@ static void init_tcpc_dev(struct tcpc_dev *fusb302_tcpc_dev)
> {
> fusb302_tcpc_dev->init = tcpm_init;
> fusb302_tcpc_dev->get_vbus = tcpm_get_vbus;
> + fusb302_tcpc_dev->get_current_limit = tcpm_get_current_limit;
> fusb302_tcpc_dev->set_cc = tcpm_set_cc;
> fusb302_tcpc_dev->get_cc = tcpm_get_cc;
> fusb302_tcpc_dev->set_polarity = tcpm_set_polarity;
> @@ -1685,6 +1720,7 @@ static int fusb302_probe(struct i2c_client *client,
> struct fusb302_chip *chip;
> struct i2c_adapter *adapter;
> struct device *dev = &client->dev;
> + const char *name;
> int ret = 0;
> u32 v;
>
> @@ -1717,6 +1753,19 @@ static int fusb302_probe(struct i2c_client *client,
> if (!device_property_read_u32(dev, "fcs,operating-sink-microwatt", &v))
> chip->tcpc_config.operating_snk_mw = v / 1000;
>
> + /*
> + * Devicetree platforms should get extcon via phandle (not yet
> + * supported). On ACPI platforms, we get the name from a device prop.
> + * This device prop is for kernel internal use only and is expected
> + * to be set by the platform code which also registers the i2c client
> + * for the fusb302.
> + */
> + if (device_property_read_string(dev, "fcs,extcon-name", &name) == 0) {
> + chip->extcon = extcon_get_extcon_dev(name);
> + if (!chip->extcon)
> + return -EPROBE_DEFER;
> + }
> +
> ret = fusb302_debugfs_init(chip);
> if (ret < 0)
> return ret;
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 07/11] staging: typec: fusb302: Export current-limit through a power_supply class dev
2017-08-30 9:48 ` [PATCH v3 07/11] staging: typec: fusb302: Export current-limit through a power_supply class dev Hans de Goede
@ 2017-08-30 14:01 ` Guenter Roeck
0 siblings, 0 replies; 22+ messages in thread
From: Guenter Roeck @ 2017-08-30 14:01 UTC (permalink / raw)
To: Hans de Goede, Darren Hart, Andy Shevchenko, Wolfram Sang,
Sebastian Reichel, Greg Kroah-Hartman, Heikki Krogerus
Cc: platform-driver-x86, linux-kernel, linux-i2c, Liam Breck,
Tony Lindgren, linux-pm, devel, Yueyao (Nathan) Zhu
On 08/30/2017 02:48 AM, Hans de Goede wrote:
> The fusb302 Type-C port-controller cannot control the current-limit
> directly, so we need to exported the limit so that another driver
> (e.g. the charger driver) can pick the limit up and configure the
> system accordingly.
>
> The power-supply subsys already provides infrastructure for this,
> power-supply devices have the notion of being supplied by another
> power-supply and have properties through which we can export the
> current-limit.
>
> Register a power_supply and export the current-limit through the
> power_supply's current-max property.
>
> Cc: "Yueyao (Nathan) Zhu" <yueyao@google.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> Changes in v2:
> -Put the psy class device code directly in fusb302.c rather then introducing
> helpers which are only used by fusb302.c
> -Add an online property to the psy so that upower does not mistake it for a
> second battery in the system
> ---
> drivers/staging/typec/fusb302/Kconfig | 2 +-
> drivers/staging/typec/fusb302/fusb302.c | 63 +++++++++++++++++++++++++++++++--
> 2 files changed, 62 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/typec/fusb302/Kconfig b/drivers/staging/typec/fusb302/Kconfig
> index fce099ff39fe..48a4f2fcee03 100644
> --- a/drivers/staging/typec/fusb302/Kconfig
> +++ b/drivers/staging/typec/fusb302/Kconfig
> @@ -1,6 +1,6 @@
> config TYPEC_FUSB302
> tristate "Fairchild FUSB302 Type-C chip driver"
> - depends on I2C
> + depends on I2C && POWER_SUPPLY
> help
> The Fairchild FUSB302 Type-C chip driver that works with
> Type-C Port Controller Manager to provide USB PD and USB
> diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c
> index 6f007f66d597..cf6355f59cd9 100644
> --- a/drivers/staging/typec/fusb302/fusb302.c
> +++ b/drivers/staging/typec/fusb302/fusb302.c
> @@ -28,6 +28,7 @@
> #include <linux/of_device.h>
> #include <linux/of_gpio.h>
> #include <linux/pinctrl/consumer.h>
> +#include <linux/power_supply.h>
> #include <linux/proc_fs.h>
> #include <linux/regulator/consumer.h>
> #include <linux/sched/clock.h>
> @@ -108,6 +109,11 @@ struct fusb302_chip {
> /* lock for sharing chip states */
> struct mutex lock;
>
> + /* psy + psy status */
> + struct power_supply *psy;
> + u32 current_limit;
> + u32 supply_voltage;
> +
> /* chip status */
> enum toggling_mode toggling_mode;
> enum src_current_status src_current_status;
> @@ -876,11 +882,13 @@ static int tcpm_set_vbus(struct tcpc_dev *dev, bool on, bool charge)
> chip->vbus_on = on;
> fusb302_log(chip, "vbus := %s", on ? "On" : "Off");
> }
> - if (chip->charge_on == charge)
> + if (chip->charge_on == charge) {
> fusb302_log(chip, "charge is already %s",
> charge ? "On" : "Off");
> - else
> + } else {
> chip->charge_on = charge;
> + power_supply_changed(chip->psy);
> + }
>
> done:
> mutex_unlock(&chip->lock);
> @@ -896,6 +904,11 @@ static int tcpm_set_current_limit(struct tcpc_dev *dev, u32 max_ma, u32 mv)
> fusb302_log(chip, "current limit: %d ma, %d mv (not implemented)",
> max_ma, mv);
>
> + chip->supply_voltage = mv;
> + chip->current_limit = max_ma;
> +
> + power_supply_changed(chip->psy);
> +
> return 0;
> }
>
> @@ -1681,6 +1694,43 @@ static irqreturn_t fusb302_irq_intn(int irq, void *dev_id)
> return IRQ_HANDLED;
> }
>
> +static int fusb302_psy_get_property(struct power_supply *psy,
> + enum power_supply_property psp,
> + union power_supply_propval *val)
> +{
> + struct fusb302_chip *chip = power_supply_get_drvdata(psy);
> +
> + switch (psp) {
> + case POWER_SUPPLY_PROP_ONLINE:
> + val->intval = chip->charge_on;
> + break;
> + case POWER_SUPPLY_PROP_VOLTAGE_NOW:
> + val->intval = chip->supply_voltage * 1000; /* mV -> µV */
> + break;
> + case POWER_SUPPLY_PROP_CURRENT_MAX:
> + val->intval = chip->current_limit * 1000; /* mA -> µA */
> + break;
> + default:
> + return -ENODATA;
> + }
> +
> + return 0;
> +}
> +
> +static enum power_supply_property fusb302_psy_properties[] = {
> + POWER_SUPPLY_PROP_ONLINE,
> + POWER_SUPPLY_PROP_VOLTAGE_NOW,
> + POWER_SUPPLY_PROP_CURRENT_MAX,
> +};
> +
> +const struct power_supply_desc fusb302_psy_desc = {
> + .name = "fusb302-typec-source",
> + .type = POWER_SUPPLY_TYPE_USB_TYPE_C,
> + .properties = fusb302_psy_properties,
> + .num_properties = ARRAY_SIZE(fusb302_psy_properties),
> + .get_property = fusb302_psy_get_property,
> +};
> +
> static int init_gpio(struct fusb302_chip *chip)
> {
> struct device_node *node;
> @@ -1720,6 +1770,7 @@ static int fusb302_probe(struct i2c_client *client,
> struct fusb302_chip *chip;
> struct i2c_adapter *adapter;
> struct device *dev = &client->dev;
> + struct power_supply_config cfg = {};
> const char *name;
> int ret = 0;
> u32 v;
> @@ -1766,6 +1817,14 @@ static int fusb302_probe(struct i2c_client *client,
> return -EPROBE_DEFER;
> }
>
> + cfg.drv_data = chip;
> + chip->psy = devm_power_supply_register(dev, &fusb302_psy_desc, &cfg);
> + if (IS_ERR(chip->psy)) {
> + ret = PTR_ERR(chip->psy);
> + dev_err(chip->dev, "Error registering power-supply: %d\n", ret);
> + return ret;
> + }
> +
> ret = fusb302_debugfs_init(chip);
> if (ret < 0)
> return ret;
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 08/11] power: supply: bq24190_charger: Export 5V boost converter as regulator
2017-08-30 9:48 ` [PATCH v3 08/11] power: supply: bq24190_charger: Export 5V boost converter as regulator Hans de Goede
@ 2017-08-30 14:46 ` Tony Lindgren
2017-08-30 16:32 ` Sebastian Reichel
0 siblings, 1 reply; 22+ messages in thread
From: Tony Lindgren @ 2017-08-30 14:46 UTC (permalink / raw)
To: Hans de Goede
Cc: devel, Heikki Krogerus, linux-kernel, Wolfram Sang,
Greg Kroah-Hartman, linux-pm, Sebastian Reichel,
platform-driver-x86, Liam Breck, Andy Shevchenko, Darren Hart,
Guenter Roeck, linux-i2c
* Hans de Goede <hdegoede@redhat.com> [170830 02:49]:
> Register the 5V boost converter as a regulator named "usb_otg_vbus".
>
> This commit also adds support for bq24190_platform_data, through which
> non device-tree platforms can pass the regulator_init_data (containing
> mappings for the consumer amongst other things).
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This will make it easy for USB PHY drivers to implement USB host mode:
Acked-by: Tony Lindgren <tony@atomide.com>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 09/11] power: supply: bq24190_charger: Get input_current_limit from our supplier
2017-08-30 9:48 ` [PATCH v3 09/11] power: supply: bq24190_charger: Get input_current_limit from our supplier Hans de Goede
@ 2017-08-30 14:47 ` Tony Lindgren
2017-08-30 16:32 ` Sebastian Reichel
0 siblings, 1 reply; 22+ messages in thread
From: Tony Lindgren @ 2017-08-30 14:47 UTC (permalink / raw)
To: Hans de Goede
Cc: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus,
platform-driver-x86, linux-kernel, linux-i2c, Liam Breck,
linux-pm, devel
* Hans de Goede <hdegoede@redhat.com> [170830 02:49]:
> On some devices the USB Type-C port power (USB PD 2.0) negotiation is
> done by a separate port-controller IC, while the current limit is
> controlled through another (charger) IC.
>
> It has been decided to model this by modelling the external Type-C
> power brick (adapter/charger) as a power-supply class device which
> supplies the charger-IC, with its voltage-now and current-max representing
> the negotiated voltage and max current draw.
>
> This commit adds support for this to the bq24190_charger driver by adding
> an external_power_changed callback and calling
> power_supply_set_input_current_limit_from_supplier from this callback.
> This callback will only get called if the bq24190 has a parent-supply.
>
> Note this replaces the functionality to get the current-limit from an
> extcon device, which will be removed in a follow-up commit.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Tony Lindgren <tony@atomide.com>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 08/11] power: supply: bq24190_charger: Export 5V boost converter as regulator
2017-08-30 14:46 ` Tony Lindgren
@ 2017-08-30 16:32 ` Sebastian Reichel
0 siblings, 0 replies; 22+ messages in thread
From: Sebastian Reichel @ 2017-08-30 16:32 UTC (permalink / raw)
To: Tony Lindgren
Cc: Hans de Goede, Darren Hart, Andy Shevchenko, Wolfram Sang,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus,
platform-driver-x86, linux-kernel, linux-i2c, Liam Breck,
linux-pm, devel
[-- Attachment #1: Type: text/plain, Size: 639 bytes --]
Hi,
On Wed, Aug 30, 2017 at 07:46:50AM -0700, Tony Lindgren wrote:
> * Hans de Goede <hdegoede@redhat.com> [170830 02:49]:
> > Register the 5V boost converter as a regulator named "usb_otg_vbus".
> >
> > This commit also adds support for bq24190_platform_data, through which
> > non device-tree platforms can pass the regulator_init_data (containing
> > mappings for the consumer amongst other things).
> >
> > Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> This will make it easy for USB PHY drivers to implement USB host mode:
>
> Acked-by: Tony Lindgren <tony@atomide.com>
Thanks, queued.
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 09/11] power: supply: bq24190_charger: Get input_current_limit from our supplier
2017-08-30 14:47 ` Tony Lindgren
@ 2017-08-30 16:32 ` Sebastian Reichel
0 siblings, 0 replies; 22+ messages in thread
From: Sebastian Reichel @ 2017-08-30 16:32 UTC (permalink / raw)
To: Tony Lindgren
Cc: Hans de Goede, Darren Hart, Andy Shevchenko, Wolfram Sang,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus,
platform-driver-x86, linux-kernel, linux-i2c, Liam Breck,
linux-pm, devel
[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]
Hi,
On Wed, Aug 30, 2017 at 07:47:46AM -0700, Tony Lindgren wrote:
> * Hans de Goede <hdegoede@redhat.com> [170830 02:49]:
> > On some devices the USB Type-C port power (USB PD 2.0) negotiation is
> > done by a separate port-controller IC, while the current limit is
> > controlled through another (charger) IC.
> >
> > It has been decided to model this by modelling the external Type-C
> > power brick (adapter/charger) as a power-supply class device which
> > supplies the charger-IC, with its voltage-now and current-max representing
> > the negotiated voltage and max current draw.
> >
> > This commit adds support for this to the bq24190_charger driver by adding
> > an external_power_changed callback and calling
> > power_supply_set_input_current_limit_from_supplier from this callback.
> > This callback will only get called if the bq24190 has a parent-supply.
> >
> > Note this replaces the functionality to get the current-limit from an
> > extcon device, which will be removed in a follow-up commit.
> >
> > Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> Acked-by: Tony Lindgren <tony@atomide.com>
Thanks, queued.
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger
2017-08-30 9:48 [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Hans de Goede
` (10 preceding siblings ...)
2017-08-30 9:48 ` [PATCH v3 11/11] platform/x86: intel_cht_int33fe: Update fusb302 type string, add properties Hans de Goede
@ 2017-08-31 16:26 ` Greg Kroah-Hartman
11 siblings, 0 replies; 22+ messages in thread
From: Greg Kroah-Hartman @ 2017-08-31 16:26 UTC (permalink / raw)
To: Hans de Goede
Cc: Darren Hart, Andy Shevchenko, Wolfram Sang, Sebastian Reichel,
Guenter Roeck, Heikki Krogerus, devel, linux-pm, Tony Lindgren,
linux-kernel, platform-driver-x86, Liam Breck, linux-i2c
On Wed, Aug 30, 2017 at 11:48:03AM +0200, Hans de Goede wrote:
> Hi All,
>
> Here is v3 of my typec power-negotation hookup series. New this version:
> - Drop a few patches merged into linux-power-supply.git/for-next
> - Drop the "power: supply: bq24190_charger: Remove extcon handling"
> patch *for now*, this can only be merged once all the other patches are
> in place (and extcon handling is no longer needed)
> - Address some review comments in some of the other patches, see the
> per patch changelogs inside the commit messages
>
> I believe that this series is ready for merging now and I would like to
> ask the various subsys maintainers to pick up and merge these patches.
> All the patches can be merged independent of eachother with the exception
> of the last 2 patches:
>
> i2c-cht-wc: Add device-properties for fusb302 integration
> platform/x86: intel_cht_int33fe: Update fusb302 type string, add properties
>
> Which should not be merged until all the other patches are in place.
staging patches all now merged, thanks!
greg k-h
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2017-08-31 16:26 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-30 9:48 [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Hans de Goede
2017-08-30 9:48 ` [PATCH v3 01/11] i2c: Allow overriding dev_name through board_info Hans de Goede
2017-08-30 9:48 ` [PATCH v3 02/11] staging: typec: tcpm: Add get_current_limit tcpc_dev callback Hans de Goede
2017-08-30 9:48 ` [PATCH v3 03/11] staging: typec: fusb302: Set max supply voltage to 5V Hans de Goede
2017-08-30 13:37 ` Guenter Roeck
2017-08-30 9:48 ` [PATCH v3 04/11] staging: typec: fusb302: Get max snk mv/ma/mw from device-properties Hans de Goede
2017-08-30 13:50 ` Guenter Roeck
2017-08-30 9:48 ` [PATCH v3 05/11] staging: typec: fusb302: Use client->irq as irq if set Hans de Goede
2017-08-30 13:56 ` Guenter Roeck
2017-08-30 9:48 ` [PATCH v3 06/11] staging: typec: fusb302: Add support for USB2 charger detection through extcon Hans de Goede
2017-08-30 13:58 ` Guenter Roeck
2017-08-30 9:48 ` [PATCH v3 07/11] staging: typec: fusb302: Export current-limit through a power_supply class dev Hans de Goede
2017-08-30 14:01 ` Guenter Roeck
2017-08-30 9:48 ` [PATCH v3 08/11] power: supply: bq24190_charger: Export 5V boost converter as regulator Hans de Goede
2017-08-30 14:46 ` Tony Lindgren
2017-08-30 16:32 ` Sebastian Reichel
2017-08-30 9:48 ` [PATCH v3 09/11] power: supply: bq24190_charger: Get input_current_limit from our supplier Hans de Goede
2017-08-30 14:47 ` Tony Lindgren
2017-08-30 16:32 ` Sebastian Reichel
2017-08-30 9:48 ` [PATCH v3 10/11] i2c-cht-wc: Add device-properties for fusb302 integration Hans de Goede
2017-08-30 9:48 ` [PATCH v3 11/11] platform/x86: intel_cht_int33fe: Update fusb302 type string, add properties Hans de Goede
2017-08-31 16:26 ` [PATCH v3 00/11] Hookup typec power-negotation to the PMIC and charger Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).