Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Final Notice
From: Y/Msn @ 2011-12-08 16:54 UTC (permalink / raw)
  To: linux-fbdev

Dear Internet User!

Congratulations! you and your family have won 500,000 GBP from the
Microsoft Family Benefit 2011 for being a regular web user.Your winnings
has been
submitted to BARCLAYS BANK OF SCOTLAND. Contact the Bank with your full
info for claims.:

Send mail to the Transfer Manager:

Transfer Manager: Robert Williams
Email: barclays_transfer_group_dept@hotmail.com

Bank Name: Barclays Bank Of Scotland

1.Name:
2.Address:
3.Telephone Number:
4.Sex:
Account Name:
Account Number:
Bank Name:


Please use this as a subject of contact : TRANSFER/NUM/1090.

Congratulations!!!
Microsoft Window


^ permalink raw reply

* [PATCH] drivers/video: fsl-diu-fb: rename "machine_data_" to "data"
From: Timur Tabi @ 2011-12-08 23:27 UTC (permalink / raw)
  To: linux-fbdev

"machine_data" is too long and clunky, and the "machine" part doesn't make
much sense, anyway.

Signed-off-by: Timur Tabi <timur@freescale.com>
---
 drivers/video/fsl-diu-fb.c |  236 ++++++++++++++++++++++----------------------
 1 files changed, 116 insertions(+), 120 deletions(-)

diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 4d54188..408272c 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -509,8 +509,8 @@ static void fsl_diu_enable_panel(struct fb_info *info)
 {
 	struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
 	struct diu_ad *ad = mfbi->ad;
-	struct fsl_diu_data *machine_data = mfbi->parent;
-	struct diu __iomem *hw = machine_data->diu_reg;
+	struct fsl_diu_data *data = mfbi->parent;
+	struct diu __iomem *hw = data->diu_reg;
 
 	switch (mfbi->index) {
 	case PLANE0:
@@ -518,7 +518,7 @@ static void fsl_diu_enable_panel(struct fb_info *info)
 			wr_reg_wa(&hw->desc[0], ad->paddr);
 		break;
 	case PLANE1_AOI0:
-		cmfbi = &machine_data->mfb[2];
+		cmfbi = &data->mfb[2];
 		if (hw->desc[1] != ad->paddr) {	/* AOI0 closed */
 			if (cmfbi->count > 0)	/* AOI1 open */
 				ad->next_ad @@ -529,7 +529,7 @@ static void fsl_diu_enable_panel(struct fb_info *info)
 		}
 		break;
 	case PLANE2_AOI0:
-		cmfbi = &machine_data->mfb[4];
+		cmfbi = &data->mfb[4];
 		if (hw->desc[2] != ad->paddr) {	/* AOI0 closed */
 			if (cmfbi->count > 0)	/* AOI1 open */
 				ad->next_ad @@ -540,17 +540,17 @@ static void fsl_diu_enable_panel(struct fb_info *info)
 		}
 		break;
 	case PLANE1_AOI1:
-		pmfbi = &machine_data->mfb[1];
+		pmfbi = &data->mfb[1];
 		ad->next_ad = 0;
-		if (hw->desc[1] = machine_data->dummy_ad.paddr)
+		if (hw->desc[1] = data->dummy_ad.paddr)
 			wr_reg_wa(&hw->desc[1], ad->paddr);
 		else					/* AOI0 open */
 			pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
 		break;
 	case PLANE2_AOI1:
-		pmfbi = &machine_data->mfb[3];
+		pmfbi = &data->mfb[3];
 		ad->next_ad = 0;
-		if (hw->desc[2] = machine_data->dummy_ad.paddr)
+		if (hw->desc[2] = data->dummy_ad.paddr)
 			wr_reg_wa(&hw->desc[2], ad->paddr);
 		else				/* AOI0 was open */
 			pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
@@ -562,52 +562,52 @@ static void fsl_diu_disable_panel(struct fb_info *info)
 {
 	struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
 	struct diu_ad *ad = mfbi->ad;
-	struct fsl_diu_data *machine_data = mfbi->parent;
-	struct diu __iomem *hw = machine_data->diu_reg;
+	struct fsl_diu_data *data = mfbi->parent;
+	struct diu __iomem *hw = data->diu_reg;
 
 	switch (mfbi->index) {
 	case PLANE0:
-		if (hw->desc[0] != machine_data->dummy_ad.paddr)
-			wr_reg_wa(&hw->desc[0], machine_data->dummy_ad.paddr);
+		if (hw->desc[0] != data->dummy_ad.paddr)
+			wr_reg_wa(&hw->desc[0], data->dummy_ad.paddr);
 		break;
 	case PLANE1_AOI0:
-		cmfbi = &machine_data->mfb[2];
+		cmfbi = &data->mfb[2];
 		if (cmfbi->count > 0)	/* AOI1 is open */
 			wr_reg_wa(&hw->desc[1], cmfbi->ad->paddr);
 					/* move AOI1 to the first */
 		else			/* AOI1 was closed */
-			wr_reg_wa(&hw->desc[1], machine_data->dummy_ad.paddr);
+			wr_reg_wa(&hw->desc[1], data->dummy_ad.paddr);
 					/* close AOI 0 */
 		break;
 	case PLANE2_AOI0:
-		cmfbi = &machine_data->mfb[4];
+		cmfbi = &data->mfb[4];
 		if (cmfbi->count > 0)	/* AOI1 is open */
 			wr_reg_wa(&hw->desc[2], cmfbi->ad->paddr);
 					/* move AOI1 to the first */
 		else			/* AOI1 was closed */
-			wr_reg_wa(&hw->desc[2], machine_data->dummy_ad.paddr);
+			wr_reg_wa(&hw->desc[2], data->dummy_ad.paddr);
 					/* close AOI 0 */
 		break;
 	case PLANE1_AOI1:
-		pmfbi = &machine_data->mfb[1];
+		pmfbi = &data->mfb[1];
 		if (hw->desc[1] != ad->paddr) {
 				/* AOI1 is not the first in the chain */
 			if (pmfbi->count > 0)
 					/* AOI0 is open, must be the first */
 				pmfbi->ad->next_ad = 0;
 		} else			/* AOI1 is the first in the chain */
-			wr_reg_wa(&hw->desc[1], machine_data->dummy_ad.paddr);
+			wr_reg_wa(&hw->desc[1], data->dummy_ad.paddr);
 					/* close AOI 1 */
 		break;
 	case PLANE2_AOI1:
-		pmfbi = &machine_data->mfb[3];
+		pmfbi = &data->mfb[3];
 		if (hw->desc[2] != ad->paddr) {
 				/* AOI1 is not the first in the chain */
 			if (pmfbi->count > 0)
 				/* AOI0 is open, must be the first */
 				pmfbi->ad->next_ad = 0;
 		} else		/* AOI1 is the first in the chain */
-			wr_reg_wa(&hw->desc[2], machine_data->dummy_ad.paddr);
+			wr_reg_wa(&hw->desc[2], data->dummy_ad.paddr);
 				/* close AOI 1 */
 		break;
 	}
@@ -616,24 +616,24 @@ static void fsl_diu_disable_panel(struct fb_info *info)
 static void enable_lcdc(struct fb_info *info)
 {
 	struct mfb_info *mfbi = info->par;
-	struct fsl_diu_data *machine_data = mfbi->parent;
-	struct diu __iomem *hw = machine_data->diu_reg;
+	struct fsl_diu_data *data = mfbi->parent;
+	struct diu __iomem *hw = data->diu_reg;
 
-	if (!machine_data->fb_enabled) {
+	if (!data->fb_enabled) {
 		out_be32(&hw->diu_mode, MFB_MODE1);
-		machine_data->fb_enabled++;
+		data->fb_enabled++;
 	}
 }
 
 static void disable_lcdc(struct fb_info *info)
 {
 	struct mfb_info *mfbi = info->par;
-	struct fsl_diu_data *machine_data = mfbi->parent;
-	struct diu __iomem *hw = machine_data->diu_reg;
+	struct fsl_diu_data *data = mfbi->parent;
+	struct diu __iomem *hw = data->diu_reg;
 
-	if (machine_data->fb_enabled) {
+	if (data->fb_enabled) {
 		out_be32(&hw->diu_mode, 0);
-		machine_data->fb_enabled = 0;
+		data->fb_enabled = 0;
 	}
 }
 
@@ -641,14 +641,14 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var,
 				struct fb_info *info)
 {
 	struct mfb_info *lower_aoi_mfbi, *upper_aoi_mfbi, *mfbi = info->par;
-	struct fsl_diu_data *machine_data = mfbi->parent;
+	struct fsl_diu_data *data = mfbi->parent;
 	int available_height, upper_aoi_bottom;
 	enum mfb_index index = mfbi->index;
 	int lower_aoi_is_open, upper_aoi_is_open;
 	__u32 base_plane_width, base_plane_height, upper_aoi_height;
 
-	base_plane_width = machine_data->fsl_diu_info[0].var.xres;
-	base_plane_height = machine_data->fsl_diu_info[0].var.yres;
+	base_plane_width = data->fsl_diu_info[0].var.xres;
+	base_plane_height = data->fsl_diu_info[0].var.yres;
 
 	if (mfbi->x_aoi_d < 0)
 		mfbi->x_aoi_d = 0;
@@ -663,7 +663,7 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var,
 		break;
 	case PLANE1_AOI0:
 	case PLANE2_AOI0:
-		lower_aoi_mfbi = machine_data->fsl_diu_info[index+1].par;
+		lower_aoi_mfbi = data->fsl_diu_info[index+1].par;
 		lower_aoi_is_open = lower_aoi_mfbi->count > 0 ? 1 : 0;
 		if (var->xres > base_plane_width)
 			var->xres = base_plane_width;
@@ -681,9 +681,8 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var,
 		break;
 	case PLANE1_AOI1:
 	case PLANE2_AOI1:
-		upper_aoi_mfbi = machine_data->fsl_diu_info[index-1].par;
-		upper_aoi_height -				machine_data->fsl_diu_info[index-1].var.yres;
+		upper_aoi_mfbi = data->fsl_diu_info[index-1].par;
+		upper_aoi_height = data->fsl_diu_info[index-1].var.yres;
 		upper_aoi_bottom = upper_aoi_mfbi->y_aoi_d + upper_aoi_height;
 		upper_aoi_is_open = upper_aoi_mfbi->count > 0 ? 1 : 0;
 		if (var->xres > base_plane_width)
@@ -823,17 +822,17 @@ static void update_lcdc(struct fb_info *info)
 {
 	struct fb_var_screeninfo *var = &info->var;
 	struct mfb_info *mfbi = info->par;
-	struct fsl_diu_data *machine_data = mfbi->parent;
+	struct fsl_diu_data *data = mfbi->parent;
 	struct diu __iomem *hw;
 	int i, j;
 	u8 *gamma_table_base;
 
 	u32 temp;
 
-	hw = machine_data->diu_reg;
+	hw = data->diu_reg;
 
-	diu_ops.set_monitor_port(machine_data->monitor_port);
-	gamma_table_base = machine_data->gamma;
+	diu_ops.set_monitor_port(data->monitor_port);
+	gamma_table_base = data->gamma;
 
 	/* Prep for DIU init  - gamma table, cursor table */
 
@@ -841,15 +840,14 @@ static void update_lcdc(struct fb_info *info)
 		for (j = 0; j <= 255; j++)
 			*gamma_table_base++ = j;
 
-	diu_ops.set_gamma_table(machine_data->monitor_port,
-		machine_data->gamma);
+	diu_ops.set_gamma_table(data->monitor_port, data->gamma);
 
 	disable_lcdc(info);
 
 	/* Program DIU registers */
 
-	out_be32(&hw->gamma, DMA_ADDR(machine_data, gamma));
-	out_be32(&hw->cursor, DMA_ADDR(machine_data, cursor));
+	out_be32(&hw->gamma, DMA_ADDR(data, gamma));
+	out_be32(&hw->cursor, DMA_ADDR(data, cursor));
 
 	out_be32(&hw->bgnd, 0x007F7F7F); 	/* BGND */
 	out_be32(&hw->bgnd_wb, 0); 		/* BGND_WB */
@@ -940,11 +938,11 @@ static int fsl_diu_set_par(struct fb_info *info)
 	unsigned long len;
 	struct fb_var_screeninfo *var = &info->var;
 	struct mfb_info *mfbi = info->par;
-	struct fsl_diu_data *machine_data = mfbi->parent;
+	struct fsl_diu_data *data = mfbi->parent;
 	struct diu_ad *ad = mfbi->ad;
 	struct diu __iomem *hw;
 
-	hw = machine_data->diu_reg;
+	hw = data->diu_reg;
 
 	set_fix(info);
 	mfbi->cursor_reset = 1;
@@ -962,7 +960,7 @@ static int fsl_diu_set_par(struct fb_info *info)
 		}
 	}
 
-	ad->pix_fmt = diu_ops.get_pixel_format(machine_data->monitor_port,
+	ad->pix_fmt = diu_ops.get_pixel_format(data->monitor_port,
 					       var->bits_per_pixel);
 	ad->addr    = cpu_to_le32(info->fix.smem_start);
 	ad->src_size_g_alpha = cpu_to_le32((var->yres_virtual << 12) |
@@ -1373,16 +1371,16 @@ static irqreturn_t fsl_diu_isr(int irq, void *dev_id)
 	return IRQ_NONE;
 }
 
-static int request_irq_local(struct fsl_diu_data *machine_data)
+static int request_irq_local(struct fsl_diu_data *data)
 {
-	struct diu __iomem *hw = machine_data->diu_reg;
+	struct diu __iomem *hw = data->diu_reg;
 	u32 ints;
 	int ret;
 
 	/* Read to clear the status */
 	in_be32(&hw->int_status);
 
-	ret = request_irq(machine_data->irq, fsl_diu_isr, 0, "fsl-diu-fb", hw);
+	ret = request_irq(data->irq, fsl_diu_isr, 0, "fsl-diu-fb", hw);
 	if (!ret) {
 		ints = INT_PARERR | INT_LS_BF_VS;
 #if !defined(CONFIG_NOT_COHERENT_CACHE)
@@ -1397,14 +1395,14 @@ static int request_irq_local(struct fsl_diu_data *machine_data)
 	return ret;
 }
 
-static void free_irq_local(struct fsl_diu_data *machine_data)
+static void free_irq_local(struct fsl_diu_data *data)
 {
-	struct diu __iomem *hw = machine_data->diu_reg;
+	struct diu __iomem *hw = data->diu_reg;
 
 	/* Disable all LCDC interrupt */
 	out_be32(&hw->int_mask, 0x1f);
 
-	free_irq(machine_data->irq, NULL);
+	free_irq(data->irq, NULL);
 }
 
 #ifdef CONFIG_PM
@@ -1414,20 +1412,20 @@ static void free_irq_local(struct fsl_diu_data *machine_data)
  */
 static int fsl_diu_suspend(struct platform_device *ofdev, pm_message_t state)
 {
-	struct fsl_diu_data *machine_data;
+	struct fsl_diu_data *data;
 
-	machine_data = dev_get_drvdata(&ofdev->dev);
-	disable_lcdc(machine_data->fsl_diu_info[0]);
+	data = dev_get_drvdata(&ofdev->dev);
+	disable_lcdc(data->fsl_diu_info[0]);
 
 	return 0;
 }
 
 static int fsl_diu_resume(struct platform_device *ofdev)
 {
-	struct fsl_diu_data *machine_data;
+	struct fsl_diu_data *data;
 
-	machine_data = dev_get_drvdata(&ofdev->dev);
-	enable_lcdc(machine_data->fsl_diu_info[0]);
+	data = dev_get_drvdata(&ofdev->dev);
+	enable_lcdc(data->fsl_diu_info[0]);
 
 	return 0;
 }
@@ -1441,20 +1439,20 @@ static ssize_t store_monitor(struct device *device,
 	struct device_attribute *attr, const char *buf, size_t count)
 {
 	enum fsl_diu_monitor_port old_monitor_port;
-	struct fsl_diu_data *machine_data +	struct fsl_diu_data *data  		container_of(attr, struct fsl_diu_data, dev_attr);
 
-	old_monitor_port = machine_data->monitor_port;
-	machine_data->monitor_port = fsl_diu_name_to_port(buf);
+	old_monitor_port = data->monitor_port;
+	data->monitor_port = fsl_diu_name_to_port(buf);
 
-	if (old_monitor_port != machine_data->monitor_port) {
+	if (old_monitor_port != data->monitor_port) {
 		/* All AOIs need adjust pixel format
 		 * fsl_diu_set_par only change the pixsel format here
 		 * unlikely to fail. */
 		unsigned int i;
 
 		for (i=0; i < NUM_AOIS; i++)
-			fsl_diu_set_par(&machine_data->fsl_diu_info[i]);
+			fsl_diu_set_par(&data->fsl_diu_info[i]);
 	}
 	return count;
 }
@@ -1462,10 +1460,10 @@ static ssize_t store_monitor(struct device *device,
 static ssize_t show_monitor(struct device *device,
 	struct device_attribute *attr, char *buf)
 {
-	struct fsl_diu_data *machine_data +	struct fsl_diu_data *data  		container_of(attr, struct fsl_diu_data, dev_attr);
 
-	switch (machine_data->monitor_port) {
+	switch (data->monitor_port) {
 	case FSL_DIU_PORT_DVI:
 		return sprintf(buf, "DVI\n");
 	case FSL_DIU_PORT_LVDS:
@@ -1481,17 +1479,17 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
 	struct mfb_info *mfbi;
-	struct fsl_diu_data *machine_data;
+	struct fsl_diu_data *data;
 	int diu_mode;
-	dma_addr_t dma_addr; /* DMA addr of machine_data struct */
+	dma_addr_t dma_addr; /* DMA addr of fsl_diu_data struct */
 	unsigned int i;
 	int ret;
 
-	machine_data = dma_alloc_coherent(&pdev->dev,
-		sizeof(struct fsl_diu_data), &dma_addr, GFP_DMA | __GFP_ZERO);
-	if (!machine_data)
+	data = dma_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data),
+				  &dma_addr, GFP_DMA | __GFP_ZERO);
+	if (!data)
 		return -ENOMEM;
-	machine_data->dma_addr = dma_addr;
+	data->dma_addr = dma_addr;
 
 	/*
 	 * dma_alloc_coherent() uses a page allocator, so the address is
@@ -1500,33 +1498,33 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
 	 * need to catch that.  It's not worth the effort to handle unaligned
 	 * alloctions now because it's highly unlikely to ever be a problem.
 	 */
-	if ((unsigned long)machine_data & 31) {
+	if ((unsigned long)data & 31) {
 		dev_err(&pdev->dev, "misaligned allocation");
 		ret = -ENOMEM;
 		goto error;
 	}
 
-	spin_lock_init(&machine_data->reg_lock);
+	spin_lock_init(&data->reg_lock);
 
 	for (i = 0; i < NUM_AOIS; i++) {
-		struct fb_info *info = &machine_data->fsl_diu_info[i];
+		struct fb_info *info = &data->fsl_diu_info[i];
 
 		info->device = &pdev->dev;
-		info->par = &machine_data->mfb[i];
+		info->par = &data->mfb[i];
 
 		/*
 		 * We store the physical address of the AD in the reserved
 		 * 'paddr' field of the AD itself.
 		 */
-		machine_data->ad[i].paddr = DMA_ADDR(machine_data, ad[i]);
+		data->ad[i].paddr = DMA_ADDR(data, ad[i]);
 
 		info->fix.smem_start = 0;
 
 		/* Initialize the AOI data structure */
 		mfbi = info->par;
 		memcpy(mfbi, &mfb_template[i], sizeof(struct mfb_info));
-		mfbi->parent = machine_data;
-		mfbi->ad = &machine_data->ad[i];
+		mfbi->parent = data;
+		mfbi->ad = &data->ad[i];
 
 		if (mfbi->index = PLANE0) {
 			const u8 *prop;
@@ -1540,104 +1538,102 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
 		}
 	}
 
-	machine_data->diu_reg = of_iomap(np, 0);
-	if (!machine_data->diu_reg) {
+	data->diu_reg = of_iomap(np, 0);
+	if (!data->diu_reg) {
 		dev_err(&pdev->dev, "cannot map DIU registers\n");
 		ret = -EFAULT;
 		goto error;
 	}
 
-	diu_mode = in_be32(&machine_data->diu_reg->diu_mode);
+	diu_mode = in_be32(&data->diu_reg->diu_mode);
 	if (diu_mode = MFB_MODE0)
-		out_be32(&machine_data->diu_reg->diu_mode, 0); /* disable DIU */
+		out_be32(&data->diu_reg->diu_mode, 0); /* disable DIU */
 
 	/* Get the IRQ of the DIU */
-	machine_data->irq = irq_of_parse_and_map(np, 0);
+	data->irq = irq_of_parse_and_map(np, 0);
 
-	if (!machine_data->irq) {
+	if (!data->irq) {
 		dev_err(&pdev->dev, "could not get DIU IRQ\n");
 		ret = -EINVAL;
 		goto error;
 	}
-	machine_data->monitor_port = monitor_port;
+	data->monitor_port = monitor_port;
 
 	/* Initialize the dummy Area Descriptor */
-	machine_data->dummy_ad.addr -		cpu_to_le32(DMA_ADDR(machine_data, dummy_aoi));
-	machine_data->dummy_ad.pix_fmt = 0x88882317;
-	machine_data->dummy_ad.src_size_g_alpha = cpu_to_le32((4 << 12) | 4);
-	machine_data->dummy_ad.aoi_size = cpu_to_le32((4 << 16) |  2);
-	machine_data->dummy_ad.offset_xyi = 0;
-	machine_data->dummy_ad.offset_xyd = 0;
-	machine_data->dummy_ad.next_ad = 0;
-	machine_data->dummy_ad.paddr = DMA_ADDR(machine_data, dummy_ad);
+	data->dummy_ad.addr = cpu_to_le32(DMA_ADDR(data, dummy_aoi));
+	data->dummy_ad.pix_fmt = 0x88882317;
+	data->dummy_ad.src_size_g_alpha = cpu_to_le32((4 << 12) | 4);
+	data->dummy_ad.aoi_size = cpu_to_le32((4 << 16) |  2);
+	data->dummy_ad.offset_xyi = 0;
+	data->dummy_ad.offset_xyd = 0;
+	data->dummy_ad.next_ad = 0;
+	data->dummy_ad.paddr = DMA_ADDR(data, dummy_ad);
 
 	/*
 	 * Let DIU display splash screen if it was pre-initialized
 	 * by the bootloader, set dummy area descriptor otherwise.
 	 */
 	if (diu_mode = MFB_MODE0)
-		out_be32(&machine_data->diu_reg->desc[0],
-			 machine_data->dummy_ad.paddr);
+		out_be32(&data->diu_reg->desc[0], data->dummy_ad.paddr);
 
-	out_be32(&machine_data->diu_reg->desc[1], machine_data->dummy_ad.paddr);
-	out_be32(&machine_data->diu_reg->desc[2], machine_data->dummy_ad.paddr);
+	out_be32(&data->diu_reg->desc[1], data->dummy_ad.paddr);
+	out_be32(&data->diu_reg->desc[2], data->dummy_ad.paddr);
 
 	for (i = 0; i < NUM_AOIS; i++) {
-		ret = install_fb(&machine_data->fsl_diu_info[i]);
+		ret = install_fb(&data->fsl_diu_info[i]);
 		if (ret) {
 			dev_err(&pdev->dev, "could not register fb %d\n", i);
 			goto error;
 		}
 	}
 
-	if (request_irq_local(machine_data)) {
+	if (request_irq_local(data)) {
 		dev_err(&pdev->dev, "could not claim irq\n");
 		goto error;
 	}
 
-	sysfs_attr_init(&machine_data->dev_attr.attr);
-	machine_data->dev_attr.attr.name = "monitor";
-	machine_data->dev_attr.attr.mode = S_IRUGO|S_IWUSR;
-	machine_data->dev_attr.show = show_monitor;
-	machine_data->dev_attr.store = store_monitor;
-	ret = device_create_file(&pdev->dev, &machine_data->dev_attr);
+	sysfs_attr_init(&data->dev_attr.attr);
+	data->dev_attr.attr.name = "monitor";
+	data->dev_attr.attr.mode = S_IRUGO|S_IWUSR;
+	data->dev_attr.show = show_monitor;
+	data->dev_attr.store = store_monitor;
+	ret = device_create_file(&pdev->dev, &data->dev_attr);
 	if (ret) {
 		dev_err(&pdev->dev, "could not create sysfs file %s\n",
-			machine_data->dev_attr.attr.name);
+			data->dev_attr.attr.name);
 	}
 
-	dev_set_drvdata(&pdev->dev, machine_data);
+	dev_set_drvdata(&pdev->dev, data);
 	return 0;
 
 error:
 	for (i = 0; i < NUM_AOIS; i++)
-		uninstall_fb(&machine_data->fsl_diu_info[i]);
+		uninstall_fb(&data->fsl_diu_info[i]);
 
-	iounmap(machine_data->diu_reg);
+	iounmap(data->diu_reg);
 
-	dma_free_coherent(&pdev->dev, sizeof(struct fsl_diu_data),
-		machine_data, machine_data->dma_addr);
+	dma_free_coherent(&pdev->dev, sizeof(struct fsl_diu_data), data,
+			  data->dma_addr);
 
 	return ret;
 }
 
 static int fsl_diu_remove(struct platform_device *pdev)
 {
-	struct fsl_diu_data *machine_data;
+	struct fsl_diu_data *data;
 	int i;
 
-	machine_data = dev_get_drvdata(&pdev->dev);
-	disable_lcdc(&machine_data->fsl_diu_info[0]);
-	free_irq_local(machine_data);
+	data = dev_get_drvdata(&pdev->dev);
+	disable_lcdc(&data->fsl_diu_info[0]);
+	free_irq_local(data);
 
 	for (i = 0; i < NUM_AOIS; i++)
-		uninstall_fb(&machine_data->fsl_diu_info[i]);
+		uninstall_fb(&data->fsl_diu_info[i]);
 
-	iounmap(machine_data->diu_reg);
+	iounmap(data->diu_reg);
 
-	dma_free_coherent(&pdev->dev, sizeof(struct fsl_diu_data),
-		machine_data, machine_data->dma_addr);
+	dma_free_coherent(&pdev->dev, sizeof(struct fsl_diu_data), data,
+			  data->dma_addr);
 
 	return 0;
 }
-- 
1.7.3.4



^ permalink raw reply related

* [PATCH 1/2] video: omap: Staticise non-exported symbols
From: Axel Lin @ 2011-12-09  1:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jonathan McDowell, Imre Deak, Cory Maccarrone, Laurent Gonzalez,
	Marek Vasut, Tomi Valkeinen, Florian Tobias Schandinat,
	linux-fbdev, linux-omap

These symbols are not used outside it's driver so no need to
make the symbol global.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/video/omap/lcd_ams_delta.c |    2 +-
 drivers/video/omap/lcd_h3.c        |    2 +-
 drivers/video/omap/lcd_htcherald.c |    2 +-
 drivers/video/omap/lcd_inn1510.c   |    2 +-
 drivers/video/omap/lcd_inn1610.c   |    2 +-
 drivers/video/omap/lcd_osk.c       |    2 +-
 drivers/video/omap/lcd_palmte.c    |    2 +-
 drivers/video/omap/lcd_palmtt.c    |    2 +-
 drivers/video/omap/lcd_palmz71.c   |    2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/video/omap/lcd_ams_delta.c b/drivers/video/omap/lcd_ams_delta.c
index 6978ae4..eb50a95 100644
--- a/drivers/video/omap/lcd_ams_delta.c
+++ b/drivers/video/omap/lcd_ams_delta.c
@@ -198,7 +198,7 @@ static int ams_delta_panel_resume(struct platform_device *pdev)
 	return 0;
 }
 
-struct platform_driver ams_delta_panel_driver = {
+static struct platform_driver ams_delta_panel_driver = {
 	.probe		= ams_delta_panel_probe,
 	.remove		= ams_delta_panel_remove,
 	.suspend	= ams_delta_panel_suspend,
diff --git a/drivers/video/omap/lcd_h3.c b/drivers/video/omap/lcd_h3.c
index 622ad83..baec34e 100644
--- a/drivers/video/omap/lcd_h3.c
+++ b/drivers/video/omap/lcd_h3.c
@@ -113,7 +113,7 @@ static int h3_panel_resume(struct platform_device *pdev)
 	return 0;
 }
 
-struct platform_driver h3_panel_driver = {
+static struct platform_driver h3_panel_driver = {
 	.probe		= h3_panel_probe,
 	.remove		= h3_panel_remove,
 	.suspend	= h3_panel_suspend,
diff --git a/drivers/video/omap/lcd_htcherald.c b/drivers/video/omap/lcd_htcherald.c
index 4802419..b1a022f 100644
--- a/drivers/video/omap/lcd_htcherald.c
+++ b/drivers/video/omap/lcd_htcherald.c
@@ -104,7 +104,7 @@ static int htcherald_panel_resume(struct platform_device *pdev)
 	return 0;
 }
 
-struct platform_driver htcherald_panel_driver = {
+static struct platform_driver htcherald_panel_driver = {
 	.probe		= htcherald_panel_probe,
 	.remove		= htcherald_panel_remove,
 	.suspend	= htcherald_panel_suspend,
diff --git a/drivers/video/omap/lcd_inn1510.c b/drivers/video/omap/lcd_inn1510.c
index 3271f16..d129946 100644
--- a/drivers/video/omap/lcd_inn1510.c
+++ b/drivers/video/omap/lcd_inn1510.c
@@ -98,7 +98,7 @@ static int innovator1510_panel_resume(struct platform_device *pdev)
 	return 0;
 }
 
-struct platform_driver innovator1510_panel_driver = {
+static struct platform_driver innovator1510_panel_driver = {
 	.probe		= innovator1510_panel_probe,
 	.remove		= innovator1510_panel_remove,
 	.suspend	= innovator1510_panel_suspend,
diff --git a/drivers/video/omap/lcd_inn1610.c b/drivers/video/omap/lcd_inn1610.c
index 12cc52a..a95756b 100644
--- a/drivers/video/omap/lcd_inn1610.c
+++ b/drivers/video/omap/lcd_inn1610.c
@@ -122,7 +122,7 @@ static int innovator1610_panel_resume(struct platform_device *pdev)
 	return 0;
 }
 
-struct platform_driver innovator1610_panel_driver = {
+static struct platform_driver innovator1610_panel_driver = {
 	.probe		= innovator1610_panel_probe,
 	.remove		= innovator1610_panel_remove,
 	.suspend	= innovator1610_panel_suspend,
diff --git a/drivers/video/omap/lcd_osk.c b/drivers/video/omap/lcd_osk.c
index 6f8d13c..b985997 100644
--- a/drivers/video/omap/lcd_osk.c
+++ b/drivers/video/omap/lcd_osk.c
@@ -116,7 +116,7 @@ static int osk_panel_resume(struct platform_device *pdev)
 	return 0;
 }
 
-struct platform_driver osk_panel_driver = {
+static struct platform_driver osk_panel_driver = {
 	.probe		= osk_panel_probe,
 	.remove		= osk_panel_remove,
 	.suspend	= osk_panel_suspend,
diff --git a/drivers/video/omap/lcd_palmte.c b/drivers/video/omap/lcd_palmte.c
index 4cb3017..d79f436 100644
--- a/drivers/video/omap/lcd_palmte.c
+++ b/drivers/video/omap/lcd_palmte.c
@@ -97,7 +97,7 @@ static int palmte_panel_resume(struct platform_device *pdev)
 	return 0;
 }
 
-struct platform_driver palmte_panel_driver = {
+static struct platform_driver palmte_panel_driver = {
 	.probe		= palmte_panel_probe,
 	.remove		= palmte_panel_remove,
 	.suspend	= palmte_panel_suspend,
diff --git a/drivers/video/omap/lcd_palmtt.c b/drivers/video/omap/lcd_palmtt.c
index b51b332..c2e96a7 100644
--- a/drivers/video/omap/lcd_palmtt.c
+++ b/drivers/video/omap/lcd_palmtt.c
@@ -102,7 +102,7 @@ static int palmtt_panel_resume(struct platform_device *pdev)
 	return 0;
 }
 
-struct platform_driver palmtt_panel_driver = {
+static struct platform_driver palmtt_panel_driver = {
 	.probe		= palmtt_panel_probe,
 	.remove		= palmtt_panel_remove,
 	.suspend	= palmtt_panel_suspend,
diff --git a/drivers/video/omap/lcd_palmz71.c b/drivers/video/omap/lcd_palmz71.c
index 2334e56..1ab4847 100644
--- a/drivers/video/omap/lcd_palmz71.c
+++ b/drivers/video/omap/lcd_palmz71.c
@@ -98,7 +98,7 @@ static int palmz71_panel_resume(struct platform_device *pdev)
 	return 0;
 }
 
-struct platform_driver palmz71_panel_driver = {
+static struct platform_driver palmz71_panel_driver = {
 	.probe		= palmz71_panel_probe,
 	.remove		= palmz71_panel_remove,
 	.suspend	= palmz71_panel_suspend,
-- 
1.7.5.4




^ permalink raw reply related

* [PATCH 1/3] video: convert mbxfb to use module_platform_driver()
From: Axel Lin @ 2011-12-09  1:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mike Rapoport, Florian Tobias Schandinat, linux-fbdev

This patch converts mbxfb to use the module_platform_driver() macro
which makes the code smaller and a bit simpler.

Cc: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/video/mbx/mbxfb.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
index 6ce3416..55bf619 100644
--- a/drivers/video/mbx/mbxfb.c
+++ b/drivers/video/mbx/mbxfb.c
@@ -1053,18 +1053,7 @@ static struct platform_driver mbxfb_driver = {
 	},
 };
 
-int __devinit mbxfb_init(void)
-{
-	return platform_driver_register(&mbxfb_driver);
-}
-
-static void __devexit mbxfb_exit(void)
-{
-	platform_driver_unregister(&mbxfb_driver);
-}
-
-module_init(mbxfb_init);
-module_exit(mbxfb_exit);
+module_platform_driver(mbxfb_driver);
 
 MODULE_DESCRIPTION("loadable framebuffer driver for Marathon device");
 MODULE_AUTHOR("Mike Rapoport, Compulab");
-- 
1.7.5.4




^ permalink raw reply related

* [PATCH 2/3] video: omap: convert drivers/video/omap/* to use
From: Axel Lin @ 2011-12-09  1:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jonathan McDowell, Cory Maccarrone, Laurent Gonzalez, Marek Vasut,
	Tomi Valkeinen, Florian Tobias Schandinat, linux-fbdev,
	linux-omap
In-Reply-To: <1323395873.3740.4.camel@phoenix>

This patch converts the drivers in drivers/video/omap/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Jonathan McDowell <noodles@earth.li>
Cc: Cory Maccarrone <darkstar6262@gmail.com>
Cc: Laurent Gonzalez <palmte.linux@free.fr>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/video/omap/lcd_ams_delta.c |   13 +------------
 drivers/video/omap/lcd_h3.c        |   14 +-------------
 drivers/video/omap/lcd_htcherald.c |   14 +-------------
 drivers/video/omap/lcd_inn1510.c   |   14 +-------------
 drivers/video/omap/lcd_inn1610.c   |   14 +-------------
 drivers/video/omap/lcd_osk.c       |   14 +-------------
 drivers/video/omap/lcd_palmte.c    |   14 +-------------
 drivers/video/omap/lcd_palmtt.c    |   13 +------------
 drivers/video/omap/lcd_palmz71.c   |   13 +------------
 9 files changed, 9 insertions(+), 114 deletions(-)

diff --git a/drivers/video/omap/lcd_ams_delta.c b/drivers/video/omap/lcd_ams_delta.c
index eb50a95..0fdd6f6 100644
--- a/drivers/video/omap/lcd_ams_delta.c
+++ b/drivers/video/omap/lcd_ams_delta.c
@@ -209,15 +209,4 @@ static struct platform_driver ams_delta_panel_driver = {
 	},
 };
 
-static int __init ams_delta_panel_drv_init(void)
-{
-	return platform_driver_register(&ams_delta_panel_driver);
-}
-
-static void __exit ams_delta_panel_drv_cleanup(void)
-{
-	platform_driver_unregister(&ams_delta_panel_driver);
-}
-
-module_init(ams_delta_panel_drv_init);
-module_exit(ams_delta_panel_drv_cleanup);
+module_platform_driver(ams_delta_panel_driver);
diff --git a/drivers/video/omap/lcd_h3.c b/drivers/video/omap/lcd_h3.c
index baec34e..49bdeca 100644
--- a/drivers/video/omap/lcd_h3.c
+++ b/drivers/video/omap/lcd_h3.c
@@ -124,16 +124,4 @@ static struct platform_driver h3_panel_driver = {
 	},
 };
 
-static int __init h3_panel_drv_init(void)
-{
-	return platform_driver_register(&h3_panel_driver);
-}
-
-static void __exit h3_panel_drv_cleanup(void)
-{
-	platform_driver_unregister(&h3_panel_driver);
-}
-
-module_init(h3_panel_drv_init);
-module_exit(h3_panel_drv_cleanup);
-
+module_platform_driver(h3_panel_driver);
diff --git a/drivers/video/omap/lcd_htcherald.c b/drivers/video/omap/lcd_htcherald.c
index b1a022f..20f4778 100644
--- a/drivers/video/omap/lcd_htcherald.c
+++ b/drivers/video/omap/lcd_htcherald.c
@@ -115,16 +115,4 @@ static struct platform_driver htcherald_panel_driver = {
 	},
 };
 
-static int __init htcherald_panel_drv_init(void)
-{
-	return platform_driver_register(&htcherald_panel_driver);
-}
-
-static void __exit htcherald_panel_drv_cleanup(void)
-{
-	platform_driver_unregister(&htcherald_panel_driver);
-}
-
-module_init(htcherald_panel_drv_init);
-module_exit(htcherald_panel_drv_cleanup);
-
+module_platform_driver(htcherald_panel_driver);
diff --git a/drivers/video/omap/lcd_inn1510.c b/drivers/video/omap/lcd_inn1510.c
index d129946..b38b1dd 100644
--- a/drivers/video/omap/lcd_inn1510.c
+++ b/drivers/video/omap/lcd_inn1510.c
@@ -109,16 +109,4 @@ static struct platform_driver innovator1510_panel_driver = {
 	},
 };
 
-static int __init innovator1510_panel_drv_init(void)
-{
-	return platform_driver_register(&innovator1510_panel_driver);
-}
-
-static void __exit innovator1510_panel_drv_cleanup(void)
-{
-	platform_driver_unregister(&innovator1510_panel_driver);
-}
-
-module_init(innovator1510_panel_drv_init);
-module_exit(innovator1510_panel_drv_cleanup);
-
+module_platform_driver(innovator1510_panel_driver);
diff --git a/drivers/video/omap/lcd_inn1610.c b/drivers/video/omap/lcd_inn1610.c
index a95756b..7e8bd8e 100644
--- a/drivers/video/omap/lcd_inn1610.c
+++ b/drivers/video/omap/lcd_inn1610.c
@@ -133,16 +133,4 @@ static struct platform_driver innovator1610_panel_driver = {
 	},
 };
 
-static int __init innovator1610_panel_drv_init(void)
-{
-	return platform_driver_register(&innovator1610_panel_driver);
-}
-
-static void __exit innovator1610_panel_drv_cleanup(void)
-{
-	platform_driver_unregister(&innovator1610_panel_driver);
-}
-
-module_init(innovator1610_panel_drv_init);
-module_exit(innovator1610_panel_drv_cleanup);
-
+module_platform_driver(innovator1610_panel_driver);
diff --git a/drivers/video/omap/lcd_osk.c b/drivers/video/omap/lcd_osk.c
index b985997..5914220 100644
--- a/drivers/video/omap/lcd_osk.c
+++ b/drivers/video/omap/lcd_osk.c
@@ -127,16 +127,4 @@ static struct platform_driver osk_panel_driver = {
 	},
 };
 
-static int __init osk_panel_drv_init(void)
-{
-	return platform_driver_register(&osk_panel_driver);
-}
-
-static void __exit osk_panel_drv_cleanup(void)
-{
-	platform_driver_unregister(&osk_panel_driver);
-}
-
-module_init(osk_panel_drv_init);
-module_exit(osk_panel_drv_cleanup);
-
+module_platform_driver(osk_panel_driver);
diff --git a/drivers/video/omap/lcd_palmte.c b/drivers/video/omap/lcd_palmte.c
index d79f436..88c31eb 100644
--- a/drivers/video/omap/lcd_palmte.c
+++ b/drivers/video/omap/lcd_palmte.c
@@ -108,16 +108,4 @@ static struct platform_driver palmte_panel_driver = {
 	},
 };
 
-static int __init palmte_panel_drv_init(void)
-{
-	return platform_driver_register(&palmte_panel_driver);
-}
-
-static void __exit palmte_panel_drv_cleanup(void)
-{
-	platform_driver_unregister(&palmte_panel_driver);
-}
-
-module_init(palmte_panel_drv_init);
-module_exit(palmte_panel_drv_cleanup);
-
+module_platform_driver(palmte_panel_driver);
diff --git a/drivers/video/omap/lcd_palmtt.c b/drivers/video/omap/lcd_palmtt.c
index c2e96a7..aaf3c8b 100644
--- a/drivers/video/omap/lcd_palmtt.c
+++ b/drivers/video/omap/lcd_palmtt.c
@@ -113,15 +113,4 @@ static struct platform_driver palmtt_panel_driver = {
 	},
 };
 
-static int __init palmtt_panel_drv_init(void)
-{
-	return platform_driver_register(&palmtt_panel_driver);
-}
-
-static void __exit palmtt_panel_drv_cleanup(void)
-{
-	platform_driver_unregister(&palmtt_panel_driver);
-}
-
-module_init(palmtt_panel_drv_init);
-module_exit(palmtt_panel_drv_cleanup);
+module_platform_driver(palmtt_panel_driver);
diff --git a/drivers/video/omap/lcd_palmz71.c b/drivers/video/omap/lcd_palmz71.c
index 1ab4847..3b7d8aa 100644
--- a/drivers/video/omap/lcd_palmz71.c
+++ b/drivers/video/omap/lcd_palmz71.c
@@ -109,15 +109,4 @@ static struct platform_driver palmz71_panel_driver = {
 	},
 };
 
-static int __init palmz71_panel_drv_init(void)
-{
-	return platform_driver_register(&palmz71_panel_driver);
-}
-
-static void __exit palmz71_panel_drv_cleanup(void)
-{
-	platform_driver_unregister(&palmz71_panel_driver);
-}
-
-module_init(palmz71_panel_drv_init);
-module_exit(palmz71_panel_drv_cleanup);
+module_platform_driver(palmz71_panel_driver);
-- 
1.7.5.4




^ permalink raw reply related

* [PATCH 3/3] video: pnx4008: convert drivers/video/pnx4008/* to use
From: Axel Lin @ 2011-12-09  2:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Grigory Tolstolytkin, Florian Tobias Schandinat, linux-fbdev
In-Reply-To: <1323395873.3740.4.camel@phoenix>

This patch converts the drivers in drivers/video/pnx4008/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Grigory Tolstolytkin <gtolstolytkin@ru.mvista.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/video/pnx4008/pnxrgbfb.c |   13 +------------
 drivers/video/pnx4008/sdum.c     |   13 +------------
 2 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/drivers/video/pnx4008/pnxrgbfb.c b/drivers/video/pnx4008/pnxrgbfb.c
index b2252fe..6d30428 100644
--- a/drivers/video/pnx4008/pnxrgbfb.c
+++ b/drivers/video/pnx4008/pnxrgbfb.c
@@ -193,17 +193,6 @@ static struct platform_driver rgbfb_driver = {
 	.remove = rgbfb_remove,
 };
 
-static int __init rgbfb_init(void)
-{
-	return platform_driver_register(&rgbfb_driver);
-}
-
-static void __exit rgbfb_exit(void)
-{
-	platform_driver_unregister(&rgbfb_driver);
-}
-
-module_init(rgbfb_init);
-module_exit(rgbfb_exit);
+module_platform_driver(rgbfb_driver);
 
 MODULE_LICENSE("GPL");
diff --git a/drivers/video/pnx4008/sdum.c b/drivers/video/pnx4008/sdum.c
index 50e0039..c5c7414 100644
--- a/drivers/video/pnx4008/sdum.c
+++ b/drivers/video/pnx4008/sdum.c
@@ -856,17 +856,6 @@ static struct platform_driver sdum_driver = {
 	.resume = sdum_resume,
 };
 
-int __init sdum_init(void)
-{
-	return platform_driver_register(&sdum_driver);
-}
-
-static void __exit sdum_exit(void)
-{
-	platform_driver_unregister(&sdum_driver);
-};
-
-module_init(sdum_init);
-module_exit(sdum_exit);
+module_platform_driver(sdum_driver);
 
 MODULE_LICENSE("GPL");
-- 
1.7.5.4




^ permalink raw reply related

* [PATCH v3] backlight/ld9040.c: regulator control in the driver
From: Donghwa Lee @ 2011-12-09  5:38 UTC (permalink / raw)
  To: linux-arm-kernel

This patch supports regulator power control in the driver.
Current ld9040 driver was controlled power on/off sequence by callback function
in the board file. But, by doing this, there's no need to register lcd power 
on/off callback function in the board file.

changes since v2:
 - bind regulators as bulk data
 - in case of failure to get regulator, free regulator bulk data

Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
---
 drivers/video/backlight/ld9040.c |   71
+++++++++++++++++++++++++++++++------
 1 files changed, 59 insertions(+), 12 deletions(-)

diff --git a/drivers/video/backlight/ld9040.c
b/drivers/video/backlight/ld9040.c
index da9a5ce..133ddff 100644
--- a/drivers/video/backlight/ld9040.c
+++ b/drivers/video/backlight/ld9040.c
@@ -31,6 +31,7 @@
 #include <linux/lcd.h>
 #include <linux/backlight.h>
 #include <linux/module.h>
+#include <linux/regulator/consumer.h>

 #include "ld9040_gamma.h"

@@ -53,8 +54,51 @@ struct ld9040 {
 	struct lcd_device		*ld;
 	struct backlight_device		*bd;
 	struct lcd_platform_data	*lcd_pd;
+
+	struct mutex			lock;
+	bool  enabled;
+};
+
+static struct regulator_bulk_data supplies[] = {
+	{ .supply = "vdd3", },
+	{ .supply = "vci", },
 };

+static void ld9040_regulator_enable(struct ld9040 *lcd)
+{
+	int ret = 0;
+	struct lcd_platform_data *pd = NULL;
+
+	pd = lcd->lcd_pd;
+	mutex_lock(&lcd->lock);
+	if (!lcd->enabled) {
+		ret = regulator_bulk_enable(ARRAY_SIZE(supplies), supplies);
+		if (ret)
+			goto out;
+
+		lcd->enabled = true;
+	}
+	mdelay(pd->power_on_delay);
+out:
+	mutex_unlock(&lcd->lock);
+}
+
+static void ld9040_regulator_disable(struct ld9040 *lcd)
+{
+	int ret = 0;
+
+	mutex_lock(&lcd->lock);
+	if (lcd->enabled) {
+		ret = regulator_bulk_disable(ARRAY_SIZE(supplies), supplies);
+		if (ret)
+			goto out;
+
+		lcd->enabled = false;
+	}
+out:
+	mutex_unlock(&lcd->lock);
+}
+
 static const unsigned short seq_swreset[] = {
 	0x01, COMMAND_ONLY,
 	ENDDEF, 0x00
@@ -532,13 +576,8 @@ static int ld9040_power_on(struct ld9040 *lcd)
 		return -EFAULT;
 	}

-	if (!pd->power_on) {
-		dev_err(lcd->dev, "power_on is NULL.\n");
-		return -EFAULT;
-	} else {
-		pd->power_on(lcd->ld, 1);
-		mdelay(pd->power_on_delay);
-	}
+	/* lcd power on */
+	ld9040_regulator_enable(lcd);

 	if (!pd->reset) {
 		dev_err(lcd->dev, "reset is NULL.\n");
@@ -582,11 +621,8 @@ static int ld9040_power_off(struct ld9040 *lcd)

 	mdelay(pd->power_off_delay);

-	if (!pd->power_on) {
-		dev_err(lcd->dev, "power_on is NULL.\n");
-		return -EFAULT;
-	} else
-		pd->power_on(lcd->ld, 0);
+	/* lcd power off */
+	ld9040_regulator_disable(lcd);

 	return 0;
 }
@@ -693,6 +729,14 @@ static int ld9040_probe(struct spi_device *spi)
 		goto out_free_lcd;
 	}

+	mutex_init(&lcd->lock);
+
+	ret = regulator_bulk_get(lcd->dev, ARRAY_SIZE(supplies), supplies);
+	if (ret) {
+		dev_err(lcd->dev, "Failed to get regulators: %d\n", ret);
+		goto out_free_lcd;
+	}
+
 	ld = lcd_device_register("ld9040", &spi->dev, lcd, &ld9040_lcd_ops);
 	if (IS_ERR(ld)) {
 		ret = PTR_ERR(ld);
@@ -739,6 +783,8 @@ static int ld9040_probe(struct spi_device *spi)
 out_unregister_lcd:
 	lcd_device_unregister(lcd->ld);
 out_free_lcd:
+	regulator_bulk_free(ARRAY_SIZE(supplies), supplies);
+
 	kfree(lcd);
 	return ret;
 }
@@ -750,6 +796,7 @@ static int __devexit ld9040_remove(struct spi_device
*spi)
 	ld9040_power(lcd, FB_BLANK_POWERDOWN);
 	backlight_device_unregister(lcd->bd);
 	lcd_device_unregister(lcd->ld);
+	regulator_bulk_free(ARRAY_SIZE(supplies), supplies);
 	kfree(lcd);

 	return 0;
-- 
1.7.4.1

^ permalink raw reply related

* Re: [PATCH 1/2] video: omap: Staticise non-exported symbols
From: Marek Vasut @ 2011-12-09  8:23 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Jonathan McDowell, Imre Deak, Cory Maccarrone,
	Laurent Gonzalez, Tomi Valkeinen, Florian Tobias Schandinat,
	linux-fbdev, linux-omap
In-Reply-To: <1323394677.3740.2.camel@phoenix>

> These symbols are not used outside it's driver so no need to
> make the symbol global.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  drivers/video/omap/lcd_ams_delta.c |    2 +-
>  drivers/video/omap/lcd_h3.c        |    2 +-
>  drivers/video/omap/lcd_htcherald.c |    2 +-
>  drivers/video/omap/lcd_inn1510.c   |    2 +-
>  drivers/video/omap/lcd_inn1610.c   |    2 +-
>  drivers/video/omap/lcd_osk.c       |    2 +-
>  drivers/video/omap/lcd_palmte.c    |    2 +-
>  drivers/video/omap/lcd_palmtt.c    |    2 +-
>  drivers/video/omap/lcd_palmz71.c   |    2 +-
>  9 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/video/omap/lcd_ams_delta.c
> b/drivers/video/omap/lcd_ams_delta.c index 6978ae4..eb50a95 100644
> --- a/drivers/video/omap/lcd_ams_delta.c
> +++ b/drivers/video/omap/lcd_ams_delta.c
> @@ -198,7 +198,7 @@ static int ams_delta_panel_resume(struct
> platform_device *pdev) return 0;
>  }
> 
> -struct platform_driver ams_delta_panel_driver = {
> +static struct platform_driver ams_delta_panel_driver = {
>  	.probe		= ams_delta_panel_probe,
>  	.remove		= ams_delta_panel_remove,
>  	.suspend	= ams_delta_panel_suspend,
> diff --git a/drivers/video/omap/lcd_h3.c b/drivers/video/omap/lcd_h3.c
> index 622ad83..baec34e 100644
> --- a/drivers/video/omap/lcd_h3.c
> +++ b/drivers/video/omap/lcd_h3.c
> @@ -113,7 +113,7 @@ static int h3_panel_resume(struct platform_device
> *pdev) return 0;
>  }
> 
> -struct platform_driver h3_panel_driver = {
> +static struct platform_driver h3_panel_driver = {
>  	.probe		= h3_panel_probe,
>  	.remove		= h3_panel_remove,
>  	.suspend	= h3_panel_suspend,
> diff --git a/drivers/video/omap/lcd_htcherald.c
> b/drivers/video/omap/lcd_htcherald.c index 4802419..b1a022f 100644
> --- a/drivers/video/omap/lcd_htcherald.c
> +++ b/drivers/video/omap/lcd_htcherald.c
> @@ -104,7 +104,7 @@ static int htcherald_panel_resume(struct
> platform_device *pdev) return 0;
>  }
> 
> -struct platform_driver htcherald_panel_driver = {
> +static struct platform_driver htcherald_panel_driver = {
>  	.probe		= htcherald_panel_probe,
>  	.remove		= htcherald_panel_remove,
>  	.suspend	= htcherald_panel_suspend,
> diff --git a/drivers/video/omap/lcd_inn1510.c
> b/drivers/video/omap/lcd_inn1510.c index 3271f16..d129946 100644
> --- a/drivers/video/omap/lcd_inn1510.c
> +++ b/drivers/video/omap/lcd_inn1510.c
> @@ -98,7 +98,7 @@ static int innovator1510_panel_resume(struct
> platform_device *pdev) return 0;
>  }
> 
> -struct platform_driver innovator1510_panel_driver = {
> +static struct platform_driver innovator1510_panel_driver = {
>  	.probe		= innovator1510_panel_probe,
>  	.remove		= innovator1510_panel_remove,
>  	.suspend	= innovator1510_panel_suspend,
> diff --git a/drivers/video/omap/lcd_inn1610.c
> b/drivers/video/omap/lcd_inn1610.c index 12cc52a..a95756b 100644
> --- a/drivers/video/omap/lcd_inn1610.c
> +++ b/drivers/video/omap/lcd_inn1610.c
> @@ -122,7 +122,7 @@ static int innovator1610_panel_resume(struct
> platform_device *pdev) return 0;
>  }
> 
> -struct platform_driver innovator1610_panel_driver = {
> +static struct platform_driver innovator1610_panel_driver = {
>  	.probe		= innovator1610_panel_probe,
>  	.remove		= innovator1610_panel_remove,
>  	.suspend	= innovator1610_panel_suspend,
> diff --git a/drivers/video/omap/lcd_osk.c b/drivers/video/omap/lcd_osk.c
> index 6f8d13c..b985997 100644
> --- a/drivers/video/omap/lcd_osk.c
> +++ b/drivers/video/omap/lcd_osk.c
> @@ -116,7 +116,7 @@ static int osk_panel_resume(struct platform_device
> *pdev) return 0;
>  }
> 
> -struct platform_driver osk_panel_driver = {
> +static struct platform_driver osk_panel_driver = {
>  	.probe		= osk_panel_probe,
>  	.remove		= osk_panel_remove,
>  	.suspend	= osk_panel_suspend,
> diff --git a/drivers/video/omap/lcd_palmte.c
> b/drivers/video/omap/lcd_palmte.c index 4cb3017..d79f436 100644
> --- a/drivers/video/omap/lcd_palmte.c
> +++ b/drivers/video/omap/lcd_palmte.c
> @@ -97,7 +97,7 @@ static int palmte_panel_resume(struct platform_device
> *pdev) return 0;
>  }
> 
> -struct platform_driver palmte_panel_driver = {
> +static struct platform_driver palmte_panel_driver = {
>  	.probe		= palmte_panel_probe,
>  	.remove		= palmte_panel_remove,
>  	.suspend	= palmte_panel_suspend,
> diff --git a/drivers/video/omap/lcd_palmtt.c
> b/drivers/video/omap/lcd_palmtt.c index b51b332..c2e96a7 100644
> --- a/drivers/video/omap/lcd_palmtt.c
> +++ b/drivers/video/omap/lcd_palmtt.c
> @@ -102,7 +102,7 @@ static int palmtt_panel_resume(struct platform_device
> *pdev) return 0;
>  }
> 
> -struct platform_driver palmtt_panel_driver = {
> +static struct platform_driver palmtt_panel_driver = {
>  	.probe		= palmtt_panel_probe,
>  	.remove		= palmtt_panel_remove,
>  	.suspend	= palmtt_panel_suspend,
> diff --git a/drivers/video/omap/lcd_palmz71.c
> b/drivers/video/omap/lcd_palmz71.c index 2334e56..1ab4847 100644
> --- a/drivers/video/omap/lcd_palmz71.c
> +++ b/drivers/video/omap/lcd_palmz71.c
> @@ -98,7 +98,7 @@ static int palmz71_panel_resume(struct platform_device
> *pdev) return 0;
>  }
> 
> -struct platform_driver palmz71_panel_driver = {
> +static struct platform_driver palmz71_panel_driver = {
>  	.probe		= palmz71_panel_probe,
>  	.remove		= palmz71_panel_remove,
>  	.suspend	= palmz71_panel_suspend,

I can speak for palmtt and palmz71,

Acked-by: Marek Vasut <marek.vasut@gmail.com>

^ permalink raw reply

* Re: [PATCH 2/3] video: omap: convert drivers/video/omap/* to use module_platform_driver()
From: Marek Vasut @ 2011-12-09  8:24 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Jonathan McDowell, Cory Maccarrone,
	Laurent Gonzalez, Tomi Valkeinen, Florian Tobias Schandinat,
	linux-fbdev, linux-omap
In-Reply-To: <1323395996.3740.6.camel@phoenix>

> This patch converts the drivers in drivers/video/omap/* to use the
> module_platform_driver() macro which makes the code smaller and a bit
> simpler.
> 
> Cc: Jonathan McDowell <noodles@earth.li>
> Cc: Cory Maccarrone <darkstar6262@gmail.com>
> Cc: Laurent Gonzalez <palmte.linux@free.fr>
> Cc: Marek Vasut <marek.vasut@gmail.com>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  drivers/video/omap/lcd_ams_delta.c |   13 +------------
>  drivers/video/omap/lcd_h3.c        |   14 +-------------
>  drivers/video/omap/lcd_htcherald.c |   14 +-------------
>  drivers/video/omap/lcd_inn1510.c   |   14 +-------------
>  drivers/video/omap/lcd_inn1610.c   |   14 +-------------
>  drivers/video/omap/lcd_osk.c       |   14 +-------------
>  drivers/video/omap/lcd_palmte.c    |   14 +-------------
>  drivers/video/omap/lcd_palmtt.c    |   13 +------------
>  drivers/video/omap/lcd_palmz71.c   |   13 +------------
>  9 files changed, 9 insertions(+), 114 deletions(-)
> 
> diff --git a/drivers/video/omap/lcd_ams_delta.c
> b/drivers/video/omap/lcd_ams_delta.c index eb50a95..0fdd6f6 100644
> --- a/drivers/video/omap/lcd_ams_delta.c
> +++ b/drivers/video/omap/lcd_ams_delta.c
> @@ -209,15 +209,4 @@ static struct platform_driver ams_delta_panel_driver > { },
>  };
> 
> -static int __init ams_delta_panel_drv_init(void)
> -{
> -	return platform_driver_register(&ams_delta_panel_driver);
> -}
> -
> -static void __exit ams_delta_panel_drv_cleanup(void)
> -{
> -	platform_driver_unregister(&ams_delta_panel_driver);
> -}
> -
> -module_init(ams_delta_panel_drv_init);
> -module_exit(ams_delta_panel_drv_cleanup);
> +module_platform_driver(ams_delta_panel_driver);
> diff --git a/drivers/video/omap/lcd_h3.c b/drivers/video/omap/lcd_h3.c
> index baec34e..49bdeca 100644
> --- a/drivers/video/omap/lcd_h3.c
> +++ b/drivers/video/omap/lcd_h3.c
> @@ -124,16 +124,4 @@ static struct platform_driver h3_panel_driver = {
>  	},
>  };
> 
> -static int __init h3_panel_drv_init(void)
> -{
> -	return platform_driver_register(&h3_panel_driver);
> -}
> -
> -static void __exit h3_panel_drv_cleanup(void)
> -{
> -	platform_driver_unregister(&h3_panel_driver);
> -}
> -
> -module_init(h3_panel_drv_init);
> -module_exit(h3_panel_drv_cleanup);
> -
> +module_platform_driver(h3_panel_driver);
> diff --git a/drivers/video/omap/lcd_htcherald.c
> b/drivers/video/omap/lcd_htcherald.c index b1a022f..20f4778 100644
> --- a/drivers/video/omap/lcd_htcherald.c
> +++ b/drivers/video/omap/lcd_htcherald.c
> @@ -115,16 +115,4 @@ static struct platform_driver htcherald_panel_driver > { },
>  };
> 
> -static int __init htcherald_panel_drv_init(void)
> -{
> -	return platform_driver_register(&htcherald_panel_driver);
> -}
> -
> -static void __exit htcherald_panel_drv_cleanup(void)
> -{
> -	platform_driver_unregister(&htcherald_panel_driver);
> -}
> -
> -module_init(htcherald_panel_drv_init);
> -module_exit(htcherald_panel_drv_cleanup);
> -
> +module_platform_driver(htcherald_panel_driver);
> diff --git a/drivers/video/omap/lcd_inn1510.c
> b/drivers/video/omap/lcd_inn1510.c index d129946..b38b1dd 100644
> --- a/drivers/video/omap/lcd_inn1510.c
> +++ b/drivers/video/omap/lcd_inn1510.c
> @@ -109,16 +109,4 @@ static struct platform_driver
> innovator1510_panel_driver = { },
>  };
> 
> -static int __init innovator1510_panel_drv_init(void)
> -{
> -	return platform_driver_register(&innovator1510_panel_driver);
> -}
> -
> -static void __exit innovator1510_panel_drv_cleanup(void)
> -{
> -	platform_driver_unregister(&innovator1510_panel_driver);
> -}
> -
> -module_init(innovator1510_panel_drv_init);
> -module_exit(innovator1510_panel_drv_cleanup);
> -
> +module_platform_driver(innovator1510_panel_driver);
> diff --git a/drivers/video/omap/lcd_inn1610.c
> b/drivers/video/omap/lcd_inn1610.c index a95756b..7e8bd8e 100644
> --- a/drivers/video/omap/lcd_inn1610.c
> +++ b/drivers/video/omap/lcd_inn1610.c
> @@ -133,16 +133,4 @@ static struct platform_driver
> innovator1610_panel_driver = { },
>  };
> 
> -static int __init innovator1610_panel_drv_init(void)
> -{
> -	return platform_driver_register(&innovator1610_panel_driver);
> -}
> -
> -static void __exit innovator1610_panel_drv_cleanup(void)
> -{
> -	platform_driver_unregister(&innovator1610_panel_driver);
> -}
> -
> -module_init(innovator1610_panel_drv_init);
> -module_exit(innovator1610_panel_drv_cleanup);
> -
> +module_platform_driver(innovator1610_panel_driver);
> diff --git a/drivers/video/omap/lcd_osk.c b/drivers/video/omap/lcd_osk.c
> index b985997..5914220 100644
> --- a/drivers/video/omap/lcd_osk.c
> +++ b/drivers/video/omap/lcd_osk.c
> @@ -127,16 +127,4 @@ static struct platform_driver osk_panel_driver = {
>  	},
>  };
> 
> -static int __init osk_panel_drv_init(void)
> -{
> -	return platform_driver_register(&osk_panel_driver);
> -}
> -
> -static void __exit osk_panel_drv_cleanup(void)
> -{
> -	platform_driver_unregister(&osk_panel_driver);
> -}
> -
> -module_init(osk_panel_drv_init);
> -module_exit(osk_panel_drv_cleanup);
> -
> +module_platform_driver(osk_panel_driver);
> diff --git a/drivers/video/omap/lcd_palmte.c
> b/drivers/video/omap/lcd_palmte.c index d79f436..88c31eb 100644
> --- a/drivers/video/omap/lcd_palmte.c
> +++ b/drivers/video/omap/lcd_palmte.c
> @@ -108,16 +108,4 @@ static struct platform_driver palmte_panel_driver = {
>  	},
>  };
> 
> -static int __init palmte_panel_drv_init(void)
> -{
> -	return platform_driver_register(&palmte_panel_driver);
> -}
> -
> -static void __exit palmte_panel_drv_cleanup(void)
> -{
> -	platform_driver_unregister(&palmte_panel_driver);
> -}
> -
> -module_init(palmte_panel_drv_init);
> -module_exit(palmte_panel_drv_cleanup);
> -
> +module_platform_driver(palmte_panel_driver);
> diff --git a/drivers/video/omap/lcd_palmtt.c
> b/drivers/video/omap/lcd_palmtt.c index c2e96a7..aaf3c8b 100644
> --- a/drivers/video/omap/lcd_palmtt.c
> +++ b/drivers/video/omap/lcd_palmtt.c
> @@ -113,15 +113,4 @@ static struct platform_driver palmtt_panel_driver = {
>  	},
>  };
> 
> -static int __init palmtt_panel_drv_init(void)
> -{
> -	return platform_driver_register(&palmtt_panel_driver);
> -}
> -
> -static void __exit palmtt_panel_drv_cleanup(void)
> -{
> -	platform_driver_unregister(&palmtt_panel_driver);
> -}
> -
> -module_init(palmtt_panel_drv_init);
> -module_exit(palmtt_panel_drv_cleanup);
> +module_platform_driver(palmtt_panel_driver);
> diff --git a/drivers/video/omap/lcd_palmz71.c
> b/drivers/video/omap/lcd_palmz71.c index 1ab4847..3b7d8aa 100644
> --- a/drivers/video/omap/lcd_palmz71.c
> +++ b/drivers/video/omap/lcd_palmz71.c
> @@ -109,15 +109,4 @@ static struct platform_driver palmz71_panel_driver = {
>  	},
>  };
> 
> -static int __init palmz71_panel_drv_init(void)
> -{
> -	return platform_driver_register(&palmz71_panel_driver);
> -}
> -
> -static void __exit palmz71_panel_drv_cleanup(void)
> -{
> -	platform_driver_unregister(&palmz71_panel_driver);
> -}
> -
> -module_init(palmz71_panel_drv_init);
> -module_exit(palmz71_panel_drv_cleanup);
> +module_platform_driver(palmz71_panel_driver);

PalmTT and PalmZ71, please add my
Acked-by: Marek Vasut <marek.vasut@gmail.com>

^ permalink raw reply

* Re: [PATCH] drivers/video: fsl-diu-fb: rename "machine_data_" to
From: Tabi Timur-B04825 @ 2011-12-09 19:54 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1323386851-3480-1-git-send-email-timur@freescale.com>

On Thu, Dec 8, 2011 at 5:27 PM, Timur Tabi <timur@freescale.com> wrote:
> "machine_data" is too long and clunky, and the "machine" part doesn't make
> much sense, anyway.
>
> Signed-off-by: Timur Tabi <timur@freescale.com>

Oops... I see an extra underscore in the git subject.  Florian, would
you be so kind as to remove it if/when you apply this patch?

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* Re: [PATCH 1/2] video: omap: Staticise non-exported symbols
From: Jonathan McDowell @ 2011-12-09 21:59 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Axel Lin, linux-kernel, Imre Deak, Cory Maccarrone,
	Laurent Gonzalez, Tomi Valkeinen, Florian Tobias Schandinat,
	linux-fbdev, linux-omap
In-Reply-To: <201112090923.46643.marek.vasut@gmail.com>

On Fri, Dec 09, 2011 at 09:23:46AM +0100, Marek Vasut wrote:
> > These symbols are not used outside it's driver so no need to
> > make the symbol global.
> > 
> > Signed-off-by: Axel Lin <axel.lin@gmail.com>
> > ---
> >  drivers/video/omap/lcd_ams_delta.c |    2 +-
> >  drivers/video/omap/lcd_h3.c        |    2 +-
> >  drivers/video/omap/lcd_htcherald.c |    2 +-
> >  drivers/video/omap/lcd_inn1510.c   |    2 +-
> >  drivers/video/omap/lcd_inn1610.c   |    2 +-
> >  drivers/video/omap/lcd_osk.c       |    2 +-
> >  drivers/video/omap/lcd_palmte.c    |    2 +-
> >  drivers/video/omap/lcd_palmtt.c    |    2 +-
> >  drivers/video/omap/lcd_palmz71.c   |    2 +-
> >  9 files changed, 9 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/video/omap/lcd_ams_delta.c
> > b/drivers/video/omap/lcd_ams_delta.c index 6978ae4..eb50a95 100644
> > --- a/drivers/video/omap/lcd_ams_delta.c
> > +++ b/drivers/video/omap/lcd_ams_delta.c
> > @@ -198,7 +198,7 @@ static int ams_delta_panel_resume(struct
> > platform_device *pdev) return 0;
> >  }
> > 
> > -struct platform_driver ams_delta_panel_driver = {
> > +static struct platform_driver ams_delta_panel_driver = {
> >  	.probe		= ams_delta_panel_probe,
> >  	.remove		= ams_delta_panel_remove,
> >  	.suspend	= ams_delta_panel_suspend,
> > diff --git a/drivers/video/omap/lcd_h3.c b/drivers/video/omap/lcd_h3.c
> > index 622ad83..baec34e 100644
> > --- a/drivers/video/omap/lcd_h3.c
> > +++ b/drivers/video/omap/lcd_h3.c
> > @@ -113,7 +113,7 @@ static int h3_panel_resume(struct platform_device
> > *pdev) return 0;
> >  }
> > 
> > -struct platform_driver h3_panel_driver = {
> > +static struct platform_driver h3_panel_driver = {
> >  	.probe		= h3_panel_probe,
> >  	.remove		= h3_panel_remove,
> >  	.suspend	= h3_panel_suspend,
> > diff --git a/drivers/video/omap/lcd_htcherald.c
> > b/drivers/video/omap/lcd_htcherald.c index 4802419..b1a022f 100644
> > --- a/drivers/video/omap/lcd_htcherald.c
> > +++ b/drivers/video/omap/lcd_htcherald.c
> > @@ -104,7 +104,7 @@ static int htcherald_panel_resume(struct
> > platform_device *pdev) return 0;
> >  }
> > 
> > -struct platform_driver htcherald_panel_driver = {
> > +static struct platform_driver htcherald_panel_driver = {
> >  	.probe		= htcherald_panel_probe,
> >  	.remove		= htcherald_panel_remove,
> >  	.suspend	= htcherald_panel_suspend,
> > diff --git a/drivers/video/omap/lcd_inn1510.c
> > b/drivers/video/omap/lcd_inn1510.c index 3271f16..d129946 100644
> > --- a/drivers/video/omap/lcd_inn1510.c
> > +++ b/drivers/video/omap/lcd_inn1510.c
> > @@ -98,7 +98,7 @@ static int innovator1510_panel_resume(struct
> > platform_device *pdev) return 0;
> >  }
> > 
> > -struct platform_driver innovator1510_panel_driver = {
> > +static struct platform_driver innovator1510_panel_driver = {
> >  	.probe		= innovator1510_panel_probe,
> >  	.remove		= innovator1510_panel_remove,
> >  	.suspend	= innovator1510_panel_suspend,
> > diff --git a/drivers/video/omap/lcd_inn1610.c
> > b/drivers/video/omap/lcd_inn1610.c index 12cc52a..a95756b 100644
> > --- a/drivers/video/omap/lcd_inn1610.c
> > +++ b/drivers/video/omap/lcd_inn1610.c
> > @@ -122,7 +122,7 @@ static int innovator1610_panel_resume(struct
> > platform_device *pdev) return 0;
> >  }
> > 
> > -struct platform_driver innovator1610_panel_driver = {
> > +static struct platform_driver innovator1610_panel_driver = {
> >  	.probe		= innovator1610_panel_probe,
> >  	.remove		= innovator1610_panel_remove,
> >  	.suspend	= innovator1610_panel_suspend,
> > diff --git a/drivers/video/omap/lcd_osk.c b/drivers/video/omap/lcd_osk.c
> > index 6f8d13c..b985997 100644
> > --- a/drivers/video/omap/lcd_osk.c
> > +++ b/drivers/video/omap/lcd_osk.c
> > @@ -116,7 +116,7 @@ static int osk_panel_resume(struct platform_device
> > *pdev) return 0;
> >  }
> > 
> > -struct platform_driver osk_panel_driver = {
> > +static struct platform_driver osk_panel_driver = {
> >  	.probe		= osk_panel_probe,
> >  	.remove		= osk_panel_remove,
> >  	.suspend	= osk_panel_suspend,
> > diff --git a/drivers/video/omap/lcd_palmte.c
> > b/drivers/video/omap/lcd_palmte.c index 4cb3017..d79f436 100644
> > --- a/drivers/video/omap/lcd_palmte.c
> > +++ b/drivers/video/omap/lcd_palmte.c
> > @@ -97,7 +97,7 @@ static int palmte_panel_resume(struct platform_device
> > *pdev) return 0;
> >  }
> > 
> > -struct platform_driver palmte_panel_driver = {
> > +static struct platform_driver palmte_panel_driver = {
> >  	.probe		= palmte_panel_probe,
> >  	.remove		= palmte_panel_remove,
> >  	.suspend	= palmte_panel_suspend,
> > diff --git a/drivers/video/omap/lcd_palmtt.c
> > b/drivers/video/omap/lcd_palmtt.c index b51b332..c2e96a7 100644
> > --- a/drivers/video/omap/lcd_palmtt.c
> > +++ b/drivers/video/omap/lcd_palmtt.c
> > @@ -102,7 +102,7 @@ static int palmtt_panel_resume(struct platform_device
> > *pdev) return 0;
> >  }
> > 
> > -struct platform_driver palmtt_panel_driver = {
> > +static struct platform_driver palmtt_panel_driver = {
> >  	.probe		= palmtt_panel_probe,
> >  	.remove		= palmtt_panel_remove,
> >  	.suspend	= palmtt_panel_suspend,
> > diff --git a/drivers/video/omap/lcd_palmz71.c
> > b/drivers/video/omap/lcd_palmz71.c index 2334e56..1ab4847 100644
> > --- a/drivers/video/omap/lcd_palmz71.c
> > +++ b/drivers/video/omap/lcd_palmz71.c
> > @@ -98,7 +98,7 @@ static int palmz71_panel_resume(struct platform_device
> > *pdev) return 0;
> >  }
> > 
> > -struct platform_driver palmz71_panel_driver = {
> > +static struct platform_driver palmz71_panel_driver = {
> >  	.probe		= palmz71_panel_probe,
> >  	.remove		= palmz71_panel_remove,
> >  	.suspend	= palmz71_panel_suspend,
> 
> I can speak for palmtt and palmz71,
> 
> Acked-by: Marek Vasut <marek.vasut@gmail.com>

Likewise, for ams-delta,

Acked-By: Jonathan McDowell <noodles@earth.li>

J.

-- 
Generally, all generalizations are false..
This .sig brought to you by the letter Z and the number 26
Product of the Republic of HuggieTag

^ permalink raw reply

* Re: [PATCH 2/3] video: omap: convert drivers/video/omap/* to use
From: Jonathan McDowell @ 2011-12-09 22:00 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Axel Lin, linux-kernel, Cory Maccarrone, Laurent Gonzalez,
	Tomi Valkeinen, Florian Tobias Schandinat, linux-fbdev,
	linux-omap
In-Reply-To: <201112090924.29551.marek.vasut@gmail.com>

On Fri, Dec 09, 2011 at 09:24:29AM +0100, Marek Vasut wrote:
> > This patch converts the drivers in drivers/video/omap/* to use the
> > module_platform_driver() macro which makes the code smaller and a bit
> > simpler.
> > 
> > Cc: Jonathan McDowell <noodles@earth.li>
> > Cc: Cory Maccarrone <darkstar6262@gmail.com>
> > Cc: Laurent Gonzalez <palmte.linux@free.fr>
> > Cc: Marek Vasut <marek.vasut@gmail.com>
> > Signed-off-by: Axel Lin <axel.lin@gmail.com>
> > ---
> >  drivers/video/omap/lcd_ams_delta.c |   13 +------------
> >  drivers/video/omap/lcd_h3.c        |   14 +-------------
> >  drivers/video/omap/lcd_htcherald.c |   14 +-------------
> >  drivers/video/omap/lcd_inn1510.c   |   14 +-------------
> >  drivers/video/omap/lcd_inn1610.c   |   14 +-------------
> >  drivers/video/omap/lcd_osk.c       |   14 +-------------
> >  drivers/video/omap/lcd_palmte.c    |   14 +-------------
> >  drivers/video/omap/lcd_palmtt.c    |   13 +------------
> >  drivers/video/omap/lcd_palmz71.c   |   13 +------------
> >  9 files changed, 9 insertions(+), 114 deletions(-)
> > 
> > diff --git a/drivers/video/omap/lcd_ams_delta.c
> > b/drivers/video/omap/lcd_ams_delta.c index eb50a95..0fdd6f6 100644
> > --- a/drivers/video/omap/lcd_ams_delta.c
> > +++ b/drivers/video/omap/lcd_ams_delta.c
> > @@ -209,15 +209,4 @@ static struct platform_driver ams_delta_panel_driver > > { },
> >  };
> > 
> > -static int __init ams_delta_panel_drv_init(void)
> > -{
> > -	return platform_driver_register(&ams_delta_panel_driver);
> > -}
> > -
> > -static void __exit ams_delta_panel_drv_cleanup(void)
> > -{
> > -	platform_driver_unregister(&ams_delta_panel_driver);
> > -}
> > -
> > -module_init(ams_delta_panel_drv_init);
> > -module_exit(ams_delta_panel_drv_cleanup);
> > +module_platform_driver(ams_delta_panel_driver);
> > diff --git a/drivers/video/omap/lcd_h3.c b/drivers/video/omap/lcd_h3.c
> > index baec34e..49bdeca 100644
> > --- a/drivers/video/omap/lcd_h3.c
> > +++ b/drivers/video/omap/lcd_h3.c
> > @@ -124,16 +124,4 @@ static struct platform_driver h3_panel_driver = {
> >  	},
> >  };
> > 
> > -static int __init h3_panel_drv_init(void)
> > -{
> > -	return platform_driver_register(&h3_panel_driver);
> > -}
> > -
> > -static void __exit h3_panel_drv_cleanup(void)
> > -{
> > -	platform_driver_unregister(&h3_panel_driver);
> > -}
> > -
> > -module_init(h3_panel_drv_init);
> > -module_exit(h3_panel_drv_cleanup);
> > -
> > +module_platform_driver(h3_panel_driver);
> > diff --git a/drivers/video/omap/lcd_htcherald.c
> > b/drivers/video/omap/lcd_htcherald.c index b1a022f..20f4778 100644
> > --- a/drivers/video/omap/lcd_htcherald.c
> > +++ b/drivers/video/omap/lcd_htcherald.c
> > @@ -115,16 +115,4 @@ static struct platform_driver htcherald_panel_driver > > { },
> >  };
> > 
> > -static int __init htcherald_panel_drv_init(void)
> > -{
> > -	return platform_driver_register(&htcherald_panel_driver);
> > -}
> > -
> > -static void __exit htcherald_panel_drv_cleanup(void)
> > -{
> > -	platform_driver_unregister(&htcherald_panel_driver);
> > -}
> > -
> > -module_init(htcherald_panel_drv_init);
> > -module_exit(htcherald_panel_drv_cleanup);
> > -
> > +module_platform_driver(htcherald_panel_driver);
> > diff --git a/drivers/video/omap/lcd_inn1510.c
> > b/drivers/video/omap/lcd_inn1510.c index d129946..b38b1dd 100644
> > --- a/drivers/video/omap/lcd_inn1510.c
> > +++ b/drivers/video/omap/lcd_inn1510.c
> > @@ -109,16 +109,4 @@ static struct platform_driver
> > innovator1510_panel_driver = { },
> >  };
> > 
> > -static int __init innovator1510_panel_drv_init(void)
> > -{
> > -	return platform_driver_register(&innovator1510_panel_driver);
> > -}
> > -
> > -static void __exit innovator1510_panel_drv_cleanup(void)
> > -{
> > -	platform_driver_unregister(&innovator1510_panel_driver);
> > -}
> > -
> > -module_init(innovator1510_panel_drv_init);
> > -module_exit(innovator1510_panel_drv_cleanup);
> > -
> > +module_platform_driver(innovator1510_panel_driver);
> > diff --git a/drivers/video/omap/lcd_inn1610.c
> > b/drivers/video/omap/lcd_inn1610.c index a95756b..7e8bd8e 100644
> > --- a/drivers/video/omap/lcd_inn1610.c
> > +++ b/drivers/video/omap/lcd_inn1610.c
> > @@ -133,16 +133,4 @@ static struct platform_driver
> > innovator1610_panel_driver = { },
> >  };
> > 
> > -static int __init innovator1610_panel_drv_init(void)
> > -{
> > -	return platform_driver_register(&innovator1610_panel_driver);
> > -}
> > -
> > -static void __exit innovator1610_panel_drv_cleanup(void)
> > -{
> > -	platform_driver_unregister(&innovator1610_panel_driver);
> > -}
> > -
> > -module_init(innovator1610_panel_drv_init);
> > -module_exit(innovator1610_panel_drv_cleanup);
> > -
> > +module_platform_driver(innovator1610_panel_driver);
> > diff --git a/drivers/video/omap/lcd_osk.c b/drivers/video/omap/lcd_osk.c
> > index b985997..5914220 100644
> > --- a/drivers/video/omap/lcd_osk.c
> > +++ b/drivers/video/omap/lcd_osk.c
> > @@ -127,16 +127,4 @@ static struct platform_driver osk_panel_driver = {
> >  	},
> >  };
> > 
> > -static int __init osk_panel_drv_init(void)
> > -{
> > -	return platform_driver_register(&osk_panel_driver);
> > -}
> > -
> > -static void __exit osk_panel_drv_cleanup(void)
> > -{
> > -	platform_driver_unregister(&osk_panel_driver);
> > -}
> > -
> > -module_init(osk_panel_drv_init);
> > -module_exit(osk_panel_drv_cleanup);
> > -
> > +module_platform_driver(osk_panel_driver);
> > diff --git a/drivers/video/omap/lcd_palmte.c
> > b/drivers/video/omap/lcd_palmte.c index d79f436..88c31eb 100644
> > --- a/drivers/video/omap/lcd_palmte.c
> > +++ b/drivers/video/omap/lcd_palmte.c
> > @@ -108,16 +108,4 @@ static struct platform_driver palmte_panel_driver = {
> >  	},
> >  };
> > 
> > -static int __init palmte_panel_drv_init(void)
> > -{
> > -	return platform_driver_register(&palmte_panel_driver);
> > -}
> > -
> > -static void __exit palmte_panel_drv_cleanup(void)
> > -{
> > -	platform_driver_unregister(&palmte_panel_driver);
> > -}
> > -
> > -module_init(palmte_panel_drv_init);
> > -module_exit(palmte_panel_drv_cleanup);
> > -
> > +module_platform_driver(palmte_panel_driver);
> > diff --git a/drivers/video/omap/lcd_palmtt.c
> > b/drivers/video/omap/lcd_palmtt.c index c2e96a7..aaf3c8b 100644
> > --- a/drivers/video/omap/lcd_palmtt.c
> > +++ b/drivers/video/omap/lcd_palmtt.c
> > @@ -113,15 +113,4 @@ static struct platform_driver palmtt_panel_driver = {
> >  	},
> >  };
> > 
> > -static int __init palmtt_panel_drv_init(void)
> > -{
> > -	return platform_driver_register(&palmtt_panel_driver);
> > -}
> > -
> > -static void __exit palmtt_panel_drv_cleanup(void)
> > -{
> > -	platform_driver_unregister(&palmtt_panel_driver);
> > -}
> > -
> > -module_init(palmtt_panel_drv_init);
> > -module_exit(palmtt_panel_drv_cleanup);
> > +module_platform_driver(palmtt_panel_driver);
> > diff --git a/drivers/video/omap/lcd_palmz71.c
> > b/drivers/video/omap/lcd_palmz71.c index 1ab4847..3b7d8aa 100644
> > --- a/drivers/video/omap/lcd_palmz71.c
> > +++ b/drivers/video/omap/lcd_palmz71.c
> > @@ -109,15 +109,4 @@ static struct platform_driver palmz71_panel_driver = {
> >  	},
> >  };
> > 
> > -static int __init palmz71_panel_drv_init(void)
> > -{
> > -	return platform_driver_register(&palmz71_panel_driver);
> > -}
> > -
> > -static void __exit palmz71_panel_drv_cleanup(void)
> > -{
> > -	platform_driver_unregister(&palmz71_panel_driver);
> > -}
> > -
> > -module_init(palmz71_panel_drv_init);
> > -module_exit(palmz71_panel_drv_cleanup);
> > +module_platform_driver(palmz71_panel_driver);
> 
> PalmTT and PalmZ71, please add my
> Acked-by: Marek Vasut <marek.vasut@gmail.com>

For ams-delta,

Acked-By: Jonathan McDowell <noodles@earth.li>

J.

-- 
                                            xmpp:noodles@earth.li
Time is an illusion. Lunchtime doubly so.

^ permalink raw reply

* [PATCH 02/16] macfb: fix black and white modes
From: Finn Thain @ 2011-12-10  5:23 UTC (permalink / raw)
  To: Florian Tobias Schandinat; +Cc: linux-fbdev, linux-m68k, Geert Uytterhoeven
In-Reply-To: <20111023141119.848736612@telegraphics.com.au>

macfb won't init in black & white modes since fb_alloc_cmap() no longer 
works for zero cmap length. Fix this and also clean up a few printk's 
and some stylistic inconsistencies.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

---

Re-sending unchanged. Still needs the right ack.

Index: linux-m68k/drivers/video/macfb.c
=================================--- linux-m68k.orig/drivers/video/macfb.c	2011-10-22 23:02:22.000000000 +1100
+++ linux-m68k/drivers/video/macfb.c	2011-10-23 00:50:51.000000000 +1100
@@ -592,12 +592,12 @@ static int __init macfb_init(void)
 	if (!fb_info.screen_base)
 		return -ENODEV;
 
-	printk("macfb: framebuffer at 0x%08lx, mapped to 0x%p, size %dk\n",
-	       macfb_fix.smem_start, fb_info.screen_base,
-	       macfb_fix.smem_len / 1024);
-	printk("macfb: mode is %dx%dx%d, linelength=%d\n",
-	       macfb_defined.xres, macfb_defined.yres,
-	       macfb_defined.bits_per_pixel, macfb_fix.line_length);
+	pr_info("macfb: framebuffer at 0x%08lx, mapped to 0x%p, size %dk\n",
+	        macfb_fix.smem_start, fb_info.screen_base,
+	        macfb_fix.smem_len / 1024);
+	pr_info("macfb: mode is %dx%dx%d, linelength=%d\n",
+	        macfb_defined.xres, macfb_defined.yres,
+	        macfb_defined.bits_per_pixel, macfb_fix.line_length);
 
 	/* Fill in the available video resolution */
 	macfb_defined.xres_virtual = macfb_defined.xres;
@@ -613,14 +613,10 @@ static int __init macfb_init(void)
 
 	switch (macfb_defined.bits_per_pixel) {
 	case 1:
-		/*
-		 * XXX: I think this will catch any program that tries
-		 * to do FBIO_PUTCMAP when the visual is monochrome.
-		 */
 		macfb_defined.red.length = macfb_defined.bits_per_pixel;
 		macfb_defined.green.length = macfb_defined.bits_per_pixel;
 		macfb_defined.blue.length = macfb_defined.bits_per_pixel;
-		video_cmap_len = 0;
+		video_cmap_len = 2;
 		macfb_fix.visual = FB_VISUAL_MONO01;
 		break;
 	case 2:
@@ -660,11 +656,10 @@ static int __init macfb_init(void)
 		macfb_fix.visual = FB_VISUAL_TRUECOLOR;
 		break;
 	default:
-		video_cmap_len = 0;
-		macfb_fix.visual = FB_VISUAL_MONO01;
-		printk("macfb: unknown or unsupported bit depth: %d\n",
+		pr_err("macfb: unknown or unsupported bit depth: %d\n",
 		       macfb_defined.bits_per_pixel);
-		break;
+		err = -EINVAL;
+		goto fail_unmap;
 	}
 	
 	/*
@@ -734,8 +729,8 @@ static int __init macfb_init(void)
 		case MAC_MODEL_Q950:
 			strcpy(macfb_fix.id, "DAFB");
 			macfb_setpalette = dafb_setpalette;
-			macfb_defined.activate = FB_ACTIVATE_NOW;
 			dafb_cmap_regs = ioremap(DAFB_BASE, 0x1000);
+			macfb_defined.activate = FB_ACTIVATE_NOW;
 			break;
 
 		/*
@@ -744,8 +739,8 @@ static int __init macfb_init(void)
 		case MAC_MODEL_LCII:
 			strcpy(macfb_fix.id, "V8");
 			macfb_setpalette = v8_brazil_setpalette;
-			macfb_defined.activate = FB_ACTIVATE_NOW;
 			v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000);
+			macfb_defined.activate = FB_ACTIVATE_NOW;
 			break;
 
 		/*
@@ -758,8 +753,8 @@ static int __init macfb_init(void)
 		case MAC_MODEL_P600:
 			strcpy(macfb_fix.id, "Brazil");
 			macfb_setpalette = v8_brazil_setpalette;
-			macfb_defined.activate = FB_ACTIVATE_NOW;
 			v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000);
+			macfb_defined.activate = FB_ACTIVATE_NOW;
 			break;
 
 		/*
@@ -773,10 +768,10 @@ static int __init macfb_init(void)
 		case MAC_MODEL_P520:
 		case MAC_MODEL_P550:
 		case MAC_MODEL_P460:
-			macfb_setpalette = v8_brazil_setpalette;
-			macfb_defined.activate = FB_ACTIVATE_NOW;
 			strcpy(macfb_fix.id, "Sonora");
+			macfb_setpalette = v8_brazil_setpalette;
 			v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000);
+			macfb_defined.activate = FB_ACTIVATE_NOW;
 			break;
 
 		/*
@@ -786,10 +781,10 @@ static int __init macfb_init(void)
 		 */
 		case MAC_MODEL_IICI:
 		case MAC_MODEL_IISI:
-			macfb_setpalette = rbv_setpalette;
-			macfb_defined.activate = FB_ACTIVATE_NOW;
 			strcpy(macfb_fix.id, "RBV");
+			macfb_setpalette = rbv_setpalette;
 			rbv_cmap_regs = ioremap(DAC_BASE, 0x1000);
+			macfb_defined.activate = FB_ACTIVATE_NOW;
 			break;
 
 		/*
@@ -797,10 +792,10 @@ static int __init macfb_init(void)
 		 */
 		case MAC_MODEL_Q840:
 		case MAC_MODEL_C660:
-			macfb_setpalette = civic_setpalette;
-			macfb_defined.activate = FB_ACTIVATE_NOW;
 			strcpy(macfb_fix.id, "Civic");
+			macfb_setpalette = civic_setpalette;
 			civic_cmap_regs = ioremap(CIVIC_BASE, 0x1000);
+			macfb_defined.activate = FB_ACTIVATE_NOW;
 			break;
 
 		
@@ -809,26 +804,26 @@ static int __init macfb_init(void)
 		 * We think this may be like the LC II
 		 */
 		case MAC_MODEL_LC:
+			strcpy(macfb_fix.id, "LC");
 			if (vidtest) {
 				macfb_setpalette = v8_brazil_setpalette;
-				macfb_defined.activate = FB_ACTIVATE_NOW;
 				v8_brazil_cmap_regs  					ioremap(DAC_BASE, 0x1000);
+				macfb_defined.activate = FB_ACTIVATE_NOW;
 			}
-			strcpy(macfb_fix.id, "LC");
 			break;
 
 		/*
 		 * We think this may be like the LC II
 		 */
 		case MAC_MODEL_CCL:
+			strcpy(macfb_fix.id, "Color Classic");
 			if (vidtest) {
 				macfb_setpalette = v8_brazil_setpalette;
-				macfb_defined.activate = FB_ACTIVATE_NOW;
 				v8_brazil_cmap_regs  					ioremap(DAC_BASE, 0x1000);
+				macfb_defined.activate = FB_ACTIVATE_NOW;
 			}
-			strcpy(macfb_fix.id, "Color Classic");
 			break;
 
 		/*
@@ -893,10 +888,10 @@ static int __init macfb_init(void)
 		case MAC_MODEL_PB270C:
 		case MAC_MODEL_PB280:
 		case MAC_MODEL_PB280C:
-			macfb_setpalette = csc_setpalette;
-			macfb_defined.activate = FB_ACTIVATE_NOW;
 			strcpy(macfb_fix.id, "CSC");
+			macfb_setpalette = csc_setpalette;
 			csc_cmap_regs = ioremap(CSC_BASE, 0x1000);
+			macfb_defined.activate = FB_ACTIVATE_NOW;
 			break;
 
 		default:
@@ -918,8 +913,9 @@ static int __init macfb_init(void)
 	if (err)
 		goto fail_dealloc;
 
-	printk("fb%d: %s frame buffer device\n",
-	       fb_info.node, fb_info.fix.id);
+	pr_info("fb%d: %s frame buffer device\n",
+	        fb_info.node, fb_info.fix.id);
+
 	return 0;
 
 fail_dealloc:

^ permalink raw reply

* [PATCH 00/10] ARM: OMAP1: ams-delta: replace custom I/O with GPIO
From: Janusz Krzysztofik @ 2011-12-11 20:11 UTC (permalink / raw)
  To: Tony Lindgren, Grant Likely, Dmitry Torokhov, Richard Purdie,
	David Woodhouse, Tomi Valkeinen, Jarkko Nikula
  Cc: linux-omap, linux-arm-kernel, linux-kernel, Janusz Krzysztofik,
	linux-input, linux-mtd, linux-fbdev, alsa-devel, Liam Girdwood,
	Mark Brown

The Amstrad Delta board has two extra output ports used for driving
input lines of different on-board devices. Those ports are now
controlled with custom functions, provided by the board arch code and
used by several device drivers.

The idea behind the series is to replace those custom I/O functions
with gpiolib API. This way, existing drivers can be made less platform
dependent, and some of them perhaps even superseded with generic GPIO
based drivers after the board platform device descriptions are
converted. Moreover, should a new driver for the on-board Smart Card
controller ever be created, it could be designed as a generic GPIO
based driver, not a custom one.

Janusz Krzysztofik (10):
  GPIO: gpio-generic: Move initialization up to postcore
  ARM: OMAP1: ams-delta: convert latches to basic_mmio_gpio
  ARM: OMAP1: ams-delta: supersede custom led device by leds-gpio
  LED: drop leds-ams-delta driver
  MTD: NAND: ams-delta: use GPIO instead of custom I/O
  ARM: OMAP1: ams-delta: Use GPIO API in modem setup
  ASoC: OMAP: ams-delta: Drive modem/codec pins over GPIO API
  omapfb: lcd_ams_delta: Drive control lines over GPIO
  input: serio: ams-delta: toggle keyboard power over GPIO
  ARM: OMAP1: ams-delta: drop custom I/O functions

 arch/arm/mach-omap1/Kconfig                       |    2 +
 arch/arm/mach-omap1/board-ams-delta.c             |  220 +++++++++++++++++----
 arch/arm/plat-omap/include/plat/board-ams-delta.h |   50 ++---
 drivers/gpio/gpio-generic.c                       |    2 +-
 drivers/input/serio/ams_delta_serio.c             |   45 +++--
 drivers/leds/Kconfig                              |    7 -
 drivers/leds/Makefile                             |    1 -
 drivers/leds/leds-ams-delta.c                     |  137 -------------
 drivers/mtd/nand/ams-delta.c                      |   74 +++++--
 drivers/video/omap/lcd_ams_delta.c                |   27 ++-
 sound/soc/omap/ams-delta.c                        |   21 ++-
 11 files changed, 309 insertions(+), 277 deletions(-)
 delete mode 100644 drivers/leds/leds-ams-delta.c

-- 
1.7.3.4


^ permalink raw reply

* [PATCH 08/10] omapfb: lcd_ams_delta: Drive control lines over GPIO
From: Janusz Krzysztofik @ 2011-12-11 20:12 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1323634328-856-1-git-send-email-jkrzyszt@tis.icnet.pl>

Don't use Amstrad Delta custom I/O functions any longer, use GPIO API
instead.

Depends on patch 5/10 "MTD: NAND: ams-delta: Use GPIO instead of custom
I/O".

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
---
 arch/arm/mach-omap1/board-ams-delta.c             |   10 -------
 arch/arm/plat-omap/include/plat/board-ams-delta.h |    2 -
 drivers/video/omap/lcd_ams_delta.c                |   27 +++++++++++++++-----
 3 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 5705481..b7422e3 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -232,16 +232,6 @@ static struct gpio _latch_gpios[] __initconst = {
 		.label	= "dockit2",
 	},
 	{
-		.gpio	= AMS_DELTA_GPIO_PIN_LCD_VBLEN,
-		.flags	= GPIOF_OUT_INIT_LOW,
-		.label	= "lcd_vblen",
-	},
-	{
-		.gpio	= AMS_DELTA_GPIO_PIN_LCD_NDISP,
-		.flags	= GPIOF_OUT_INIT_LOW,
-		.label	= "lcd_ndisp",
-	},
-	{
 		.gpio	= AMS_DELTA_GPIO_PIN_KEYBRD_PWR,
 		.flags	= GPIOF_OUT_INIT_LOW,
 		.label	= "keybrd_pwr",
diff --git a/arch/arm/plat-omap/include/plat/board-ams-delta.h b/arch/arm/plat-omap/include/plat/board-ams-delta.h
index 73fdab9..1d0706e 100644
--- a/arch/arm/plat-omap/include/plat/board-ams-delta.h
+++ b/arch/arm/plat-omap/include/plat/board-ams-delta.h
@@ -28,8 +28,6 @@
 
 #if defined (CONFIG_MACH_AMS_DELTA)
 
-#define AMS_DELTA_LATCH2_LCD_VBLEN	0x0001
-#define AMS_DELTA_LATCH2_LCD_NDISP	0x0002
 #define AMD_DELTA_LATCH2_KEYBRD_PWR	0x0100
 #define AMD_DELTA_LATCH2_KEYBRD_DATA	0x0200
 #define AMD_DELTA_LATCH2_SCARD_RSTIN	0x0400
diff --git a/drivers/video/omap/lcd_ams_delta.c b/drivers/video/omap/lcd_ams_delta.c
index 6978ae4..73b211b 100644
--- a/drivers/video/omap/lcd_ams_delta.c
+++ b/drivers/video/omap/lcd_ams_delta.c
@@ -25,6 +25,7 @@
 #include <linux/io.h>
 #include <linux/delay.h>
 #include <linux/lcd.h>
+#include <linux/gpio.h>
 
 #include <plat/board-ams-delta.h>
 #include <mach/hardware.h>
@@ -98,29 +99,41 @@ static struct lcd_ops ams_delta_lcd_ops = {
 
 /* omapfb panel section */
 
+static struct gpio _gpios[] __initconst_or_module = {
+	{
+		.gpio	= AMS_DELTA_GPIO_PIN_LCD_VBLEN,
+		.flags	= GPIOF_OUT_INIT_LOW,
+		.label	= "lcd_vblen",
+	},
+	{
+		.gpio	= AMS_DELTA_GPIO_PIN_LCD_NDISP,
+		.flags	= GPIOF_OUT_INIT_LOW,
+		.label	= "lcd_ndisp",
+	},
+};
+
 static int ams_delta_panel_init(struct lcd_panel *panel,
 		struct omapfb_device *fbdev)
 {
-	return 0;
+	return gpio_request_array(_gpios, ARRAY_SIZE(_gpios));
 }
 
 static void ams_delta_panel_cleanup(struct lcd_panel *panel)
 {
+	gpio_free_array(_gpios, ARRAY_SIZE(_gpios));
 }
 
 static int ams_delta_panel_enable(struct lcd_panel *panel)
 {
-	ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP,
-			AMS_DELTA_LATCH2_LCD_NDISP);
-	ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN,
-			AMS_DELTA_LATCH2_LCD_VBLEN);
+	gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 1);
+	gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 1);
 	return 0;
 }
 
 static void ams_delta_panel_disable(struct lcd_panel *panel)
 {
-	ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN, 0);
-	ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP, 0);
+	gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 0);
+	gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 0);
 }
 
 static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel)
-- 
1.7.3.4


^ permalink raw reply related

* Re: [PATCH 00/10] ARM: OMAP1: ams-delta: replace custom I/O with
From: Jonathan McDowell @ 2011-12-12  5:00 UTC (permalink / raw)
  To: Janusz Krzysztofik
  Cc: Tony Lindgren, Grant Likely, Dmitry Torokhov, Richard Purdie,
	David Woodhouse, Tomi Valkeinen, Jarkko Nikula, linux-fbdev,
	alsa-devel, Mark Brown, linux-kernel, linux-mtd, linux-input,
	linux-omap, Liam Girdwood, linux-arm-kernel
In-Reply-To: <1323634328-856-1-git-send-email-jkrzyszt@tis.icnet.pl>

On Sun, Dec 11, 2011 at 09:11:58PM +0100, Janusz Krzysztofik wrote:
> The Amstrad Delta board has two extra output ports used for driving
> input lines of different on-board devices. Those ports are now
> controlled with custom functions, provided by the board arch code and
> used by several device drivers.
> 
> The idea behind the series is to replace those custom I/O functions
> with gpiolib API. This way, existing drivers can be made less platform
> dependent, and some of them perhaps even superseded with generic GPIO
> based drivers after the board platform device descriptions are
> converted. Moreover, should a new driver for the on-board Smart Card
> controller ever be created, it could be designed as a generic GPIO
> based driver, not a custom one.

Nice work; moving ams-delta over to gpiolib has been on my todo list for
a while (albeit quite low down).

J.

-- 
I just Fedexed my soul to hell. I'm *real* clever.

^ permalink raw reply

* Re: [PATCH 1/2] video: omap: Staticise non-exported symbols
From: Tomi Valkeinen @ 2011-12-12 10:45 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Jonathan McDowell, Imre Deak, Cory Maccarrone,
	Laurent Gonzalez, Marek Vasut, Florian Tobias Schandinat,
	linux-fbdev, linux-omap
In-Reply-To: <1323394677.3740.2.camel@phoenix>

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

On Fri, 2011-12-09 at 09:37 +0800, Axel Lin wrote:
> These symbols are not used outside it's driver so no need to
> make the symbol global.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Thanks, applied to DSS tree.

 Tomi


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH 2/3] video: omap: convert drivers/video/omap/* to use
From: Tomi Valkeinen @ 2011-12-12 10:46 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Jonathan McDowell, Cory Maccarrone,
	Laurent Gonzalez, Marek Vasut, Florian Tobias Schandinat,
	linux-fbdev, linux-omap
In-Reply-To: <1323395996.3740.6.camel@phoenix>

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

On Fri, 2011-12-09 at 09:59 +0800, Axel Lin wrote:
> This patch converts the drivers in drivers/video/omap/* to use the
> module_platform_driver() macro which makes the code smaller and a bit
> simpler.
> 
> Cc: Jonathan McDowell <noodles@earth.li>
> Cc: Cory Maccarrone <darkstar6262@gmail.com>
> Cc: Laurent Gonzalez <palmte.linux@free.fr>
> Cc: Marek Vasut <marek.vasut@gmail.com>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Thanks, applied to DSS tree.

 Tomi


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH 08/10] omapfb: lcd_ams_delta: Drive control lines over
From: Tomi Valkeinen @ 2011-12-12 11:24 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1323634328-856-9-git-send-email-jkrzyszt@tis.icnet.pl>

[-- Attachment #1: Type: text/plain, Size: 639 bytes --]

On Sun, 2011-12-11 at 21:12 +0100, Janusz Krzysztofik wrote:
> Don't use Amstrad Delta custom I/O functions any longer, use GPIO API
> instead.
> 
> Depends on patch 5/10 "MTD: NAND: ams-delta: Use GPIO instead of custom
> I/O".
> 
> Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
> ---
>  arch/arm/mach-omap1/board-ams-delta.c             |   10 -------
>  arch/arm/plat-omap/include/plat/board-ams-delta.h |    2 -
>  drivers/video/omap/lcd_ams_delta.c                |   27 +++++++++++++++-----
>  3 files changed, 20 insertions(+), 19 deletions(-)

Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

 Tomi


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Xmas Lening Aanbieding
From: Joseph Evans @ 2011-12-12 13:11 UTC (permalink / raw)
  To: linux-fbdev

Wir sind auf dem XAMS Kredit Angebot mit so viel Bonus, bitte
kontaktieren Sie mich, wenn Sie tun müssen, jede Form von Darlehen von
unserer Firma.
Grüße


We are on our xams loan special offer with so much bonus, please do
contact me if you do need any form of loan from our firm.
Regards

^ permalink raw reply

* Re: [PATCH v4 0/3] fbdev: Add FOURCC-based format configuration API
From: Laurent Pinchart @ 2011-12-12 16:08 UTC (permalink / raw)
  To: Florian Tobias Schandinat; +Cc: linux-fbdev, linux-media
In-Reply-To: <1322562419-9934-1-git-send-email-laurent.pinchart@ideasonboard.com>

Hi Florian,

On Tuesday 29 November 2011 11:26:56 Laurent Pinchart wrote:
> Hi everybody,
> 
> Here's the fourth version of the fbdev FOURCC-based format configuration
> API.

Is there a chance this will make it to v3.3 ?

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH v4 0/3] fbdev: Add FOURCC-based format configuration API
From: Florian Tobias Schandinat @ 2011-12-12 18:49 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-fbdev, linux-media
In-Reply-To: <201112121708.30839.laurent.pinchart@ideasonboard.com>

Hi Laurent,

On 12/12/2011 04:08 PM, Laurent Pinchart wrote:
> Hi Florian,
> 
> On Tuesday 29 November 2011 11:26:56 Laurent Pinchart wrote:
>> Hi everybody,
>>
>> Here's the fourth version of the fbdev FOURCC-based format configuration
>> API.
> 
> Is there a chance this will make it to v3.3 ?

Yes, that's likely. I thought you wanted to post a new version of 2/3?
I think you also want to do something with red, green, blue, transp when
entering FOURCC mode, at least setting them to zero or maybe even requiring that
they are zero to enter FOURCC mode (as additional safety barrier).


Best regards,

Florian Tobias Schandinat

^ permalink raw reply

* Re: [PATCH v4 0/3] fbdev: Add FOURCC-based format configuration API
From: Laurent Pinchart @ 2011-12-13  0:40 UTC (permalink / raw)
  To: Florian Tobias Schandinat; +Cc: linux-fbdev, linux-media
In-Reply-To: <4EE64CC2.5090906@gmx.de>

Hi Florian,

On Monday 12 December 2011 19:49:38 Florian Tobias Schandinat wrote:
> On 12/12/2011 04:08 PM, Laurent Pinchart wrote:
> > On Tuesday 29 November 2011 11:26:56 Laurent Pinchart wrote:
> >> Hi everybody,
> >> 
> >> Here's the fourth version of the fbdev FOURCC-based format configuration
> >> API.
> > 
> > Is there a chance this will make it to v3.3 ?
> 
> Yes, that's likely. I thought you wanted to post a new version of 2/3?

Oops, seems I forgot to send it. Sorry :-/ I'll post a new version tomorrow.

> I think you also want to do something with red, green, blue, transp when
> entering FOURCC mode, at least setting them to zero or maybe even requiring
> that they are zero to enter FOURCC mode (as additional safety barrier).

Agreed. The FOURCC mode documentation already requires those fields to be set 
to 0 by applications.

I'll enforce this in fb_set_var() if info->fix has the FB_CAP_FOURCC 
capability flag set.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH 63/65] OMAPDSS: APPLY: add checking of ovls/mgrs settings
From: Archit Taneja @ 2011-12-13 10:14 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-fbdev, linux-omap, archit
In-Reply-To: <1323332965.1867.20.camel@deskari>

Hi,

On Thursday 08 December 2011 01:59 PM, Tomi Valkeinen wrote:
> On Wed, 2011-12-07 at 18:35 +0530, Archit Taneja wrote:
>> Hi,
>>
>> On Tuesday 22 November 2011 02:52 PM, Tomi Valkeinen wrote:
>>> Add checks for overlay and manager settings. The checks are a bit
>>> complex, as we need to observe the bigger picture instead of overlays
>>> and managers independently. Things like the used display and the zorder
>>> of other overlays affect the validity of the settings.
>>
>> Minor comment:
>>
>> dss_ovl_check, dss_mgr_check and dss_mgr_check_zorder don't really
>> qualify as functions which do actual applying of configurations, they
>> could be moved from apply.c to manager.c and overlay.c.
>
> I had the check functions in apply.c because they used apply.c's
> internal datastructures.
>
> However, looking the functions now, only dss_mgr_check_zorder() used the
> internal datas, and the function doesn't even use those variables for
> anything =).

Also, the function dss_mgr_check() takes 'struct 
omap_overlay_manager_info *info' as a parameter but doesn't use it. We 
might want to remove that too.

Archit

>
> So you're right, they can be moved to manager.c and overlay.c, thanks.
>
>   Tomi
>


^ permalink raw reply

* Re: [PATCH v4 0/3] fbdev: Add FOURCC-based format configuration API
From: Geert Uytterhoeven @ 2011-12-13 10:47 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Florian Tobias Schandinat, linux-fbdev, linux-media
In-Reply-To: <201112130140.45045.laurent.pinchart@ideasonboard.com>

On Tue, Dec 13, 2011 at 01:40, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>> I think you also want to do something with red, green, blue, transp when
>> entering FOURCC mode, at least setting them to zero or maybe even requiring
>> that they are zero to enter FOURCC mode (as additional safety barrier).
>
> Agreed. The FOURCC mode documentation already requires those fields to be set
> to 0 by applications.
>
> I'll enforce this in fb_set_var() if info->fix has the FB_CAP_FOURCC
> capability flag set.

So when info->fix has the FB_CAP_FOURCC capability flag set, you can no longer
enter legacy mode?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox