All of lore.kernel.org
 help / color / mirror / Atom feed
From: vinod.koul@intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 07/11] dmaengine: sun6i: Retrieve channel count/max request from devicetree
Date: Mon, 23 Oct 2017 11:45:09 +0530	[thread overview]
Message-ID: <20171023061508.GD936@localhost> (raw)
In-Reply-To: <2200ff4f-67f6-45c7-a2c8-99d066af3391@rwthex-w2-a.rwth-ad.de>

On Tue, Oct 17, 2017 at 01:06:34AM +0200, Stefan Br?ns wrote:
> To avoid introduction of a new compatible for each small SoC/DMA controller
> variation, move the definition of the channel count to the devicetree.
> 
> The number of vchans is no longer explicit, but limited by the highest
> port/DMA request number. The result is a slight overallocation for SoCs
> with a sparse port mapping.

Applied, thanks. But ...


>  static int sun6i_dma_probe(struct platform_device *pdev)
>  {
> +	struct device_node *np = pdev->dev.of_node;
>  	struct sun6i_dma_dev *sdc;
>  	struct resource *res;
>  	int ret, i;
> @@ -1228,6 +1233,26 @@ static int sun6i_dma_probe(struct platform_device *pdev)
>  	sdc->num_vchans = sdc->cfg->nr_max_vchans;
>  	sdc->max_request = sdc->cfg->nr_max_requests;
>  
> +	ret = of_property_read_u32(np, "dma-channels", &sdc->num_pchans);
> +	if (ret && !sdc->num_pchans) {
> +		dev_err(&pdev->dev, "Can't get dma-channels.\n");
> +		return ret;
> +	}

 ... we should probably use device_read_xxx calls instead of of_xxx

-- 
~Vinod

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: "Stefan Brüns" <stefan.bruens-vA1bhqPz9FBZXbeN9DUtxg@public.gmane.org>
Cc: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
	Andre Przywara <andre.przywara-5wv7dgnIgG8@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Dan Williams
	<dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Code Kipper <codekipper-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v5 07/11] dmaengine: sun6i: Retrieve channel count/max request from devicetree
Date: Mon, 23 Oct 2017 11:45:09 +0530	[thread overview]
Message-ID: <20171023061508.GD936@localhost> (raw)
In-Reply-To: <2200ff4f-67f6-45c7-a2c8-99d066af3391-cBaz+nnMw1+1MzRH+ruthl5UTUQ924AY@public.gmane.org>

On Tue, Oct 17, 2017 at 01:06:34AM +0200, Stefan Brüns wrote:
> To avoid introduction of a new compatible for each small SoC/DMA controller
> variation, move the definition of the channel count to the devicetree.
> 
> The number of vchans is no longer explicit, but limited by the highest
> port/DMA request number. The result is a slight overallocation for SoCs
> with a sparse port mapping.

Applied, thanks. But ...


>  static int sun6i_dma_probe(struct platform_device *pdev)
>  {
> +	struct device_node *np = pdev->dev.of_node;
>  	struct sun6i_dma_dev *sdc;
>  	struct resource *res;
>  	int ret, i;
> @@ -1228,6 +1233,26 @@ static int sun6i_dma_probe(struct platform_device *pdev)
>  	sdc->num_vchans = sdc->cfg->nr_max_vchans;
>  	sdc->max_request = sdc->cfg->nr_max_requests;
>  
> +	ret = of_property_read_u32(np, "dma-channels", &sdc->num_pchans);
> +	if (ret && !sdc->num_pchans) {
> +		dev_err(&pdev->dev, "Can't get dma-channels.\n");
> +		return ret;
> +	}

 ... we should probably use device_read_xxx calls instead of of_xxx

-- 
~Vinod
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul@intel.com>
To: "Stefan Brüns" <stefan.bruens@rwth-aachen.de>
Cc: linux-sunxi@googlegroups.com, devicetree@vger.kernel.org,
	Chen-Yu Tsai <wens@csie.org>,
	Andre Przywara <andre.przywara@arm.com>,
	linux-kernel@vger.kernel.org,
	Dan Williams <dan.j.williams@intel.com>,
	Rob Herring <robh+dt@kernel.org>,
	dmaengine@vger.kernel.org, Code Kipper <codekipper@gmail.com>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 07/11] dmaengine: sun6i: Retrieve channel count/max request from devicetree
Date: Mon, 23 Oct 2017 11:45:09 +0530	[thread overview]
Message-ID: <20171023061508.GD936@localhost> (raw)
In-Reply-To: <2200ff4f-67f6-45c7-a2c8-99d066af3391@rwthex-w2-a.rwth-ad.de>

On Tue, Oct 17, 2017 at 01:06:34AM +0200, Stefan Brüns wrote:
> To avoid introduction of a new compatible for each small SoC/DMA controller
> variation, move the definition of the channel count to the devicetree.
> 
> The number of vchans is no longer explicit, but limited by the highest
> port/DMA request number. The result is a slight overallocation for SoCs
> with a sparse port mapping.

Applied, thanks. But ...


>  static int sun6i_dma_probe(struct platform_device *pdev)
>  {
> +	struct device_node *np = pdev->dev.of_node;
>  	struct sun6i_dma_dev *sdc;
>  	struct resource *res;
>  	int ret, i;
> @@ -1228,6 +1233,26 @@ static int sun6i_dma_probe(struct platform_device *pdev)
>  	sdc->num_vchans = sdc->cfg->nr_max_vchans;
>  	sdc->max_request = sdc->cfg->nr_max_requests;
>  
> +	ret = of_property_read_u32(np, "dma-channels", &sdc->num_pchans);
> +	if (ret && !sdc->num_pchans) {
> +		dev_err(&pdev->dev, "Can't get dma-channels.\n");
> +		return ret;
> +	}

 ... we should probably use device_read_xxx calls instead of of_xxx

-- 
~Vinod

  reply	other threads:[~2017-10-23  6:15 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170928014928.2272-1-stefan.bruens@rwth-aachen.de>
2017-09-28  1:49 ` [PATCH v4 01/11] dmaengine: sun6i: Correct setting of clock autogating register for A83T/H3 Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49 ` [PATCH v4 02/11] dmaengine: sun6i: Correct burst length field offsets for H3 Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49 ` [PATCH v4 03/11] dmaengine: sun6i: Restructure code to allow extension for new SoCs Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49 ` [PATCH v4 04/11] dmaengine: sun6i: Enable additional burst lengths/widths on H3 Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49 ` [PATCH v4 05/11] dmaengine: sun6i: Move number of pchans/vchans/request to device struct Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49 ` [PATCH v4 06/11] arm64: allwinner: a64: Add devicetree binding for DMA controller Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49 ` [PATCH v4 07/11] dmaengine: sun6i: Retrieve channel count/max request from devicetree Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-10-16  7:02   ` Vinod Koul
2017-10-16  7:02     ` Vinod Koul
2017-10-16  7:02     ` Vinod Koul
2017-10-16 14:21     ` Brüns, Stefan
2017-10-16 14:21       ` Brüns, Stefan
2017-10-16 14:21       ` Brüns, Stefan
2017-10-16 17:15       ` Vinod Koul
2017-10-16 17:15         ` Vinod Koul
2017-10-16 17:15         ` Vinod Koul
2017-09-28  1:49 ` [PATCH v4 08/11] dmaengine: sun6i: Add support for Allwinner A64 and compatibles Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49 ` [PATCH v4 09/11] arm64: allwinner: a64: Add device node for DMA controller Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49 ` [PATCH v4 10/11] arm64: allwinner: a64: add dma controller references to spi nodes Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49 ` [PATCH v4 11/11] arm: allwinner: Correct unit name in devicetree binding example Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-09-28  1:49   ` Stefan Brüns
2017-10-05 22:34   ` Rob Herring
2017-10-05 22:34     ` Rob Herring
2017-10-16 23:06 ` [PATCH v5 07/11] dmaengine: sun6i: Retrieve channel count/max request from devicetree Stefan Brüns
2017-10-16 23:06   ` Stefan Brüns
2017-10-16 23:06   ` Stefan Brüns
2017-10-23  6:15   ` Vinod Koul [this message]
2017-10-23  6:15     ` Vinod Koul
2017-10-23  6:15     ` Vinod Koul

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=20171023061508.GD936@localhost \
    --to=vinod.koul@intel.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.