Skip to contentSkip to conversation

mx3fb: some debug and initialisation fixes.

PATCH New Alberto Panizzo 3 participants 5 messages Dec 18, 2009 – Jan 20, 2010 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mx3fb: some debug and initialisation fixes.

Fix the kernel oops when dev_dbg is called with mx3_fbi->txd == NULL

Fix the late initialisation of mx3fb->backlight_level.
If not, in the chain of function started by init_fb_chan(), in __blank() call sdc_set_brightness(mx3fb, mx3fb->backlight_level) that will shut down the CONTRAST PWM output.

---
 drivers/video/mx3fb.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/video/mx3fb.c +8 -4
index 054ef29..772ba3f 100644
@@ -324,8 +324,11 @@ static void sdc_enable_channel(struct mx3fb_info *mx3_fbi)
 	unsigned long flags;
 	dma_cookie_t cookie;
 
-	dev_dbg(mx3fb->dev, "mx3fbi %p, desc %p, sg %p\n", mx3_fbi,
-		to_tx_desc(mx3_fbi->txd), to_tx_desc(mx3_fbi->txd)->sg);
+	if (mx3_fbi->txd)
+		dev_dbg(mx3fb->dev, "mx3fbi %p, desc %p, sg %p\n", mx3_fbi,
+			to_tx_desc(mx3_fbi->txd), to_tx_desc(mx3_fbi->txd)->sg);
+	else
+		dev_dbg(mx3fb->dev, "mx3fbi %p, txd = NULL\n", mx3_fbi);
 
 	/* This enables the channel */
 	if (mx3_fbi->cookie < 0) {
@@ -646,6 +649,7 @@ static int sdc_set_global_alpha(struct mx3fb_data *mx3fb, bool enable, uint8_t a
 
 static void sdc_set_brightness(struct mx3fb_data *mx3fb, uint8_t value)
 {
+	dev_dbg(mx3fb->dev, "%s: value = %d\n", __func__, value);
 	/* This might be board-specific */
 	mx3fb_write_reg(mx3fb, 0x03000000UL | value << 16, SDC_PWM_CTRL);
 	return;
@@ -1486,12 +1490,12 @@ static int mx3fb_probe(struct platform_device *pdev)
 		goto ersdc0;
 	}
 
+	mx3fb->backlight_level = 255;
+
 	ret = init_fb_chan(mx3fb, to_idmac_chan(chan));
 	if (ret < 0)
 		goto eisdc0;
 
-	mx3fb->backlight_level = 255;
-
 	return 0;
 
 eisdc0:
Signature · 1 line
1.6.3.3
#1 lore raw

PATCH 1/1 mx3fb: some debug and initialisation fixes.

Quoted 9 lines · Alberto Panizzo

Fix the kernel oops when dev_dbg is called with mx3_fbi->txd == NULL

Fix the late initialisation of mx3fb->backlight_level.
If not, in the chain of function started by init_fb_chan(), in __blank() call sdc_set_brightness(mx3fb, mx3fb->backlight_level) that will shut down the CONTRAST PWM output.

Thanks
Guennadi

Quoted 50 lines
---
 drivers/video/mx3fb.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/video/mx3fb.c +8 -4
index 054ef29..772ba3f 100644
@@ -324,8 +324,11 @@ static void sdc_enable_channel(struct mx3fb_info *mx3_fbi)
 	unsigned long flags;
 	dma_cookie_t cookie;
 
-	dev_dbg(mx3fb->dev, "mx3fbi %p, desc %p, sg %p\n", mx3_fbi,
-		to_tx_desc(mx3_fbi->txd), to_tx_desc(mx3_fbi->txd)->sg);
+	if (mx3_fbi->txd)
+		dev_dbg(mx3fb->dev, "mx3fbi %p, desc %p, sg %p\n", mx3_fbi,
+			to_tx_desc(mx3_fbi->txd), to_tx_desc(mx3_fbi->txd)->sg);
+	else
+		dev_dbg(mx3fb->dev, "mx3fbi %p, txd = NULL\n", mx3_fbi);
 
 	/* This enables the channel */
 	if (mx3_fbi->cookie < 0) {
@@ -646,6 +649,7 @@ static int sdc_set_global_alpha(struct mx3fb_data *mx3fb, bool enable, uint8_t a
 
 static void sdc_set_brightness(struct mx3fb_data *mx3fb, uint8_t value)
 {
+	dev_dbg(mx3fb->dev, "%s: value = %d\n", __func__, value);
 	/* This might be board-specific */
 	mx3fb_write_reg(mx3fb, 0x03000000UL | value << 16, SDC_PWM_CTRL);
 	return;
@@ -1486,12 +1490,12 @@ static int mx3fb_probe(struct platform_device *pdev)
 		goto ersdc0;
 	}
 
+	mx3fb->backlight_level = 255;
+
 	ret = init_fb_chan(mx3fb, to_idmac_chan(chan));
 	if (ret < 0)
 		goto eisdc0;
 
-	mx3fb->backlight_level = 255;
-
 	return 0;
 
 eisdc0:
Signature · 1 line
1.6.3.3

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

#2 lore raw

PATCH 1/1 mx3fb: some debug and initialisation fixes.

Quoted 12 lines · Guennadi Liakhovetski
Quoted 4 lines · Alberto Panizzo

Fix the kernel oops when dev_dbg is called with mx3_fbi->txd == NULL

Fix the late initialisation of mx3fb->backlight_level. If not, in the chain of function started by init_fb_chan(), in

__blank() call

Quoted 1 line

sdc_set_brightness(mx3fb, mx3fb->backlight_level) that will shut

down

Quoted 3 lines

the CONTRAST PWM output.

Quoted 6 lines
Quoted 1 line

Thanks
Guennadi

Thanks Guennadi for Acking.
Forgive me, but I not understand well the correct path for pulling this patch to linus tree.
I thought that Sascha was the right maintainer so I cc-ed him. But I am wrong right?

Please can you point me to the right mailing list or maintainer?

Thanks
Alberto!

#3 lore raw

PATCH 1/1 mx3fb: some debug and initialisation fixes.

Quoted 7 lines · Alberto Panizzo

Thanks Guennadi for Acking.
Forgive me, but I not understand well the correct path for pulling this patch to linus tree.
I thought that Sascha was the right maintainer so I cc-ed him. But I am wrong right?

Please can you point me to the right mailing list or maintainer?

scripts/get_maintainer.pl should be able to tell you - the general framebuffer subsystem path is via akpm at the moment.

#4 lore raw

PATCH 1/1 mx3fb: some debug and initialisation fixes.

Quoted 8 lines · Mark Brown
Quoted 5 lines · Alberto Panizzo

Thanks Guennadi for Acking.
Forgive me, but I not understand well the correct path for pulling this patch to linus tree.
I thought that Sascha was the right maintainer so I cc-ed him. But I am wrong right?

Quoted 4 lines
Quoted 1 line

Please can you point me to the right mailing list or maintainer?

scripts/get_maintainer.pl should be able to tell you - the general framebuffer subsystem path is via akpm at the moment.

Thanks