mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Ben Dooks" <ben.dooks@sifive.com>
Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Greentime Hu <greentime.hu@sifive.com>,
	jarkko.nikula@linux.intel.com,
	William Salmon <william.salmon@sifive.com>,
	Jude Onyenegecha <jude.onyenegecha@sifive.com>
Subject: Re: [PATCH v8 1/5] pwm: dwc: split pci out of core driver
Date: Mon, 17 Jul 2023 08:07:10 +0100	[thread overview]
Message-ID: <faa870b6-112e-46fa-2b98-f5700dd76263@codethink.co.uk> (raw)
In-Reply-To: <20230715192832.hczmcchn4svzilnd@pengutronix.de>

On 15/07/2023 20:28, Uwe Kleine-König wrote:
> On Wed, Jun 14, 2023 at 06:14:53PM +0100, Ben Dooks wrote:
>> Moving towards adding non-pci support for the driver, move the pci
>> parts out of the core into their own module. This is partly due to
>> the module_driver() code only being allowed once in a module and also
>> to avoid a number of #ifdef if we build a single file in a system
>> without pci support.
>>
>> Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
>> ---
>> v8:
>>   - add module namespace
>>   - remove compile-test for pci case, doesn't make sense
>>   - fix makefile, missed config symbol changes
>> v7:
>>   - re-order kconfig to make dwc core be selected by PCI driver
>> v6:
>>   - put DWC_PERIOD_NS back to avoid bisect issues
>> v4:
>>   - removed DWC_PERIOD_NS as not needed
>> ---
>>   drivers/pwm/Kconfig        |  14 ++-
>>   drivers/pwm/Makefile       |   1 +
>>   drivers/pwm/pwm-dwc-core.c | 176 +++++++++++++++++++++++++++++++++
>>   drivers/pwm/pwm-dwc.c      | 197 +------------------------------------
>>   drivers/pwm/pwm-dwc.h      |  60 +++++++++++
>>   5 files changed, 253 insertions(+), 195 deletions(-)
>>   create mode 100644 drivers/pwm/pwm-dwc-core.c
>>   create mode 100644 drivers/pwm/pwm-dwc.h
>>
>> diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
>> index 8df861b1f4a3..7c54cdcb97a0 100644
>> --- a/drivers/pwm/Kconfig
>> +++ b/drivers/pwm/Kconfig
>> @@ -186,9 +186,19 @@ config PWM_CROS_EC
>>   	  PWM driver for exposing a PWM attached to the ChromeOS Embedded
>>   	  Controller.
>>   
>> +config PWM_DWC_CORE
>> +	tristate
>> +	depends on HAS_IOMEM
>> +	help
>> +	  PWM driver for Synopsys DWC PWM Controller.
>> +
>> +	  To compile this driver as a module, build the dependecies as
>> +	  modules, this will be called pwm-dwc-core.
>> +
>>   config PWM_DWC
>> -	tristate "DesignWare PWM Controller"
>> -	depends on PCI
>> +	tristate "DesignWare PWM Controller (PCI bus)"
>> +	depends on HAS_IOMEM && PCI
>> +	select PWM_DWC_CORE
>>   	help
>>   	  PWM driver for Synopsys DWC PWM Controller attached to a PCI bus.
>>   
>> diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile
>> index 19899b912e00..de3ed77e8d7c 100644
>> --- a/drivers/pwm/Makefile
>> +++ b/drivers/pwm/Makefile
>> @@ -15,6 +15,7 @@ obj-$(CONFIG_PWM_CLK)		+= pwm-clk.o
>>   obj-$(CONFIG_PWM_CLPS711X)	+= pwm-clps711x.o
>>   obj-$(CONFIG_PWM_CRC)		+= pwm-crc.o
>>   obj-$(CONFIG_PWM_CROS_EC)	+= pwm-cros-ec.o
>> +obj-$(CONFIG_PWM_DWC_CORE)	+= pwm-dwc-core.o
>>   obj-$(CONFIG_PWM_DWC)		+= pwm-dwc.o
> 
> Would it make sense to call this pwm-dwc-pci.o? And the symbol
> CONFIG_PWM_DWC_PCI? (The latter would break make oldconfig. Hmm, I'm
> unsure myself.)

i left the pci as the pwm-dwc so that anyone moving up and using
this as a module won't have to change config or their module loading
if they're not autoloading modules.

> I didn't check all the details, but assuming that this is a split
> without further changes it looks ok to me.
> 
> Best regards
> Uwe
> 

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html


  reply	other threads:[~2023-07-17  7:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14 17:14 [PATCH v8 0/5] DesignWare PWM driver updates Ben Dooks
2023-06-14 17:14 ` [PATCH v8 1/5] pwm: dwc: split pci out of core driver Ben Dooks
2023-07-15 19:28   ` Uwe Kleine-König
2023-07-17  7:07     ` Ben Dooks [this message]
2023-07-17  7:46       ` Uwe Kleine-König
2023-06-14 17:14 ` [PATCH v8 2/5] pwm: dwc: make timer clock configurable Ben Dooks
2023-06-14 17:14 ` [PATCH v8 3/5] pwm: dwc: add PWM bit unset in get_state call Ben Dooks
2023-07-15 19:33   ` Uwe Kleine-König
2023-06-14 17:14 ` [PATCH v8 4/5] pwm: dwc: use clock rate in hz to avoid rounding issues Ben Dooks
2023-07-15 19:42   ` Uwe Kleine-König
2023-06-14 17:14 ` [PATCH v8 5/5] pwm: dwc: add of/platform support Ben Dooks
2023-07-15 19:51   ` Uwe Kleine-König
2023-06-20 12:59 ` [PATCH v8 0/5] DesignWare PWM driver updates Jarkko Nikula
2023-06-23  9:46   ` Ben Dooks

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=faa870b6-112e-46fa-2b98-f5700dd76263@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --cc=ben.dooks@sifive.com \
    --cc=devicetree@vger.kernel.org \
    --cc=greentime.hu@sifive.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jude.onyenegecha@sifive.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=william.salmon@sifive.com \
    /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®