Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1355925
| From | Roger Quadros <rogerq@ti.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 1/7] ARM: OMAP2+: gpmc-nand: Set omap2-nand's parent dev to GPMC dev |
| Date | 2016-03-11 15:00 +0100 |
| Message-ID | <rbvLJ-73L-23@gated-at.bofh.it> (permalink) |
| References | <rbiEN-5UZ-7@gated-at.bofh.it> <rbiEP-5UZ-41@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Franklin,
On 11/03/16 01:56, Franklin S Cooper Jr wrote:
> The dma channel information is located within the GPMC node which is the
> NAND's parent node. The NAND driver requires a handle to the GPMC's dev
> to properly parse the DMA properties. Therefore, set the NAND's parent dev
> to the GPMC's dev so it can be referenced within the driver.
>
> Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
> ---
> Version 4 changes:
> Instead of storing the GPMC dev in a new property simply grab a reference
> to it and set omap2-nand's dev.parent to it.
>
> arch/arm/mach-omap2/gpmc-nand.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
> index 72918c4..77e453c 100644
> --- a/arch/arm/mach-omap2/gpmc-nand.c
> +++ b/arch/arm/mach-omap2/gpmc-nand.c
> @@ -15,6 +15,7 @@
> #include <linux/omap-gpmc.h>
> #include <linux/mtd/nand.h>
> #include <linux/platform_data/mtd-nand-omap2.h>
> +#include <linux/of_platform.h>
>
> #include <asm/mach/flash.h>
>
> @@ -77,6 +78,9 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
> int err = 0;
> struct gpmc_settings s;
> struct platform_device *pdev;
> + struct platform_device *gpmc_dev;
> + struct device_node *gpmc_node;
> +
> struct resource gpmc_nand_res[] = {
> { .flags = IORESOURCE_MEM, },
> { .flags = IORESOURCE_IRQ, },
> @@ -134,8 +138,18 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
> if (pdev) {
> err = platform_device_add_resources(pdev, gpmc_nand_res,
> ARRAY_SIZE(gpmc_nand_res));
> - if (!err)
> + if (!err) {
> pdev->dev.platform_data = gpmc_nand_data;
> +
> + gpmc_node = of_get_parent(gpmc_nand_data->of_node);
I'm afraid that we can't use this method as we want to restrict
gpmc_nand_init() to non-DT boots.
> +
> + if (gpmc_node) {
> + gpmc_dev = of_find_device_by_node(gpmc_node);
> +
> + if (gpmc_dev)
> + pdev->dev.parent = &gpmc_dev->dev;
> + }
> + }
> } else {
> err = -ENOMEM;
> }
>
cheers,
-roger
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 0/7] mtd: nand: Fix support for NAND DMA prefetch Franklin S Cooper Jr <fcooper@ti.com> - 2016-03-11 01:00 +0100
[PATCH v4 3/7] ARM: dts: am437x: Fix GPMC dma properties Franklin S Cooper Jr <fcooper@ti.com> - 2016-03-11 01:00 +0100
Re: [PATCH v4 3/7] ARM: dts: am437x: Fix GPMC dma properties Roger Quadros <rogerq@ti.com> - 2016-03-11 15:00 +0100
Re: [PATCH v4 3/7] ARM: dts: am437x: Fix GPMC dma properties Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-03-11 15:10 +0100
[PATCH v4 2/7] ARM: dts: am33xx: Fix GPMC dma properties Franklin S Cooper Jr <fcooper@ti.com> - 2016-03-11 01:00 +0100
Re: [PATCH v4 2/7] ARM: dts: am33xx: Fix GPMC dma properties Roger Quadros <rogerq@ti.com> - 2016-03-11 15:00 +0100
Re: [PATCH v4 2/7] ARM: dts: am33xx: Fix GPMC dma properties Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-03-11 15:10 +0100
[PATCH v4 1/7] ARM: OMAP2+: gpmc-nand: Set omap2-nand's parent dev to GPMC dev Franklin S Cooper Jr <fcooper@ti.com> - 2016-03-11 01:00 +0100
Re: [PATCH v4 1/7] ARM: OMAP2+: gpmc-nand: Set omap2-nand's parent dev to GPMC dev Roger Quadros <rogerq@ti.com> - 2016-03-11 15:00 +0100
Re: [PATCH v4 1/7] ARM: OMAP2+: gpmc-nand: Set omap2-nand's parent dev to GPMC dev "Franklin S Cooper Jr." <fcooper@ti.com> - 2016-03-11 16:50 +0100
Re: [PATCH v4 1/7] ARM: OMAP2+: gpmc-nand: Set omap2-nand's parent dev to GPMC dev Roger Quadros <rogerq@ti.com> - 2016-03-14 10:20 +0100
[PATCH v4 4/7] mtd: nand: omap2: Support parsing dma channel information from DT Franklin S Cooper Jr <fcooper@ti.com> - 2016-03-11 01:00 +0100
[PATCH v4 5/7] mtd: nand: omap2: Start dma request before enabling prefetch Franklin S Cooper Jr <fcooper@ti.com> - 2016-03-11 01:00 +0100
Re: [PATCH v4 0/7] mtd: nand: Fix support for NAND DMA prefetch Roger Quadros <rogerq@ti.com> - 2016-03-11 15:10 +0100
Re: [PATCH v4 0/7] mtd: nand: Fix support for NAND DMA prefetch "Franklin S Cooper Jr." <fcooper@ti.com> - 2016-03-14 15:20 +0100
csiph-web