All of lore.kernel.org
 help / color / mirror / Atom feed
From: b32955@freescale.com (Huang Shijie)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 1/6] drivers: bus: add a new driver for WEIM
Date: Thu, 23 May 2013 17:35:42 +0800	[thread overview]
Message-ID: <519DE2EE.1050006@freescale.com> (raw)
In-Reply-To: <20130523092344.GF32299@pengutronix.de>

? 2013?05?23? 17:23, Sascha Hauer ??:
> On Thu, May 23, 2013 at 04:16:13PM +0800, Huang Shijie wrote:
>> +			<cs-number>  0<physical address of mapping>  <size>
>> +
>> +Timing property for child nodes. It is mandatory, not optional.
>> +
>> + - fsl,weim-cs-timing:	The timing array, contains 6 timing values for the
>> +			child node. We can get the CS index from the child
>> +			node's "reg" property.
> This should be more detailed, something like:
>
> This contains the values for the registers EIM_CSnGCR1, EIM_CSnGCR2,
> EIM_CSnRCR1, EIM_CSnRCR2, EIM_CSnWCR1, EIM_CSnWCR2 in this order.
>


do you mean i should add some new properties, such as
"fsl,eim_csnrcr1", "fsl,eim_csnrcr2" ...
>> +static int weim_parse_dt(struct platform_device *pdev)
>> +{
>> +	struct device_node *child;
>> +	int ret;
>> +
>> +	for_each_child_of_node(pdev->dev.of_node, child) {
>> +		if (!child->name)
>> +			continue;
>> +
>> +		ret = weim_timing_setup(pdev, child);
>> +		if (ret)
>> +			goto parse_fail;
>> +
>> +		if (!of_platform_device_create(child, NULL,&pdev->dev)) {
>> +			ret = -EINVAL;
>> +			goto parse_fail;
>> +		}
> I would print some warning here for the failures in this loop, but I
> don't think it's necessary to bail out. No need to make all WEIM devices
> fail if one has an erroneous device node.
>
ok.
>> +
>> +	/* get the resource */
>> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> +	weim->base = devm_ioremap_resource(&pdev->dev, res);
>> +	if (IS_ERR(weim->base)) {
>> +		ret = PTR_ERR(weim->base);
>> +		goto weim_err;
>> +	}
>> +
>> +	/* get the clock */
>> +	weim->clk = devm_clk_get(&pdev->dev, NULL);
>> +	if (IS_ERR(weim->clk))
>> +		goto weim_err;
>> +
>> +	clk_prepare_enable(weim->clk);
>> +
>> +	/* parse the device node */
>> +	ret = weim_parse_dt(pdev);
>> +	if (ret) {
>> +		clk_disable_unprepare(weim->clk);
>> +		goto weim_err;
>> +	}
>> +
>> +	dev_info(&pdev->dev, "WEIM driver registered.\n");
>> +	return 0;
>> +
>> +weim_err:
>> +	return ret;
>> +}
>> +
>> +static int weim_remove(struct platform_device *pdev)
>> +{
>> +	struct imx_weim *weim = platform_get_drvdata(pdev);
>> +
>> +	clk_disable_unprepare(weim->clk);
> Once again: Is this clock needed for the child devices? If yes, you
> can't disable it here and leave the child devices registered.
>
again. yes. we need this clock.


thanks
Huang Shijie

WARNING: multiple messages have this Message-ID (diff)
From: Huang Shijie <b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
To: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	Alison_Chaiken-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH V2 1/6] drivers: bus: add a new driver for WEIM
Date: Thu, 23 May 2013 17:35:42 +0800	[thread overview]
Message-ID: <519DE2EE.1050006@freescale.com> (raw)
In-Reply-To: <20130523092344.GF32299-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

于 2013年05月23日 17:23, Sascha Hauer 写道:
> On Thu, May 23, 2013 at 04:16:13PM +0800, Huang Shijie wrote:
>> +			<cs-number>  0<physical address of mapping>  <size>
>> +
>> +Timing property for child nodes. It is mandatory, not optional.
>> +
>> + - fsl,weim-cs-timing:	The timing array, contains 6 timing values for the
>> +			child node. We can get the CS index from the child
>> +			node's "reg" property.
> This should be more detailed, something like:
>
> This contains the values for the registers EIM_CSnGCR1, EIM_CSnGCR2,
> EIM_CSnRCR1, EIM_CSnRCR2, EIM_CSnWCR1, EIM_CSnWCR2 in this order.
>


do you mean i should add some new properties, such as
"fsl,eim_csnrcr1", "fsl,eim_csnrcr2" ...
>> +static int weim_parse_dt(struct platform_device *pdev)
>> +{
>> +	struct device_node *child;
>> +	int ret;
>> +
>> +	for_each_child_of_node(pdev->dev.of_node, child) {
>> +		if (!child->name)
>> +			continue;
>> +
>> +		ret = weim_timing_setup(pdev, child);
>> +		if (ret)
>> +			goto parse_fail;
>> +
>> +		if (!of_platform_device_create(child, NULL,&pdev->dev)) {
>> +			ret = -EINVAL;
>> +			goto parse_fail;
>> +		}
> I would print some warning here for the failures in this loop, but I
> don't think it's necessary to bail out. No need to make all WEIM devices
> fail if one has an erroneous device node.
>
ok.
>> +
>> +	/* get the resource */
>> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> +	weim->base = devm_ioremap_resource(&pdev->dev, res);
>> +	if (IS_ERR(weim->base)) {
>> +		ret = PTR_ERR(weim->base);
>> +		goto weim_err;
>> +	}
>> +
>> +	/* get the clock */
>> +	weim->clk = devm_clk_get(&pdev->dev, NULL);
>> +	if (IS_ERR(weim->clk))
>> +		goto weim_err;
>> +
>> +	clk_prepare_enable(weim->clk);
>> +
>> +	/* parse the device node */
>> +	ret = weim_parse_dt(pdev);
>> +	if (ret) {
>> +		clk_disable_unprepare(weim->clk);
>> +		goto weim_err;
>> +	}
>> +
>> +	dev_info(&pdev->dev, "WEIM driver registered.\n");
>> +	return 0;
>> +
>> +weim_err:
>> +	return ret;
>> +}
>> +
>> +static int weim_remove(struct platform_device *pdev)
>> +{
>> +	struct imx_weim *weim = platform_get_drvdata(pdev);
>> +
>> +	clk_disable_unprepare(weim->clk);
> Once again: Is this clock needed for the child devices? If yes, you
> can't disable it here and leave the child devices registered.
>
again. yes. we need this clock.


thanks
Huang Shijie

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

  reply	other threads:[~2013-05-23  9:35 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23  8:16 [PATCH V2 0/6] ARM: imx6q{dl}: add the WEIM driver Huang Shijie
2013-05-23  8:16 ` Huang Shijie
2013-05-23  8:16 ` [PATCH V2 1/6] drivers: bus: add a new driver for WEIM Huang Shijie
2013-05-23  8:16   ` Huang Shijie
2013-05-23  8:46   ` Alexander Shiyan
2013-05-23  8:46     ` Alexander Shiyan
2013-05-23  9:02     ` Huang Shijie
2013-05-23  9:02       ` Huang Shijie
2013-05-23  9:23   ` Sascha Hauer
2013-05-23  9:23     ` Sascha Hauer
2013-05-23  9:35     ` Huang Shijie [this message]
2013-05-23  9:35       ` Huang Shijie
2013-05-23  9:53       ` Arnd Bergmann
2013-05-23  9:53         ` Arnd Bergmann
2013-05-23 11:55         ` Sascha Hauer
2013-05-23 11:55           ` Sascha Hauer
2013-05-23 13:09           ` Arnd Bergmann
2013-05-23 13:09             ` Arnd Bergmann
2013-05-24  7:16             ` Huang Shijie
2013-05-24  7:16               ` Huang Shijie
2013-05-24  7:19               ` Sascha Hauer
2013-05-24  7:19                 ` Sascha Hauer
2013-05-23 10:19   ` Russell King - ARM Linux
2013-05-23 10:19     ` Russell King - ARM Linux
2013-05-24  2:42     ` Huang Shijie
2013-05-24  2:42       ` Huang Shijie
2013-05-23  8:16 ` [PATCH V2 2/6] ARM: dts: imx6q{dl}: fix the pin conflict between SPI and WEIM Huang Shijie
2013-05-23  8:16   ` Huang Shijie
2013-05-23  8:16 ` [PATCH V2 3/6] ARM: dts: imx6qdl: add more information for WEIM Huang Shijie
2013-05-23  8:16   ` Huang Shijie
2013-05-23  8:16 ` [PATCH V2 4/6] ARM: dts: imx6q: add pinctrl for WEIM NOR Huang Shijie
2013-05-23  8:16   ` Huang Shijie
2013-05-23  9:14   ` Alexander Shiyan
2013-05-23  9:14     ` Alexander Shiyan
2013-05-23  9:27     ` Huang Shijie
2013-05-23  9:27       ` Huang Shijie
2013-05-23  9:39       ` Re[2]: " Alexander Shiyan
2013-05-23  9:39         ` Alexander Shiyan
2013-05-23  9:52         ` Huang Shijie
2013-05-23  9:52           ` Huang Shijie
2013-05-23  9:55           ` Re[2]: " Alexander Shiyan
2013-05-23  9:55             ` Alexander Shiyan
2013-05-24  2:41             ` Huang Shijie
2013-05-24  2:41               ` Huang Shijie
2013-05-23  8:16 ` [PATCH V2 5/6] ARM: dts: imx6dl: add a " Huang Shijie
2013-05-23  8:16   ` Huang Shijie
2013-05-23  8:16 ` [PATCH V2 6/6] ARM: dts: imx6qdl: enable the " Huang Shijie
2013-05-23  8:16   ` Huang Shijie

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=519DE2EE.1050006@freescale.com \
    --to=b32955@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.