From: "Andreas Bießmann" <biessmann@corscience.de>
To: kernel@avr32linux.org
Cc: "Nicolas Ferre" <nicolas.ferre@atmel.com>,
"Andreas Bießmann" <biessmann@corscience.de>,
"open list:ATMEL LCDFB DRIVER" <linux-fbdev@vger.kernel.org>,
"open list" <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] atmel_lcdfb: implement inverted contrast pwm
Date: Fri, 11 Feb 2011 15:19:43 +0000 [thread overview]
Message-ID: <1297437584-14048-1-git-send-email-biessmann@corscience.de> (raw)
This patch introduces lcdc->lcdcon_pol_negative which set CONTRAST_CTR
register to inverted polarity.
Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
---
These are some older patches which are used in some of our systems. Heavy
merging pointed out these functionality was missed to push upstream.
drivers/video/atmel_lcdfb.c | 7 ++++++-
include/video/atmel_lcdc.h | 1 +
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index bac16345..16da8af 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -68,7 +68,7 @@ static void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
}
#endif
-static const u32 contrast_ctr = ATMEL_LCDC_PS_DIV8
+static u32 contrast_ctr = ATMEL_LCDC_PS_DIV8
| ATMEL_LCDC_POL_POSITIVE
| ATMEL_LCDC_ENA_PWMENABLE;
@@ -163,6 +163,10 @@ static void exit_backlight(struct atmel_lcdfb_info *sinfo)
static void init_contrast(struct atmel_lcdfb_info *sinfo)
{
+ /* contrast pwm can be 'inverted' */
+ if (sinfo->lcdcon_pol_negative)
+ contrast_ctr &= ~(ATMEL_LCDC_POL_POSITIVE);
+
/* have some default contrast/backlight settings */
lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr);
lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, ATMEL_LCDC_CVAL_DEFAULT);
@@ -816,6 +820,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
sinfo->guard_time = pdata_sinfo->guard_time;
sinfo->smem_len = pdata_sinfo->smem_len;
sinfo->lcdcon_is_backlight = pdata_sinfo->lcdcon_is_backlight;
+ sinfo->lcdcon_pol_negative = pdata_sinfo->lcdcon_pol_negative;
sinfo->lcd_wiring_mode = pdata_sinfo->lcd_wiring_mode;
} else {
dev_err(dev, "cannot get default configuration\n");
diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h
index 0c864db..28447f1 100644
--- a/include/video/atmel_lcdc.h
+++ b/include/video/atmel_lcdc.h
@@ -52,6 +52,7 @@ struct atmel_lcdfb_info {
u8 bl_power;
#endif
bool lcdcon_is_backlight;
+ bool lcdcon_pol_negative;
u8 saved_lcdcon;
u8 default_bpp;
--
1.7.2.3
next reply other threads:[~2011-02-11 15:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-11 15:19 Andreas Bießmann [this message]
2011-02-11 15:19 ` [PATCH 2/2] atmel_lcdfb: add fb_blank function Andreas Bießmann
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=1297437584-14048-1-git-send-email-biessmann@corscience.de \
--to=biessmann@corscience.de \
--cc=kernel@avr32linux.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.ferre@atmel.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;
as well as URLs for NNTP newsgroup(s).