public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH v4, for-next] OMAP: DMA: Use some define rather than a hexadecimal constant for LCD register
Date: Tue, 17 Nov 2009 08:10:58 -0800	[thread overview]
Message-ID: <20091117161058.GA29266@atomide.com> (raw)
In-Reply-To: <200911171145.55658.jkrzyszt@tis.icnet.pl>

* Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> [091117 02:45]:
> Tuesday 17 November 2009 02:24:35 Tony Lindgren napisał(a):
> > * Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> [091116 16:38]:
> > > Tuesday 17 November 2009 01:16:58 Tony Lindgren napisał(a):
> > > > * Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> [091116 15:13]:
> > > > > diff -uprN a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
> > > > > --- a/arch/arm/plat-omap/dma.c	2009-11-14 23:48:41.000000000 +0100
> > > > > +++ b/arch/arm/plat-omap/dma.c	2009-11-16 23:49:30.000000000 +0100
> > > > > @@ -36,6 +36,10 @@
> > > > >
> > > > >  #include <plat/tc.h>
> > > > >
> > > > > +#ifdef CONFIG_ARCH_OMAP1
> > > > > +#include <mach/lcdc.h>
> > > > > +#endif
> > > > > +
> > > > >  #undef DEBUG
> > > > >
> > > > >  #ifndef CONFIG_ARCH_OMAP1
> > > > > @@ -1124,9 +1128,11 @@ int omap_dma_running(void)
> > > > >  	 * On OMAP1510, internal LCD controller will start the transfer
> > > > >  	 * when it gets enabled, so assume DMA running if LCD enabled.
> > > > >  	 */
> > > > > +#ifdef CONFIG_ARCH_OMAP1
> > > > >  	if (cpu_is_omap1510())
> > > > > -		if (omap_readw(0xfffec000 + 0x00) & (1 << 0))
> > > > > +		if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
> > > > >  			return 1;
> > > > > +#endif
> > > > >
> > > > >  	/* Check if LCD DMA is running */
> > > > >  	if (cpu_is_omap16xx())
> > > >
> > > > Hmm, this is getting complicated... How about just add function to
> > > > drivers/video/omap/lcdc.c for something like omap_lcdc_get_status()
> > > > or similar?
> > >
> > > Good idea.
> 
> ... for a function itself, but not for putting it there, since omapfb, that 
> lcdc is a part of, can be build as a module :).
> 
> > > > Then you can define that function in some header as:
> > > >
> > > > #if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP)
> > > > extern int omap_lcdc_get_status(void);
> > > > #else
> > > > static inline int omap_lcdc_get_status(void)
> > > > {
> > > > 	return -ENODEV;
> > > > }
> > > > #endif
> > > >
> > > > That way the defines can stay where they are and you don't need the
> > > > ugly ifdefs.
> > >
> > > Sorry if my question seems stupid, but assuming the function can be as
> > > simple as:
> > >
> > > int omap_lcdc_get_status(void)
> > > {
> > > 	return omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN;
> > > }
> > >
> > > could't it be defined as static inline too and put inside lcdc.h?
> >
> > Sure, but then you need to move the defines again, no?
> 
> I can see 3 options:
> 
> 1. While keeping those hex constants as they are for now, solve the issue 
> during refactoring arch/arm/plat-omap/dma.c for a separate 
> arch/arm/mach-omap1/lcd_dma.c, as Paul suggested (may take some time). Since 
> the register test would be put there, some headers will have to be moved out 
> of drivers/video/omap/lcdc.c anyway.

This sounds like the best way to go to me.
 
> 2. Temporarily apply v2 of the patch. It compiles cleanly since defines are 
> put into <plat/omapfb.h> that exists for all OMAP classes. Then, clean up 
> things while doing #1. I'm not sure if that temporary solution could result 
> in one more conflict with DSS2.

Yeah let's rather do the real fix at #1 above :)
 
> 3. Based on v4 and your suggestion for a function, work out an intermediate 
> solution as soon as possible. I would appreciate any further suggestions on 
> how that could be arranged.
> 
> If there are no better options, please suggest which of those three you would 
> like me to take.

I think #1 above is the way to go.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2009-11-17 16:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-16 22:25 [v3, for-next] OMAP: DMA: Use some define rather than a hexadecimal constant for LCD register Tony Lindgren
2009-11-16 22:46 ` Janusz Krzysztofik
2009-11-16 23:13 ` [PATCH v4, " Janusz Krzysztofik
2009-11-17  0:16   ` Tony Lindgren
2009-11-17  0:38     ` Janusz Krzysztofik
2009-11-17  1:24       ` Tony Lindgren
2009-11-17 10:45         ` Janusz Krzysztofik
2009-11-17 11:50           ` Janusz Krzysztofik
2009-11-17 16:10           ` Tony Lindgren [this message]
2009-11-24 21:34             ` [PATCH v5] OMAP1: LCD_DMA: " Janusz Krzysztofik
2009-12-05 13:49               ` Janusz Krzysztofik
2009-12-07 21:15                 ` Tony Lindgren
2009-12-07 21:14               ` [APPLIED] [PATCH v5] OMAP1: LCD_DMA: Use some define rather than a Tony Lindgren

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=20091117161058.GA29266@atomide.com \
    --to=tony@atomide.com \
    --cc=jkrzyszt@tis.icnet.pl \
    --cc=linux-omap@vger.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