All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] ARM: qcom: msm8974-hammerhead: add USB OTG support
@ 2018-11-01  0:11 Brian Masney
  2018-11-01  0:11 ` [PATCH v2 1/7] dt-bindings: power: supply: bq24190_charger: add bq24192 and usb-otg-vbus Brian Masney
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Brian Masney @ 2018-11-01  0:11 UTC (permalink / raw)
  To: sre, robh+dt, mark.rutland, andy.gross, david.brown,
	bjorn.andersson, linus.walleij
  Cc: linux-pm, devicetree, linux-kernel, linux-arm-msm, linux-soc,
	linux-gpio, jonathan, masneyb

This patch set adds USB OTG support for the LG Nexus 5 (hammerhead)
phone.

Changes in v2:
- Reworked patches to use gpio hogging as suggested in the bq24190
  device tree documentation.
- bq24190_charger: changed to use a switch instead of an if as requested
  by Sebastian Reichel.
- bq24190_charger dt-bindings: added usb-otg-vbus to example.


Brian Masney (5):
  dt-bindings: power: supply: bq24190_charger: add bq24192 and
    usb-otg-vbus
  power: supply: bq24190_charger: add extcon support for USB OTG
  pinctrl: qcom: spmi-gpio: fix gpio-hog related boot issues
  ARM: dts: qcom: msm8974: add gpio-ranges
  ARM: dts: qcom: msm8974-hammerhead: add USB OTG support

Jonathan Marek (2):
  power: supply: bq24190_charger: add support for bq24192 variant
  power: supply: bq24190_charger: add of_match for usb-otg-vbus
    regulator

 .../bindings/power/supply/bq24190.txt         |  9 +++
 .../qcom-msm8974-lge-nexus5-hammerhead.dts    | 60 +++++++++++++++++++
 arch/arm/boot/dts/qcom-msm8974.dtsi           | 11 ++++
 arch/arm/boot/dts/qcom-pm8941.dtsi            |  1 +
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c      | 21 +++++--
 drivers/power/supply/bq24190_charger.c        | 48 ++++++++++++++-
 6 files changed, 143 insertions(+), 7 deletions(-)

-- 
2.17.2

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v2 1/7] dt-bindings: power: supply: bq24190_charger: add bq24192 and usb-otg-vbus
  2018-11-01  0:11 [PATCH v2 0/7] ARM: qcom: msm8974-hammerhead: add USB OTG support Brian Masney
@ 2018-11-01  0:11 ` Brian Masney
  2018-11-05 21:59     ` Rob Herring
  2018-12-05 21:55   ` Sebastian Reichel
  2018-11-01  0:11 ` [PATCH v2 2/7] power: supply: bq24190_charger: add support for bq24192 variant Brian Masney
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 20+ messages in thread
From: Brian Masney @ 2018-11-01  0:11 UTC (permalink / raw)
  To: sre, robh+dt, mark.rutland, andy.gross, david.brown,
	bjorn.andersson, linus.walleij
  Cc: linux-pm, devicetree, linux-kernel, linux-arm-msm, linux-soc,
	linux-gpio, jonathan, masneyb

Add support for the ti,bq24192 variant and a child node for the
usb-otg-vbus regulator.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 .../devicetree/bindings/power/supply/bq24190.txt         | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/power/supply/bq24190.txt b/Documentation/devicetree/bindings/power/supply/bq24190.txt
index 9e517d307070..c8ac028bd3c7 100644
--- a/Documentation/devicetree/bindings/power/supply/bq24190.txt
+++ b/Documentation/devicetree/bindings/power/supply/bq24190.txt
@@ -3,6 +3,7 @@ TI BQ24190 Li-Ion Battery Charger
 Required properties:
 - compatible: contains one of the following:
     * "ti,bq24190"
+    * "ti,bq24192"
     * "ti,bq24192i"
 - reg: integer, I2C address of the charger.
 - interrupts[-extended]: configuration for charger INT pin.
@@ -19,6 +20,12 @@ Optional properties:
 - ti,system-minimum-microvolt: when power is connected and the battery is below
   minimum system voltage, the system will be regulated above this setting.
 
+child nodes:
+- usb-otg-vbus:
+  Usage: optional
+  Description: Regulator that is used to control the VBUS voltage direction for
+               either USB host mode or for charging on the OTG port.
+
 Notes:
 - Some circuit boards wire the chip's "OTG" pin high (enabling 500mA default
   charge current on USB SDP ports, among other features). To simulate this on
@@ -39,6 +46,8 @@ Example:
 		interrupts-extended = <&gpiochip 10 IRQ_TYPE_EDGE_FALLING>;
 		monitored-battery = <&bat>;
 		ti,system-minimum-microvolt = <3200000>;
+
+		usb_otg_vbus: usb-otg-vbus { };
 	};
 
 	&twl_gpio {
-- 
2.17.2

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 2/7] power: supply: bq24190_charger: add support for bq24192 variant
  2018-11-01  0:11 [PATCH v2 0/7] ARM: qcom: msm8974-hammerhead: add USB OTG support Brian Masney
  2018-11-01  0:11 ` [PATCH v2 1/7] dt-bindings: power: supply: bq24190_charger: add bq24192 and usb-otg-vbus Brian Masney
@ 2018-11-01  0:11 ` Brian Masney
  2018-12-05 21:56   ` Sebastian Reichel
  2018-11-01  0:11 ` [PATCH v2 3/7] power: supply: bq24190_charger: add of_match for usb-otg-vbus regulator Brian Masney
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: Brian Masney @ 2018-11-01  0:11 UTC (permalink / raw)
  To: sre, robh+dt, mark.rutland, andy.gross, david.brown,
	bjorn.andersson, linus.walleij
  Cc: linux-pm, devicetree, linux-kernel, linux-arm-msm, linux-soc,
	linux-gpio, jonathan, masneyb

From: Jonathan Marek <jonathan@marek.ca>

This patch adds support for the bq24192 variant to bq24190_charger.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
[masneyb@onstation.org: Changed if statement to a switch based on
feedback from Sebastian Reichel.]
Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/power/supply/bq24190_charger.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
index b58df04d03b3..44d3aff32885 100644
--- a/drivers/power/supply/bq24190_charger.c
+++ b/drivers/power/supply/bq24190_charger.c
@@ -1637,8 +1637,12 @@ static int bq24190_hw_init(struct bq24190_dev_info *bdi)
 	if (ret < 0)
 		return ret;
 
-	if (v != BQ24190_REG_VPRS_PN_24190 &&
-	    v != BQ24190_REG_VPRS_PN_24192I) {
+	switch (v) {
+	case BQ24190_REG_VPRS_PN_24190:
+	case BQ24190_REG_VPRS_PN_24192:
+	case BQ24190_REG_VPRS_PN_24192I:
+		break;
+	default:
 		dev_err(bdi->dev, "Error unknown model: 0x%02x\n", v);
 		return -ENODEV;
 	}
@@ -1931,6 +1935,7 @@ static const struct dev_pm_ops bq24190_pm_ops = {
 
 static const struct i2c_device_id bq24190_i2c_ids[] = {
 	{ "bq24190" },
+	{ "bq24192" },
 	{ "bq24192i" },
 	{ },
 };
@@ -1939,6 +1944,7 @@ MODULE_DEVICE_TABLE(i2c, bq24190_i2c_ids);
 #ifdef CONFIG_OF
 static const struct of_device_id bq24190_of_match[] = {
 	{ .compatible = "ti,bq24190", },
+	{ .compatible = "ti,bq24192", },
 	{ .compatible = "ti,bq24192i", },
 	{ },
 };
-- 
2.17.2

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 3/7] power: supply: bq24190_charger: add of_match for usb-otg-vbus regulator
  2018-11-01  0:11 [PATCH v2 0/7] ARM: qcom: msm8974-hammerhead: add USB OTG support Brian Masney
  2018-11-01  0:11 ` [PATCH v2 1/7] dt-bindings: power: supply: bq24190_charger: add bq24192 and usb-otg-vbus Brian Masney
  2018-11-01  0:11 ` [PATCH v2 2/7] power: supply: bq24190_charger: add support for bq24192 variant Brian Masney
@ 2018-11-01  0:11 ` Brian Masney
  2018-12-05 21:56   ` Sebastian Reichel
  2018-11-01  0:11 ` [PATCH v2 4/7] power: supply: bq24190_charger: add extcon support for USB OTG Brian Masney
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: Brian Masney @ 2018-11-01  0:11 UTC (permalink / raw)
  To: sre, robh+dt, mark.rutland, andy.gross, david.brown,
	bjorn.andersson, linus.walleij
  Cc: linux-pm, devicetree, linux-kernel, linux-arm-msm, linux-soc,
	linux-gpio, jonathan, masneyb

From: Jonathan Marek <jonathan@marek.ca>

This patch adds an of_match for the usb-otg-vbus regulator to
bq24190_charger.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/power/supply/bq24190_charger.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
index 44d3aff32885..9e7f3e33458a 100644
--- a/drivers/power/supply/bq24190_charger.c
+++ b/drivers/power/supply/bq24190_charger.c
@@ -577,6 +577,7 @@ static const struct regulator_ops bq24190_vbus_ops = {
 
 static const struct regulator_desc bq24190_vbus_desc = {
 	.name = "usb_otg_vbus",
+	.of_match = "usb-otg-vbus",
 	.type = REGULATOR_VOLTAGE,
 	.owner = THIS_MODULE,
 	.ops = &bq24190_vbus_ops,
-- 
2.17.2

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 4/7] power: supply: bq24190_charger: add extcon support for USB OTG
  2018-11-01  0:11 [PATCH v2 0/7] ARM: qcom: msm8974-hammerhead: add USB OTG support Brian Masney
                   ` (2 preceding siblings ...)
  2018-11-01  0:11 ` [PATCH v2 3/7] power: supply: bq24190_charger: add of_match for usb-otg-vbus regulator Brian Masney
@ 2018-11-01  0:11 ` Brian Masney
  2018-12-05 21:56   ` Sebastian Reichel
  2018-11-01  0:11 ` [PATCH v2 5/7] pinctrl: qcom: spmi-gpio: fix gpio-hog related boot issues Brian Masney
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: Brian Masney @ 2018-11-01  0:11 UTC (permalink / raw)
  To: sre, robh+dt, mark.rutland, andy.gross, david.brown,
	bjorn.andersson, linus.walleij
  Cc: linux-pm, devicetree, linux-kernel, linux-arm-msm, linux-soc,
	linux-gpio, jonathan, masneyb

Add extcon support so that we can notify USB drivers of cable state
changes. Based on work from Jonathan Marek. USB OTG was tested on a LG
Nexus 5 (hammerhead) phone.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/power/supply/bq24190_charger.c | 37 +++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
index 9e7f3e33458a..4e64e6ac95c5 100644
--- a/drivers/power/supply/bq24190_charger.c
+++ b/drivers/power/supply/bq24190_charger.c
@@ -21,6 +21,7 @@
 #include <linux/workqueue.h>
 #include <linux/gpio.h>
 #include <linux/i2c.h>
+#include <linux/extcon-provider.h>
 
 #define	BQ24190_MANUFACTURER	"Texas Instruments"
 
@@ -159,6 +160,7 @@
 struct bq24190_dev_info {
 	struct i2c_client		*client;
 	struct device			*dev;
+	struct extcon_dev		*edev;
 	struct power_supply		*charger;
 	struct power_supply		*battery;
 	struct delayed_work		input_current_limit_work;
@@ -174,6 +176,11 @@ struct bq24190_dev_info {
 	u8				watchdog;
 };
 
+static const unsigned int bq24190_usb_extcon_cable[] = {
+	EXTCON_USB,
+	EXTCON_NONE,
+};
+
 /*
  * The tables below provide a 2-way mapping for the value that goes in
  * the register field and the real-world value that it represents.
@@ -1528,6 +1535,20 @@ static const struct power_supply_desc bq24190_battery_desc = {
 	.property_is_writeable	= bq24190_battery_property_is_writeable,
 };
 
+static int bq24190_configure_usb_otg(struct bq24190_dev_info *bdi, u8 ss_reg)
+{
+	bool otg_enabled;
+	int ret;
+
+	otg_enabled = !!(ss_reg & BQ24190_REG_SS_VBUS_STAT_MASK);
+	ret = extcon_set_state_sync(bdi->edev, EXTCON_USB, otg_enabled);
+	if (ret < 0)
+		dev_err(bdi->dev, "Can't set extcon state to %d: %d\n",
+			otg_enabled, ret);
+
+	return ret;
+}
+
 static void bq24190_check_status(struct bq24190_dev_info *bdi)
 {
 	const u8 battery_mask_ss = BQ24190_REG_SS_CHRG_STAT_MASK;
@@ -1597,8 +1618,10 @@ static void bq24190_check_status(struct bq24190_dev_info *bdi)
 		bdi->ss_reg = ss_reg;
 	}
 
-	if (alert_charger || alert_battery)
+	if (alert_charger || alert_battery) {
 		power_supply_changed(bdi->charger);
+		bq24190_configure_usb_otg(bdi, ss_reg);
+	}
 	if (alert_battery && bdi->battery)
 		power_supply_changed(bdi->battery);
 
@@ -1732,6 +1755,14 @@ static int bq24190_probe(struct i2c_client *client,
 		return -EINVAL;
 	}
 
+	bdi->edev = devm_extcon_dev_allocate(dev, bq24190_usb_extcon_cable);
+	if (IS_ERR(bdi->edev))
+		return PTR_ERR(bdi->edev);
+
+	ret = devm_extcon_dev_register(dev, bdi->edev);
+	if (ret < 0)
+		return ret;
+
 	pm_runtime_enable(dev);
 	pm_runtime_use_autosuspend(dev);
 	pm_runtime_set_autosuspend_delay(dev, 600);
@@ -1778,6 +1809,10 @@ static int bq24190_probe(struct i2c_client *client,
 		goto out_charger;
 	}
 
+	ret = bq24190_configure_usb_otg(bdi, bdi->ss_reg);
+	if (ret < 0)
+		goto out_charger;
+
 	ret = bq24190_sysfs_create_group(bdi);
 	if (ret < 0) {
 		dev_err(dev, "Can't create sysfs entries\n");
-- 
2.17.2

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 5/7] pinctrl: qcom: spmi-gpio: fix gpio-hog related boot issues
  2018-11-01  0:11 [PATCH v2 0/7] ARM: qcom: msm8974-hammerhead: add USB OTG support Brian Masney
                   ` (3 preceding siblings ...)
  2018-11-01  0:11 ` [PATCH v2 4/7] power: supply: bq24190_charger: add extcon support for USB OTG Brian Masney
@ 2018-11-01  0:11 ` Brian Masney
  2018-11-09  8:59     ` Linus Walleij
  2018-11-01  0:11 ` [PATCH v2 6/7] ARM: dts: qcom: msm8974: add gpio-ranges Brian Masney
  2018-11-01  0:11 ` [PATCH v2 7/7] ARM: dts: qcom: msm8974-hammerhead: add USB OTG support Brian Masney
  6 siblings, 1 reply; 20+ messages in thread
From: Brian Masney @ 2018-11-01  0:11 UTC (permalink / raw)
  To: sre, robh+dt, mark.rutland, andy.gross, david.brown,
	bjorn.andersson, linus.walleij
  Cc: linux-pm, devicetree, linux-kernel, linux-arm-msm, linux-soc,
	linux-gpio, jonathan, masneyb

When attempting to setup up a gpio hog, device probing would repeatedly
fail with -EPROBE_DEFERED errors. It was caused by a circular dependency
between the gpio and pinctrl frameworks. If the gpio-ranges property is
present in device tree, then the gpio framework will handle the gpio pin
registration and eliminate the circular dependency.

See Christian Lamparter's commit a86caa9ba5d7 ("pinctrl: msm: fix
gpio-hog related boot issues") for a detailed commit message that
explains the issue in much more detail. The code comment in this commit
came from Christian's commit.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index a29efbe08f48..4c1ff9a1d156 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -1028,10 +1028,23 @@ static int pmic_gpio_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = gpiochip_add_pin_range(&state->chip, dev_name(dev), 0, 0, npins);
-	if (ret) {
-		dev_err(dev, "failed to add pin range\n");
-		goto err_range;
+	/*
+	 * For DeviceTree-supported systems, the gpio core checks the
+	 * pinctrl's device node for the "gpio-ranges" property.
+	 * If it is present, it takes care of adding the pin ranges
+	 * for the driver. In this case the driver can skip ahead.
+	 *
+	 * In order to remain compatible with older, existing DeviceTree
+	 * files which don't set the "gpio-ranges" property or systems that
+	 * utilize ACPI the driver has to call gpiochip_add_pin_range().
+	 */
+	if (!of_property_read_bool(dev->of_node, "gpio-ranges")) {
+		ret = gpiochip_add_pin_range(&state->chip, dev_name(dev), 0, 0,
+					     npins);
+		if (ret) {
+			dev_err(dev, "failed to add pin range\n");
+			goto err_range;
+		}
 	}
 
 	return 0;
-- 
2.17.2

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 6/7] ARM: dts: qcom: msm8974: add gpio-ranges
  2018-11-01  0:11 [PATCH v2 0/7] ARM: qcom: msm8974-hammerhead: add USB OTG support Brian Masney
                   ` (4 preceding siblings ...)
  2018-11-01  0:11 ` [PATCH v2 5/7] pinctrl: qcom: spmi-gpio: fix gpio-hog related boot issues Brian Masney
@ 2018-11-01  0:11 ` Brian Masney
  2018-12-07 11:41     ` Brian Masney
  2018-11-01  0:11 ` [PATCH v2 7/7] ARM: dts: qcom: msm8974-hammerhead: add USB OTG support Brian Masney
  6 siblings, 1 reply; 20+ messages in thread
From: Brian Masney @ 2018-11-01  0:11 UTC (permalink / raw)
  To: sre, robh+dt, mark.rutland, andy.gross, david.brown,
	bjorn.andersson, linus.walleij
  Cc: linux-pm, devicetree, linux-kernel, linux-arm-msm, linux-soc,
	linux-gpio, jonathan, masneyb

This adds the gpio-ranges property to pm8941_gpios so that the GPIO
pins are initialized by the GPIO framework and not pinctrl. This fixes
a circular dependency so GPIO hogging can be used on this board.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 arch/arm/boot/dts/qcom-pm8941.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/qcom-pm8941.dtsi b/arch/arm/boot/dts/qcom-pm8941.dtsi
index 2515c5c217ac..9a91b758f7aa 100644
--- a/arch/arm/boot/dts/qcom-pm8941.dtsi
+++ b/arch/arm/boot/dts/qcom-pm8941.dtsi
@@ -63,6 +63,7 @@
 			compatible = "qcom,pm8941-gpio", "qcom,spmi-gpio";
 			reg = <0xc000>;
 			gpio-controller;
+			gpio-ranges = <&pm8941_gpios 0 0 36>;
 			#gpio-cells = <2>;
 			interrupts = <0 0xc0 0 IRQ_TYPE_NONE>,
 				     <0 0xc1 0 IRQ_TYPE_NONE>,
-- 
2.17.2

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 7/7] ARM: dts: qcom: msm8974-hammerhead: add USB OTG support
  2018-11-01  0:11 [PATCH v2 0/7] ARM: qcom: msm8974-hammerhead: add USB OTG support Brian Masney
                   ` (5 preceding siblings ...)
  2018-11-01  0:11 ` [PATCH v2 6/7] ARM: dts: qcom: msm8974: add gpio-ranges Brian Masney
@ 2018-11-01  0:11 ` Brian Masney
  6 siblings, 0 replies; 20+ messages in thread
From: Brian Masney @ 2018-11-01  0:11 UTC (permalink / raw)
  To: sre, robh+dt, mark.rutland, andy.gross, david.brown,
	bjorn.andersson, linus.walleij
  Cc: linux-pm, devicetree, linux-kernel, linux-arm-msm, linux-soc,
	linux-gpio, jonathan, masneyb

Add the device tree bindings for USB OTG support. Driver was tested
using on a LG Nexus 5 (hammerhead) phone. This patch is based on work
from Jonathan Marek and from the other msm8974 devices.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 .../qcom-msm8974-lge-nexus5-hammerhead.dts    | 60 +++++++++++++++++++
 arch/arm/boot/dts/qcom-msm8974.dtsi           | 11 ++++
 2 files changed, 71 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts b/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
index ed8f064d0895..f67ab43956dc 100644
--- a/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
+++ b/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
@@ -242,6 +242,16 @@
 			};
 		};
 
+		i2c1_pins: i2c1 {
+			mux {
+				pins = "gpio2", "gpio3";
+				function = "blsp_i2c1";
+
+				drive-strength = <2>;
+				bias-disable;
+			};
+		};
+
 		i2c3_pins: i2c3 {
 			mux {
 				pins = "gpio10", "gpio11";
@@ -343,6 +353,24 @@
 		};
 	};
 
+	i2c@f9923000 {
+		status = "ok";
+		pinctrl-names = "default";
+		pinctrl-0 = <&i2c1_pins>;
+		clock-frequency = <100000>;
+		qcom,src-freq = <50000000>;
+
+		charger: bq24192@6b {
+			compatible = "ti,bq24192";
+			reg = <0x6b>;
+			interrupts-extended = <&spmi_bus 0 0xd5 0 IRQ_TYPE_EDGE_FALLING>;
+
+			omit-battery-class;
+
+			usb_otg_vbus: usb-otg-vbus { };
+		};
+	};
+
 	i2c@f9925000 {
 		status = "ok";
 		pinctrl-names = "default";
@@ -360,6 +388,31 @@
 			amstaos,proximity-diodes = <0>;
 		};
 	};
+
+	usb@f9a55000 {
+		status = "ok";
+
+		phys = <&usb_hs1_phy>;
+		phy-select = <&tcsr 0xb000 0>;
+
+		extcon = <&charger>, <&usb_id>;
+		vbus-supply = <&usb_otg_vbus>;
+
+		hnp-disable;
+		srp-disable;
+		adp-disable;
+
+		ulpi {
+			phy@a {
+				status = "ok";
+
+				v1p8-supply = <&pm8941_l6>;
+				v3p3-supply = <&pm8941_l24>;
+
+				qcom,init-seq = /bits/ 8 <0x1 0x64>;
+			};
+		};
+	};
 };
 
 &spmi_bus {
@@ -372,6 +425,13 @@
 				bias-pull-up;
 				power-source = <PM8941_GPIO_S3>;
 			};
+
+			otg {
+				gpio-hog;
+				gpios = <35 GPIO_ACTIVE_HIGH>;
+				output-high;
+				line-name = "otg-gpio";
+			};
 		};
 	};
 };
diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
index aba159d5a95a..8294192db9eb 100644
--- a/arch/arm/boot/dts/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
@@ -704,6 +704,17 @@
 			interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
 		};
 
+		i2c@f9923000 {
+			status = "disabled";
+			compatible = "qcom,i2c-qup-v2.1.1";
+			reg = <0xf9923000 0x1000>;
+			interrupts = <0 95 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&gcc GCC_BLSP1_QUP1_I2C_APPS_CLK>, <&gcc GCC_BLSP1_AHB_CLK>;
+			clock-names = "core", "iface";
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
 		i2c@f9924000 {
 			status = "disabled";
 			compatible = "qcom,i2c-qup-v2.1.1";
-- 
2.17.2

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 1/7] dt-bindings: power: supply: bq24190_charger: add bq24192 and usb-otg-vbus
  2018-11-01  0:11 ` [PATCH v2 1/7] dt-bindings: power: supply: bq24190_charger: add bq24192 and usb-otg-vbus Brian Masney
@ 2018-11-05 21:59     ` Rob Herring
  2018-12-05 21:55   ` Sebastian Reichel
  1 sibling, 0 replies; 20+ messages in thread
From: Rob Herring @ 2018-11-05 21:59 UTC (permalink / raw)
  Cc: sre, robh+dt, mark.rutland, andy.gross, david.brown,
	bjorn.andersson, linus.walleij, linux-pm, devicetree,
	linux-kernel, linux-arm-msm, linux-soc, linux-gpio, jonathan,
	masneyb

On Wed, 31 Oct 2018 20:11:43 -0400, Brian Masney wrote:
> Add support for the ti,bq24192 variant and a child node for the
> usb-otg-vbus regulator.
> 
> Signed-off-by: Brian Masney <masneyb@onstation.org>
> ---
>  .../devicetree/bindings/power/supply/bq24190.txt         | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 1/7] dt-bindings: power: supply: bq24190_charger: add bq24192 and usb-otg-vbus
@ 2018-11-05 21:59     ` Rob Herring
  0 siblings, 0 replies; 20+ messages in thread
From: Rob Herring @ 2018-11-05 21:59 UTC (permalink / raw)
  To: Brian Masney
  Cc: sre, robh+dt, mark.rutland, andy.gross, david.brown,
	bjorn.andersson, linus.walleij, linux-pm, devicetree,
	linux-kernel, linux-arm-msm, linux-soc, linux-gpio, jonathan,
	masneyb

On Wed, 31 Oct 2018 20:11:43 -0400, Brian Masney wrote:
> Add support for the ti,bq24192 variant and a child node for the
> usb-otg-vbus regulator.
> 
> Signed-off-by: Brian Masney <masneyb@onstation.org>
> ---
>  .../devicetree/bindings/power/supply/bq24190.txt         | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 5/7] pinctrl: qcom: spmi-gpio: fix gpio-hog related boot issues
  2018-11-01  0:11 ` [PATCH v2 5/7] pinctrl: qcom: spmi-gpio: fix gpio-hog related boot issues Brian Masney
@ 2018-11-09  8:59     ` Linus Walleij
  0 siblings, 0 replies; 20+ messages in thread
From: Linus Walleij @ 2018-11-09  8:59 UTC (permalink / raw)
  To: masneyb, Bjorn Andersson
  Cc: Sebastian Reichel, Rob Herring, Mark Rutland, Andy Gross,
	David Brown, Linux PM list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel, linux-arm-msm, open list:ARM/QUALCOMM SUPPORT,
	open list:GPIO SUBSYSTEM, jonathan

On Thu, Nov 1, 2018 at 1:12 AM Brian Masney <masneyb@onstation.org> wrote:

> When attempting to setup up a gpio hog, device probing would repeatedly
> fail with -EPROBE_DEFERED errors. It was caused by a circular dependency
> between the gpio and pinctrl frameworks. If the gpio-ranges property is
> present in device tree, then the gpio framework will handle the gpio pin
> registration and eliminate the circular dependency.
>
> See Christian Lamparter's commit a86caa9ba5d7 ("pinctrl: msm: fix
> gpio-hog related boot issues") for a detailed commit message that
> explains the issue in much more detail. The code comment in this commit
> came from Christian's commit.
>
> Signed-off-by: Brian Masney <masneyb@onstation.org>

No word from Bjorn but I trust my own intuition and applied it.

Björn: shout if it's wrong.

Question: should this also be done for pinctrl-ssbi-gpio.c?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 5/7] pinctrl: qcom: spmi-gpio: fix gpio-hog related boot issues
@ 2018-11-09  8:59     ` Linus Walleij
  0 siblings, 0 replies; 20+ messages in thread
From: Linus Walleij @ 2018-11-09  8:59 UTC (permalink / raw)
  To: masneyb, Bjorn Andersson
  Cc: Sebastian Reichel, Rob Herring, Mark Rutland, Andy Gross,
	David Brown, Linux PM list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel, linux-arm-msm, open list:ARM/QUALCOMM SUPPORT,
	open list:GPIO SUBSYSTEM, jonathan

On Thu, Nov 1, 2018 at 1:12 AM Brian Masney <masneyb@onstation.org> wrote:

> When attempting to setup up a gpio hog, device probing would repeatedly
> fail with -EPROBE_DEFERED errors. It was caused by a circular dependency
> between the gpio and pinctrl frameworks. If the gpio-ranges property is
> present in device tree, then the gpio framework will handle the gpio pin
> registration and eliminate the circular dependency.
>
> See Christian Lamparter's commit a86caa9ba5d7 ("pinctrl: msm: fix
> gpio-hog related boot issues") for a detailed commit message that
> explains the issue in much more detail. The code comment in this commit
> came from Christian's commit.
>
> Signed-off-by: Brian Masney <masneyb@onstation.org>

No word from Bjorn but I trust my own intuition and applied it.

Björn: shout if it's wrong.

Question: should this also be done for pinctrl-ssbi-gpio.c?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 5/7] pinctrl: qcom: spmi-gpio: fix gpio-hog related boot issues
  2018-11-09  8:59     ` Linus Walleij
@ 2018-11-09 10:22       ` Brian Masney
  -1 siblings, 0 replies; 20+ messages in thread
From: Brian Masney @ 2018-11-09 10:22 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Bjorn Andersson, Sebastian Reichel, Rob Herring, Mark Rutland,
	Andy Gross, David Brown, Linux PM list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel, linux-arm-msm, open list:ARM/QUALCOMM SUPPORT,
	open list:GPIO SUBSYSTEM, jonathan

On Fri, Nov 09, 2018 at 09:59:08AM +0100, Linus Walleij wrote:
> On Thu, Nov 1, 2018 at 1:12 AM Brian Masney <masneyb@onstation.org> wrote:
> 
> > When attempting to setup up a gpio hog, device probing would repeatedly
> > fail with -EPROBE_DEFERED errors. It was caused by a circular dependency
> > between the gpio and pinctrl frameworks. If the gpio-ranges property is
> > present in device tree, then the gpio framework will handle the gpio pin
> > registration and eliminate the circular dependency.
> >
> > See Christian Lamparter's commit a86caa9ba5d7 ("pinctrl: msm: fix
> > gpio-hog related boot issues") for a detailed commit message that
> > explains the issue in much more detail. The code comment in this commit
> > came from Christian's commit.
> >
> > Signed-off-by: Brian Masney <masneyb@onstation.org>
> 
> No word from Bjorn but I trust my own intuition and applied it.
> 
> Björn: shout if it's wrong.
> 
> Question: should this also be done for pinctrl-ssbi-gpio.c?

Yes, I believe so.

Brian

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 5/7] pinctrl: qcom: spmi-gpio: fix gpio-hog related boot issues
@ 2018-11-09 10:22       ` Brian Masney
  0 siblings, 0 replies; 20+ messages in thread
From: Brian Masney @ 2018-11-09 10:22 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Bjorn Andersson, Sebastian Reichel, Rob Herring, Mark Rutland,
	Andy Gross, David Brown, Linux PM list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel, linux-arm-msm, open list:ARM/QUALCOMM SUPPORT,
	open list:GPIO SUBSYSTEM, jonathan

On Fri, Nov 09, 2018 at 09:59:08AM +0100, Linus Walleij wrote:
> On Thu, Nov 1, 2018 at 1:12 AM Brian Masney <masneyb@onstation.org> wrote:
> 
> > When attempting to setup up a gpio hog, device probing would repeatedly
> > fail with -EPROBE_DEFERED errors. It was caused by a circular dependency
> > between the gpio and pinctrl frameworks. If the gpio-ranges property is
> > present in device tree, then the gpio framework will handle the gpio pin
> > registration and eliminate the circular dependency.
> >
> > See Christian Lamparter's commit a86caa9ba5d7 ("pinctrl: msm: fix
> > gpio-hog related boot issues") for a detailed commit message that
> > explains the issue in much more detail. The code comment in this commit
> > came from Christian's commit.
> >
> > Signed-off-by: Brian Masney <masneyb@onstation.org>
> 
> No word from Bjorn but I trust my own intuition and applied it.
> 
> Björn: shout if it's wrong.
> 
> Question: should this also be done for pinctrl-ssbi-gpio.c?

Yes, I believe so.

Brian

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 1/7] dt-bindings: power: supply: bq24190_charger: add bq24192 and usb-otg-vbus
  2018-11-01  0:11 ` [PATCH v2 1/7] dt-bindings: power: supply: bq24190_charger: add bq24192 and usb-otg-vbus Brian Masney
  2018-11-05 21:59     ` Rob Herring
@ 2018-12-05 21:55   ` Sebastian Reichel
  1 sibling, 0 replies; 20+ messages in thread
From: Sebastian Reichel @ 2018-12-05 21:55 UTC (permalink / raw)
  To: Brian Masney
  Cc: robh+dt, mark.rutland, andy.gross, david.brown, bjorn.andersson,
	linus.walleij, linux-pm, devicetree, linux-kernel, linux-arm-msm,
	linux-soc, linux-gpio, jonathan

[-- Attachment #1: Type: text/plain, Size: 1883 bytes --]

Hi,

On Wed, Oct 31, 2018 at 08:11:43PM -0400, Brian Masney wrote:
> Add support for the ti,bq24192 variant and a child node for the
> usb-otg-vbus regulator.
> 
> Signed-off-by: Brian Masney <masneyb@onstation.org>
> ---

Thanks, queued.

-- Sebastian

>  .../devicetree/bindings/power/supply/bq24190.txt         | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/bq24190.txt b/Documentation/devicetree/bindings/power/supply/bq24190.txt
> index 9e517d307070..c8ac028bd3c7 100644
> --- a/Documentation/devicetree/bindings/power/supply/bq24190.txt
> +++ b/Documentation/devicetree/bindings/power/supply/bq24190.txt
> @@ -3,6 +3,7 @@ TI BQ24190 Li-Ion Battery Charger
>  Required properties:
>  - compatible: contains one of the following:
>      * "ti,bq24190"
> +    * "ti,bq24192"
>      * "ti,bq24192i"
>  - reg: integer, I2C address of the charger.
>  - interrupts[-extended]: configuration for charger INT pin.
> @@ -19,6 +20,12 @@ Optional properties:
>  - ti,system-minimum-microvolt: when power is connected and the battery is below
>    minimum system voltage, the system will be regulated above this setting.
>  
> +child nodes:
> +- usb-otg-vbus:
> +  Usage: optional
> +  Description: Regulator that is used to control the VBUS voltage direction for
> +               either USB host mode or for charging on the OTG port.
> +
>  Notes:
>  - Some circuit boards wire the chip's "OTG" pin high (enabling 500mA default
>    charge current on USB SDP ports, among other features). To simulate this on
> @@ -39,6 +46,8 @@ Example:
>  		interrupts-extended = <&gpiochip 10 IRQ_TYPE_EDGE_FALLING>;
>  		monitored-battery = <&bat>;
>  		ti,system-minimum-microvolt = <3200000>;
> +
> +		usb_otg_vbus: usb-otg-vbus { };
>  	};
>  
>  	&twl_gpio {
> -- 
> 2.17.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 2/7] power: supply: bq24190_charger: add support for bq24192 variant
  2018-11-01  0:11 ` [PATCH v2 2/7] power: supply: bq24190_charger: add support for bq24192 variant Brian Masney
@ 2018-12-05 21:56   ` Sebastian Reichel
  0 siblings, 0 replies; 20+ messages in thread
From: Sebastian Reichel @ 2018-12-05 21:56 UTC (permalink / raw)
  To: Brian Masney
  Cc: robh+dt, mark.rutland, andy.gross, david.brown, bjorn.andersson,
	linus.walleij, linux-pm, devicetree, linux-kernel, linux-arm-msm,
	linux-soc, linux-gpio, jonathan

[-- Attachment #1: Type: text/plain, Size: 1779 bytes --]

Hi,

On Wed, Oct 31, 2018 at 08:11:44PM -0400, Brian Masney wrote:
> From: Jonathan Marek <jonathan@marek.ca>
> 
> This patch adds support for the bq24192 variant to bq24190_charger.
> 
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> [masneyb@onstation.org: Changed if statement to a switch based on
> feedback from Sebastian Reichel.]
> Signed-off-by: Brian Masney <masneyb@onstation.org>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/bq24190_charger.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
> index b58df04d03b3..44d3aff32885 100644
> --- a/drivers/power/supply/bq24190_charger.c
> +++ b/drivers/power/supply/bq24190_charger.c
> @@ -1637,8 +1637,12 @@ static int bq24190_hw_init(struct bq24190_dev_info *bdi)
>  	if (ret < 0)
>  		return ret;
>  
> -	if (v != BQ24190_REG_VPRS_PN_24190 &&
> -	    v != BQ24190_REG_VPRS_PN_24192I) {
> +	switch (v) {
> +	case BQ24190_REG_VPRS_PN_24190:
> +	case BQ24190_REG_VPRS_PN_24192:
> +	case BQ24190_REG_VPRS_PN_24192I:
> +		break;
> +	default:
>  		dev_err(bdi->dev, "Error unknown model: 0x%02x\n", v);
>  		return -ENODEV;
>  	}
> @@ -1931,6 +1935,7 @@ static const struct dev_pm_ops bq24190_pm_ops = {
>  
>  static const struct i2c_device_id bq24190_i2c_ids[] = {
>  	{ "bq24190" },
> +	{ "bq24192" },
>  	{ "bq24192i" },
>  	{ },
>  };
> @@ -1939,6 +1944,7 @@ MODULE_DEVICE_TABLE(i2c, bq24190_i2c_ids);
>  #ifdef CONFIG_OF
>  static const struct of_device_id bq24190_of_match[] = {
>  	{ .compatible = "ti,bq24190", },
> +	{ .compatible = "ti,bq24192", },
>  	{ .compatible = "ti,bq24192i", },
>  	{ },
>  };
> -- 
> 2.17.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 3/7] power: supply: bq24190_charger: add of_match for usb-otg-vbus regulator
  2018-11-01  0:11 ` [PATCH v2 3/7] power: supply: bq24190_charger: add of_match for usb-otg-vbus regulator Brian Masney
@ 2018-12-05 21:56   ` Sebastian Reichel
  0 siblings, 0 replies; 20+ messages in thread
From: Sebastian Reichel @ 2018-12-05 21:56 UTC (permalink / raw)
  To: Brian Masney
  Cc: robh+dt, mark.rutland, andy.gross, david.brown, bjorn.andersson,
	linus.walleij, linux-pm, devicetree, linux-kernel, linux-arm-msm,
	linux-soc, linux-gpio, jonathan

[-- Attachment #1: Type: text/plain, Size: 999 bytes --]

Hi,

On Wed, Oct 31, 2018 at 08:11:45PM -0400, Brian Masney wrote:
> From: Jonathan Marek <jonathan@marek.ca>
> 
> This patch adds an of_match for the usb-otg-vbus regulator to
> bq24190_charger.
> 
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> Signed-off-by: Brian Masney <masneyb@onstation.org>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/bq24190_charger.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
> index 44d3aff32885..9e7f3e33458a 100644
> --- a/drivers/power/supply/bq24190_charger.c
> +++ b/drivers/power/supply/bq24190_charger.c
> @@ -577,6 +577,7 @@ static const struct regulator_ops bq24190_vbus_ops = {
>  
>  static const struct regulator_desc bq24190_vbus_desc = {
>  	.name = "usb_otg_vbus",
> +	.of_match = "usb-otg-vbus",
>  	.type = REGULATOR_VOLTAGE,
>  	.owner = THIS_MODULE,
>  	.ops = &bq24190_vbus_ops,
> -- 
> 2.17.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 4/7] power: supply: bq24190_charger: add extcon support for USB OTG
  2018-11-01  0:11 ` [PATCH v2 4/7] power: supply: bq24190_charger: add extcon support for USB OTG Brian Masney
@ 2018-12-05 21:56   ` Sebastian Reichel
  0 siblings, 0 replies; 20+ messages in thread
From: Sebastian Reichel @ 2018-12-05 21:56 UTC (permalink / raw)
  To: Brian Masney
  Cc: robh+dt, mark.rutland, andy.gross, david.brown, bjorn.andersson,
	linus.walleij, linux-pm, devicetree, linux-kernel, linux-arm-msm,
	linux-soc, linux-gpio, jonathan

[-- Attachment #1: Type: text/plain, Size: 3457 bytes --]

Hi,

On Wed, Oct 31, 2018 at 08:11:46PM -0400, Brian Masney wrote:
> Add extcon support so that we can notify USB drivers of cable state
> changes. Based on work from Jonathan Marek. USB OTG was tested on a LG
> Nexus 5 (hammerhead) phone.
> 
> Signed-off-by: Brian Masney <masneyb@onstation.org>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/bq24190_charger.c | 37 +++++++++++++++++++++++++-
>  1 file changed, 36 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
> index 9e7f3e33458a..4e64e6ac95c5 100644
> --- a/drivers/power/supply/bq24190_charger.c
> +++ b/drivers/power/supply/bq24190_charger.c
> @@ -21,6 +21,7 @@
>  #include <linux/workqueue.h>
>  #include <linux/gpio.h>
>  #include <linux/i2c.h>
> +#include <linux/extcon-provider.h>
>  
>  #define	BQ24190_MANUFACTURER	"Texas Instruments"
>  
> @@ -159,6 +160,7 @@
>  struct bq24190_dev_info {
>  	struct i2c_client		*client;
>  	struct device			*dev;
> +	struct extcon_dev		*edev;
>  	struct power_supply		*charger;
>  	struct power_supply		*battery;
>  	struct delayed_work		input_current_limit_work;
> @@ -174,6 +176,11 @@ struct bq24190_dev_info {
>  	u8				watchdog;
>  };
>  
> +static const unsigned int bq24190_usb_extcon_cable[] = {
> +	EXTCON_USB,
> +	EXTCON_NONE,
> +};
> +
>  /*
>   * The tables below provide a 2-way mapping for the value that goes in
>   * the register field and the real-world value that it represents.
> @@ -1528,6 +1535,20 @@ static const struct power_supply_desc bq24190_battery_desc = {
>  	.property_is_writeable	= bq24190_battery_property_is_writeable,
>  };
>  
> +static int bq24190_configure_usb_otg(struct bq24190_dev_info *bdi, u8 ss_reg)
> +{
> +	bool otg_enabled;
> +	int ret;
> +
> +	otg_enabled = !!(ss_reg & BQ24190_REG_SS_VBUS_STAT_MASK);
> +	ret = extcon_set_state_sync(bdi->edev, EXTCON_USB, otg_enabled);
> +	if (ret < 0)
> +		dev_err(bdi->dev, "Can't set extcon state to %d: %d\n",
> +			otg_enabled, ret);
> +
> +	return ret;
> +}
> +
>  static void bq24190_check_status(struct bq24190_dev_info *bdi)
>  {
>  	const u8 battery_mask_ss = BQ24190_REG_SS_CHRG_STAT_MASK;
> @@ -1597,8 +1618,10 @@ static void bq24190_check_status(struct bq24190_dev_info *bdi)
>  		bdi->ss_reg = ss_reg;
>  	}
>  
> -	if (alert_charger || alert_battery)
> +	if (alert_charger || alert_battery) {
>  		power_supply_changed(bdi->charger);
> +		bq24190_configure_usb_otg(bdi, ss_reg);
> +	}
>  	if (alert_battery && bdi->battery)
>  		power_supply_changed(bdi->battery);
>  
> @@ -1732,6 +1755,14 @@ static int bq24190_probe(struct i2c_client *client,
>  		return -EINVAL;
>  	}
>  
> +	bdi->edev = devm_extcon_dev_allocate(dev, bq24190_usb_extcon_cable);
> +	if (IS_ERR(bdi->edev))
> +		return PTR_ERR(bdi->edev);
> +
> +	ret = devm_extcon_dev_register(dev, bdi->edev);
> +	if (ret < 0)
> +		return ret;
> +
>  	pm_runtime_enable(dev);
>  	pm_runtime_use_autosuspend(dev);
>  	pm_runtime_set_autosuspend_delay(dev, 600);
> @@ -1778,6 +1809,10 @@ static int bq24190_probe(struct i2c_client *client,
>  		goto out_charger;
>  	}
>  
> +	ret = bq24190_configure_usb_otg(bdi, bdi->ss_reg);
> +	if (ret < 0)
> +		goto out_charger;
> +
>  	ret = bq24190_sysfs_create_group(bdi);
>  	if (ret < 0) {
>  		dev_err(dev, "Can't create sysfs entries\n");
> -- 
> 2.17.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 6/7] ARM: dts: qcom: msm8974: add gpio-ranges
  2018-11-01  0:11 ` [PATCH v2 6/7] ARM: dts: qcom: msm8974: add gpio-ranges Brian Masney
@ 2018-12-07 11:41     ` Brian Masney
  0 siblings, 0 replies; 20+ messages in thread
From: Brian Masney @ 2018-12-07 11:41 UTC (permalink / raw)
  Cc: linux-pm, devicetree, linux-kernel, linux-arm-msm, linux-soc,
	linux-gpio, jonathan, sre, robh+dt, mark.rutland, andy.gross,
	david.brown, bjorn.andersson, linus.walleij

On Wed, Oct 31, 2018 at 08:11:48PM -0400, Brian Masney wrote:
> This adds the gpio-ranges property to pm8941_gpios so that the GPIO
> pins are initialized by the GPIO framework and not pinctrl. This fixes
> a circular dependency so GPIO hogging can be used on this board.
> 
> Signed-off-by: Brian Masney <masneyb@onstation.org>

Hi Andy,

All of the dependencies for USB have been merged into their respective
trees. Patches 6 and 7 in this series are the only two that are
outstanding for your consideration.

I know that I'm still waiting for a review from Dmitry regarding the new
vibrator driver [1] and we're nearing the end of the development cycle.
In case he runs into an issue with that driver, I verified that I can use
git am to apply patches 6 and 7 in this series for USB, and the patch
for WiFi [2] without the bindings for the vibrator. I'm hoping to get as
much of this merged into this kernel development cycle as possible.

[1] https://lore.kernel.org/lkml/20181025012937.2154-1-masneyb@onstation.org/
[2] https://lore.kernel.org/lkml/20181104215034.3677-1-masneyb@onstation.org/

Thanks,

Brian

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 6/7] ARM: dts: qcom: msm8974: add gpio-ranges
@ 2018-12-07 11:41     ` Brian Masney
  0 siblings, 0 replies; 20+ messages in thread
From: Brian Masney @ 2018-12-07 11:41 UTC (permalink / raw)
  To: andy.gross
  Cc: linux-pm, devicetree, linux-kernel, linux-arm-msm, linux-soc,
	linux-gpio, jonathan, sre, robh+dt, mark.rutland, andy.gross,
	david.brown, bjorn.andersson, linus.walleij

On Wed, Oct 31, 2018 at 08:11:48PM -0400, Brian Masney wrote:
> This adds the gpio-ranges property to pm8941_gpios so that the GPIO
> pins are initialized by the GPIO framework and not pinctrl. This fixes
> a circular dependency so GPIO hogging can be used on this board.
> 
> Signed-off-by: Brian Masney <masneyb@onstation.org>

Hi Andy,

All of the dependencies for USB have been merged into their respective
trees. Patches 6 and 7 in this series are the only two that are
outstanding for your consideration.

I know that I'm still waiting for a review from Dmitry regarding the new
vibrator driver [1] and we're nearing the end of the development cycle.
In case he runs into an issue with that driver, I verified that I can use
git am to apply patches 6 and 7 in this series for USB, and the patch
for WiFi [2] without the bindings for the vibrator. I'm hoping to get as
much of this merged into this kernel development cycle as possible.

[1] https://lore.kernel.org/lkml/20181025012937.2154-1-masneyb@onstation.org/
[2] https://lore.kernel.org/lkml/20181104215034.3677-1-masneyb@onstation.org/

Thanks,

Brian

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-12-07 11:41 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-01  0:11 [PATCH v2 0/7] ARM: qcom: msm8974-hammerhead: add USB OTG support Brian Masney
2018-11-01  0:11 ` [PATCH v2 1/7] dt-bindings: power: supply: bq24190_charger: add bq24192 and usb-otg-vbus Brian Masney
2018-11-05 21:59   ` Rob Herring
2018-11-05 21:59     ` Rob Herring
2018-12-05 21:55   ` Sebastian Reichel
2018-11-01  0:11 ` [PATCH v2 2/7] power: supply: bq24190_charger: add support for bq24192 variant Brian Masney
2018-12-05 21:56   ` Sebastian Reichel
2018-11-01  0:11 ` [PATCH v2 3/7] power: supply: bq24190_charger: add of_match for usb-otg-vbus regulator Brian Masney
2018-12-05 21:56   ` Sebastian Reichel
2018-11-01  0:11 ` [PATCH v2 4/7] power: supply: bq24190_charger: add extcon support for USB OTG Brian Masney
2018-12-05 21:56   ` Sebastian Reichel
2018-11-01  0:11 ` [PATCH v2 5/7] pinctrl: qcom: spmi-gpio: fix gpio-hog related boot issues Brian Masney
2018-11-09  8:59   ` Linus Walleij
2018-11-09  8:59     ` Linus Walleij
2018-11-09 10:22     ` Brian Masney
2018-11-09 10:22       ` Brian Masney
2018-11-01  0:11 ` [PATCH v2 6/7] ARM: dts: qcom: msm8974: add gpio-ranges Brian Masney
2018-12-07 11:41   ` Brian Masney
2018-12-07 11:41     ` Brian Masney
2018-11-01  0:11 ` [PATCH v2 7/7] ARM: dts: qcom: msm8974-hammerhead: add USB OTG support Brian Masney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.