All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Walmsley <paul@pwsan.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Nishanth Menon <nm@ti.com>, Felipe Balbi <felipe.balbi@nokia.com>
Subject: Re: [PATCH v2 8/8] OMAP1 clock: convert mach-omap1/clock.h to mach-omap1/clock_data.c
Date: Thu, 3 Dec 2009 05:33:44 -0700 (MST)	[thread overview]
Message-ID: <alpine.DEB.2.00.0912030520360.13408@utopia.booyaka.com> (raw)
In-Reply-To: <20091203121157.GC20379@n2100.arm.linux.org.uk>

Hello Russell,

On Thu, 3 Dec 2009, Russell King - ARM Linux wrote:

> On Thu, Dec 03, 2009 at 04:24:35AM -0700, Paul Walmsley wrote:
> > @@ -42,134 +47,19 @@ static void clk_omap1_dummy_disable(struct clk *clk)
> >  {
> >  }
> >  
> > -static const struct clkops clkops_dummy = {
> > -	.enable = clk_omap1_dummy_enable,
> > -	.disable = clk_omap1_dummy_disable,
> > -};
> ...
> > +/*
> > + * clkops
> > + */
> >  
> > -	/* Turn off DSP and ARM_TIMXO. Make sure ARM_INTHCK is not divided */
> > -	/* (on 730, bit 13 must not be cleared) */
> > -	if (cpu_is_omap7xx())
> > -		omap_writew(omap_readw(ARM_CKCTL) & 0x2fff, ARM_CKCTL);
> > -	else
> > -		omap_writew(omap_readw(ARM_CKCTL) & 0x0fff, ARM_CKCTL);
> > +const struct clkops clkops_dspck = {
> > +	.enable		= omap1_clk_enable_dsp_domain,
> > +	.disable	= omap1_clk_disable_dsp_domain,
> > +};
> >  
> > -	/* Put DSP/MPUI into reset until needed */
> > -	omap_writew(0, ARM_RSTCT1);
> > -	omap_writew(1, ARM_RSTCT2);
> > -	omap_writew(0x400, ARM_IDLECT1);
> > +const struct clkops clkops_dummy = {
> > +	.enable		= clk_omap1_dummy_enable,
> > +	.disable	= clk_omap1_dummy_disable,
> > +};
> >  
> > -	/*
> > -	 * According to OMAP5910 Erratum SYS_DMA_1, bit DMACK_REQ (bit 8)
> > -	 * of the ARM_IDLECT2 register must be set to zero. The power-on
> > -	 * default value of this bit is one.
> > -	 */
> > -	omap_writew(0x0000, ARM_IDLECT2);	/* Turn LCD clock off also */
> > +const struct clkops clkops_uart = {
> > +	.enable		= omap1_clk_enable_uart_functional,
> > +	.disable	= omap1_clk_disable_uart_functional,
> > +};
> 
> What is the reasoning for moving all clkops away from their associated
> enable/disable functions right to the end of the file?
>
> Isn't it better to have like stuff together, in much the same way that
> it's preferred to have EXPORT_SYMBOL next to their function/data that
> it's exporting?

My preference was to keep data separated from code in the source files; I 
think it is slightly more readable.

The other consideration is that there are some patches in the works here 
to move all of the struct clk function pointers into the struct clkops.  
When this happens, many function pointers are shared between struct 
clkops, and so it becomes somewhat arbitrary as to which set of functions 
the struct clkops is placed near.

But as for the current set of patches, there's no major attachment to the 
the placement of the struct clkops.  I'd be happy to move them back, close 
to the enable/disable code if you prefer.  Would you like me to do so?


- Paul

WARNING: multiple messages have this Message-ID (diff)
From: paul@pwsan.com (Paul Walmsley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 8/8] OMAP1 clock: convert mach-omap1/clock.h to mach-omap1/clock_data.c
Date: Thu, 3 Dec 2009 05:33:44 -0700 (MST)	[thread overview]
Message-ID: <alpine.DEB.2.00.0912030520360.13408@utopia.booyaka.com> (raw)
In-Reply-To: <20091203121157.GC20379@n2100.arm.linux.org.uk>

Hello Russell,

On Thu, 3 Dec 2009, Russell King - ARM Linux wrote:

> On Thu, Dec 03, 2009 at 04:24:35AM -0700, Paul Walmsley wrote:
> > @@ -42,134 +47,19 @@ static void clk_omap1_dummy_disable(struct clk *clk)
> >  {
> >  }
> >  
> > -static const struct clkops clkops_dummy = {
> > -	.enable = clk_omap1_dummy_enable,
> > -	.disable = clk_omap1_dummy_disable,
> > -};
> ...
> > +/*
> > + * clkops
> > + */
> >  
> > -	/* Turn off DSP and ARM_TIMXO. Make sure ARM_INTHCK is not divided */
> > -	/* (on 730, bit 13 must not be cleared) */
> > -	if (cpu_is_omap7xx())
> > -		omap_writew(omap_readw(ARM_CKCTL) & 0x2fff, ARM_CKCTL);
> > -	else
> > -		omap_writew(omap_readw(ARM_CKCTL) & 0x0fff, ARM_CKCTL);
> > +const struct clkops clkops_dspck = {
> > +	.enable		= omap1_clk_enable_dsp_domain,
> > +	.disable	= omap1_clk_disable_dsp_domain,
> > +};
> >  
> > -	/* Put DSP/MPUI into reset until needed */
> > -	omap_writew(0, ARM_RSTCT1);
> > -	omap_writew(1, ARM_RSTCT2);
> > -	omap_writew(0x400, ARM_IDLECT1);
> > +const struct clkops clkops_dummy = {
> > +	.enable		= clk_omap1_dummy_enable,
> > +	.disable	= clk_omap1_dummy_disable,
> > +};
> >  
> > -	/*
> > -	 * According to OMAP5910 Erratum SYS_DMA_1, bit DMACK_REQ (bit 8)
> > -	 * of the ARM_IDLECT2 register must be set to zero. The power-on
> > -	 * default value of this bit is one.
> > -	 */
> > -	omap_writew(0x0000, ARM_IDLECT2);	/* Turn LCD clock off also */
> > +const struct clkops clkops_uart = {
> > +	.enable		= omap1_clk_enable_uart_functional,
> > +	.disable	= omap1_clk_disable_uart_functional,
> > +};
> 
> What is the reasoning for moving all clkops away from their associated
> enable/disable functions right to the end of the file?
>
> Isn't it better to have like stuff together, in much the same way that
> it's preferred to have EXPORT_SYMBOL next to their function/data that
> it's exporting?

My preference was to keep data separated from code in the source files; I 
think it is slightly more readable.

The other consideration is that there are some patches in the works here 
to move all of the struct clk function pointers into the struct clkops.  
When this happens, many function pointers are shared between struct 
clkops, and so it becomes somewhat arbitrary as to which set of functions 
the struct clkops is placed near.

But as for the current set of patches, there's no major attachment to the 
the placement of the struct clkops.  I'd be happy to move them back, close 
to the enable/disable code if you prefer.  Would you like me to do so?


- Paul

  reply	other threads:[~2009-12-03 12:33 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-03 10:06 [PATCH 0/8] OMAP clock: convert static definitions in header files to C files Paul Walmsley
2009-12-03 10:06 ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 1/8] OMAP1/2/3 clock: remove paranoid checks in preparation for clock{, 2xxx, 3xxx}_data.c Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 2/8] OMAP2 clock: APLL code shouldn't rely on static clocks in its local namespace Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 3/8] OMAP2/3: move SDRC macros to mach-omap2/sdrc.h Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 4/8] OMAP2xxx clock: remove implicit dependency between rate CPU flag and clkdev_omap CPU flag Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 5/8] OMAP3 clock: convert clock34xx.h to clock34xx_data.c Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 6/8] OMAP2 clock: convert clock24xx.h to clock2xxx_data.c, opp2xxx* Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 7/8] OMAP1 clock: convert test in disable_unused() to use ENABLE_ON_INIT Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 8/8] OMAP1 clock: convert mach-omap1/clock.h to mach-omap1/clock_data.c Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:27   ` Russell King
2009-12-03 10:27     ` Russell King
2009-12-03 10:36     ` Paul Walmsley
2009-12-03 10:36       ` Paul Walmsley
2009-12-03 10:43       ` Russell King - ARM Linux
2009-12-03 10:43         ` Russell King - ARM Linux
2009-12-03 10:57         ` Paul Walmsley
2009-12-03 10:57           ` Paul Walmsley
2009-12-03 11:22           ` [PATCH v2 5/8] OMAP3 clock: convert clock34xx.h to clock34xx_data.c Paul Walmsley
2009-12-03 11:22             ` Paul Walmsley
2009-12-03 11:23           ` [PATCH v2 6/8] OMAP2 clock: convert clock24xx.h to clock2xxx_data.c, opp2xxx* Paul Walmsley
2009-12-03 11:23             ` Paul Walmsley
2009-12-03 11:24           ` [PATCH v2 8/8] OMAP1 clock: convert mach-omap1/clock.h to mach-omap1/clock_data.c Paul Walmsley
2009-12-03 11:24             ` Paul Walmsley
2009-12-03 12:11             ` Russell King - ARM Linux
2009-12-03 12:11               ` Russell King - ARM Linux
2009-12-03 12:33               ` Paul Walmsley [this message]
2009-12-03 12:33                 ` Paul Walmsley
2009-12-03 15:03                 ` Russell King - ARM Linux
2009-12-03 15:03                   ` Russell King - ARM Linux
2009-12-03 15:26                   ` Paul Walmsley
2009-12-03 15:26                     ` Paul Walmsley
2009-12-03 16:18                     ` [PATCH v3 5/8] OMAP3 clock: convert clock34xx.h to clock34xx_data.c Paul Walmsley
2009-12-03 16:18                       ` Paul Walmsley
2009-12-03 16:19                     ` [PATCH v3 6/8] OMAP2 clock: convert clock24xx.h to clock2xxx_data.c, opp2xxx* Paul Walmsley
2009-12-03 16:19                       ` Paul Walmsley
2009-12-03 16:20                     ` [PATCH v3 8/8] OMAP1 clock: convert mach-omap1/clock.h to mach-omap1/clock_data.c Paul Walmsley
2009-12-03 16:20                       ` Paul Walmsley
2009-12-03 10:29   ` [PATCH " Russell King
2009-12-03 10:29     ` Russell King
2009-12-03 10:37     ` Paul Walmsley
2009-12-03 10:37       ` Paul Walmsley
2009-12-03 10:41       ` Russell King - ARM Linux
2009-12-03 10:41         ` Russell King - ARM Linux
2009-12-04 10:05 ` [PATCH 0/8] OMAP clock: convert static definitions in header files to C files Nayak, Rajendra
2009-12-04 10:05   ` Nayak, Rajendra
2009-12-04 10:13   ` Russell King - ARM Linux
2009-12-04 10:13     ` Russell King - ARM Linux
2009-12-07 12:58   ` Paul Walmsley
2009-12-07 12:58     ` Paul Walmsley

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=alpine.DEB.2.00.0912030520360.13408@utopia.booyaka.com \
    --to=paul@pwsan.com \
    --cc=felipe.balbi@nokia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nm@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.