Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f3e2664 authored by Eric Miao's avatar Eric Miao Committed by Russell King
Browse files

[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: default avatarEric Miao <eric.miao@marvell.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 9a1ac7e4
Loading
Loading
Loading
Loading
+36 −26
Original line number Original line Diff line number Diff line
@@ -1677,53 +1677,63 @@ MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.txt)");
#define pxafb_setup_options()		(0)
#define pxafb_setup_options()		(0)
#endif
#endif


static int __devinit pxafb_probe(struct platform_device *dev)
{
	struct pxafb_info *fbi;
	struct pxafb_mach_info *inf;
	struct resource *r;
	int irq, ret;

	dev_dbg(&dev->dev, "pxafb_probe\n");

	inf = dev->dev.platform_data;
	ret = -ENOMEM;
	fbi = NULL;
	if (!inf)
		goto failed;

	ret = pxafb_parse_options(&dev->dev, g_options);
	if (ret < 0)
		goto failed;

#ifdef DEBUG_VAR
#ifdef DEBUG_VAR
/* Check for various illegal bit-combinations. Currently only
/* Check for various illegal bit-combinations. Currently only
 * a warning is given. */
 * a warning is given. */
static void __devinit pxafb_check_options(struct device *dev,
					  struct pxafb_mach_info *inf)
{
	if (inf->lcd_conn)
		return;


	if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK)
	if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK)
		dev_warn(&dev->dev, "machine LCCR0 setting contains "
		dev_warn(dev, "machine LCCR0 setting contains "
				"illegal bits: %08x\n",
				"illegal bits: %08x\n",
			inf->lccr0 & LCCR0_INVALID_CONFIG_MASK);
			inf->lccr0 & LCCR0_INVALID_CONFIG_MASK);
	if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK)
	if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK)
		dev_warn(&dev->dev, "machine LCCR3 setting contains "
		dev_warn(dev, "machine LCCR3 setting contains "
				"illegal bits: %08x\n",
				"illegal bits: %08x\n",
			inf->lccr3 & LCCR3_INVALID_CONFIG_MASK);
			inf->lccr3 & LCCR3_INVALID_CONFIG_MASK);
	if (inf->lccr0 & LCCR0_DPD &&
	if (inf->lccr0 & LCCR0_DPD &&
	    ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas ||
	    ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas ||
	     (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl ||
	     (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl ||
	     (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono))
	     (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono))
		dev_warn(&dev->dev, "Double Pixel Data (DPD) mode is "
		dev_warn(dev, "Double Pixel Data (DPD) mode is "
				"only valid in passive mono"
				"only valid in passive mono"
				" single panel mode\n");
				" single panel mode\n");
	if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act &&
	if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act &&
	    (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual)
	    (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual)
		dev_warn(&dev->dev, "Dual panel only valid in passive mode\n");
		dev_warn(dev, "Dual panel only valid in passive mode\n");
	if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas &&
	if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas &&
	     (inf->modes->upper_margin || inf->modes->lower_margin))
	     (inf->modes->upper_margin || inf->modes->lower_margin))
		dev_warn(&dev->dev, "Upper and lower margins must be 0 in "
		dev_warn(dev, "Upper and lower margins must be 0 in "
				"passive mode\n");
				"passive mode\n");
}
#else
#define pxafb_check_options(...)	do {} while (0)
#endif
#endif


static int __devinit pxafb_probe(struct platform_device *dev)
{
	struct pxafb_info *fbi;
	struct pxafb_mach_info *inf;
	struct resource *r;
	int irq, ret;

	dev_dbg(&dev->dev, "pxafb_probe\n");

	inf = dev->dev.platform_data;
	ret = -ENOMEM;
	fbi = NULL;
	if (!inf)
		goto failed;

	ret = pxafb_parse_options(&dev->dev, g_options);
	if (ret < 0)
		goto failed;

	pxafb_check_options(&dev->dev, inf);

	dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n",
	dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n",
			inf->modes->xres,
			inf->modes->xres,
			inf->modes->yres,
			inf->modes->yres,