From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: "Nuno Sá" <noname.nuno@gmail.com>
Cc: "Uwe Kleine-König" <ukleinek@kernel.org>,
"Marcelo Schmitt" <marcelo.schmitt@analog.com>,
linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org,
jic23@kernel.org, "kernel test robot" <lkp@intel.com>,
"Trevor Gamblin" <tgamblin@baylibre.com>,
"Axel Haslam" <ahaslam@baylibre.com>
Subject: Re: [PATCH] pwm: Declare waveform stubs for when PWM is not reachable
Date: Fri, 10 Oct 2025 16:01:35 -0300 [thread overview]
Message-ID: <aOlYDyLzVGbCh5mE@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <2e82eaf275b5c8df768c8b842167c3562991e50c.camel@gmail.com>
On 10/10, Nuno Sá wrote:
> On Thu, 2025-10-09 at 18:53 +0200, Uwe Kleine-König wrote:
...
> > >
> > > Fixes: 6c5126c6406d ("pwm: Provide new consumer API functions for
> > > waveforms")
> >
> > At the time 6c5126c6406d was applied, there was no user of the API that
> > doesn't depend on CONFIG_PWM, so I object adding this Fixes line.
Fair. Looks like the stubs are not the preferred solution so probably going to
drop this patch.
> >
...
> >
> > WARNING: unmet direct dependencies detected for
> > SPI_OFFLOAD_TRIGGER_PWM
> > Depends on [n]: SPI [=y] && SPI_OFFLOAD [=y] && PWM [=n]
> > Selected by [y]:
> > - AD4030 [=y] && IIO [=y] && SPI [=y] && GPIOLIB [=y]
> >
> > This is the thing that needs fixing, i.e. don't select a symbol with
> > dependencies that the selecting symbol doesn't assert to be fulfilled.
> >
>
> Agreed. Seems to be one of those cases where we select a symbol that depends on
> something.
>
> However, this driver can indeed work without spi offload and hence PWM and
> SPI_OFFLOAD (AFAIR) are optional so I wonder what's the right approach. Looking
> at the new series I already see:
>
> select SPI_OFFLOAD_TRIGGER_PWM if (SPI_OFFLOAD && PWM)
>
> Which makes more sense but I guess we still need the stubs with the above. But
> I would also expect stubs to be needed for spi/offload/consumer.h. Maybe I'm
> missing something though...
I have successfully tested it with imply SPI_OFFLOAD_TRIGGER_PWM in Kconfig and
MODULE_IMPORT_NS("SPI_OFFLOAD") in the ADC driver.
Both the PWM offload trigger and ADC driver were built as modules.
I'm not sure the import ns is needed, but ended up breaking the remote test
setup so will only be able to tell it next week.
>
> I did not tested but I also wonder if 'imply SPI_OFFLOAD_TRIGGER_PWM' is not
> similar to the above.
It works, and I'll update the IIO patch to have
select SPI_OFFLOAD
imply PWM
imply SPI_OFFLOAD_TRIGGER_PWM
in Kconfig. The PWM imply is because I think SPI offload support meets the
"highly desirable feature" criterion mentioned by kbuild doc [1].
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/kbuild/kconfig-language.rst?h=v6.17#n197
One alternative to this patch is to have `#if IS_REACHABLE(CONFIG_PWM)` in the
ADC driver as David suggested in the other thread. I'll probably do that and
drop the changes to PWM.
I first thought of using `#ifdef CONFIG_PWM`, but couldn't convince myself about
that from the relatively small number of ifdef use-cases in IIO.
Thanks,
Marcelo
>
> - Nuno Sá
>
> > Best regards
> > Uwe
next prev parent reply other threads:[~2025-10-10 19:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-07 22:19 Marcelo Schmitt
2025-10-09 16:53 ` Uwe Kleine-König
2025-10-10 10:26 ` Nuno Sá
2025-10-10 19:01 ` Marcelo Schmitt [this message]
2025-10-10 18:51 ` Nuno Sá
2025-10-10 20:37 ` Marcelo Schmitt
2025-10-14 15:46 ` Nuno Sá
2025-10-13 9:12 ` Uwe Kleine-König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aOlYDyLzVGbCh5mE@debian-BULLSEYE-live-builder-AMD64 \
--to=marcelo.schmitt1@gmail.com \
--cc=ahaslam@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=lkp@intel.com \
--cc=marcelo.schmitt@analog.com \
--cc=noname.nuno@gmail.com \
--cc=tgamblin@baylibre.com \
--cc=ukleinek@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®