Skip to contentSkip to conversation

am200epd, pxafb, metronomefb changes v7

RFC In review Jaya Kumar 3 participants 11 messages Jul 26, 2008 – Jul 30, 2008

Subsystems (4)
lore
Share & tools
lore

Jaya Kumar

author
#0 lore raw

cover am200epd, pxafb, metronomefb changes v7

Hi Eric, arm and fbdev friends,

This is version 7 of this RFC and contains the following updates:
- replace custom transfer sizes with customized bpp custom_lccr_bpp. Improved comments for what the changes do.
- add gpio_request for BTRST pin in gumstix_bluetooth_init

Thanks to Eric and Russell for feedback.
I will take out DEBUG before final.

This RFC consists of patches intended to improve the condition of the am200epd devkit support. The am200epd devkit contains a gumstix (pxa255) and a carrier board (am200epd or Lyre), and a metronome display controller. Previously, there was a drivers/video/am200epd driver that manipulated pxa LCDC registers and GPSR/GPLR registers directly. That was clearly wrong and broken so I have removed it and written a new mach-pxa am200epd support driver.This driver interfaces with pxafb through a set of callbacks to share/unshare pxafb's framebuffer and achieves the same functionality without manipulating any pxa registers directly. The patches are split as follows:

pxafb: add shared framebuffer interface
gumstix: conversion to MFP support and add bluetooth support
am200epd: convert to shared fb and use gpio api
metronomefb: convert printk to dev_dbg/err messages
metronomefb: changes to use separate framebuffer

I would be grateful for any feedback and advice.

Thanks,
jaya

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

author
#1 lore raw

RFC 1/5 pxafb: add shared framebuffer interface

These changes are to make it possible for a secondary driver to share the pxafb framebuffer. The changes include:
- adding custom_lccr_bpp entry so that a driver can set a specific transfer width on the AMLCD bus while using a separate bits per pixel for its actual framebuffer.
- adding extra_video_mem entry so that a driver can tell pxafb of its additional needs.
- adding share_video_mem/unshare_video_mem callbacks to notify the secondary driver of the framebuffer address, to allow refcounting, and to cleanup on completion.

---
 drivers/video/pxafb.c            |   65 +++++++++++++++++++++++++++++++++-----
 include/asm-arm/arch-pxa/pxafb.h |    8 +++++
 2 files changed, 65 insertions(+), 8 deletions(-)
drivers/video/pxafb.c +57 -8
index bb25143..54e0ad1 100644
@@ -57,6 +57,8 @@
  */
 #define DEBUG_VAR 1
 
+static struct platform_driver pxafb_driver;
+
 #include "pxafb.h"
 
 /* Bits which should not be set in machine configuration structures */
@@ -218,9 +220,25 @@ pxafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
  *  pxafb_bpp_to_lccr3():
  *    Convert a bits per pixel value to the correct bit pattern for LCCR3
  */
-static int pxafb_bpp_to_lccr3(struct fb_var_screeninfo *var)
+static int pxafb_bpp_to_lccr3(struct fb_var_screeninfo *var,
+				struct pxafb_mach_info *inf)
 {
 	int ret = 0;
+
+	/* this is to support devices that have customized
+	 * bpp settings for LCCR that are independent from
+	 * the actual bpp used in the framebuffer.
+	 */
+	if (inf->custom_lccr_bpp) {
+		switch (inf->custom_lccr_bpp) {
+		case 1:  ret = LCCR3_1BPP; break;
+		case 2:  ret = LCCR3_2BPP; break;
+		case 4:  ret = LCCR3_4BPP; break;
+		case 8:  ret = LCCR3_8BPP; break;
+		case 16: ret = LCCR3_16BPP; break;
+		}
+		return ret;
+	}
 	switch (var->bits_per_pixel) {
 	case 1:  ret = LCCR3_1BPP; break;
 	case 2:  ret = LCCR3_2BPP; break;
@@ -826,10 +844,22 @@ int pxafb_smart_flush(struct fb_info *info)
 static void setup_parallel_timing(struct pxafb_info *fbi,
 				  struct fb_var_screeninfo *var)
 {
+	struct pxafb_mach_info *inf = fbi->dev->platform_data;
 	unsigned int lines_per_panel, pcd = get_pcd(fbi, var->pixclock);
+	unsigned int pix_per_line = var->xres;
+
+	/*
+	 * We can have a device that needs a different width for its AMLCD
+	 * transfers than its framebuffer's bits per pixel. So we need to
+	 * divide down the x resolution. Eg: 800 pixels at 8bpp is the fb.
+	 * The device uses 16-bit xfers so the desired result is:
+	 * 800 pixels / ( 16 bit xfer / 8bpp ) = 400 pixels per line
+	 */
+	if (inf->custom_lccr_bpp)
+		pix_per_line /= (inf->custom_lccr_bpp / var->bits_per_pixel);
 
 	fbi->reg_lccr1 =
-		LCCR1_DisWdth(var->xres) +
+		LCCR1_DisWdth(pix_per_line) +
 		LCCR1_HorSnchWdth(var->hsync_len) +
 		LCCR1_BegLnDel(var->left_margin) +
 		LCCR1_EndLnDel(var->right_margin);
@@ -870,6 +900,7 @@ static int pxafb_activate_var(struct fb_var_screeninfo *var,
 {
 	u_long flags;
 	size_t nbytes;
+	struct pxafb_mach_info *inf = fbi->dev->platform_data;
 
 #if DEBUG_VAR
 	if (!(fbi->lccr0 & LCCR0_LCDT)) {
@@ -928,7 +959,7 @@ static int pxafb_activate_var(struct fb_var_screeninfo *var,
 		(LCCR0_LDM | LCCR0_SFM | LCCR0_IUM | LCCR0_EFM |
 		 LCCR0_QDM | LCCR0_BM  | LCCR0_OUM);
 
-	fbi->reg_lccr3 |= pxafb_bpp_to_lccr3(var);
+	fbi->reg_lccr3 |= pxafb_bpp_to_lccr3(var, inf);
 
 	nbytes = var->yres * fbi->fb.fix.line_length;
 
@@ -1304,14 +1335,17 @@ static int pxafb_resume(struct platform_device *dev)
  *      cache.  Once this area is remapped, all virtual memory
  *      access to the video memory should occur at the new region.
  */
-static int __devinit pxafb_map_video_memory(struct pxafb_info *fbi)
+static int __devinit pxafb_map_video_memory(struct pxafb_info *fbi,
+						struct pxafb_mach_info *inf)
 {
+	int ret;
 	/*
 	 * We reserve one page for the palette, plus the size
 	 * of the framebuffer.
 	 */
 	fbi->video_offset = PAGE_ALIGN(sizeof(struct pxafb_dma_buff));
-	fbi->map_size = PAGE_ALIGN(fbi->fb.fix.smem_len + fbi->video_offset);
+	fbi->map_size = PAGE_ALIGN(fbi->fb.fix.smem_len + fbi->video_offset +
+					inf->extra_video_mem);
 	fbi->map_cpu = dma_alloc_writecombine(fbi->dev, fbi->map_size,
 					      &fbi->map_dma, GFP_KERNEL);
 
@@ -1340,6 +1374,13 @@ static int __devinit pxafb_map_video_memory(struct pxafb_info *fbi)
 		fbi->smart_cmds = (uint16_t *) fbi->dma_buff->cmd_buff;
 		fbi->n_smart_cmds = 0;
 #endif
+		if (inf->share_video_mem) {
+			ret = inf->share_video_mem(fbi->fb.screen_base,
+				fbi->screen_dma, pxafb_driver.driver.owner,
+				inf->extra_data);
+			if (ret)
+				return ret;
+		}
 	}
 
 	return fbi->map_cpu ? 0 : -ENOMEM;
@@ -1761,10 +1802,12 @@ static int __devinit pxafb_probe(struct platform_device *dev)
 	}
 
 	/* Initialize video memory */
-	ret = pxafb_map_video_memory(fbi);
-	if (ret) {
+	ret = pxafb_map_video_memory(fbi, inf);
+	if (ret == -ENODEV) {
+		dev_err(&dev->dev, "Failed device binding: %d\n", ret);
+		goto failed_free_mem;
+	} else if (ret) {
 		dev_err(&dev->dev, "Failed to allocate video RAM: %d\n", ret);
-		ret = -ENOMEM;
 		goto failed_free_io;
 	}
 
@@ -1836,6 +1879,8 @@ failed_free_cmap:
 failed_free_irq:
 	free_irq(irq, fbi);
 failed_free_mem:
+	if (inf->unshare_video_mem)
+		inf->unshare_video_mem(inf->extra_data);
 	dma_free_writecombine(&dev->dev, fbi->map_size,
 			fbi->map_cpu, fbi->map_dma);
 failed_free_io:
@@ -1856,6 +1901,7 @@ static int __devexit pxafb_remove(struct platform_device *dev)
 	struct resource *r;
 	int irq;
 	struct fb_info *info;
+	struct pxafb_mach_info *inf;
 
 	if (!fbi)
 		return 0;
@@ -1872,6 +1918,9 @@ static int __devexit pxafb_remove(struct platform_device *dev)
 	irq = platform_get_irq(dev, 0);
 	free_irq(irq, fbi);
 
+	inf = dev->dev.platform_data;
+	if (inf->unshare_video_mem)
+		inf->unshare_video_mem(inf->extra_data);
 	dma_free_writecombine(&dev->dev, fbi->map_size,
 					fbi->map_cpu, fbi->map_dma);
 
include/asm-arm/arch-pxa/pxafb.h +8 -0
index daf018d..c8c3e84 100644
@@ -139,9 +139,17 @@ struct pxafb_mach_info {
 	 * All other bits in LCCR4 should be left alone.
 	 */
 	u_int		lccr4;
+	unsigned int	custom_lccr_bpp; /* custom bpp setting */
+	/* size of extra mem needed for secondary driver */
+	unsigned int	extra_video_mem;
+	void		*extra_data; /* extra data for secondary */
 	void (*pxafb_backlight_power)(int);
 	void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *);
 	void (*smart_update)(struct fb_info *);
+	/* share_video_mem allows client drivers to get our framebuffer */
+	int (*share_video_mem)(char __iomem *, dma_addr_t, struct module *,
+				void *);
+	void (*unshare_video_mem)(void *);
 };
 void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info);
 void set_pxa_fb_parent(struct device *parent_dev);
Signature · 8 lines
1.5.3.6


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
author
#4 lore raw

RFC 2/5 gumstix: conversion to MFP support and add bluetooth support

In reply to Jaya Kumar

This patch converts gumstix over to the MFP configuration system and adds bluetooth support.

---
 arch/arm/mach-pxa/gumstix.c |  100 +++++++++++++++++++++++++++++++++++-------
 1 files changed, 83 insertions(+), 17 deletions(-)
arch/arm/mach-pxa/gumstix.c +83 -17
index bdf2397..49b78e7 100644
@@ -20,8 +20,12 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
+#include <linux/delay.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/gpio.h>
+#include <linux/err.h>
+#include <linux/clk.h>
 
 #include <asm/setup.h>
 #include <asm/memory.h>
@@ -40,7 +44,7 @@
 
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxa2xx-regs.h>
-#include <asm/arch/pxa2xx-gpio.h>
+#include <asm/arch/mfp-pxa25x.h>
 
 #include "generic.h"
 
@@ -85,21 +89,8 @@ static struct platform_device *devices[] __initdata = {
 };
 
 #ifdef CONFIG_MMC_PXA
-static struct pxamci_platform_data gumstix_mci_platform_data;
-
-static int gumstix_mci_init(struct device *dev, irq_handler_t detect_int,
-				void *data)
-{
-	pxa_gpio_mode(GPIO6_MMCCLK_MD);
-	pxa_gpio_mode(GPIO53_MMCCLK_MD);
-	pxa_gpio_mode(GPIO8_MMCCS0_MD);
-
-	return 0;
-}
-
 static struct pxamci_platform_data gumstix_mci_platform_data = {
 	.ocr_mask	= MMC_VDD_32_33|MMC_VDD_33_34,
-	.init		= gumstix_mci_init,
 };
 
 static void __init gumstix_mmc_init(void)
@@ -109,11 +100,11 @@ static void __init gumstix_mmc_init(void)
 #else
 static void __init gumstix_mmc_init(void)
 {
-	printk(KERN_INFO "Gumstix mmc disabled\n");
+	pr_debug("Gumstix mmc disabled\n");
 }
 #endif
 
-#ifdef CONFIG_USB_GADGET_PXA2XX
+#ifdef CONFIG_USB_GADGET_PXA25X
 static struct pxa2xx_udc_mach_info gumstix_udc_info __initdata = {
 	.gpio_vbus		= GPIO_GUMSTIX_USB_GPIOn,
 	.gpio_pullup		= GPIO_GUMSTIX_USB_GPIOx,
@@ -126,12 +117,87 @@ static void __init gumstix_udc_init(void)
 #else
 static void gumstix_udc_init(void)
 {
-	printk(KERN_INFO "Gumstix udc is disabled\n");
+	pr_debug("Gumstix udc is disabled\n");
 }
 #endif
 
+#ifdef CONFIG_BT
+/* Normally, the bootloader would have enabled this 32kHz clock but many
+** boards still have u-boot 1.1.4 so we check if it has been turned on and
+** if not, we turn it on with a warning message. */
+static void gumstix_setup_bt_clock(void)
+{
+	int timeout = 500;
+
+	if (!(OSCC & OSCC_OOK))
+		pr_warning("32kHz clock was not on. Bootloader may need to "
+				"be updated\n");
+	else
+		return;
+
+	OSCC |= OSCC_OON;
+	do {
+		if (OSCC & OSCC_OOK)
+			break;
+		udelay(1);
+	} while (--timeout);
+	if (!timeout)
+		pr_err("Failed to start 32kHz clock\n");
+}
+
+static void __init gumstix_bluetooth_init(void)
+{
+	int err;
+
+	gumstix_setup_bt_clock();
+
+	err = gpio_request(GPIO_GUMSTIX_BTRESET, "BTRST");
+	if (err) {
+		pr_err("gumstix: failed request gpio for bluetooth reset\n");
+		return;
+	}
+
+	err = gpio_direction_output(GPIO_GUMSTIX_BTRESET, 1);
+	if (err) {
+		pr_err("gumstix: can't reset bluetooth\n");
+		return;
+	}
+	gpio_set_value(GPIO_GUMSTIX_BTRESET, 0);
+	udelay(100);
+	gpio_set_value(GPIO_GUMSTIX_BTRESET, 1);
+}
+#else
+static void gumstix_bluetooth_init(void)
+{
+	pr_debug("Gumstix Bluetooth is disabled\n");
+}
+#endif
+
+static unsigned long gumstix_pin_config[] __initdata = {
+	GPIO12_32KHz,
+	/* BTUART */
+	GPIO42_HWUART_RXD,
+	GPIO43_HWUART_TXD,
+	GPIO44_HWUART_CTS,
+	GPIO45_HWUART_RTS,
+	/* MMC */
+	GPIO6_MMC_CLK,
+	GPIO53_MMC_CLK,
+	GPIO8_MMC_CS0,
+	/* these are used by AM200EPD */
+	GPIO51_GPIO,
+	GPIO49_GPIO,
+	GPIO48_GPIO,
+	GPIO32_GPIO,
+	GPIO17_GPIO,
+	GPIO16_GPIO,
+};
+
 static void __init gumstix_init(void)
 {
+	pxa2xx_mfp_config(ARRAY_AND_SIZE(gumstix_pin_config));
+
+	gumstix_bluetooth_init();
 	gumstix_udc_init();
 	gumstix_mmc_init();
 	(void) platform_add_devices(devices, ARRAY_SIZE(devices));
Signature · 8 lines
1.5.3.6


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
author
#5 lore raw

RFC 3/5 am200epd: convert to shared fb and use gpio api

In reply to Jaya Kumar

The original am200epd driver was designed with bad assumptions. It manipulated GPSR/GPLR registers directly. It relied on direct access to the pxa LCDC registers which have since conflicted with commit ce4fb7b892a6d6c6a0f87366b26fd834d2923dd7 . This patch moves it into mach-pxa and overhauls it to use pxafb's fb. It now uses the generic GPIO api.

---
 arch/arm/mach-pxa/Kconfig    |    3 +
 arch/arm/mach-pxa/Makefile   |    1 +
 arch/arm/mach-pxa/am200epd.c |  326 ++++++++++++++++++++++++++++++++++++++++++
 drivers/video/Kconfig        |   13 --
 drivers/video/Makefile       |    1 -
 drivers/video/am200epd.c     |  295 --------------------------------------
 6 files changed, 330 insertions(+), 309 deletions(-)
 create mode 100644 arch/arm/mach-pxa/am200epd.c
 delete mode 100644 drivers/video/am200epd.c
arch/arm/mach-pxa/Kconfig +3 -0
index 3e28521..945014e 100644
@@ -243,6 +243,9 @@ config PCM990_DISPLAY_NONE
 
 endchoice
 
+config MACH_AM200EPD
+	depends on MACH_GUMSTIX_F
+	bool "Enable AM200EPD board support"
 
 config PXA_EZX
 	bool "Motorola EZX Platform"
arch/arm/mach-pxa/Makefile +1 -0
index 5220a5c..618fe96 100644
@@ -21,6 +21,7 @@ obj-$(CONFIG_CPU_PXA320)	+= pxa320.o
 
 # Specific board support
 obj-$(CONFIG_ARCH_GUMSTIX)	+= gumstix.o
+obj-$(CONFIG_MACH_AM200EPD)	+= am200epd.o
 obj-$(CONFIG_ARCH_LUBBOCK)	+= lubbock.o
 obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
 obj-$(CONFIG_MACH_MAINSTONE)	+= mainstone.o
arch/arm/mach-pxa/am200epd.c new file +326 -0

326 lines not on this page · raw message

drivers/video/Kconfig +0 -13
index e0c5f96..752907d 100644
@@ -1938,19 +1938,6 @@ config FB_XILINX
 	  framebuffer. ML300 carries a 640*480 LCD display on the board,
 	  ML403 uses a standard DB15 VGA connector.
 
-config FB_AM200EPD
-       tristate "AM-200 E-Ink EPD devkit support"
-       depends on FB && ARCH_PXA && MMU
-       select FB_SYS_FILLRECT
-       select FB_SYS_COPYAREA
-       select FB_SYS_IMAGEBLIT
-       select FB_SYS_FOPS
-       select FB_DEFERRED_IO
-       select FB_METRONOME
-       help
-         This enables support for the Metronome display controller used on
-         the E-Ink AM-200 EPD devkit.
-
 config FB_VIRTUAL
 	tristate "Virtual Frame Buffer support (ONLY FOR TESTING!)"
 	depends on FB
drivers/video/Makefile +0 -1
index 04bca35..80d5842 100644
@@ -29,7 +29,6 @@ obj-$(CONFIG_FB_DEFERRED_IO)   += fb_defio.o
 
 # Hardware specific drivers go first
 obj-$(CONFIG_FB_AMIGA)            += amifb.o c2p.o
-obj-$(CONFIG_FB_AM200EPD)         += am200epd.o
 obj-$(CONFIG_FB_ARC)              += arcfb.o
 obj-$(CONFIG_FB_CLPS711X)         += clps711xfb.o
 obj-$(CONFIG_FB_CYBER2000)        += cyber2000fb.o
drivers/video/am200epd.c deleted +0 -295

295 lines not on this page · raw message

Signature · 8 lines
1.5.3.6


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
author
#7 lore raw

RFC 4/5 metronomefb: convert printk to dev_dbg/err messages

In reply to Jaya Kumar

This patch converts the printk messages in metronomefb to dev_dbg/err type messages.

---
 drivers/video/metronomefb.c |   49 +++++++++++++++++++-----------------------
 1 files changed, 22 insertions(+), 27 deletions(-)
drivers/video/metronomefb.c +22 -27
index cc4c038..8ccd113 100644
@@ -18,6 +18,8 @@
  * is provided as am200epd.c
  *
  */
+#define DEBUG 1
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -40,15 +42,6 @@
 
 #include <asm/unaligned.h>
 
-
-#define DEBUG 1
-#ifdef DEBUG
-#define DPRINTK(f, a...) printk(KERN_DEBUG "%s: " f, __func__ , ## a)
-#else
-#define DPRINTK(f, a...)
-#endif
-
-
 /* Display specific information */
 #define DPY_W 832
 #define DPY_H 622
@@ -135,8 +128,8 @@ static u16 calc_img_cksum(u16 *start, int length)
 
 /* here we decode the incoming waveform file and populate metromem */
 #define EXP_WFORM_SIZE 47001
-static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
-				u8 *frame_count)
+static int __devinit load_waveform(u8 *mem, size_t size, int m, int t,
+				struct metronomefb_par *par)
 {
 	int tta;
 	int wmta;
@@ -148,9 +141,11 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
 	int wfm_idx, owfm_idx;
 	int mem_idx = 0;
 	struct waveform_hdr *wfm_hdr;
+	u8 *metromem = par->metromem_wfm;
+	struct device *dev = par->info->dev;
 
 	if (size != EXP_WFORM_SIZE) {
-		printk(KERN_ERR "Error: unexpected size %d != %d\n", size,
+		dev_err(dev, "Error: unexpected size %d != %d\n", size,
 					EXP_WFORM_SIZE);
 		return -EINVAL;
 	}
@@ -158,16 +153,16 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
 	wfm_hdr = (struct waveform_hdr *) mem;
 
 	if (wfm_hdr->fvsn != 1) {
-		printk(KERN_ERR "Error: bad fvsn %x\n", wfm_hdr->fvsn);
+		dev_err(dev, "Error: bad fvsn %x\n", wfm_hdr->fvsn);
 		return -EINVAL;
 	}
 	if (wfm_hdr->luts != 0) {
-		printk(KERN_ERR "Error: bad luts %x\n", wfm_hdr->luts);
+		dev_err(dev, "Error: bad luts %x\n", wfm_hdr->luts);
 		return -EINVAL;
 	}
 	cksum = calc_cksum(32, 47, mem);
 	if (cksum != wfm_hdr->wfm_cs) {
-		printk(KERN_ERR "Error: bad cksum %x != %x\n", cksum,
+		dev_err(dev, "Error: bad cksum %x != %x\n", cksum,
 					wfm_hdr->wfm_cs);
 		return -EINVAL;
 	}
@@ -175,7 +170,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
 	wfm_hdr->trc += 1;
 	for (i = 0; i < 5; i++) {
 		if (*(wfm_hdr->stuff2a + i) != 0) {
-			printk(KERN_ERR "Error: unexpected value in padding\n");
+			dev_err(dev, "Error: unexpected value in padding\n");
 			return -EINVAL;
 		}
 	}
@@ -200,7 +195,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
 		return -EINVAL;
 	cksum = calc_cksum(sizeof(*wfm_hdr), cksum_idx, mem);
 	if (cksum != mem[cksum_idx]) {
-		printk(KERN_ERR "Error: bad temperature range table cksum"
+		dev_err(dev, "Error: bad temperature range table cksum"
 				" %x != %x\n", cksum, mem[cksum_idx]);
 		return -EINVAL;
 	}
@@ -212,7 +207,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
 		return -EINVAL;
 	cksum = calc_cksum(cksum_idx - 3, cksum_idx, mem);
 	if (cksum != mem[cksum_idx]) {
-		printk(KERN_ERR "Error: bad mode table address cksum"
+		dev_err(dev, "Error: bad mode table address cksum"
 				" %x != %x\n", cksum, mem[cksum_idx]);
 		return -EINVAL;
 	}
@@ -224,7 +219,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
 		return -EINVAL;
 	cksum = calc_cksum(cksum_idx - 3, cksum_idx, mem);
 	if (cksum != mem[cksum_idx]) {
-		printk(KERN_ERR "Error: bad temperature table address cksum"
+		dev_err(dev, "Error: bad temperature table address cksum"
 			" %x != %x\n", cksum, mem[cksum_idx]);
 		return -EINVAL;
 	}
@@ -259,11 +254,11 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
 		return -EINVAL;
 	cksum = calc_cksum(owfm_idx, cksum_idx, mem);
 	if (cksum != mem[cksum_idx]) {
-		printk(KERN_ERR "Error: bad waveform data cksum"
+		dev_err(dev, "Error: bad waveform data cksum"
 				" %x != %x\n", cksum, mem[cksum_idx]);
 		return -EINVAL;
 	}
-	*frame_count = (mem_idx/64);
+	par->frame_count = (mem_idx/64);
 
 	return 0;
 }
@@ -662,15 +657,15 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
 		b) process waveform and decode into metromem */
 	retval = request_firmware(&fw_entry, "metronome.wbf", &dev->dev);
 	if (retval < 0) {
-		printk(KERN_ERR "metronomefb: couldn't get waveform\n");
+		dev_err(&dev->dev, "Failed to get waveform\n");
 		goto err_dma_free;
 	}
 
-	retval = load_waveform((u8 *) fw_entry->data, fw_entry->size,
-				par->metromem_wfm, 3, 31, &par->frame_count);
+	retval = load_waveform((u8 *) fw_entry->data, fw_entry->size, 3, 31,
+				par);
 	release_firmware(fw_entry);
 	if (retval < 0) {
-		printk(KERN_ERR "metronomefb: couldn't process waveform\n");
+		dev_err(&dev->dev, "Failed processing waveform\n");
 		goto err_dma_free;
 	}
 
@@ -688,7 +683,7 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
 
 	retval = fb_alloc_cmap(&info->cmap, 8, 0);
 	if (retval < 0) {
-		printk(KERN_ERR "Failed to allocate colormap\n");
+		dev_err(&dev->dev, "Failed to allocate colormap\n");
 		goto err_fb_rel;
 	}
 
@@ -704,7 +699,7 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
 
 	platform_set_drvdata(dev, info);
 
-	printk(KERN_INFO
+	dev_dbg(&dev->dev,
 		"fb%d: Metronome frame buffer device, using %dK of video"
 		" memory\n", info->node, videomemorysize >> 10);
 
Signature · 8 lines
1.5.3.6


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
author
#10 lore raw

RFC 5/5 metronomefb: changes to use separate framebuffer

In reply to Jaya Kumar

These changes are used in order to support the use of a separate framebuffer provided by the platform device driver. Other changes are cleanup to error handling and order of release.

---
 drivers/video/Kconfig       |   18 +++-
 drivers/video/metronomefb.c |  225 +++++++++++++++++++++++++------------------
 include/video/metronomefb.h |   22 ++---
 3 files changed, 151 insertions(+), 114 deletions(-)
drivers/video/Kconfig +13 -5
index 752907d..dda770c 100644
@@ -172,11 +172,6 @@ config FB_DEFERRED_IO
 	bool
 	depends on FB
 
-config FB_METRONOME
-	tristate
-	depends on FB
-	depends on FB_DEFERRED_IO
-
 config FB_HECUBA
 	tristate
 	depends on FB
@@ -1975,6 +1970,19 @@ config XEN_FBDEV_FRONTEND
 	  frame buffer driver.  It communicates with a back-end
 	  in another domain.
 
+config FB_METRONOME
+	tristate "E-Ink Metronome/8track controller support"
+	depends on FB
+	select FB_SYS_FILLRECT
+	select FB_SYS_COPYAREA
+	select FB_SYS_IMAGEBLIT
+	select FB_SYS_FOPS
+	select FB_DEFERRED_IO
+	help
+	  This driver implements support for the E-Ink Metronome
+	  controller. The pre-release name for this device was 8track
+	  and could also have been called by some vendors as PVI-nnnn.
+
 source "drivers/video/omap/Kconfig"
 
 source "drivers/video/backlight/Kconfig"
drivers/video/metronomefb.c +131 -94

379 lines not on this page · raw message

include/video/metronomefb.h +7 -15
index dab04b4..79444cd 100644
@@ -12,14 +12,6 @@
 #ifndef _LINUX_METRONOMEFB_H_
 #define _LINUX_METRONOMEFB_H_
 
-/* address and control descriptors used by metronome controller */
-struct metromem_desc {
-	u32 mFDADR0;
-	u32 mFSADR0;
-	u32 mFIDR0;
-	u32 mLDCMD0;
-};
-
 /* command structure used by metronome controller */
 struct metromem_cmd {
 	u16 opcode;
@@ -30,33 +22,33 @@ struct metromem_cmd {
 /* struct used by metronome. board specific stuff comes from *board */
 struct metronomefb_par {
 	unsigned char *metromem;
-	struct metromem_desc *metromem_desc;
 	struct metromem_cmd *metromem_cmd;
 	unsigned char *metromem_wfm;
 	unsigned char *metromem_img;
 	u16 *metromem_img_csum;
 	u16 *csum_table;
-	int metromemsize;
 	dma_addr_t metromem_dma;
-	dma_addr_t metromem_desc_dma;
 	struct fb_info *info;
 	struct metronome_board *board;
 	wait_queue_head_t waitq;
 	u8 frame_count;
+	int extra_size;
+	int dt;
 };
 
 /* board specific routines */
 struct metronome_board {
 	struct module *owner;
-	void (*free_irq)(struct fb_info *);
-	void (*init_gpio_regs)(struct metronomefb_par *);
-	void (*init_lcdc_regs)(struct metronomefb_par *);
-	void (*post_dma_setup)(struct metronomefb_par *);
+	struct module *fbmaster;
 	void (*set_rst)(struct metronomefb_par *, int);
 	void (*set_stdby)(struct metronomefb_par *, int);
+	void (*cleanup)(struct metronomefb_par *);
 	int (*met_wait_event)(struct metronomefb_par *);
 	int (*met_wait_event_intr)(struct metronomefb_par *);
 	int (*setup_irq)(struct fb_info *);
+	int (*setup_fb)(struct metronomefb_par *);
+	int (*setup_io)(struct metronomefb_par *);
+	int (*get_panel_type)(void);
 };
 
 #endif
Signature · 8 lines
1.5.3.6


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Acked-by on v1 1/5
#2 lore raw

Re: [RFC 2.6.26-rc9 1/5] pxafb: add shared framebuffer interface

In reply to Jaya Kumar
Quoted 11 lines · On Sat, 26 Jul 2008 00:32:50 -0400 Jaya Kumar <[email protected]> wrote:

These changes are to make it possible for a secondary driver to share the pxafb framebuffer. The changes include:
- adding custom_lccr_bpp entry so that a driver can set a specific transfer width on the AMLCD bus while using a separate bits per pixel for its actual framebuffer.
- adding extra_video_mem entry so that a driver can tell pxafb of its additional needs.
- adding share_video_mem/unshare_video_mem callbacks to notify the secondary driver of the framebuffer address, to allow refcounting, and to cleanup on completion.

Quoted 1 line

Jaya,

This patch was already Acked-by Eric Miao. Please decide if you want to upload it into the RMK's patch system or I should CC it to Andrew Morton. Please add Acked-by tags to patches you post if they are already Acked-by.

Please upload/sent first Acked-by patches to correct persons for merge and repost only not accepted ones. Whole your work will be merged this step by step approach.

Regards,
Krzysztof

Quoted 194 lines
---
 drivers/video/pxafb.c            |   65 +++++++++++++++++++++++++++++++++-----
 include/asm-arm/arch-pxa/pxafb.h |    8 +++++
 2 files changed, 65 insertions(+), 8 deletions(-)
drivers/video/pxafb.c +57 -8
index bb25143..54e0ad1 100644
@@ -57,6 +57,8 @@
  */
 #define DEBUG_VAR 1
 
+static struct platform_driver pxafb_driver;
+
 #include "pxafb.h"
 
 /* Bits which should not be set in machine configuration structures */
@@ -218,9 +220,25 @@ pxafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
  *  pxafb_bpp_to_lccr3():
  *    Convert a bits per pixel value to the correct bit pattern for LCCR3
  */
-static int pxafb_bpp_to_lccr3(struct fb_var_screeninfo *var)
+static int pxafb_bpp_to_lccr3(struct fb_var_screeninfo *var,
+				struct pxafb_mach_info *inf)
 {
 	int ret = 0;
+
+	/* this is to support devices that have customized
+	 * bpp settings for LCCR that are independent from
+	 * the actual bpp used in the framebuffer.
+	 */
+	if (inf->custom_lccr_bpp) {
+		switch (inf->custom_lccr_bpp) {
+		case 1:  ret = LCCR3_1BPP; break;
+		case 2:  ret = LCCR3_2BPP; break;
+		case 4:  ret = LCCR3_4BPP; break;
+		case 8:  ret = LCCR3_8BPP; break;
+		case 16: ret = LCCR3_16BPP; break;
+		}
+		return ret;
+	}
 	switch (var->bits_per_pixel) {
 	case 1:  ret = LCCR3_1BPP; break;
 	case 2:  ret = LCCR3_2BPP; break;
@@ -826,10 +844,22 @@ int pxafb_smart_flush(struct fb_info *info)
 static void setup_parallel_timing(struct pxafb_info *fbi,
 				  struct fb_var_screeninfo *var)
 {
+	struct pxafb_mach_info *inf = fbi->dev->platform_data;
 	unsigned int lines_per_panel, pcd = get_pcd(fbi, var->pixclock);
+	unsigned int pix_per_line = var->xres;
+
+	/*
+	 * We can have a device that needs a different width for its AMLCD
+	 * transfers than its framebuffer's bits per pixel. So we need to
+	 * divide down the x resolution. Eg: 800 pixels at 8bpp is the fb.
+	 * The device uses 16-bit xfers so the desired result is:
+	 * 800 pixels / ( 16 bit xfer / 8bpp ) = 400 pixels per line
+	 */
+	if (inf->custom_lccr_bpp)
+		pix_per_line /= (inf->custom_lccr_bpp / var->bits_per_pixel);
 
 	fbi->reg_lccr1 =
-		LCCR1_DisWdth(var->xres) +
+		LCCR1_DisWdth(pix_per_line) +
 		LCCR1_HorSnchWdth(var->hsync_len) +
 		LCCR1_BegLnDel(var->left_margin) +
 		LCCR1_EndLnDel(var->right_margin);
@@ -870,6 +900,7 @@ static int pxafb_activate_var(struct fb_var_screeninfo *var,
 {
 	u_long flags;
 	size_t nbytes;
+	struct pxafb_mach_info *inf = fbi->dev->platform_data;
 
 #if DEBUG_VAR
 	if (!(fbi->lccr0 & LCCR0_LCDT)) {
@@ -928,7 +959,7 @@ static int pxafb_activate_var(struct fb_var_screeninfo *var,
 		(LCCR0_LDM | LCCR0_SFM | LCCR0_IUM | LCCR0_EFM |
 		 LCCR0_QDM | LCCR0_BM  | LCCR0_OUM);
 
-	fbi->reg_lccr3 |= pxafb_bpp_to_lccr3(var);
+	fbi->reg_lccr3 |= pxafb_bpp_to_lccr3(var, inf);
 
 	nbytes = var->yres * fbi->fb.fix.line_length;
 
@@ -1304,14 +1335,17 @@ static int pxafb_resume(struct platform_device *dev)
  *      cache.  Once this area is remapped, all virtual memory
  *      access to the video memory should occur at the new region.
  */
-static int __devinit pxafb_map_video_memory(struct pxafb_info *fbi)
+static int __devinit pxafb_map_video_memory(struct pxafb_info *fbi,
+						struct pxafb_mach_info *inf)
 {
+	int ret;
 	/*
 	 * We reserve one page for the palette, plus the size
 	 * of the framebuffer.
 	 */
 	fbi->video_offset = PAGE_ALIGN(sizeof(struct pxafb_dma_buff));
-	fbi->map_size = PAGE_ALIGN(fbi->fb.fix.smem_len + fbi->video_offset);
+	fbi->map_size = PAGE_ALIGN(fbi->fb.fix.smem_len + fbi->video_offset +
+					inf->extra_video_mem);
 	fbi->map_cpu = dma_alloc_writecombine(fbi->dev, fbi->map_size,
 					      &fbi->map_dma, GFP_KERNEL);
 
@@ -1340,6 +1374,13 @@ static int __devinit pxafb_map_video_memory(struct pxafb_info *fbi)
 		fbi->smart_cmds = (uint16_t *) fbi->dma_buff->cmd_buff;
 		fbi->n_smart_cmds = 0;
 #endif
+		if (inf->share_video_mem) {
+			ret = inf->share_video_mem(fbi->fb.screen_base,
+				fbi->screen_dma, pxafb_driver.driver.owner,
+				inf->extra_data);
+			if (ret)
+				return ret;
+		}
 	}
 
 	return fbi->map_cpu ? 0 : -ENOMEM;
@@ -1761,10 +1802,12 @@ static int __devinit pxafb_probe(struct platform_device *dev)
 	}
 
 	/* Initialize video memory */
-	ret = pxafb_map_video_memory(fbi);
-	if (ret) {
+	ret = pxafb_map_video_memory(fbi, inf);
+	if (ret == -ENODEV) {
+		dev_err(&dev->dev, "Failed device binding: %d\n", ret);
+		goto failed_free_mem;
+	} else if (ret) {
 		dev_err(&dev->dev, "Failed to allocate video RAM: %d\n", ret);
-		ret = -ENOMEM;
 		goto failed_free_io;
 	}
 
@@ -1836,6 +1879,8 @@ failed_free_cmap:
 failed_free_irq:
 	free_irq(irq, fbi);
 failed_free_mem:
+	if (inf->unshare_video_mem)
+		inf->unshare_video_mem(inf->extra_data);
 	dma_free_writecombine(&dev->dev, fbi->map_size,
 			fbi->map_cpu, fbi->map_dma);
 failed_free_io:
@@ -1856,6 +1901,7 @@ static int __devexit pxafb_remove(struct platform_device *dev)
 	struct resource *r;
 	int irq;
 	struct fb_info *info;
+	struct pxafb_mach_info *inf;
 
 	if (!fbi)
 		return 0;
@@ -1872,6 +1918,9 @@ static int __devexit pxafb_remove(struct platform_device *dev)
 	irq = platform_get_irq(dev, 0);
 	free_irq(irq, fbi);
 
+	inf = dev->dev.platform_data;
+	if (inf->unshare_video_mem)
+		inf->unshare_video_mem(inf->extra_data);
 	dma_free_writecombine(&dev->dev, fbi->map_size,
 					fbi->map_cpu, fbi->map_dma);
 
include/asm-arm/arch-pxa/pxafb.h +8 -0
index daf018d..c8c3e84 100644
@@ -139,9 +139,17 @@ struct pxafb_mach_info {
 	 * All other bits in LCCR4 should be left alone.
 	 */
 	u_int		lccr4;
+	unsigned int	custom_lccr_bpp; /* custom bpp setting */
+	/* size of extra mem needed for secondary driver */
+	unsigned int	extra_video_mem;
+	void		*extra_data; /* extra data for secondary */
 	void (*pxafb_backlight_power)(int);
 	void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *);
 	void (*smart_update)(struct fb_info *);
+	/* share_video_mem allows client drivers to get our framebuffer */
+	int (*share_video_mem)(char __iomem *, dma_addr_t, struct module *,
+				void *);
+	void (*unshare_video_mem)(void *);
 };
 void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info);
 void set_pxa_fb_parent(struct device *parent_dev);
Signature · 7 lines
1.5.3.6


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

----------------------------------------------------------------------
Nie dla mieczakow!
Sprawdz >>> http://link.interia.pl/f1e93

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

author
#3 lore raw

Re: [RFC 2.6.26-rc9 1/5] pxafb: add shared framebuffer interface

Quoted 16 lines · Krzysztof Helt
Quoted 11 lines · On Sat, 26 Jul 2008 00:32:50 -0400 Jaya Kumar <[email protected]> wrote:

These changes are to make it possible for a secondary driver to share the pxafb framebuffer. The changes include:
- adding custom_lccr_bpp entry so that a driver can set a specific transfer width on the AMLCD bus while using a separate bits per pixel for its actual framebuffer.
- adding extra_video_mem entry so that a driver can tell pxafb of its additional needs.
- adding share_video_mem/unshare_video_mem callbacks to notify the secondary driver of the framebuffer address, to allow refcounting, and to cleanup on completion.

Quoted 1 line
Quoted 9 lines

Jaya,

This patch was already Acked-by Eric Miao. Please decide if you want to upload it into the RMK's patch system or I should CC it to Andrew Morton. Please add Acked-by tags to patches you post if they are already Acked-by.

Hi Krzysztof,

Thanks. My intention is to eventually push this set to rmk. Of the original 10 of this set, I've pushed 4 to rmk which I think are already in Linus's tree now.

I'll add the acked-by tags to this set when I post next. I was being cautious about keeping acked-by tags on patches where I've made changes even if minor. :-)

I think Eric has acked patch #2, the MFP conversion. But this add shared fb interface to pxafb, patch #1 hasn't received his ack yet so I am seeking his approval before submitting to rmk.

Thanks,
jaya

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

#6 lore raw

Re: [RFC 2.6.26-rc9 3/5] am200epd: convert to shared fb and use gpio api

In reply to Jaya Kumar
Quoted 5 lines · Jaya Kumar

The original am200epd driver was designed with bad assumptions. It manipulated GPSR/GPLR registers directly. It relied on direct access to the pxa LCDC registers which have since conflicted with commit ce4fb7b892a6d6c6a0f87366b26fd834d2923dd7 . This patch moves it into mach-pxa and overhauls it to use pxafb's fb. It now uses the generic GPIO api.

Is it possible for a separate patch for the GPIO conversion, which I'm totally happy with. And that's going to make review and merging a bit quicker.

Thanks.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

#8 lore raw

Re: [RFC 2.6.26-rc9 4/5] metronomefb: convert printk to dev_dbg/err messages

In reply to Jaya Kumar
Quoted 3 lines · Jaya Kumar

This patch converts the printk messages in metronomefb to dev_dbg/err type messages.

I think this is already Acked (except for the DEBUG definition), so it would probably nice if you can re-order the patch series and put this in the front, so the next time we can focus on those patches with concerns only, and get things merged a bit quicker.

That will take you sometime, though. Sorry about that and thanks for the good work.

Quoted 175 lines
---
 drivers/video/metronomefb.c |   49 +++++++++++++++++++-----------------------
 1 files changed, 22 insertions(+), 27 deletions(-)
drivers/video/metronomefb.c +22 -28
index cc4c038..8ccd113 100644
@@ -18,6 +18,8 @@
 * is provided as am200epd.c
 *
 */
+#define DEBUG 1
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -40,15 +42,6 @@
 
 #include <asm/unaligned.h>
 
-
-#define DEBUG 1
-#ifdef DEBUG
-#define DPRINTK(f, a...) printk(KERN_DEBUG "%s: " f, __func__ , ## a)
-#else
-#define DPRINTK(f, a...)
-#endif
-
-
 /* Display specific information */
 #define DPY_W 832
 #define DPY_H 622
@@ -135,8 +128,8 @@ static u16 calc_img_cksum(u16 *start, int length)
 
 /* here we decode the incoming waveform file and populate metromem */
 #define EXP_WFORM_SIZE 47001
-static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
-                               u8 *frame_count)
+static int __devinit load_waveform(u8 *mem, size_t size, int m, int t,
+                               struct metronomefb_par *par)
 {
       int tta;
       int wmta;
@@ -148,9 +141,11 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
       int wfm_idx, owfm_idx;
       int mem_idx = 0;
       struct waveform_hdr *wfm_hdr;
+       u8 *metromem = par->metromem_wfm;
+       struct device *dev = par->info->dev;
 
       if (size != EXP_WFORM_SIZE) {
-               printk(KERN_ERR "Error: unexpected size %d != %d\n", size,
+               dev_err(dev, "Error: unexpected size %d != %d\n", size,
                                       EXP_WFORM_SIZE);
               return -EINVAL;
       }
@@ -158,16 +153,16 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
       wfm_hdr = (struct waveform_hdr *) mem;
 
       if (wfm_hdr->fvsn != 1) {
-               printk(KERN_ERR "Error: bad fvsn %x\n", wfm_hdr->fvsn);
+               dev_err(dev, "Error: bad fvsn %x\n", wfm_hdr->fvsn);
               return -EINVAL;
       }
       if (wfm_hdr->luts != 0) {
-               printk(KERN_ERR "Error: bad luts %x\n", wfm_hdr->luts);
+               dev_err(dev, "Error: bad luts %x\n", wfm_hdr->luts);
               return -EINVAL;
       }
       cksum = calc_cksum(32, 47, mem);
       if (cksum != wfm_hdr->wfm_cs) {
-               printk(KERN_ERR "Error: bad cksum %x != %x\n", cksum,
+               dev_err(dev, "Error: bad cksum %x != %x\n", cksum,
                                       wfm_hdr->wfm_cs);
               return -EINVAL;
       }
@@ -175,7 +170,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
       wfm_hdr->trc += 1;
       for (i = 0; i < 5; i++) {
               if (*(wfm_hdr->stuff2a + i) != 0) {
-                       printk(KERN_ERR "Error: unexpected value in padding\n");
+                       dev_err(dev, "Error: unexpected value in padding\n");
                       return -EINVAL;
               }
       }
@@ -200,7 +195,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
               return -EINVAL;
       cksum = calc_cksum(sizeof(*wfm_hdr), cksum_idx, mem);
       if (cksum != mem[cksum_idx]) {
-               printk(KERN_ERR "Error: bad temperature range table cksum"
+               dev_err(dev, "Error: bad temperature range table cksum"
                               " %x != %x\n", cksum, mem[cksum_idx]);
               return -EINVAL;
       }
@@ -212,7 +207,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
               return -EINVAL;
       cksum = calc_cksum(cksum_idx - 3, cksum_idx, mem);
       if (cksum != mem[cksum_idx]) {
-               printk(KERN_ERR "Error: bad mode table address cksum"
+               dev_err(dev, "Error: bad mode table address cksum"
                               " %x != %x\n", cksum, mem[cksum_idx]);
               return -EINVAL;
       }
@@ -224,7 +219,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
               return -EINVAL;
       cksum = calc_cksum(cksum_idx - 3, cksum_idx, mem);
       if (cksum != mem[cksum_idx]) {
-               printk(KERN_ERR "Error: bad temperature table address cksum"
+               dev_err(dev, "Error: bad temperature table address cksum"
                       " %x != %x\n", cksum, mem[cksum_idx]);
               return -EINVAL;
       }
@@ -259,11 +254,11 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
               return -EINVAL;
       cksum = calc_cksum(owfm_idx, cksum_idx, mem);
       if (cksum != mem[cksum_idx]) {
-               printk(KERN_ERR "Error: bad waveform data cksum"
+               dev_err(dev, "Error: bad waveform data cksum"
                               " %x != %x\n", cksum, mem[cksum_idx]);
               return -EINVAL;
       }
-       *frame_count = (mem_idx/64);
+       par->frame_count = (mem_idx/64);
 
       return 0;
 }
@@ -662,15 +657,15 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
               b) process waveform and decode into metromem */
       retval = request_firmware(&fw_entry, "metronome.wbf", &dev->dev);
       if (retval < 0) {
-               printk(KERN_ERR "metronomefb: couldn't get waveform\n");
+               dev_err(&dev->dev, "Failed to get waveform\n");
               goto err_dma_free;
       }
 
-       retval = load_waveform((u8 *) fw_entry->data, fw_entry->size,
-                               par->metromem_wfm, 3, 31, &par->frame_count);
+       retval = load_waveform((u8 *) fw_entry->data, fw_entry->size, 3, 31,
+                               par);
       release_firmware(fw_entry);
       if (retval < 0) {
-               printk(KERN_ERR "metronomefb: couldn't process waveform\n");
+               dev_err(&dev->dev, "Failed processing waveform\n");
               goto err_dma_free;
       }
 
@@ -688,7 +683,7 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
 
       retval = fb_alloc_cmap(&info->cmap, 8, 0);
       if (retval < 0) {
-               printk(KERN_ERR "Failed to allocate colormap\n");
+               dev_err(&dev->dev, "Failed to allocate colormap\n");
               goto err_fb_rel;
       }
 
@@ -704,7 +699,7 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
 
       platform_set_drvdata(dev, info);
 
-       printk(KERN_INFO
+       dev_dbg(&dev->dev,
               "fb%d: Metronome frame buffer device, using %dK of video"
               " memory\n", info->node, videomemorysize >> 10);
 
--

1.5.3.6

-------------------------------------------------------------------

List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php
Signature · 8 lines
Cheers
- eric

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
author
#9 lore raw

Re: [RFC 2.6.26-rc9 4/5] metronomefb: convert printk to dev_dbg/err messages

Quoted 5 lines · Eric Miao
Quoted 3 lines · Jaya Kumar

This patch converts the printk messages in metronomefb to dev_dbg/err type messages.

Quoted 7 lines

I think this is already Acked (except for the DEBUG definition), so it would probably nice if you can re-order the patch series and put this in the front, so the next time we can focus on those patches with concerns only, and get things merged a bit quicker.

That will take you sometime, though. Sorry about that and thanks for the good work.

Hi Eric,

No worries. Yup, I'll take DEBUG out before posting final. Thanks for the review.

Regards,
jaya

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/