Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ath79: update DTS for TP-Link WDR3600/WDR4300 v1 #2284

Closed
wants to merge 1 commit into from

Conversation

adschm
Copy link
Member

@adschm adschm commented Jul 29, 2019

This updates gpio-export to gpio-hogs and switches to interrupt-driven gpio-keys.

Solved usb power with gpio-hogs.
It looks like this is the first case where two reg_usb_vbus with different gpios are required for two ports.
I need some help with the setup for those. (Just check what's there already)

@kofec
Copy link

kofec commented Jul 29, 2019

I will have a question fot this topic. After all latest changes regarding GPIO. Is it possible to mange power on this device - WDR3600/WDR4300 v1
on older releases it was done by:

    # echo 0 > /sys/class/gpio/gpio21/value
    # echo 0 > /sys/class/gpio/gpio22/value

@adschm
Copy link
Member Author

adschm commented Jul 29, 2019

@kofec I can try on my device one the correct setup is sorted out.

@blocktrron blocktrron added the target/ath79 pull request/issue for ath79 target label Jul 29, 2019
@adschm
Copy link
Member Author

adschm commented Jul 29, 2019

Tried different variants, but I only get USB2 working, USB1 is dead. With gpio-export everything works as expected. Any ideas?

@jneuhauser
Copy link
Contributor

jneuhauser commented Jul 30, 2019

I´ve added the following nodes only to get the default trigger for the leds working...

port@1 {
	...
	hub_port1: port@1 {
		...
	};

	hub_port2: port@2 {
		...
	};
};

The driver does not handle this nodes as the usb ports are working also without the nodes above.
I think you have to add your both vbus-supply definitions as properties to the usb node.

EDIT: I personally prefer the solution with gpio-export

@adschm
Copy link
Member Author

adschm commented Jul 30, 2019

@jneuhauser

I've already tried with

&usb {
	[...]
	vbus-supply = <&reg_usb_vbus1 &reg_usb_vbus2>;
	[...]
};

Same situation.

But this sounds like I should try to get rid of the nested nodes?

@981213
Copy link
Member

981213 commented Aug 1, 2019

vbus-supply only works for SoCs using chipidea driver. ar934x uses generic ehci platform driver if I remember correctly.
I used fixed regulator for Qihoo C301 but I only setup an always-on fixed regulator without binding it to USB node.

@jeffsf
Copy link
Contributor

jeffsf commented Aug 1, 2019

gpio-hog is also functional for this, as well as “clean” in the DTS.

I keep hoping to find a way to “bounce” the power, but I haven’t seen any way to control a fixed-regulator through sysfs or the like.

@adschm
Copy link
Member Author

adschm commented Aug 1, 2019

Okay, so I will give it a try with gpio-hog as in:

@adschm
Copy link
Member Author

adschm commented Aug 1, 2019

Thanks for your pointers.
I updated the commit and tested successfully on WDR4300.

@adschm adschm changed the title [RFC] ath79: update DTS for TP-Link WDR3600/WDR4300 v1 ath79: update DTS for TP-Link WDR3600/WDR4300 v1 Aug 1, 2019
@adschm
Copy link
Member Author

adschm commented Aug 1, 2019

Coming back to the question raised by @kofec:

Can I manage USB power set via gpio-hogs on the running device?

@adschm
Copy link
Member Author

adschm commented Aug 2, 2019

This replaces gpio-export by gpio-hogs and switches buttons
to interrupt-driven gpio-keys.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
@adschm
Copy link
Member Author

adschm commented Aug 7, 2019

Update:

  • Improved node names
  • Use GPIO_ACTIVE_HIGH consistently

@adschm
Copy link
Member Author

adschm commented Aug 7, 2019

@blocktrron
Maybe have a look at this? It is simple and tested, and I would like it merged, since #2298 depends on it.

@Leo-PL
Copy link
Contributor

Leo-PL commented Aug 12, 2019

For me, LGTM, except that I'd split the gpio-keys part and gpio-hogs part as separate commits, they are logically separate changes.

@blocktrron
Copy link
Member

Thanks! Merged to my staging tree: https://git.openwrt.org/?p=openwrt/staging/blocktrron.git;a=summary

@adrianschmutzler If you want to reach out specifically to me, E-Mail is the best way, as GitHub gives me notifications about everything in the Organization, independent whether I'm mentioned or not.

@blocktrron blocktrron closed this Aug 12, 2019
@adschm adschm deleted the wdr4300fix branch August 14, 2019 21:23
@Leo-PL
Copy link
Contributor

Leo-PL commented Dec 4, 2019

@adrianschmutzler coming back to the topic of controlling devices via userspace, have you managed to perform this?

If it's no longer possible with GPIO hogs, then it's a regression, which affects my devices, as I use USB power switch to restart LTE modem.

@adschm
Copy link
Member Author

adschm commented Dec 4, 2019

There has been a discussion on the same subject on the devel list:
https://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg49204.html

Since there have been two requests, I would be willing to "revert" usb power to gpio-export for this device if one of you provides a proper patch.

@Leo-PL
Copy link
Contributor

Leo-PL commented Dec 4, 2019

I'll provide a patch in coming days.
Also, regarding "for this device": I think this is a regression for all USB-capable devices which had a GPIO export previously, including but not limited to TL-WR1043ND, TL-WR703N and others, to name a few that I do own. I believe that until a better solution can be found, the change to GPIO hogs for USB power shall be reverted for all capable devices.

@adschm
Copy link
Member Author

adschm commented Dec 5, 2019

@Leo-PL Well, have a look at the discussion. You may try your luck with reverting everything.
If you do that, please send to patch to the list instead of opening a PR here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target/ath79 pull request/issue for ath79 target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants