Thread (39 messages) 39 messages, 6 authors, 2012-07-02
STALE5080d
Revisions (15)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v2 [diff vs current]
  4. v2 [diff vs current]
  5. v2 [diff vs current]
  6. v2 [diff vs current]
  7. v2 [diff vs current]
  8. v2 [diff vs current]
  9. v2 [diff vs current]
  10. v2 [diff vs current]
  11. v2 [diff vs current]
  12. v2 [diff vs current]
  13. v2 [diff vs current]
  14. v2 current
  15. v2 [diff vs current]

[PATCH v2 2/2] net: flexcan: add transceiver switch gpios support

From: Dong Aisheng <hidden>
Date: 2012-06-28 11:48:16
Also in: linux-can

On Thu, Jun 28, 2012 at 07:46:02PM +0800, Shawn Guo wrote:
On Thu, Jun 28, 2012 at 07:33:28PM +0800, Dong Aisheng wrote:
quoted
quoted
+		phy_stby_gpio = of_get_named_gpio_flags(pdev->dev.of_node,
+							"phy-standby-gpios",
+							0, &flags);
+		if (gpio_is_valid(phy_stby_gpio)) {
+			if (flags == OF_GPIO_ACTIVE_LOW)
+				phy_stby_high = false;
+			err = devm_gpio_request_one(&pdev->dev, phy_stby_gpio,
+						    GPIOF_DIR_OUT,
+						    "phy-standby");
+			if (err) {
+				dev_err(&pdev->dev,
+					"failed to request gpio %d: %d\n",
+					phy_stby_gpio, err);
+				goto failed_gpio;
I checked mx28 evk, it seems the phy only has a STB gpio and shared by both CAN0&CAN1.
I wonder the CAN1 probe may fail here.
It can be managed by dts.  Here is what I have in imx28-evk.dts, where
only can0 has phy-enable-gpios property.


	can0: can at 80032000 {
		pinctrl-names = "default";
		pinctrl-0 = <&can0_pins_a>;
		phy-enable-gpios = <&gpio2 13 0>;
		status = "okay";
	};

	can1: can at 80034000 {
		pinctrl-names = "default";
		pinctrl-0 = <&can1_pins_a>;
		status = "okay";
	};
Yes, that is a solution.
But it may not so reasonable since dts file should represent hw, but here
we have to do some trick by we know how driver works.
Maybe we need find a better solution.

Regards
Dong Aisheng
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help