-
Notifications
You must be signed in to change notification settings - Fork 4
driver: add oob support for rockchip pwm. #1
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
base: linux-evl-6.1-stan-rkr4.1
Are you sure you want to change the base?
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.
| 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There could be some concurrency problems, where user use two threads to call the oob_apply and apply at same time.
| } | ||
|
|
||
|
|
||
| static irqreturn_t rockchip_pwm_oob_irq_v1(int irq, void *data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| } | ||
|
|
||
| static struct class * pwm_cdev_class; | ||
| static const struct file_operations pwm_fops = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add an operation for compat pointer
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: