mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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>,
	dlechner@baylibre.com
Subject: Re: [PATCH] pwm: Declare waveform stubs for when PWM is not reachable
Date: Fri, 10 Oct 2025 17:37:52 -0300	[thread overview]
Message-ID: <aOluoP01oaDzaseV@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <04eb5b1ccc0268ff7e9b88835203771886c5ee25.camel@gmail.com>

...
> > > 
> > > 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].
> 
> With imply we then need to take care either using stubs (which seems not to be an
> option) or with preprocessor conditions in your driver. As discussed in the other
> thread I would just select SPI_OFFLOAD. Basically I would:
> 
> 	select SPI_OFFLOAD
> 	select SPI_OFFLOAD_TRIGGER_PWM
> 	depends on PWM

Yeah, depending on PWM is what I was trying to avoid because the ADC can be used
without PWM. Doing the above is the easiest solution - depend on everything,
select everything. Though, I guess I'm technically not keeping backwards
compatibility if I add a new dependency to the driver.

IIO_BUFFER_DMA and IIO_BUFFER_DMAENGINE are part of IIO subsystem so okay to
select them? Otherwise, yeah, they should be optional too (would either imply
them or select if SPI_OFFLOAD).

I'm currently leaning towards
 	imply PWM
 	imply SPI_OFFLOAD_TRIGGER_PWM //(SPI_OFFLOAD_TRIGGER_PWM depends on SPI_OFFLOAD)
but not really sure.

It's sort of a feature bundle we want to enable to provide SPI offloading.

if SPI_OFFLOAD && PWM
	select SPI_OFFLOAD_TRIGGER_PWM
	select IIO_BUFFER_DMA
	select IIO_BUFFER_DMAENGINE

we can have
	imply IIO_BUFFER_DMA
	imply IIO_BUFFER_DMAENGINE
 	imply PWM
 	imply SPI_OFFLOAD_TRIGGER_PWM

but we could then have IIO_BUFFER_DMA=y and PWM=n and still be unable to SPI offload?

Maybe
	imply IIO_BUFFER_DMA if (SPI_OFFLOAD && PWM)
	imply IIO_BUFFER_DMAENGINE if (SPI_OFFLOAD && PWM)
 	imply PWM
 	imply SPI_OFFLOAD_TRIGGER_PWM if (SPI_OFFLOAD && PWM)
?

Forgot to add David to CC list on previous reply so doing it now.

> 
> - Nuno Sá
> 	
> > 
> > [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

  reply	other threads:[~2025-10-10 20:36 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
2025-10-10 18:51       ` Nuno Sá
2025-10-10 20:37         ` Marcelo Schmitt [this message]
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=aOluoP01oaDzaseV@debian-BULLSEYE-live-builder-AMD64 \
    --to=marcelo.schmitt1@gmail.com \
    --cc=ahaslam@baylibre.com \
    --cc=dlechner@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®