Skip to contentSkip to conversation

AT91, DT, usb gadget: disable pull-up on vbus-gpio (PB16) to reduce power consumption

PATCH Superseded Sylvain Rochet 4 participants 5 messages Jan 15, 2015 – Jan 16, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 AT91, DT, usb gadget: disable pull-up on vbus-gpio (PB16) to reduce power consumption

There is an external resistor divider on PB16, acting like a pull-down, the pull-up increase power consumption and prevent the vbus detect pin to reach Vss voltage, ~1.5V mesured on my board, it might no even work if the pull-up is stronger than usual.

---
 arch/arm/boot/dts/at91sam9x5ek.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +9 -0
index 3a9f6fa..f622f96 100644
@@ -53,6 +53,8 @@
 			};
 
 			usb2: gadget at f803c000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_board_usb2>;
 				atmel,vbus-gpio = <&pioB 16 GPIO_ACTIVE_HIGH>;
 				status = "okay";
 			};
@@ -80,6 +82,13 @@
 							<AT91_PIOD 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;	/* PD14 gpio CD pin pull up and deglitch */
 					};
 				};
+
+				usb2 {
+					pinctrl_board_usb2: usb2-board {
+						atmel,pins =
+							<AT91_PIOB 16 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;		/* PB16, no pull up and deglitch */
+					};
+				};
 			};
 
 			spi0: spi at f0000000 {
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 AT91, DT, usb gadget: disable pull-up on vbus-gpio (PB16) to reduce power consumption

Hi Sylvain Rochet,

Quoted 6 lines · Sylvain Rochet

There is an external resistor divider on PB16, acting like a pull-down, the pull-up increase power consumption and prevent the vbus detect pin to reach Vss voltage, ~1.5V mesured on my board, it might no even work if the pull-up is stronger than usual.

Thanks for your patch.

Quoted 18 lines
---
  arch/arm/boot/dts/at91sam9x5ek.dtsi | 9 +++++++++
  1 file changed, 9 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +2 -0
index 3a9f6fa..f622f96 100644
@@ -53,6 +53,8 @@
  			};
 
  			usb2: gadget at f803c000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_board_usb2>;
  				atmel,vbus-gpio = <&pioB 16 GPIO_ACTIVE_HIGH>;
  				status = "okay";
  			};

arch/arm/boot/dts/at91sam9x5ek.dtsi line 89

Quoted 8 lines
arch/arm/boot/dts/at91sam9x5ek.dtsi +5 -0
@@ -80,6 +82,13 @@
  							<AT91_PIOD 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;	/* PD14 gpio CD pin pull up and deglitch */
  					};
  				};
+
+				usb2 {
+					pinctrl_board_usb2: usb2-board {
+						atmel,pins =
+							<AT91_PIOB 16 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;		/* PB16, no pull up and deglitch */

Nitpick:
I think comments as "PB16 gpio vbus sense, deglitch" will be better. Or else change "pinctrl_board_usb2" to "pinctrl_usb2_vbus_sense". These will be help the user easily to understand the function of this pin.

arch/arm/boot/dts/at91sam9x5ek.dtsi line 94

Quoted 6 lines
arch/arm/boot/dts/at91sam9x5ek.dtsi +2 -0
+					};
+				};
  			};
 
  			spi0: spi at f0000000 {

Best Regards,
Bo Shen

#2 lore raw

PATCH v2 1/1 AT91, DT, usb gadget: disable pull-up on vbus-gpio (PB16) to reduce power consumption

There is an external resistor divider on PB16, acting like a pull-down, the pull-up increase power consumption and prevent the vbus detect pin to reach Vss voltage, ~1.5V mesured on my board, it might not even work if the pull-up is stronger than usual.

---
Improved GPIO comment, fixed typo in commit summary.

 arch/arm/boot/dts/at91sam9x5ek.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +9 -0
index 3a9f6fa..bd16bd3 100644
@@ -53,6 +53,8 @@
 			};
 
 			usb2: gadget at f803c000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_board_usb2>;
 				atmel,vbus-gpio = <&pioB 16 GPIO_ACTIVE_HIGH>;
 				status = "okay";
 			};
@@ -80,6 +82,13 @@
 							<AT91_PIOD 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;	/* PD14 gpio CD pin pull up and deglitch */
 					};
 				};
+
+				usb2 {
+					pinctrl_board_usb2: usb2-board {
+						atmel,pins =
+							<AT91_PIOB 16 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;		/* PB16 gpio vbus sense, deglitch */
+					};
+				};
 			};
 
 			spi0: spi at f0000000 {
Signature · 1 line
2.1.4
#3 lore raw

PATCH v2 1/1 AT91, DT, usb gadget: disable pull-up on vbus-gpio (PB16) to reduce power consumption

Quoted 6 lines · Sylvain Rochet

There is an external resistor divider on PB16, acting like a pull-down, the pull-up increase power consumption and prevent the vbus detect pin to reach Vss voltage, ~1.5V mesured on my board, it might not even work if the pull-up is stronger than usual.

You should have added the ack from Bo here too.

Quoted 36 lines

---
Improved GPIO comment, fixed typo in commit summary.

 arch/arm/boot/dts/at91sam9x5ek.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +9 -0
index 3a9f6fa..bd16bd3 100644
@@ -53,6 +53,8 @@
 			};
 
 			usb2: gadget at f803c000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_board_usb2>;
 				atmel,vbus-gpio = <&pioB 16 GPIO_ACTIVE_HIGH>;
 				status = "okay";
 			};
@@ -80,6 +82,13 @@
 							<AT91_PIOD 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;	/* PD14 gpio CD pin pull up and deglitch */
 					};
 				};
+
+				usb2 {
+					pinctrl_board_usb2: usb2-board {
+						atmel,pins =
+							<AT91_PIOB 16 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;		/* PB16 gpio vbus sense, deglitch */
+					};
+				};
 			};
 
 			spi0: spi at f0000000 {
Signature · 1 line
2.1.4
Signature · 3 lines
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH v2 1/1 AT91, DT, usb gadget: disable pull-up on vbus-gpio (PB16) to reduce power consumption

Le 16/01/2015 11:43, Alexandre Belloni a ?crit :

Quoted 10 lines · Sylvain Rochet
Quoted 6 lines

There is an external resistor divider on PB16, acting like a pull-down, the pull-up increase power consumption and prevent the vbus detect pin to reach Vss voltage, ~1.5V mesured on my board, it might not even work if the pull-up is stronger than usual.

You should have added the ack from Bo here too.

Stacked on top of at91-3.20-dt. Thanks for this patch.

Bye,

Quoted 37 lines
Quoted 36 lines

---
Improved GPIO comment, fixed typo in commit summary.

 arch/arm/boot/dts/at91sam9x5ek.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +9 -0
index 3a9f6fa..bd16bd3 100644
@@ -53,6 +53,8 @@
 			};
 
 			usb2: gadget at f803c000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_board_usb2>;
 				atmel,vbus-gpio = <&pioB 16 GPIO_ACTIVE_HIGH>;
 				status = "okay";
 			};
@@ -80,6 +82,13 @@
 							<AT91_PIOD 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;	/* PD14 gpio CD pin pull up and deglitch */
 					};
 				};
+
+				usb2 {
+					pinctrl_board_usb2: usb2-board {
+						atmel,pins =
+							<AT91_PIOB 16 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;		/* PB16 gpio vbus sense, deglitch */
+					};
+				};
 			};
 
 			spi0: spi at f0000000 {
Signature · 1 line
2.1.4
Signature · 1 line
Nicolas Ferre