* [PATCH 13/21] video: neofb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:57 UTC (permalink / raw)
To: linux-fbdev
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/neofb.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index 7ef079c..891b0bf 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -2146,12 +2146,6 @@ static void neofb_remove(struct pci_dev *dev)
fb_destroy_modedb(info->monspecs.modedb);
neo_unmap_mmio(info);
neo_free_fb_info(info);
-
- /*
- * Ensure that the driver data is no longer
- * valid.
- */
- pci_set_drvdata(dev, NULL);
}
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 12/21] video: mb862xxfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:57 UTC (permalink / raw)
To: linux-fbdev
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/mb862xx/mb862xxfbdrv.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c
index 91c59c9..98d2f8c 100644
--- a/drivers/video/mb862xx/mb862xxfbdrv.c
+++ b/drivers/video/mb862xx/mb862xxfbdrv.c
@@ -1157,7 +1157,6 @@ static void mb862xx_pci_remove(struct pci_dev *pdev)
device_remove_file(&pdev->dev, &dev_attr_dispregs);
- pci_set_drvdata(pdev, NULL);
unregister_framebuffer(fbi);
fb_dealloc_cmap(&fbi->cmap);
--
1.7.10.4
^ permalink raw reply related
* [PATCH 11/21] video: kyrofb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:56 UTC (permalink / raw)
To: linux-fbdev
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/kyro/fbdev.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c
index 6157f74..c82f040 100644
--- a/drivers/video/kyro/fbdev.c
+++ b/drivers/video/kyro/fbdev.c
@@ -779,7 +779,6 @@ static void kyrofb_remove(struct pci_dev *pdev)
#endif
unregister_framebuffer(info);
- pci_set_drvdata(pdev, NULL);
framebuffer_release(info);
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 10/21] video: intelfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:56 UTC (permalink / raw)
To: linux-fbdev
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/intelfb/intelfbdrv.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 8209e46..b847d53 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -931,8 +931,6 @@ static void intelfb_pci_unregister(struct pci_dev *pdev)
return;
cleanup(dinfo);
-
- pci_set_drvdata(pdev, NULL);
}
/***************************************************************
--
1.7.10.4
^ permalink raw reply related
* [PATCH 09/21] video: i810fb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:55 UTC (permalink / raw)
To: linux-fbdev
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/i810/i810_main.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index 4ce3438..038192a 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -2129,7 +2129,6 @@ static void __exit i810fb_remove_pci(struct pci_dev *dev)
unregister_framebuffer(info);
i810fb_release_resource(info, par);
- pci_set_drvdata(dev, NULL);
printk("cleanup_module: unloaded i810 framebuffer device\n");
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 08/21] video: i740fb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:54 UTC (permalink / raw)
To: linux-fbdev
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/i740fb.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/i740fb.c b/drivers/video/i740fb.c
index 6c48388..6501ac1 100644
--- a/drivers/video/i740fb.c
+++ b/drivers/video/i740fb.c
@@ -1194,7 +1194,6 @@ static void i740fb_remove(struct pci_dev *dev)
pci_iounmap(dev, info->screen_base);
pci_release_regions(dev);
/* pci_disable_device(dev); */
- pci_set_drvdata(dev, NULL);
framebuffer_release(info);
}
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 07/21] video: gxfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:54 UTC (permalink / raw)
To: linux-fbdev
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/geode/gxfb_core.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c
index 19f0c1ad..a42d74d 100644
--- a/drivers/video/geode/gxfb_core.c
+++ b/drivers/video/geode/gxfb_core.c
@@ -471,7 +471,6 @@ static void gxfb_remove(struct pci_dev *pdev)
pci_release_region(pdev, 1);
fb_dealloc_cmap(&info->cmap);
- pci_set_drvdata(pdev, NULL);
framebuffer_release(info);
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 06/21] video: gx1fb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:53 UTC (permalink / raw)
To: linux-fbdev
From fbb1885952efb15a46d03aac050c38fc9179594e Mon Sep 17 00:00:00 2001
From: Jingoo Han <jg1.han@samsung.com>
Date: Thu, 12 Sep 2013 14:42:45 +0900
Subject: [PATCH 06/21] video: gx1fb: remove unnecessary pci_set_drvdata()
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/geode/gx1fb_core.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/geode/gx1fb_core.c b/drivers/video/geode/gx1fb_core.c
index ebbaada..7551a04 100644
--- a/drivers/video/geode/gx1fb_core.c
+++ b/drivers/video/geode/gx1fb_core.c
@@ -399,7 +399,6 @@ static void gx1fb_remove(struct pci_dev *pdev)
release_mem_region(gx1_gx_base() + 0x8300, 0x100);
fb_dealloc_cmap(&info->cmap);
- pci_set_drvdata(pdev, NULL);
framebuffer_release(info);
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 05/21] video: lxfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:53 UTC (permalink / raw)
To: linux-fbdev
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/geode/lxfb_core.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c
index 4dd7b55..10de31b 100644
--- a/drivers/video/geode/lxfb_core.c
+++ b/drivers/video/geode/lxfb_core.c
@@ -606,7 +606,6 @@ static void lxfb_remove(struct pci_dev *pdev)
pci_release_region(pdev, 3);
fb_dealloc_cmap(&info->cmap);
- pci_set_drvdata(pdev, NULL);
framebuffer_release(info);
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 04/21] video: cyber2000fb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:52 UTC (permalink / raw)
To: linux-fbdev
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/cyber2000fb.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c
index e78d9f2..42da9c8 100644
--- a/drivers/video/cyber2000fb.c
+++ b/drivers/video/cyber2000fb.c
@@ -1874,11 +1874,6 @@ static void cyberpro_pci_remove(struct pci_dev *dev)
iounmap(cfb->region);
cyberpro_free_fb_info(cfb);
- /*
- * Ensure that the driver data is no longer
- * valid.
- */
- pci_set_drvdata(dev, NULL);
if (cfb = int_cfb_info)
int_cfb_info = NULL;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 03/21] video: cirrusfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:51 UTC (permalink / raw)
To: linux-fbdev
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/cirrusfb.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index 97db3ba..b016746 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -2159,7 +2159,6 @@ static int cirrusfb_pci_register(struct pci_dev *pdev,
if (!ret)
return 0;
- pci_set_drvdata(pdev, NULL);
iounmap(info->screen_base);
err_release_legacy:
if (release_io_ports)
--
1.7.10.4
^ permalink raw reply related
* [PATCH 02/21] video: carminefb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:51 UTC (permalink / raw)
To: linux-fbdev
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/carminefb.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/carminefb.c b/drivers/video/carminefb.c
index 153dd65..b98f709 100644
--- a/drivers/video/carminefb.c
+++ b/drivers/video/carminefb.c
@@ -746,7 +746,6 @@ static void carminefb_remove(struct pci_dev *dev)
iounmap(hw->v_regs);
release_mem_region(fix.mmio_start, fix.mmio_len);
- pci_set_drvdata(dev, NULL);
pci_disable_device(dev);
kfree(hw);
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 01/21] video: arkfb: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:50 UTC (permalink / raw)
To: linux-fbdev
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/arkfb.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c
index 94a51f1..ff6e304b 100644
--- a/drivers/video/arkfb.c
+++ b/drivers/video/arkfb.c
@@ -1108,7 +1108,6 @@ static void ark_pci_remove(struct pci_dev *dev)
pci_release_regions(dev);
/* pci_disable_device(dev); */
- pci_set_drvdata(dev, NULL);
framebuffer_release(info);
}
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 00/21] video: remove unnecessary pci_set_drvdata()
From: Jingoo Han @ 2013-09-12 6:49 UTC (permalink / raw)
To: linux-fbdev
Since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound),
the driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
---
drivers/video/arkfb.c | 1 -
drivers/video/carminefb.c | 1 -
drivers/video/cirrusfb.c | 1 -
drivers/video/cyber2000fb.c | 5 -----
drivers/video/geode/gx1fb_core.c | 1 -
drivers/video/geode/gxfb_core.c | 1 -
drivers/video/geode/lxfb_core.c | 1 -
drivers/video/i740fb.c | 1 -
drivers/video/i810/i810_main.c | 1 -
drivers/video/intelfb/intelfbdrv.c | 2 --
drivers/video/kyro/fbdev.c | 1 -
drivers/video/mb862xx/mb862xxfbdrv.c | 1 -
drivers/video/neofb.c | 6 ------
drivers/video/pm2fb.c | 1 -
drivers/video/pm3fb.c | 1 -
drivers/video/s3fb.c | 1 -
drivers/video/savage/savagefb_driver.c | 6 ------
drivers/video/sis/sis_main.c | 4 ----
drivers/video/tdfxfb.c | 1 -
drivers/video/tridentfb.c | 1 -
drivers/video/vt8623fb.c | 1 -
21 files changed, 39 deletions(-)
^ permalink raw reply
* Re: [RFC PATCH] amba: Ensure drvdata is NULL
From: Michal Simek @ 2013-09-12 5:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <346db238d6c8c418bddb1e8a166e9818b5074c06.1378305864.git.michal.simek@xilinx.com>
[-- Attachment #1: Type: text/plain, Size: 8371 bytes --]
Hi Russell,
any comment on this one?
Thanks,
Michal
On 09/04/2013 04:44 PM, Michal Simek wrote:
> This patch is inpired by the patch for drvdata
> "device-core: Ensure drvdata = NULL when no driver is bound"
> (sha1: 0998d0631001288a5974afc0b2a5f568bcdecb4d)
>
> Also it fixes all occurences in drivers.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> arch/arm/kernel/etm.c | 6 ------
> drivers/amba/bus.c | 2 ++
> drivers/dma/pl330.c | 3 ---
> drivers/input/serio/ambakmi.c | 2 --
> drivers/mmc/host/mmci.c | 2 --
> drivers/rtc/rtc-pl030.c | 2 --
> drivers/rtc/rtc-pl031.c | 2 --
> drivers/spi/spi-pl022.c | 1 -
> drivers/tty/serial/amba-pl010.c | 3 ---
> drivers/tty/serial/amba-pl011.c | 3 ---
> drivers/video/amba-clcd.c | 2 --
> drivers/watchdog/sp805_wdt.c | 1 -
> 12 files changed, 2 insertions(+), 27 deletions(-)
>
> diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c
> index 8ff0ecd..131a6ab 100644
> --- a/arch/arm/kernel/etm.c
> +++ b/arch/arm/kernel/etm.c
> @@ -385,7 +385,6 @@ out:
> return ret;
>
> out_unmap:
> - amba_set_drvdata(dev, NULL);
> iounmap(t->etb_regs);
>
> out_release:
> @@ -398,8 +397,6 @@ static int etb_remove(struct amba_device *dev)
> {
> struct tracectx *t = amba_get_drvdata(dev);
>
> - amba_set_drvdata(dev, NULL);
> -
> iounmap(t->etb_regs);
> t->etb_regs = NULL;
>
> @@ -588,7 +585,6 @@ out:
> return ret;
>
> out_unmap:
> - amba_set_drvdata(dev, NULL);
> iounmap(t->etm_regs);
>
> out_release:
> @@ -601,8 +597,6 @@ static int etm_remove(struct amba_device *dev)
> {
> struct tracectx *t = amba_get_drvdata(dev);
>
> - amba_set_drvdata(dev, NULL);
> -
> iounmap(t->etm_regs);
> t->etm_regs = NULL;
>
> diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
> index c670727..9762090 100644
> --- a/drivers/amba/bus.c
> +++ b/drivers/amba/bus.c
> @@ -373,6 +373,7 @@ static int amba_probe(struct device *dev)
> if (ret == 0)
> break;
>
> + amba_set_drvdata(pcdev, NULL);
> pm_runtime_disable(dev);
> pm_runtime_set_suspended(dev);
> pm_runtime_put_noidle(dev);
> @@ -391,6 +392,7 @@ static int amba_remove(struct device *dev)
>
> pm_runtime_get_sync(dev);
> ret = drv->remove(pcdev);
> + amba_set_drvdata(pcdev, NULL);
> pm_runtime_put_noidle(dev);
>
> /* Undo the runtime PM settings in amba_probe() */
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index fa645d8..626f99e 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -3026,8 +3026,6 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
>
> return 0;
> probe_err3:
> - amba_set_drvdata(adev, NULL);
> -
> /* Idle the DMAC */
> list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels,
> chan.device_node) {
> @@ -3061,7 +3059,6 @@ static int pl330_remove(struct amba_device *adev)
> of_dma_controller_free(adev->dev.of_node);
>
> dma_async_device_unregister(&pdmac->ddma);
> - amba_set_drvdata(adev, NULL);
>
> /* Idle the DMAC */
> list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels,
> diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
> index 4e2fd44..b7c206d 100644
> --- a/drivers/input/serio/ambakmi.c
> +++ b/drivers/input/serio/ambakmi.c
> @@ -167,8 +167,6 @@ static int amba_kmi_remove(struct amba_device *dev)
> {
> struct amba_kmi_port *kmi = amba_get_drvdata(dev);
>
> - amba_set_drvdata(dev, NULL);
> -
> serio_unregister_port(kmi->io);
> clk_put(kmi->clk);
> iounmap(kmi->base);
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index c3785ed..07e17f1 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -1678,8 +1678,6 @@ static int mmci_remove(struct amba_device *dev)
> {
> struct mmc_host *mmc = amba_get_drvdata(dev);
>
> - amba_set_drvdata(dev, NULL);
> -
> if (mmc) {
> struct mmci_host *host = mmc_priv(mmc);
>
> diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030.c
> index 22bacdb..a804f75 100644
> --- a/drivers/rtc/rtc-pl030.c
> +++ b/drivers/rtc/rtc-pl030.c
> @@ -153,8 +153,6 @@ static int pl030_remove(struct amba_device *dev)
> {
> struct pl030_rtc *rtc = amba_get_drvdata(dev);
>
> - amba_set_drvdata(dev, NULL);
> -
> writel(0, rtc->base + RTC_CR);
>
> free_irq(dev->irq[0], rtc);
> diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
> index 0f0609b..c9ca86e 100644
> --- a/drivers/rtc/rtc-pl031.c
> +++ b/drivers/rtc/rtc-pl031.c
> @@ -305,7 +305,6 @@ static int pl031_remove(struct amba_device *adev)
> {
> struct pl031_local *ldata = dev_get_drvdata(&adev->dev);
>
> - amba_set_drvdata(adev, NULL);
> free_irq(adev->irq[0], ldata);
> rtc_device_unregister(ldata->rtc);
> iounmap(ldata->base);
> @@ -392,7 +391,6 @@ out_no_irq:
> rtc_device_unregister(ldata->rtc);
> out_no_rtc:
> iounmap(ldata->base);
> - amba_set_drvdata(adev, NULL);
> out_no_remap:
> kfree(ldata);
> out:
> diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
> index abef061..e12813e 100644
> --- a/drivers/spi/spi-pl022.c
> +++ b/drivers/spi/spi-pl022.c
> @@ -2306,7 +2306,6 @@ pl022_remove(struct amba_device *adev)
> amba_release_regions(adev);
> tasklet_disable(&pl022->pump_transfers);
> spi_unregister_master(pl022->master);
> - amba_set_drvdata(adev, NULL);
> return 0;
> }
>
> diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
> index c368405..f630b78 100644
> --- a/drivers/tty/serial/amba-pl010.c
> +++ b/drivers/tty/serial/amba-pl010.c
> @@ -728,7 +728,6 @@ static int pl010_probe(struct amba_device *dev, const struct amba_id *id)
> amba_set_drvdata(dev, uap);
> ret = uart_add_one_port(&amba_reg, &uap->port);
> if (ret) {
> - amba_set_drvdata(dev, NULL);
> amba_ports[i] = NULL;
> clk_put(uap->clk);
> unmap:
> @@ -745,8 +744,6 @@ static int pl010_remove(struct amba_device *dev)
> struct uart_amba_port *uap = amba_get_drvdata(dev);
> int i;
>
> - amba_set_drvdata(dev, NULL);
> -
> uart_remove_one_port(&amba_reg, &uap->port);
>
> for (i = 0; i < ARRAY_SIZE(amba_ports); i++)
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index 28b35ad..2a1efe0 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -2143,7 +2143,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
> amba_set_drvdata(dev, uap);
> ret = uart_add_one_port(&amba_reg, &uap->port);
> if (ret) {
> - amba_set_drvdata(dev, NULL);
> amba_ports[i] = NULL;
> pl011_dma_remove(uap);
> }
> @@ -2156,8 +2155,6 @@ static int pl011_remove(struct amba_device *dev)
> struct uart_amba_port *uap = amba_get_drvdata(dev);
> int i;
>
> - amba_set_drvdata(dev, NULL);
> -
> uart_remove_one_port(&amba_reg, &uap->port);
>
> for (i = 0; i < ARRAY_SIZE(amba_ports); i++)
> diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c
> index 0a2cce7..0bab6ab 100644
> --- a/drivers/video/amba-clcd.c
> +++ b/drivers/video/amba-clcd.c
> @@ -594,8 +594,6 @@ static int clcdfb_remove(struct amba_device *dev)
> {
> struct clcd_fb *fb = amba_get_drvdata(dev);
>
> - amba_set_drvdata(dev, NULL);
> -
> clcdfb_disable(fb);
> unregister_framebuffer(&fb->fb);
> if (fb->fb.cmap.len)
> diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
> index 58df98a..3f786ce 100644
> --- a/drivers/watchdog/sp805_wdt.c
> +++ b/drivers/watchdog/sp805_wdt.c
> @@ -268,7 +268,6 @@ static int sp805_wdt_remove(struct amba_device *adev)
> struct sp805_wdt *wdt = amba_get_drvdata(adev);
>
> watchdog_unregister_device(&wdt->wdd);
> - amba_set_drvdata(adev, NULL);
> watchdog_set_drvdata(&wdt->wdd, NULL);
>
> return 0;
> --
> 1.8.2.3
>
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply
* [PATCH 3/3] video: xilinxfb: Simplify error path
From: Michal Simek @ 2013-09-12 5:54 UTC (permalink / raw)
To: linux-kernel, monstr
Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev
In-Reply-To: <7016a90750626ba866dddc6f85cfdd71943f6891.1378965270.git.michal.simek@xilinx.com>
[-- Attachment #1: Type: text/plain, Size: 2024 bytes --]
devm_iounmap is called automatically that's why remove it from the code
dev_set_drvdata(dev, NULL) is called by generic code
after device_release or on probe failure.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/video/xilinxfb.c | 28 ++++++----------------------
1 file changed, 6 insertions(+), 22 deletions(-)
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index fd9c430..7e3036c 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -260,10 +260,9 @@ static int xilinxfb_assign(struct platform_device *pdev,
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
drvdata->regs = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(drvdata->regs)) {
- rc = PTR_ERR(drvdata->regs);
- goto err_region;
- }
+ if (IS_ERR(drvdata->regs))
+ return PTR_ERR(drvdata->regs);
+
drvdata->regs_phys = res->start;
}
@@ -279,11 +278,7 @@ static int xilinxfb_assign(struct platform_device *pdev,
if (!drvdata->fb_virt) {
dev_err(dev, "Could not allocate frame buffer memory\n");
- rc = -ENOMEM;
- if (drvdata->flags & BUS_ACCESS_FLAG)
- goto err_fbmem;
- else
- goto err_region;
+ return -ENOMEM;
}
/* Clear (turn to black) the framebuffer */
@@ -363,13 +358,6 @@ err_cmap:
/* Turn off the display */
xilinx_fb_out32(drvdata, REG_CTRL, 0);
-err_fbmem:
- if (drvdata->flags & BUS_ACCESS_FLAG)
- devm_iounmap(dev, drvdata->regs);
-
-err_region:
- dev_set_drvdata(dev, NULL);
-
return rc;
}
@@ -394,16 +382,12 @@ static int xilinxfb_release(struct device *dev)
/* Turn off the display */
xilinx_fb_out32(drvdata, REG_CTRL, 0);
- /* Release the resources, as allocated based on interface */
- if (drvdata->flags & BUS_ACCESS_FLAG)
- devm_iounmap(dev, drvdata->regs);
#ifdef CONFIG_PPC_DCR
- else
+ /* Release the resources, as allocated based on interface */
+ if (!(drvdata->flags & BUS_ACCESS_FLAG))
dcr_unmap(drvdata->dcr_host, drvdata->dcr_len);
#endif
- dev_set_drvdata(dev, NULL);
-
return 0;
}
--
1.8.2.3
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply related
* [PATCH 2/3] video: xilinxfb: Use devm_kzalloc instead of kzalloc
From: Michal Simek @ 2013-09-12 5:54 UTC (permalink / raw)
To: linux-kernel, monstr
Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev
In-Reply-To: <7016a90750626ba866dddc6f85cfdd71943f6891.1378965270.git.michal.simek@xilinx.com>
[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]
Simplify driver probe and release function.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/video/xilinxfb.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 123cd70..fd9c430 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -368,7 +368,6 @@ err_fbmem:
devm_iounmap(dev, drvdata->regs);
err_region:
- kfree(drvdata);
dev_set_drvdata(dev, NULL);
return rc;
@@ -403,7 +402,6 @@ static int xilinxfb_release(struct device *dev)
dcr_unmap(drvdata->dcr_host, drvdata->dcr_len);
#endif
- kfree(drvdata);
dev_set_drvdata(dev, NULL);
return 0;
@@ -425,7 +423,7 @@ static int xilinxfb_of_probe(struct platform_device *pdev)
pdata = xilinx_fb_default_pdata;
/* Allocate the driver data region */
- drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
+ drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
if (!drvdata) {
dev_err(&pdev->dev, "Couldn't allocate device private record\n");
return -ENOMEM;
@@ -453,7 +451,6 @@ static int xilinxfb_of_probe(struct platform_device *pdev)
drvdata->dcr_host = dcr_map(op->dev.of_node, start, drvdata->dcr_len);
if (!DCR_MAP_OK(drvdata->dcr_host)) {
dev_err(&op->dev, "invalid DCR address\n");
- kfree(drvdata);
return -ENODEV;
}
}
--
1.8.2.3
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply related
* [PATCH 1/3] video: xilinxfb: Use standard variable name convention
From: Michal Simek @ 2013-09-12 5:54 UTC (permalink / raw)
To: linux-kernel, monstr
Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Grant Likely,
Rob Herring, linux-fbdev, devicetree
[-- Attachment #1: Type: text/plain, Size: 2571 bytes --]
s/op/pdev/ in xilinxfb_of_probe().
No functional chagnes.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/video/xilinxfb.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 84c664e..123cd70 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -413,7 +413,7 @@ static int xilinxfb_release(struct device *dev)
* OF bus binding
*/
-static int xilinxfb_of_probe(struct platform_device *op)
+static int xilinxfb_of_probe(struct platform_device *pdev)
{
const u32 *prop;
u32 tft_access = 0;
@@ -427,7 +427,7 @@ static int xilinxfb_of_probe(struct platform_device *op)
/* Allocate the driver data region */
drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
if (!drvdata) {
- dev_err(&op->dev, "Couldn't allocate device private record\n");
+ dev_err(&pdev->dev, "Couldn't allocate device private record\n");
return -ENOMEM;
}
@@ -435,7 +435,7 @@ static int xilinxfb_of_probe(struct platform_device *op)
* To check whether the core is connected directly to DCR or BUS
* interface and initialize the tft_access accordingly.
*/
- of_property_read_u32(op->dev.of_node, "xlnx,dcr-splb-slave-if",
+ of_property_read_u32(pdev->dev.of_node, "xlnx,dcr-splb-slave-if",
&tft_access);
/*
@@ -459,29 +459,29 @@ static int xilinxfb_of_probe(struct platform_device *op)
}
#endif
- prop = of_get_property(op->dev.of_node, "phys-size", &size);
+ prop = of_get_property(pdev->dev.of_node, "phys-size", &size);
if ((prop) && (size >= sizeof(u32)*2)) {
pdata.screen_width_mm = prop[0];
pdata.screen_height_mm = prop[1];
}
- prop = of_get_property(op->dev.of_node, "resolution", &size);
+ prop = of_get_property(pdev->dev.of_node, "resolution", &size);
if ((prop) && (size >= sizeof(u32)*2)) {
pdata.xres = prop[0];
pdata.yres = prop[1];
}
- prop = of_get_property(op->dev.of_node, "virtual-resolution", &size);
+ prop = of_get_property(pdev->dev.of_node, "virtual-resolution", &size);
if ((prop) && (size >= sizeof(u32)*2)) {
pdata.xvirt = prop[0];
pdata.yvirt = prop[1];
}
- if (of_find_property(op->dev.of_node, "rotate-display", NULL))
+ if (of_find_property(pdev->dev.of_node, "rotate-display", NULL))
pdata.rotate_screen = 1;
- dev_set_drvdata(&op->dev, drvdata);
- return xilinxfb_assign(op, drvdata, &pdata);
+ dev_set_drvdata(&pdev->dev, drvdata);
+ return xilinxfb_assign(pdev, drvdata, &pdata);
}
static int xilinxfb_of_remove(struct platform_device *op)
--
1.8.2.3
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply related
* [PATCH 2/2] radeonfb: Use pci_dev pm_cap
From: Jon Mason @ 2013-09-11 21:35 UTC (permalink / raw)
To: linux-fbdev
Use the already existing pm_cap variable in struct pci_dev for
determining the power management offset. This saves the driver from
having to keep track of an extra variable. Also, use the pci_power_t
value instead of always using the raw value for PCI_D2.
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/aty/radeon_pm.c | 15 ++++++---------
drivers/video/aty/radeonfb.h | 1 -
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
index f7091ec..f266224 100644
--- a/drivers/video/aty/radeon_pm.c
+++ b/drivers/video/aty/radeon_pm.c
@@ -2515,13 +2515,13 @@ static void radeonfb_whack_power_state(struct radeonfb_info *rinfo, pci_power_t
for (;;) {
pci_read_config_word(rinfo->pdev,
- rinfo->pm_reg+PCI_PM_CTRL,
+ rinfo->pdev->pm_cap + PCI_PM_CTRL,
&pwr_cmd);
- if (pwr_cmd & 2)
+ if (pwr_cmd & state)
break;
- pwr_cmd = (pwr_cmd & ~PCI_PM_CTRL_STATE_MASK) | 2;
+ pwr_cmd = (pwr_cmd & ~PCI_PM_CTRL_STATE_MASK) | state;
pci_write_config_word(rinfo->pdev,
- rinfo->pm_reg+PCI_PM_CTRL,
+ rinfo->pdev->pm_cap + PCI_PM_CTRL,
pwr_cmd);
msleep(500);
}
@@ -2532,7 +2532,7 @@ static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend)
{
u32 tmp;
- if (!rinfo->pm_reg)
+ if (!rinfo->pdev->pm_cap)
return;
/* Set the chip into appropriate suspend mode (we use D2,
@@ -2804,9 +2804,6 @@ static void radeonfb_early_resume(void *data)
void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep)
{
- /* Find PM registers in config space if any*/
- rinfo->pm_reg = rinfo->pdev->pm_cap;
-
/* Enable/Disable dynamic clocks: TODO add sysfs access */
if (rinfo->family = CHIP_FAMILY_RS480)
rinfo->dynclk = -1;
@@ -2830,7 +2827,7 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlis
* reason. --BenH
*/
if (machine_is(powermac) && rinfo->of_node) {
- if (rinfo->is_mobility && rinfo->pm_reg &&
+ if (rinfo->is_mobility && rinfo->pdev->pm_cap &&
rinfo->family <= CHIP_FAMILY_RV250)
rinfo->pm_mode |= radeon_pm_d2;
diff --git a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h
index 7351e66..cb84604 100644
--- a/drivers/video/aty/radeonfb.h
+++ b/drivers/video/aty/radeonfb.h
@@ -342,7 +342,6 @@ struct radeonfb_info {
int mtrr_hdl;
- int pm_reg;
u32 save_regs[100];
int asleep;
int lock_blank;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 1/2] aty128fb: Use pci_dev pm_cap
From: Jon Mason @ 2013-09-11 21:35 UTC (permalink / raw)
To: linux-fbdev
Use the already existing pm_cap variable in struct pci_dev for
determining the power management offset. This saves the driver from
having to keep track of an extra variable.
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/aty/aty128fb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index a4dfe8c..b5edb6f 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -413,7 +413,6 @@ struct aty128fb_par {
int blitter_may_be_busy;
int fifo_slots; /* free slots in FIFO (64 max) */
- int pm_reg;
int crt_on, lcd_on;
struct pci_dev *pdev;
struct fb_info *next;
@@ -2016,7 +2015,6 @@ static int aty128_init(struct pci_dev *pdev, const struct pci_device_id *ent)
aty128_init_engine(par);
- par->pm_reg = pdev->pm_cap;
par->pdev = pdev;
par->asleep = 0;
par->lock_blank = 0;
@@ -2397,7 +2395,7 @@ static void aty128_set_suspend(struct aty128fb_par *par, int suspend)
u32 pmgt;
struct pci_dev *pdev = par->pdev;
- if (!par->pm_reg)
+ if (!par->pdev->pm_cap)
return;
/* Set the chip into the appropriate suspend mode (we use D2,
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH 1/2] video: ARM CLCD: Add DT support
From: Sylwester Nawrocki @ 2013-09-11 21:14 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1378907036.4082.105.camel@hornet>
On 09/11/2013 03:43 PM, Pawel Moll wrote:
> On Tue, 2013-09-10 at 22:41 +0100, Sylwester Nawrocki wrote:
>> On 09/09/2013 01:19 PM, Pawel Moll wrote:
>>> On Sat, 2013-09-07 at 23:55 +0100, Sylwester Nawrocki wrote:
[...]
>>>>> +- video-ram: phandle to a node describing specialized video memory
>>>>> + (that is *not* described in the top level "memory" node)
>>>>> + that must be used as a framebuffer, eg. due to restrictions
>>>>> + of the system interconnect; the node must contain a
>>>>> + standard reg property describing the address and the size
>>>>> + of the memory area
>>>>
>>>> It seems the "specialized video memory" is described by some vendor specific
>>>> DT binding ? Is it documented ? It sounds like you are unnecessarily
>>>> repeating the memory node details here.
>>>
>>> I appreciate this property being the hardest to swallow, but the problem
>>> it is trying to solve is quite simple, really. System can be designed in
>>> such a way that CLCD is *not* able to read data from the main memory. In
>>> such case there will be a separate block of (usually static) memory
>>> "next" to CLCD, which *must* be used for the framebuffer. And I've got
>>> two choices here: to simply define an address and size, or to define a
>>> phandle to a node with standard reg property. I'll be really grateful
>>> for ideas how to describe the situation better.
>>
>> I thought about reusing the binding only, the part defining reserved
>> (carve out) memory regions.
>
> Em, what exactly do you mean? Referring to the definition of "reserved
> memory region" as an example how to use reg =<(address) (size)>?
> (because, I don't think it can be "linux,contiguous-memory-region",
> "reserved-memory-region"). Can do, however I'm not sure if it won't
> cause even more confusion, as I hope that the CMA bindings will be
> useful here on their own, to allocate "normal" contiguous framebuffers.
> Keep in mind those two use cases are very very different.
Yes, I wasn't aware then that your "video RAM" is a separate chip attached
to a distinct bus.
My idea was to reuse memory node structure, including "reserved-memory"
compatible value (note there are some fixups pending and those names are
subject to change). Not sure about the property in CLCD device node
containing phandle to the memory node (currently 'memory-region').
>>>> Perhaps this binding/driver should use the common reserved memory bindings,
>>>> see thread http://www.spinics.net/lists/devicetree/msg02880.html
>>>
>>> No, not really - as I said, this is *not* the main RAM of the system.
>>> CMA doesn't even know about its existence.
>>
>> I'm really not an expert in this area, I'll assume we don't list such
>> separate memory chips in the 'memory' node.
>
> ePAPR spec, regarding the memory node, states: "The client program may
> access memory not covered by any memory reservations (see section 8.3)
> using any storage attributes it chooses." (note that the reservations
> mentioned are "the other" reservations, /memreserve/ ones ;-)
>
> Now, I wouldn't want my "client program" (read: Linux kernel) to use the
> "video memory" in question for general allocations, if only because of
> its rather poor performance (resulting from the interconnect design, not
> the memory chip characteristics), so I treat it more as a memory mapped
> device which happens to have a lot of word-long registers...
>
>> But if such memory could be used not only by this single IP block it would
>> probably make sense to have it listed in memory/reserved-memory, so it
>> could be used by other devices of which drivers possibly wouldn't have to
>> contain all the detailed dt parsing/memory handling code.
>
> The "video RAM" on my platform could be used for other purposes. If you
> don't mind latencies :-) It's just that the CLCD itself can't use
> anything else.
It seems then you just need to assign specific memory region to the device.
That's one of the main requirements the recent "CMA" memory bindings were
supposed to address.
> So, if the memory/reserved-memory described areas *not* to be used as
> "normal RAM", yes - we could use it. I don't think it's the case now,
> though.
AFAIU it's the case, you just need to have compatible property set to
"reserved-memory-region". Then the kernel will early call memblock_remove()
on that region, which will subsequently be declared for use by the device
DMA with a call to dma_declare_coherent_memory(), while populating devices
from DT [1]. It's likely I'm missing some details though, that would make
this unsuitable for your environment.
[1] http://www.spinics.net/lists/devicetree/msg02880.html
> Also, Steven mentioned the other option I talked about - just raw
> address/size pair. See me deliberation there...
>
>>>>> +- panel-dimensions: (optional) array of two numbers (width and height)
>>>>> + describing physical dimension in mm of the panel
>>>>> +- panel-type: (required) must be "tft" or "stn", defines panel type
>>>>> +- panel-tft-interface: (for "tft" panel type) array of 3 numbers defining
>>>>> + widths in bits of the R, G and B components
>>>>> +- panel-tft-rb-swapped: (for "tft" panel type) if present means that
>>>>> + the R& B components are swapped on the board
>>>>> +- panel-stn-color: (for "stn" panel type) if present means that
>>>>> + the panel is a colour STN display, if missing
>>>>> + is a monochrome display
>>>>> +- panel-stn-dual: (for "stn" panel type) if present means that there
>>>>> + are two STN displays connected
>>>>> +- panel-stn-4bit: (for monochrome "stn" panel) if present means
>>>>> + that the monochrome display is connected
>>>>> + via 4 bit-wide interface
>>>>
>>>> Are this vendor specific or common properties ? Shouldn't those be prefixed
>>>> with the vendor name ?
>>>
>>> I have no answer to this question. My guts are telling me - nope. TFT is
>>> TFT, STN is STN, nothing to do with "arm,". But I welcome other
>>> opinions.
>>
>> I thought about documenting such a common properties in a common place.
>> It's
>> not immediately clear from names of these properties that they apply to
>> PL110/
>> PL111 devices only. If we let such generic names being redefined across DT
>> bindings of different devices it is going to be pretty messy IMHO. Same
>> property in two different dts files would potentially have different
>> meaning.
>>
>> So perhaps instead of panel-dimensions we could define common
>> properties, e.g.
>>
>> - display-phys-width: physical horizontal dimension of a display in
>> millimetres
>> (micrometres ?);
>> - display-phys-height: physical vertical dimension of a display in
>> millimetres
>> (micrometres ?);
>>
>> Instead of 'panel-stn-color' a boolean property 'monochrome-display',
>> the default
>> when this property was missing would be "colour display".
>>
>> I'd like to leave defining such common properties to someone having more
>> experience
>> in the display area. I don't think it would take much time come up with
>> generic
>> names for that couple properties you need. Then CDF implementation
>> would simply use whatever gets agreed.
>
> Ok, I see what you're saying. Yes, this could be done. No, I don't claim
> to have enough expertise either (micrometers??? :-O ;-) The other thing
> is that I don't really expect generic CDF bindings to cover such things.
> They will (hopefully) only describe what's connected with what. And the
> drivers should know how. Of course they may need the dimensions& alike
> in the tree (of course having them standardised would help here), but
> it's not a CDF job to provide those.
Of course it's always easier to define couple of DT properties that would
cover part of functionality of some specific device. But then such
properties
should be prefixed with vendor name AFAIU, since they are not approved as
common ones and useful for wider set of devices.
From the device tree perspective CDF is just a collection of (display
related) devices and a complete set of DT properties will be needed to
describe them. Certainly some share of device-specific properties should
be expected. Links between (sub)devices can be already described in DT by
the binding documented in video-interfaces.txt.
--
Thanks,
Sylwester
^ permalink raw reply
* Re: [PATCH v2 1/2] video: ARM CLCD: Add DT support
From: Stephen Warren @ 2013-09-11 17:39 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1378899931.4082.75.camel@hornet>
On 09/11/2013 05:45 AM, Pawel Moll wrote:
> On Tue, 2013-09-10 at 18:32 +0100, Stephen Warren wrote:
>>> +Optional properties:
>>> +
>>> +- video-ram: phandle to a node describing specialized video memory
>>> + (that is *not* described in the top level "memory" node)
>>> + that must be used as a framebuffer, eg. due to restrictions
>>> + of the system interconnect; the node must contain a
>>> + standard reg property describing the address and the size
>>> + of the memory area
>>
>> Should this use the "CMA bindings" that are being proposed at the moment?
>
> I expected this bit to be the hardest to get through :-)
>
> The memory in question is *not* a part of "normal" RAM, therefore CMA
> doesn't even know about it. The situation I have to deal with is a
> system when CLCD's AHB master can *not* access the normal RAM, so the
> designers kindly ;-) provided some static RAM which it can address.
>
>> Even if not, I'm not quite clear on what the referenced node is supposed
>> to contain; is just a reg property enough, so you'd see the following at
>> a completely arbitrary location in the DT:
>>
>> framebuffer-mem {
>> reg = <0x80000000 0x00100000>;
>> };
>
> The place wouldn't be random, no. Getting back to my scenario, the
> "video" RAM, being close to CLCD, is (obviously) also addressable by the
> core, as any other memory-mapped device. So its position is determined
> by the platform memory map:
>
> \ {
> #address-cell = <2>;
> #size-cell = <2>;
> static-memory-bus {
> #address-cell = <2>;
> #size-cell = <1>;
> ranges = <2 0 0 0x18000000 64M>;
> motherboard {
> ranges;
> video-ram {
> reg = <2 0 8MB>;
> };
> };
> };
> };
>
> From the core's perspective it's just a bit of extra memory, you could,
> for example, put a MTD ram disk on it. It seems to deserve a
> representation in the tree then.
Yes, that's a good point. Perhaps it is reasonable to represent the
memory somewhere then.
I don't see why this memory couldn't exist in the regular /memory node;
it is after all (admittedly slow) RAM. Obviously you'd want to cover the
region with a /memreserve/ to avoid it being used just like any other
RAM. Perhaps the CLCD could reference the memreserve then?
Alternatively, if you want to represent the region as a regular node
rather than a /memory entry, I'd expect there to be a binding defining
what that node was, and the node to at least have a compatible value as
well. I'm not sure how you would indicate that the node should be MTD
vs. a resource for CLCD though; perhaps you'd use a different compatible
value depending on the intended use of the memory?
>> I'm not sure what the benefit of making this a standalone node is; why
>> not just put the base/size directly into the video-ram property in the
>> CLCD node?
>
> This is certainly an option. I've considered this as well, but thought
> that the above made more sense.
>
> Having said that, there is actually a use case, although a very
> non-probable one, for having a direct number there... The interconnect
> that CLCD is connected to could have different mapping than the
> processor's one. In other word, the memory seen by the core at X, could
> be accessed by the CLCD at Y. Or, in even more quirky situation, the
> core may not have access to the memory at all, with the graphics being
> generated only by GPU (or any other third party). Then the value would
> mean "the address you have to use when generating AMBA read transactions
> to be get some meaningful data" and would have to be known explicitly.
>
> I guess it won't be hard to convince me it's a better option ;-)
That's true. Everything in DT is currently set up to describe the CPU's
memory map. Either we need to add some more properties to describe the
potentially different memory map for other bus masters, and/or we should
represent the various buses in DT, and any driver doing DMA should ask
each bus's driver in turn to translate the core-visible address to a bus
address so we can eventually end up with the address needed by the bus
masters.
That is indeed complex, and could at least in many situations simple be
short-circuited by putting the relevant base address in each other bus
master's own node/property. Hopefully we wouldn't get bitten by how
non-general that could be.
>>> +- max-framebuffer-size: maximum size in bytes of the framebuffer the
>>> + system can handle, eg. in terms of available
>>> + memory bandwidth
>>
>> Size doesn't imply bandwidth, due to the potential for varying bpp,
>> frame-rates, margin/porch sizes, etc. If this is a bandwidth limit,
>> shouldn't we instead represent that value directly, perhaps along with
>> some multiplier to convert theoretical bandwidth to practical bandwidth
>> (to account for memory protocol and controller overheads)?
>
> It's a *memory interface* bandwidth, so synchronization fields are
> irrelevant here.
For average bandwidth, sure. However, the peak bandwidth is affected; if
your active region is 80% vs 95% of your line length, that's a
difference in the required region during the active period only. Of
course, your HW may start pre-fetching much earlier than the start of
the active region, so there are many variables.
> And the bpp limit is actually being calculated from
> this value, not the other way round. But I forgot about differing frame
> rates, that's fact. So it probably should be:
>
> - max-memory-bandwidth: maximum bandwidth in bytes per second that the
> cell's memory interface can handle
>
> and can be then used to calculate maximum bpp depending on the selected
> mode.
Yes, that's a better property definition.
> As to the multipliers... Although I hope that the SOC designer can
> provide theoretical throughput data, the only practical way of getting
> the value I was able to come up with was just trying different
> combinations till cross the line, so there isn't much math to be done
> further.
I don't know how constrained of a system CLCD is, but I do know that
mode validation is a very complex process in some real-life graphics
drivers. There are many complex calculations/modelling/heuristics
applied. I guess it would be very difficult to fully parametrize this
through DT; a real/complete solution is going to have to know enormous
detail of the memory system. So it's probably not worth pushing for DT
to represent the information required for this. I suppose in practice,
for a simple solution, the best idea is to revise max-memory-bandwidth
down (internally to the driver to maintain DT ABI I suppose) if any
problems are found in practice with the calculations.
>> ...
>>> +- panel-type: (required) must be "tft" or "stn", defines panel type
>> ...
>>> +- panel-stn-4bit: (for monochrome "stn" panel) if present means
>>> + that the monochrome display is connected
>>> + via 4 bit-wide interface
>>
>> I just wanted to confirm that those are a complete/direct representation
>> of all the HW options the module supports?
>
> Yes. TFT or STN. There can be one or STN panels connected. STN(s) can be
> color or mono. Mono STN(s) can be driven via 4 or 8 bit wide interfaces.
> Disclaimer: I'm not trying to pretend an expert here. I'm just basing
> the above on the cell's spec.
>
>>> +- display-timings: standard display timings sub-node, see
>>> + Documentation/devicetree/bindings/video/display-timing.txt
>>
>> Should that be in a "Required sub-nodes" section (I assume required not
>> optional) rather than "Optional Properties"?
>
> Right, the whole "panel" section is kept separately in a hope that CDF
> (or DRM or whatever ;-) generic display pipeline bindings will deprecate
> it. So the display-timings is required when optional panel properties
> are present. Maybe I should split them into a separate sub-node?
> Something along these lines (including the bandwidth example):
I would assume that TFT-vs-STN is a pretty direct representation of the
HW (IO bus to panel in particular), and hence wouldn't be replaced by
CDF? I would expect CDF to represent the more generic properties. But, I
haven't been following CDF too closely, so perhaps that's not true.
If you're expecting this binding to change if/when CDF appears, perhaps
it'd be better to wait for CDF, or plan for a new compatible property at
that time, or add some property indicating old-style configuration vs
new-style configuration once CDF is supported?
^ permalink raw reply
* Re: [PATCH v2 1/2] video: ARM CLCD: Add DT support
From: Pawel Moll @ 2013-09-11 16:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130910194324.GE12758@n2100.arm.linux.org.uk>
On Tue, 2013-09-10 at 20:43 +0100, Russell King - ARM Linux wrote:
> On Tue, Sep 10, 2013 at 11:25:25AM +0100, Pawel Moll wrote:
> > +#ifdef CONFIG_OF
> > +static int clcdfb_of_get_tft_panel(struct device_node *node,
> > + struct clcd_panel *panel)
> > +{
> > + int err;
> > + u32 rgb[3];
> > +
> > + err = of_property_read_u32_array(node, "panel-tft-interface", rgb, 3);
> > + if (err)
> > + return err;
> > +
> > + /* Bypass pixel clock divider, data output on the falling edge */
> > + panel->tim2 = TIM2_BCD | TIM2_IPC;
> > +
> > + /* TFT display, vert. comp. interrupt at the start of the back porch */
> > + panel->cntl |= CNTL_LCDTFT | CNTL_LCDVCOMP(1);
> > +
> > + if (rgb[0] >= 4 && rgb[1] >= 4 && rgb[2] >= 4)
> > + panel->caps |= CLCD_CAP_444;
> > + if (rgb[0] >= 5 && rgb[1] >= 5 && rgb[2] >= 5)
> > + panel->caps |= CLCD_CAP_5551;
> > + if (rgb[0] >= 5 && rgb[1] >= 6 && rgb[2] >= 5)
> > + panel->caps |= CLCD_CAP_565;
> > + if (rgb[0] >= 8 && rgb[1] >= 8 && rgb[2] >= 8)
> > + panel->caps |= CLCD_CAP_888;
>
> This definitely isn't right. Why does a panel which has 8 bits of RGB
> get to indicate that it supports everything below it?
>
> This is not how this hardware works. Look at table A-7 in the TRM.
> If you wire the CLCD controller directly to a panel which is 8-bit RGB
> only, it can't support any of the other formats.
>
> The CLCD controller itself can only support on the hardware 8-bits of
> RGB or 5 bits of RGB plus an intensity bit, so that's two formats.
I must admit I didn't checked the PL110 CLD multiplexing scheme, naively
expecting it to be the same as PL111. My bad, thanks for pointing this
out.
The code above works for PL111 - the signals are laid so with full 888
wiring and 444 mode the bottom bits are reserved (see table A.10). In
reality they're zeros, so the colour space is narrowed.
Seems that the code will have to behave differently for PL110 and PL111
here.
> However, things are complicated by ARMs addition of an external mux
> on the CLCD output, which gives us the other format possibilities
> by munging the signals to give appropriate formats in the framebuffer
> memory. In other words, in RGB444 mode, the mux ends up taking
> red from CLD[4:1], green from CLD[9:7,5], blue from CLD[14:13,11:10].
It's the Versatile AB/PB hacked CLCD, PL110/111 hybrid, right? It
doesn't really fall into the "arm,pl110" and "arm,pl111" compatible
value, so would need to be something like "arm,versatile,clcdc" and
require custom code. I don't think I want to solve this problem right
now.
> This is one of the dangers of directly converting what's in the kernel
> to DT properties without getting the hardware documentation and fully
> understanding that first - remember, DT properties are supposed to be
> based on the hardware, not the Linux implementation.
I don't think I've directly converted what's in the kernel to DT
properties. There is no "caps" property in the binding. There is only
information how is the cell wired up to a panel, and this information is
valid for both PL110 and PL111 as it is. My fault I've believed when was
told that "the two are basically the same." and should have compared the
TRMs in details.
Will fix the code.
Paweł
^ permalink raw reply
* Re: [PATCH/RFC v3 06/19] video: display: OF support
From: Hans Verkuil @ 2013-09-11 13:48 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Philipp Zabel, Laurent Pinchart, dri-devel, linux-fbdev,
linux-media, Guennadi Liakhovetski, sylvester.nawrocki,
sakari.ailus
In-Reply-To: <2263372.8nCBHctlWT@avalon>
On 09/11/2013 01:33 PM, Laurent Pinchart wrote:
> Hi Philipp,
>
> On Wednesday 04 September 2013 16:21:38 Philipp Zabel wrote:
>> Am Samstag, den 10.08.2013, 01:03 +0200 schrieb Laurent Pinchart:
>>> Extend the notifier with DT node matching support, and add helper
>>> functions to build the notifier and link entities based on a graph
>>> representation in DT.
>>>
>>> Signed-off-by: Laurent Pinchart
>>> <laurent.pinchart+renesas@ideasonboard.com>
>>> ---
>>>
>>> drivers/video/display/display-core.c | 334 ++++++++++++++++++++++++++
>>> drivers/video/display/display-notifier.c | 187 +++++++++++++++++
>>> include/video/display.h | 45 +++++
>>> 3 files changed, 566 insertions(+)
>>>
>>> diff --git a/drivers/video/display/display-core.c
>>> b/drivers/video/display/display-core.c index c3b47d3..328ead7 100644
>>> --- a/drivers/video/display/display-core.c
>>> +++ b/drivers/video/display/display-core.c
>>
>> [...]
>>
>>> @@ -420,6 +599,161 @@ int display_entity_link_graph(struct device *dev,
>>> struct list_head *entities)>
>>> }
>>> EXPORT_SYMBOL_GPL(display_entity_link_graph);
>>>
>>> +#ifdef CONFIG_OF
>>> +
>>> +static int display_of_entity_link_entity(struct device *dev,
>>> + struct display_entity *entity,
>>> + struct list_head *entities,
>>> + struct display_entity *root)
>>> +{
>>> + u32 link_flags = MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED;
>>> + const struct device_node *node = entity->dev->of_node;
>>
>> the current device tree matching implementation only allows one display
>> entity per linux device. How about adding an of_node pointer to struct
>> display_entity directly and allow multiple display entity nodes below in a
>> single device node in the device tree?
>
> That's a very good point. We had a similar issues in V4L2, with sensors that
> would create several entities. However, in those cases, the sensors would be
> connected to the rest of the pipeline through a single entity :
>
> Sensor Entity 1 -> ... -> Sensor Entity N -> V4L2 pipeline ...
>
> The core code thus had to care about a single sensor entity when building the
> pipeline. We could solve the problem in a similar way for panels, but encoders
> need a more elaborate solution.
Why? Sorry, I don't see why an encoder is different in this respect than a panel.
I'm sure I'm missing something here.
>
> I see (at least) two possibilities here, either explicitly describing all
> entities that make the device in DT (as you have proposed below), or creating
> a hierarchy of entities, with parent entities that can contain several child
> entities. I've CC'ed Guennadi, Hans, Sylwester and Sakari to get their opinion
> on the matter.
I think the way this is done today in complex devices is that the driver just
exposes itself as a single sub-device, but internally it has its own pipeline of
sub-devices. The only one that I know of (platform/s5p-tv/hdmi_drv) doesn't expose
them to a media controller, they are completely hidden inside the hdmi driver.
The ability to support hierarchies of entities would be very nice. However, I
don't know how much work that would be to implement and if it is worth the
effort.
Regards,
Hans
>
>> lvds-encoder {
>> channel@0 {
>
> If I understand this correctly, your LVDS encoder has two independent
> channels. In the general case a device made of multiple entities might have
> those entities chained, so "channel" might not be the best term. "entity"
> might be a better choice.
>
>> port@0 {
>> lvds0_input: endpoint {
>> };
>> };
>> port@1 {
>> lvds0_output: endpoint {
>> };
>> };
>> };
>> channel@1 {
>> port@0 {
>> lvds1_input: endpoint {
>> };
>> };
>> lvds1: port@1 {
>> lvds1_output: endpoint {
>> };
>> };
>> };
>> };
>>
>>> + struct media_entity *local = &entity->entity;
>>> + struct device_node *ep = NULL;
>>> + int ret = 0;
>>> +
>>> + dev_dbg(dev, "creating links for entity %s\n", local->name);
>>> +
>>> + while (1) {
>>> + struct media_entity *remote = NULL;
>>> + struct media_pad *remote_pad;
>>> + struct media_pad *local_pad;
>>> + struct display_of_link link;
>>> + struct display_entity *ent;
>>> + struct device_node *next;
>>> +
>>> + /* Get the next endpoint and parse its link. */
>>> + next = display_of_get_next_endpoint(node, ep);
>>> + if (next = NULL)
>>> + break;
>>> +
>>> + of_node_put(ep);
>>> + ep = next;
>>> +
>>> + dev_dbg(dev, "processing endpoint %s\n", ep->full_name);
>>> +
>>> + ret = display_of_parse_link(ep, &link);
>>> + if (ret < 0) {
>>> + dev_err(dev, "failed to parse link for %s\n",
>>> + ep->full_name);
>>> + continue;
>>> + }
>>> +
>>> + /* Skip source pads, they will be processed from the other end of
>>> + * the link.
>>> + */
>>> + if (link.local_port >= local->num_pads) {
>>> + dev_err(dev, "invalid port number %u on %s\n",
>>> + link.local_port, link.local_node->full_name);
>>> + display_of_put_link(&link);
>>> + ret = -EINVAL;
>>> + break;
>>> + }
>>> +
>>> + local_pad = &local->pads[link.local_port];
>>> +
>>> + if (local_pad->flags & MEDIA_PAD_FL_SOURCE) {
>>> + dev_dbg(dev, "skipping source port %s:%u\n",
>>> + link.local_node->full_name, link.local_port);
>>> + display_of_put_link(&link);
>>> + continue;
>>> + }
>>> +
>>> + /* Find the remote entity. If not found, just skip the link as
>>> + * it goes out of scope of the entities handled by the notifier.
>>> + */
>>> + list_for_each_entry(ent, entities, list) {
>>> + if (ent->dev->of_node = link.remote_node) {
>>> + remote = &ent->entity;
>>> + break;
>>> + }
>>> + }
>>> +
>>> + if (root->dev->of_node = link.remote_node)
>>> + remote = &root->entity;
>>> +
>>> + if (remote = NULL) {
>>> + dev_dbg(dev, "no entity found for %s\n",
>>> + link.remote_node->full_name);
>>> + display_of_put_link(&link);
>>> + continue;
>>> + }
>>> +
>>> + if (link.remote_port >= remote->num_pads) {
>>> + dev_err(dev, "invalid port number %u on %s\n",
>>> + link.remote_port, link.remote_node->full_name);
>>> + display_of_put_link(&link);
>>> + ret = -EINVAL;
>>> + break;
>>> + }
>>> +
>>> + remote_pad = &remote->pads[link.remote_port];
>>> +
>>> + display_of_put_link(&link);
>>> +
>>> + /* Create the media link. */
>>> + dev_dbg(dev, "creating %s:%u -> %s:%u link\n",
>>> + remote->name, remote_pad->index,
>>> + local->name, local_pad->index);
>>> +
>>> + ret = media_entity_create_link(remote, remote_pad->index,
>>> + local, local_pad->index,
>>> + link_flags);
>>> + if (ret < 0) {
>>> + dev_err(dev,
>>> + "failed to create %s:%u -> %s:%u link\n",
>>> + remote->name, remote_pad->index,
>>> + local->name, local_pad->index);
>>> + break;
>>> + }
>>> + }
>>> +
>>> + of_node_put(ep);
>>> + return ret;
>>> +}
>>
>> [...]
>>
>> For example like this:
>>
>> diff --git a/drivers/video/display/display-core.c
>> b/drivers/video/display/display-core.c index 7910c23..a04feed 100644
>> --- a/drivers/video/display/display-core.c
>> +++ b/drivers/video/display/display-core.c
>> @@ -302,6 +302,9 @@ int display_entity_init(struct display_entity *entity,
>> unsigned int num_sinks, kref_init(&entity->ref);
>> entity->state = DISPLAY_ENTITY_STATE_OFF;
>>
>> + if (!entity->of_node && entity->dev)
>> + entity->of_node = entity->dev->of_node;
>> +
>> num_pads = num_sinks + num_sources;
>> pads = kzalloc(sizeof(*pads) * num_pads, GFP_KERNEL);
>> if (pads = NULL)
>> @@ -665,7 +668,7 @@ static int display_of_entity_link_entity(struct device
>> *dev, struct display_entity *root)
>> {
>> u32 link_flags = MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED;
>> - const struct device_node *node = entity->dev->of_node;
>> + const struct device_node *node = entity->of_node;
>> struct media_entity *local = &entity->entity;
>> struct device_node *ep = NULL;
>> int num_sink, ret = 0;
>> @@ -727,13 +730,13 @@ static int display_of_entity_link_entity(struct device
>> *dev, * it goes out of scope of the entities handled by the notifier. */
>> list_for_each_entry(ent, entities, list) {
>> - if (ent->dev->of_node = link.remote_node) {
>> + if (ent->of_node = link.remote_node) {
>> remote = &ent->entity;
>> break;
>> }
>> }
>>
>> - if (root && root->dev->of_node = link.remote_node)
>> + if (root && root->of_node = link.remote_node)
>> remote = &root->entity;
>>
>> if (remote = NULL) {
>> diff --git a/drivers/video/display/display-notifier.c
>> b/drivers/video/display/display-notifier.c index a3998c7..d0da6e5 100644
>> --- a/drivers/video/display/display-notifier.c
>> +++ b/drivers/video/display/display-notifier.c
>> @@ -28,28 +28,30 @@ static DEFINE_MUTEX(display_entity_mutex);
>> * Notifiers
>> */
>>
>> -static bool match_platform(struct device *dev,
>> +static bool match_platform(struct display_entity *entity,
>> struct display_entity_match *match)
>> {
>> pr_debug("%s: matching device '%s' with name '%s'\n", __func__,
>> - dev_name(dev), match->match.platform.name);
>> + dev_name(entity->dev), match->match.platform.name);
>>
>> - return !strcmp(match->match.platform.name, dev_name(dev));
>> + return !strcmp(match->match.platform.name, dev_name(entity->dev));
>> }
>>
>> -static bool match_dt(struct device *dev, struct display_entity_match
>> *match) +static bool match_dt(struct display_entity *entity,
>> + struct display_entity_match *match)
>> {
>> pr_debug("%s: matching device node '%s' with node '%s'\n", __func__,
>> - dev->of_node->full_name, match->match.dt.node->full_name);
>> + entity->of_node->full_name, match->match.dt.node->full_name);
>>
>> - return match->match.dt.node = dev->of_node;
>> + return match->match.dt.node = entity->of_node;
>> }
>>
>> static struct display_entity_match *
>> display_entity_notifier_match(struct display_entity_notifier *notifier,
>> struct display_entity *entity)
>> {
>> - bool (*match_func)(struct device *, struct display_entity_match *);
>> + bool (*match_func)(struct display_entity *,
>> + struct display_entity_match *);
>> struct display_entity_match *match;
>>
>> pr_debug("%s: matching entity '%s' (ptr 0x%p dev '%s')\n", __func__,
>> @@ -66,7 +68,7 @@ display_entity_notifier_match(struct
>> display_entity_notifier *notifier, break;
>> }
>>
>> - if (match_func(entity->dev, match))
>> + if (match_func(entity, match))
>> return match;
>> }
>>
>> diff --git a/include/video/display.h b/include/video/display.h
>> index 4c402bee..d1f8833 100644
>> --- a/include/video/display.h
>> +++ b/include/video/display.h
>> @@ -228,6 +228,7 @@ struct display_entity {
>> struct list_head list;
>> struct device *dev;
>> struct module *owner;
>> + struct device_node *of_node;
>> struct kref ref;
>>
>> char name[32];
^ permalink raw reply
* Re: [PATCH 1/2] video: ARM CLCD: Add DT support
From: Pawel Moll @ 2013-09-11 13:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <522F91F8.6010207@gmail.com>
On Tue, 2013-09-10 at 22:41 +0100, Sylwester Nawrocki wrote:
> On 09/09/2013 01:19 PM, Pawel Moll wrote:
> > On Sat, 2013-09-07 at 23:55 +0100, Sylwester Nawrocki wrote:
> >> H --- /dev/null
> >>> +++ b/Documentation/devicetree/bindings/video/arm,pl11x.txt
> >>> @@ -0,0 +1,87 @@
> >>> +* ARM PrimeCell Color LCD Controller (CLCD) PL110/PL111
> >>
> >> nit: Shouldn't the abbreviation be CLCDC ?
> >
> > The commonly used acronym for this cell is CLCD. For what its worth, I
> > can make the line read:
> >
> > ARM PrimeCell Color LCD (CLCD) Controller PL110/PL111
>
> OK, that's probably better. A meaningless detail, I've just seen mostly
> CLCDC used in the PL100/PL111 TRM and LCDC would presumably be more
> intuitive
> for this type of IP block.
I think I'll completely remove the acronym. No intuition will be
necessary then :-)
> >>> +- video-ram: phandle to a node describing specialized video memory
> >>> + (that is *not* described in the top level "memory" node)
> >>> + that must be used as a framebuffer, eg. due to restrictions
> >>> + of the system interconnect; the node must contain a
> >>> + standard reg property describing the address and the size
> >>> + of the memory area
> >>
> >> It seems the "specialized video memory" is described by some vendor specific
> >> DT binding ? Is it documented ? It sounds like you are unnecessarily
> >> repeating the memory node details here.
> >
> > I appreciate this property being the hardest to swallow, but the problem
> > it is trying to solve is quite simple, really. System can be designed in
> > such a way that CLCD is *not* able to read data from the main memory. In
> > such case there will be a separate block of (usually static) memory
> > "next" to CLCD, which *must* be used for the framebuffer. And I've got
> > two choices here: to simply define an address and size, or to define a
> > phandle to a node with standard reg property. I'll be really grateful
> > for ideas how to describe the situation better.
>
> I though about reusing the binding only, the part defining reserved
> (carve out) memory regions.
Em, what exactly do you mean? Referring to the definition of "reserved
memory region" as an example how to use reg = <(address) (size)>?
(because, I don't think it can be "linux,contiguous-memory-region",
"reserved-memory-region"). Can do, however I'm not sure if it won't
cause even more confusion, as I hope that the CMA bindings will be
useful here on their own, to allocate "normal" contiguous framebuffers.
Keep in mind those two use cases are very very different.
> >> Perhaps this binding/driver should use the common reserved memory bindings,
> >> see thread http://www.spinics.net/lists/devicetree/msg02880.html
> >
> > No, not really - as I said, this is *not* the main RAM of the system.
> > CMA doesn't even know about its existence.
>
> I'm really not an expert in this area, I'll assume we don't list such
> separate memory chips in the 'memory' node.
ePAPR spec, regarding the memory node, states: "The client program may
access memory not covered by any memory reservations (see section 8.3)
using any storage attributes it chooses." (note that the reservations
mentioned are "the other" reservations, /memreserve/ ones ;-)
Now, I wouldn't want my "client program" (read: Linux kernel) to use the
"video memory" in question for general allocations, if only because of
its rather poor performance (resulting from the interconnect design, not
the memory chip characteristics), so I treat it more as a memory mapped
device which happens to have a lot of word-long registers...
> But if such memory could be used not only by this single IP block it would
> probably make sense to have it listed in memory/reserved-memory, so it
> could be used by other devices of which drivers possibly wouldn't have to
> contain all the detailed dt parsing/memory handling code.
The "video RAM" on my platform could be used for other purposes. If you
don't mind latencies :-) It's just that the CLCD itself can't use
anything else.
So, if the memory/reserved-memory described areas *not* to be used as
"normal RAM", yes - we could use it. I don't think it's the case now,
though.
Also, Steven mentioned the other option I talked about - just raw
address/size pair. See me deliberation there...
> >>> +- panel-dimensions: (optional) array of two numbers (width and height)
> >>> + describing physical dimension in mm of the panel
> >>> +- panel-type: (required) must be "tft" or "stn", defines panel type
> >>> +- panel-tft-interface: (for "tft" panel type) array of 3 numbers defining
> >>> + widths in bits of the R, G and B components
> >>> +- panel-tft-rb-swapped: (for "tft" panel type) if present means that
> >>> + the R& B components are swapped on the board
> >>> +- panel-stn-color: (for "stn" panel type) if present means that
> >>> + the panel is a colour STN display, if missing
> >>> + is a monochrome display
> >>> +- panel-stn-dual: (for "stn" panel type) if present means that there
> >>> + are two STN displays connected
> >>> +- panel-stn-4bit: (for monochrome "stn" panel) if present means
> >>> + that the monochrome display is connected
> >>> + via 4 bit-wide interface
> >>
> >> Are this vendor specific or common properties ? Shouldn't those be prefixed
> >> with the vendor name ?
> >
> > I have no answer to this question. My guts are telling me - nope. TFT is
> > TFT, STN is STN, nothing to do with "arm,". But I welcome other
> > opinions.
>
> I thought about documenting such a common properties in a common place.
> It's
> not immediately clear from names of these properties that they apply to
> PL110/
> PL111 devices only. If we let such generic names being redefined across DT
> bindings of different devices it is going to be pretty messy IMHO. Same
> property in two different dts files would potentially have different
> meaning.
>
> So perhaps instead of panel-dimensions we could define common
> properties, e.g.
>
> - display-phys-width: physical horizontal dimension of a display in
> millimetres
> (micrometres ?);
> - display-phys-height: physical vertical dimension of a display in
> millimetres
> (micrometres ?);
>
> Instead of 'panel-stn-color' a boolean property 'monochrome-display',
> the default
> when this property was missing would be "colour display".
>
> I'd like to leave defining such common properties to someone having more
> experience
> in the display area. I don't think it would take much time come up with
> generic
> names for that couple properties you need. Then CDF implementation
> would simply use whatever gets agreed.
Ok, I see what you're saying. Yes, this could be done. No, I don't claim
to have enough expertise either (micrometers??? :-O ;-) The other thing
is that I don't really expect generic CDF bindings to cover such things.
They will (hopefully) only describe what's connected with what. And the
drivers should know how. Of course they may need the dimensions & alike
in the tree (of course having them standardised would help here), but
it's not a CDF job to provide those.
Anyway, if I decide to split the panel data into a separate sub-node,
I'll look into that.
Paweł
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox