Re: [PATCH RFC 1/6] rust: Add basic PWM abstractions

Michal Wilczynski
2025-05-26T14:02:31Z

On 5/26/25 09:53, Uwe Kleine-König wrote:
> Hello Michal,
>
> On Sat, May 24, 2025 at 11:14:55PM +0200, Michal Wilczynski wrote:
>> Introduce initial Rust abstractions for the Linux PWM subsystem. These
>> abstractions provide safe wrappers around the core C data structures and
>> functions, enabling the development of PWM chip drivers in Rust.
>
> Oh wow, thanks for rustifying PWM. That might be my chance to actually
> learn Rust.
>
> I don't know when I will find the time to look into that in detail but
> one thing I'd like to have for Rust support is that the drivers use the
> new abstraction (i.e. .round_waveform_tohw() + .round_waveform_fromhw()
> + .read_waveform() + .write_waveform()) instead of the older .apply()
> callback.

Hi Uwe,

Thanks for the valuable feedback. You're right, building on the newer
waveform abstractions is a correct approach.

I'll rework the patches to use .round_waveform_tohw(),
.round_waveform_fromhw(), .read_waveform(), and .write_waveform() as you
suggested, instead of the .apply() callback.

I appreciate you steering me in the right direction.

>
> Best regards
> Uwe

Best regards,
--
Michal Wilczynski <m.wilczynski@samsung.com>