From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 3/4] common lcd: simplify core functions
Date: Mon, 25 Jun 2012 09:23:37 +0200 [thread overview]
Message-ID: <20120625072337.9CD3E202239@gemini.denx.de> (raw)
In-Reply-To: <1340607844-8718-4-git-send-email-nikita@compulab.co.il>
Dear Nikita Kiryanov,
In message <1340607844-8718-4-git-send-email-nikita@compulab.co.il> you wrote:
> Move highly platform dependant code into its own function to reduce the
> number of #ifdefs in the bigger functions
>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> ---
> common/lcd.c | 58 ++++++++++++++++++++++++++++------------------------------
> 1 files changed, 28 insertions(+), 30 deletions(-)
>
> diff --git a/common/lcd.c b/common/lcd.c
> index 4a5c8d5..3c0f1b1 100644
> --- a/common/lcd.c
> +++ b/common/lcd.c
> @@ -498,21 +498,35 @@ static int lcd_getbgcolor(void)
> /************************************************************************/
> /* ** Chipset depending Bitmap / Logo stuff... */
> /************************************************************************/
> +static inline ushort *configuration_get_cmap(void)
> +{
> +#if defined CONFIG_CPU_PXA
> + struct pxafb_info *fbi = &panel_info.pxa;
> + return (ushort *)fbi->palette;
> +#elif defined(CONFIG_MPC823)
> + volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
> + volatile cpm8xx_t *cp = &(immr->im_cpm);
> + return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]);
> +#elif defined(CONFIG_ATMEL_LCD)
> + return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0));
> +#else
> + return (ushort *)panel_info.cmap;
> +#endif
> +}
Please fix and use I/O accessors instead of volatile pointers.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Program maintenance is an entropy-increasing process, and even its
most skilfull execution only delays the subsidence of the system into
unfixable obsolescence. - Fred Brooks, "The Mythical Man Month"
next prev parent reply other threads:[~2012-06-25 7:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-25 7:04 [U-Boot] [PATCH V2 0/4] common/lcd cleanup Nikita Kiryanov
2012-06-25 7:04 ` [U-Boot] [PATCH V2 1/4] common lcd: simplify lcd_logo Nikita Kiryanov
2012-06-25 7:04 ` [U-Boot] [PATCH V2 2/4] common lcd: simplify lcd_display Nikita Kiryanov
2012-06-25 7:04 ` [U-Boot] [PATCH V2 3/4] common lcd: simplify core functions Nikita Kiryanov
2012-06-25 7:23 ` Wolfgang Denk [this message]
2012-07-04 10:33 ` Nikita Kiryanov
2012-06-25 7:04 ` [U-Boot] [PATCH V2 4/4] common lcd: simplify lcd_display_bitmap Nikita Kiryanov
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=20120625072337.9CD3E202239@gemini.denx.de \
--to=wd@denx.de \
--cc=u-boot@lists.denx.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