driver: add oob support for rockchip pwm.#1
Open
ruiqurm wants to merge 5 commits intolinux-evl-6.1-stan-rkr4.1from
Open
driver: add oob support for rockchip pwm.#1ruiqurm wants to merge 5 commits intolinux-evl-6.1-stan-rkr4.1from
ruiqurm wants to merge 5 commits intolinux-evl-6.1-stan-rkr4.1from
Conversation
To enable oob pwm operations, we need a cdev to do some oob_ioctl()s. The commit only provide a basic interface.
* add `oob_apply`, `oob_prepare` and `oob_finish` operations to support out-of-bound pwm handling. * Support `oneshot-mode` for rockchip.
* Support v1_config only. * Support regular, one-shot and capture mode. But not test the `capture` mode so far.
ruiqurm
commented
Mar 25, 2025
| int rockchip_pwm_oob_apply(struct pwm_chip *chip, struct pwm_device *pwm, | ||
| const struct pwm_state *state){ | ||
| struct rockchip_pwm_chip *pc = to_rockchip_pwm_chip(chip); | ||
| u32 enable_conf = pc->data->enable_conf; |
Author
There was a problem hiding this comment.
There could be some concurrency problems, where user use two threads to call the oob_apply and apply at same time.
ruiqurm
commented
Mar 25, 2025
| } | ||
|
|
||
|
|
||
| static irqreturn_t rockchip_pwm_oob_irq_v1(int irq, void *data) |
Author
There was a problem hiding this comment.
Here the difference between rockchip_pwm_oob_irq_v1 and the oridinary is that the oob function call the oob apply. Maybe we can have some tricks to bridge the gap.
ruiqurm
commented
Mar 25, 2025
| } | ||
|
|
||
| static struct class * pwm_cdev_class; | ||
| static const struct file_operations pwm_fops = { |
Author
There was a problem hiding this comment.
We could add an operation for compat pointer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patchset introduces out-of-band (OOB) support for Rockchip PWM controllers, enabling real-time PWM control through the EVL framework. The changes include:
Implementation of the pwm_cdev interface structure to expose PWM channels to userspace through /dev/pwm.
Generic support for OOB PWM control, providing an abstraction for real-time, low-latency updates to PWM state.
Rockchip-specific OOB PWM driver that integrates with the EVL kernel to provide deterministic PWM updates via the OOB path.
Tested on Rock5b+/5c(rk3588) platform.
Example test: