aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Miao <ycmiao@ycmiao-ubuntu.internal.example.org>2008-08-16 03:50:51 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-08-16 11:39:16 -0400
commit4f3e2664622d23a17c6fc45a4df4c35cd2612ffb (patch)
treee34ee6b3e165d03bb0187457a6d6ac8256b51c95
parent9a1ac7e498b9fc367235aabeb5b86c1319db1de9 (diff)
[ARM] pxafb: fix the warning of incorrect lccr when lcd_conn is specified
The newly introduced "lcd_conn" field for connected LCD panel type will cause the original code to generate the warnings of incorrect lccr*. This is unnecessary since well encoded LCD_* flags will not generate incorrect combinition of lccr* bits. Skip the check if "lcd_conn" is specified. Signed-off-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/video/pxafb.c62
1 files changed, 36 insertions, 26 deletions
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index fa108dad09bf..97204497d9f7 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -1677,53 +1677,63 @@ MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.txt)");
1677#define pxafb_setup_options() (0) 1677#define pxafb_setup_options() (0)
1678#endif 1678#endif
1679 1679
1680static int __devinit pxafb_probe(struct platform_device *dev)
1681{
1682 struct pxafb_info *fbi;
1683 struct pxafb_mach_info *inf;
1684 struct resource *r;
1685 int irq, ret;
1686
1687 dev_dbg(&dev->dev, "pxafb_probe\n");
1688
1689 inf = dev->dev.platform_data;
1690 ret = -ENOMEM;
1691 fbi = NULL;
1692 if (!inf)
1693 goto failed;
1694
1695 ret = pxafb_parse_options(&dev->dev, g_options);
1696 if (ret < 0)
1697 goto failed;
1698
1699#ifdef DEBUG_VAR 1680#ifdef DEBUG_VAR
1700 /* Check for various illegal bit-combinations. Currently only 1681/* Check for various illegal bit-combinations. Currently only
1701 * a warning is given. */ 1682 * a warning is given. */
1683static void __devinit pxafb_check_options(struct device *dev,
1684 struct pxafb_mach_info *inf)
1685{
1686 if (inf->lcd_conn)
1687 return;
1702 1688
1703 if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK) 1689 if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK)
1704 dev_warn(&dev->dev, "machine LCCR0 setting contains " 1690 dev_warn(dev, "machine LCCR0 setting contains "
1705 "illegal bits: %08x\n", 1691 "illegal bits: %08x\n",
1706 inf->lccr0 & LCCR0_INVALID_CONFIG_MASK); 1692 inf->lccr0 & LCCR0_INVALID_CONFIG_MASK);
1707 if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK) 1693 if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK)
1708 dev_warn(&dev->dev, "machine LCCR3 setting contains " 1694 dev_warn(dev, "machine LCCR3 setting contains "
1709 "illegal bits: %08x\n", 1695 "illegal bits: %08x\n",
1710 inf->lccr3 & LCCR3_INVALID_CONFIG_MASK); 1696 inf->lccr3 & LCCR3_INVALID_CONFIG_MASK);
1711 if (inf->lccr0 & LCCR0_DPD && 1697 if (inf->lccr0 & LCCR0_DPD &&
1712 ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas || 1698 ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas ||
1713 (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl || 1699 (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl ||
1714 (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono)) 1700 (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono))
1715 dev_warn(&dev->dev, "Double Pixel Data (DPD) mode is " 1701 dev_warn(dev, "Double Pixel Data (DPD) mode is "
1716 "only valid in passive mono" 1702 "only valid in passive mono"
1717 " single panel mode\n"); 1703 " single panel mode\n");
1718 if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act && 1704 if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act &&
1719 (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual) 1705 (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual)
1720 dev_warn(&dev->dev, "Dual panel only valid in passive mode\n"); 1706 dev_warn(dev, "Dual panel only valid in passive mode\n");
1721 if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas && 1707 if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas &&
1722 (inf->modes->upper_margin || inf->modes->lower_margin)) 1708 (inf->modes->upper_margin || inf->modes->lower_margin))
1723 dev_warn(&dev->dev, "Upper and lower margins must be 0 in " 1709 dev_warn(dev, "Upper and lower margins must be 0 in "
1724 "passive mode\n"); 1710 "passive mode\n");
1711}
1712#else
1713#define pxafb_check_options(...) do {} while (0)
1725#endif 1714#endif
1726 1715
1716static int __devinit pxafb_probe(struct platform_device *dev)
1717{
1718 struct pxafb_info *fbi;
1719 struct pxafb_mach_info *inf;
1720 struct resource *r;
1721 int irq, ret;
1722
1723 dev_dbg(&dev->dev, "pxafb_probe\n");
1724
1725 inf = dev->dev.platform_data;
1726 ret = -ENOMEM;
1727 fbi = NULL;
1728 if (!inf)
1729 goto failed;
1730
1731 ret = pxafb_parse_options(&dev->dev, g_options);
1732 if (ret < 0)
1733 goto failed;
1734
1735 pxafb_check_options(&dev->dev, inf);
1736
1727 dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n", 1737 dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n",
1728 inf->modes->xres, 1738 inf->modes->xres,
1729 inf->modes->yres, 1739 inf->modes->yres,