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

[Issue-51]: enable pwm from device tree #17

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

jempatel
Copy link
Collaborator

  • do not claim pwm pins

@greenbreakfast greenbreakfast merged commit 16c4470 into openwrt-22.03 Jun 23, 2023
@greenbreakfast greenbreakfast deleted the Issue-51-enable-pwm branch June 23, 2023 20:48
@greenbreakfast
Copy link
Contributor

greenbreakfast commented Jun 23, 2023

thanks @jempatel, merging this in (cc OnionIoT/OpenWRT-Packages#51)
Will make a release here and then build new beta firmware afterwards.

So we don't need the second patch that @plan44 uses in https://github.com/plan44/plan44-feed/blob/main/p44b-onion/p44build/global-patches/204-mt7628an-pwm-irq.diff ?

@jempatel
Copy link
Collaborator Author

thanks @jempatel, merging this in (cc OnionIoT/OpenWRT-Packages#51) Will make a release here and then build new beta firmware afterwards.

So we don't need the second patch that @plan44 uses in https://github.com/plan44/plan44-feed/blob/main/p44b-onion/p44build/global-patches/204-mt7628an-pwm-irq.diff ?

Yes, It sets interrupt from dts file, so I am not sure about its use case. For PWM to work, We needed two changes

  1. enable pwm from dts, which we tracked from the sources repo of the old version.
  2. enabling pwm causes a pin claimed issue, and a patch from plan44 worked with that, and after applying that patch sysfs for pwmchip0 was created.

@plan44
Copy link

plan44 commented Jun 25, 2023

Yes, It sets interrupt from dts file, so I am not sure about its use case.

Its documentary at this time, as the current PWM driver does not make use of interrupts.

But knowing how PWM interrupts are connected in the MT7688 chip is a valuable documentation nugget!

Back in 2017 (when I started writing p44ledchain) I spent days figuring out what IRQ the PWM unit might use. This is not poperly documented anywhere, not even in the MT7688 datasheet. I finally found the number 26 mentioned in the datasheet for the MT7628 (different, but similar enough SoC), and verified it actually is the same in MT7688...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants