linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: vitor <vitor.soares@synopsys.com>
To: Boris Brezillon <boris.brezillon@bootlin.com>,
	Vitor Soares <vitor.soares@synopsys.com>
Cc: <wsa@the-dreams.de>, <linux-i2c@vger.kernel.org>,
	<corbet@lwn.net>, <linux-doc@vger.kernel.org>,
	<gregkh@linuxfoundation.org>, <arnd@arndb.de>,
	<psroka@cadence.com>, <agolec@cadence.com>,
	<adouglas@cadence.com>, <bfolta@cadence.com>, <dkos@cadence.com>,
	<alicja@cadence.com>, <cwronka@cadence.com>,
	<sureshp@cadence.com>, <rafalc@cadence.com>,
	<thomas.petazzoni@bootlin.com>, <nm@ti.com>, <robh+dt@kernel.org>,
	<pawel.moll@arm.com>, <mark.rutland@arm.com>,
	<ijc+devicetree@hellion.org.uk>, <galak@codeaurora.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<geert@linux-m68k.org>, <linus.walleij@linaro.org>,
	<Xiang.Lin@synaptics.com>, <linux-gpio@vger.kernel.org>,
	<nsekhar@ti.com>, <pgaj@cadence.com>, <peda@axentia.se>,
	<mshettel@codeaurora.org>, <swboyd@chromium.org>,
	<joao.pinto@synopsys.com>
Subject: Re: [PATCH] i3c: master: dw: split dw-i3c-master.c into master and bus specific parts
Date: Fri, 23 Nov 2018 12:39:31 +0000	[thread overview]
Message-ID: <6d513e04-3a57-1989-429c-64631101c5a2@synopsys.com> (raw)
In-Reply-To: <20181122210202.6af50fcc@bbrezillon>

Hi Boris,


On 22/11/18 20:02, Boris Brezillon wrote:
> On Thu, 22 Nov 2018 17:54:54 +0000
> Vitor Soares <vitor.soares@synopsys.com> wrote:
>
>> From: Vitor Soares <soares@synopsys.com>
>>
>> This patch slipts dw-i3c-master.c into three pieces:
>> 	dw-i3c-master.c - contains the code that interacts directly with the
>> 	core in master mode.
>>
>> 	dw-i3c-platdrv.c - contains the code specific to the platform driver.
>>
>> 	dw-i3c-core.h - contains the definitions and declarations shared by
>> 	dw-i3c-master and dw-i3c-platdrv
>>
>> This patch will allow SOC integrators to add their code specific to
>> DesignWare I3C IP.
> Isn't it too early to do this change? Can't we wait until we have a SoC
> that actually embeds this IP?


I'm trying to turn it more flexible so the other can reuse the code.


>
>> Signed-off-by: Vitor Soares <soares@synopsys.com>
>> ---
>>   drivers/i3c/master/Kconfig          |   9 +-
>>   drivers/i3c/master/Makefile         |   5 +-
>>   drivers/i3c/master/dw-i3c-core.h    | 214 ++++++++++++++++++++++++++
>>   drivers/i3c/master/dw-i3c-master.c  | 299 ++----------------------------------
>>   drivers/i3c/master/dw-i3c-platdrv.c | 112 ++++++++++++++
> I'd prefer to have a dw/ subdir where you'd place all dw files.


Sure. I will change to this:

../dwc
    |-core.h
    |-master.c
    |-platdrv.c


so the user doesn't need to write dw-i3c.. several times. The folder 
name is the same as for other subsystem (e.g. PCI).

What do you think?

>
>>   5 files changed, 349 insertions(+), 290 deletions(-)
>>   create mode 100644 drivers/i3c/master/dw-i3c-core.h
>>   create mode 100644 drivers/i3c/master/dw-i3c-platdrv.c
>>
>> diff --git a/drivers/i3c/master/Kconfig b/drivers/i3c/master/Kconfig
>> index 8ee1ce6..fdc6e46 100644
>> --- a/drivers/i3c/master/Kconfig
>> +++ b/drivers/i3c/master/Kconfig
>> @@ -5,9 +5,14 @@ config CDNS_I3C_MASTER
>>   	help
>>   	  Enable this driver if you want to support Cadence I3C master block.
>>   
>> -config DW_I3C_MASTER
>> -	tristate "Synospsys DesignWare I3C master driver"
>> +config DW_I3C_CORE
>> +	tristate
>> +
>> +config DW_I3C_PLATFORM
>> +	tristate "Synospsys DesignWare I3C Platform driver"
>> +	select DW_I3C_CORE
>>   	depends on I3C
>> +	depends on HAS_IOMEM
>>   	depends on !(ALPHA || PARISC)
>>   	# ALPHA and PARISC needs {read,write}sl()
>>   	help
>> diff --git a/drivers/i3c/master/Makefile b/drivers/i3c/master/Makefile
>> index fc53939..004ad1c 100644
>> --- a/drivers/i3c/master/Makefile
>> +++ b/drivers/i3c/master/Makefile
>> @@ -1,2 +1,5 @@
>>   obj-$(CONFIG_CDNS_I3C_MASTER)		+= i3c-master-cdns.o
>> -obj-$(CONFIG_DW_I3C_MASTER)		+= dw-i3c-master.o
>> +obj-$(CONFIG_DW_I3C_CORE)		+= dw-i3c-core.o
>> +dw-i3c-core-objs			:= dw-i3c-master.o
>> +obj-$(CONFIG_DW_I3C_PLATFORM)		+= dw-i3c-platform.o
>> +dw-i3c-platform-objs			:= dw-i3c-platdrv.o
> Do we really have to create one module for the core and one per SoC?
> Can't we have everything in the same .ko?


This will help the introduction of new modules. The design in my mind is 
to have:

-core.h

-common.c

-master.c

-slave.c

...

I'm not sure if make sense to change core.h to common.h.



Thaks for your feedback.


Best regards,

Vitor Soares


  reply	other threads:[~2018-11-23 12:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22 17:54 [PATCH] i3c: master: dw: split dw-i3c-master.c into master and bus specific parts Vitor Soares
2018-11-22 20:02 ` Boris Brezillon
2018-11-23 12:39   ` vitor [this message]
2018-11-23 12:50     ` Boris Brezillon
2018-11-26 12:06       ` vitor
2018-11-26 12:35         ` Boris Brezillon
2018-11-26 18:33           ` vitor
2018-11-26 18:56             ` Boris Brezillon
2018-11-26 19:08               ` Boris Brezillon
2018-11-26 19:28                 ` vitor
2018-11-26 20:06                   ` Boris Brezillon
2018-11-26 20:11               ` vitor
2018-11-26 21:33                 ` Boris Brezillon
2018-11-27 11:50                   ` vitor
2018-11-27 12:33                     ` Boris Brezillon
2018-12-04  0:34                       ` vitor
2018-12-04  9:19                         ` Boris Brezillon

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=6d513e04-3a57-1989-429c-64631101c5a2@synopsys.com \
    --to=vitor.soares@synopsys.com \
    --cc=Xiang.Lin@synaptics.com \
    --cc=adouglas@cadence.com \
    --cc=agolec@cadence.com \
    --cc=alicja@cadence.com \
    --cc=arnd@arndb.de \
    --cc=bfolta@cadence.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=corbet@lwn.net \
    --cc=cwronka@cadence.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dkos@cadence.com \
    --cc=galak@codeaurora.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=joao.pinto@synopsys.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mshettel@codeaurora.org \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=pawel.moll@arm.com \
    --cc=peda@axentia.se \
    --cc=pgaj@cadence.com \
    --cc=psroka@cadence.com \
    --cc=rafalc@cadence.com \
    --cc=robh+dt@kernel.org \
    --cc=sureshp@cadence.com \
    --cc=swboyd@chromium.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wsa@the-dreams.de \
    /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;
as well as URLs for NNTP newsgroup(s).