From: Sekhar Nori <nsekhar@ti.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>,
Kevin Hilman <khilman@kernel.org>,
Russell King <linux@armlinux.org.uk>,
Santosh Shilimkar <ssantosh@kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [RESEND PATCH v2 2/4] memory: aemif: add support for board files
Date: Tue, 17 Apr 2018 19:27:46 +0530 [thread overview]
Message-ID: <d3584cd9-904c-c737-8a06-92ed05f559ce@ti.com> (raw)
In-Reply-To: <20180417102917.7794-3-brgl@bgdev.pl>
On Tuesday 17 April 2018 03:59 PM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> Currently aemif is supported in two places separately. By the platform
> driver in drivers/memory and by a hand crafted driver in mach-davinci.
>
> We want to drop the latter but also keep the legacy mode. Add support
> for board files to the aemif driver.
>
> The new structure in platform data currently only contains the chip
> select number, since currently existing users don't require anything
> else, but it can be extended in the future.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
> drivers/memory/ti-aemif.c | 57 +++++++++++++++++---------
> include/linux/platform_data/ti-aemif.h | 9 ++++
> 2 files changed, 46 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/memory/ti-aemif.c b/drivers/memory/ti-aemif.c
> index 588e58d40d1b..27d2b076f465 100644
> --- a/drivers/memory/ti-aemif.c
> +++ b/drivers/memory/ti-aemif.c
> @@ -394,14 +401,24 @@ static int aemif_probe(struct platform_device *pdev)
> }
>
> /*
> - * Create a child devices explicitly from here to
> - * guarantee that the child will be probed after the AEMIF timing
> - * parameters are set.
> + * Create a child devices explicitly from here to guarantee that the
> + * child will be probed after the AEMIF timing parameters are set.
> */
> - for_each_available_child_of_node(np, child_np) {
> - ret = of_platform_populate(child_np, NULL, dev_lookup, dev);
> - if (ret < 0)
> - goto error;
> + if (np) {
> + for_each_available_child_of_node(np, child_np) {
> + ret = of_platform_populate(child_np, NULL,
> + dev_lookup, dev);
> + if (ret < 0)
> + goto error;
> + }
> + } else {
> + for (i = 0; i < pdata->num_sub_devices; i++) {
> + ret = platform_device_register(&pdata->sub_devices[i]);
Before doing this can we make aemif device the parent of the sub_device?
> + if (ret) {
> + dev_warn(dev, "Error register sub device %s\n",
> + pdata->sub_devices[i].name);
> + }
> + }
> }
>
> return 0;
> diff --git a/include/linux/platform_data/ti-aemif.h b/include/linux/platform_data/ti-aemif.h
> index ac72e115093c..dfe8901128c9 100644
> --- a/include/linux/platform_data/ti-aemif.h
> +++ b/include/linux/platform_data/ti-aemif.h
> @@ -16,8 +16,17 @@
>
> #include <linux/of_platform.h>
>
> +struct aemif_abus_data {
> + u32 cs;
> +};
> +
> struct aemif_platform_data {
> struct of_dev_auxdata *dev_lookup;
> + u32 cs_offset;
> + struct aemif_abus_data *abus_data;
> + size_t num_abus_data;
> + struct platform_device *sub_devices;
> + size_t num_sub_devices;
It will be nice to add documentation for these members.
Thanks,
Sekhar
next prev parent reply other threads:[~2018-04-17 13:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-17 10:29 [RESEND PATCH v2 0/4] ARM: davinci: remove the mach-specific aemif driver - part 1 Bartosz Golaszewski
2018-04-17 10:29 ` [RESEND PATCH v2 1/4] memory: aemif: don't rely on kbuild for driver's name Bartosz Golaszewski
2018-04-17 10:29 ` [RESEND PATCH v2 2/4] memory: aemif: add support for board files Bartosz Golaszewski
2018-04-17 13:57 ` Sekhar Nori [this message]
2018-04-17 10:29 ` [RESEND PATCH v2 3/4] ARM: davinci: add aemif & nand support to da850-lcdk in legacy mode Bartosz Golaszewski
2018-04-17 14:09 ` Sekhar Nori
2018-04-25 9:14 ` Bartosz Golaszewski
2018-04-25 9:20 ` Sekhar Nori
2018-04-17 10:29 ` [RESEND PATCH v2 4/4] ARM: davinci: use aemif platform driver in legacy mode for da850-evm Bartosz Golaszewski
2018-04-17 14:12 ` Sekhar Nori
2018-04-25 9:26 ` Bartosz Golaszewski
2018-04-17 10:53 ` [RESEND PATCH v2 0/4] ARM: davinci: remove the mach-specific aemif driver - part 1 Sekhar Nori
2018-04-17 12:36 ` Bartosz Golaszewski
2018-04-17 12:41 ` Bartosz Golaszewski
2018-04-17 13:59 ` Bartosz Golaszewski
2018-04-17 17:29 ` Santosh Shilimkar
2018-04-18 8:17 ` Sekhar Nori
2018-04-18 17:15 ` Santosh Shilimkar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d3584cd9-904c-c737-8a06-92ed05f559ce@ti.com \
--to=nsekhar@ti.com \
--cc=bgolaszewski@baylibre.com \
--cc=brgl@bgdev.pl \
--cc=khilman@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=ssantosh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®