[PATCH v2] rust: pwm: Add UnregisteredChip wrapper around Chip

Markus Probst markus.probst at posteo.de
Tue Dec 9 07:00:44 PST 2025


On Tue, 2025-12-09 at 14:41 +0100, Michal Wilczynski wrote:
> 
> On 12/9/25 13:26, Markus Probst wrote:
> > On Tue, 2025-12-09 at 09:08 +0100, Uwe Kleine-König wrote:
> > > On Sun, Dec 07, 2025 at 11:16:59PM +0100, Michal Wilczynski wrote:
> > > > On 12/2/25 19:17, Markus Probst wrote:
> > > What does "not able to successfully compile drivers/pwm/pwm_th1520.rs"
> > > mean? You were unable to find a .config that included CONFIG_PWM_TH1520,
> > > or you got a compiler error? If it's the latter, ...
> > > 
> > > > I suspect your kernel configuration is missing CONFIG_COMMON_CLK.
> > > 
> > > ... are we missing a dependency for the driver?
> > I got a compiler error. Enabling CONFIG_COMMON_CLK indeed fixes it.
> > 
> > Without it:
> >   CLIPPY     drivers/pwm/pwm_th1520.o
> > error[E0432]: unresolved import `kernel::clk::Clk`
> >   --> drivers/pwm/pwm_th1520.rs:26:5
> >    |
> > 26 |     clk::Clk,
> >    |     ^^^^^^^^ no `Clk` in `clk`
> > 
> > error: aborting due to 1 previous error
> > 
> > For more information about this error, try `rustc --explain E0432`.
> > make[4]: *** [scripts/Makefile.build:354: drivers/pwm/pwm_th1520.o]
> > Error 1
> > make[3]: *** [scripts/Makefile.build:556: drivers/pwm] Error 2
> > make[2]: *** [scripts/Makefile.build:556: drivers] Error 2
> > make[1]: *** [/home/markustieger/build/synology/linux-
> > upstream/Makefile:2010: .] Error 2
> > make: *** [Makefile:248: __sub-make] Error 2
> > 
> > A simple fix would be to add "depends on COMMON_CLK" in
> > drivers/pwm/Kconfig for PWM_TH1520.
> 	
> While at it I think we should also add dependency on ARCH_THEAD |
> COMPILE_TEST as well as HAS_IOMEM in my opinion. I think some of those
> dependencies were lost when we were iterating on the patchset for some
> reason, can't recall when exactly.
> 
> If you plan to send a patch include those as well. Otherwise let me know
> and I send a patch.
No, I am currently busy writing the serial device bus rust abstractions
(include/linux/serdev.h) for a driver.

Thanks
- Markus Probst

> 
> > 
> > Thanks
> > - Markus Probst
> Best regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20251209/85723f6d/attachment.sig>


More information about the linux-riscv mailing list