devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Figa <t.figa@samsung.com>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Padmavathi Venna <padma.v@samsung.com>,
	padma.kvr@gmail.com, linux-samsung-soc@vger.kernel.org,
	alsa-devel@alsa-project.org, devicetree-discuss@lists.ozlabs.org,
	sbkim73@samsung.com, broonie@opensource.wolfsonmicro.com,
	vinod.koul@intel.com, grant.likely@secretlab.ca,
	swarren@nvidia.com, boojin.kim@samsung.com,
	kgene.kim@samsung.com, jassisinghbrar@gmail.com,
	thomas.abraham@linaro.org, lrg@ti.com, tiwai@suse.de,
	ben-linux@fluff.org
Subject: Re: [PATCH V6 02/10] ASoC: SAMSUNG: Add DT support for i2s
Date: Thu, 14 Feb 2013 12:05:54 +0100	[thread overview]
Message-ID: <1448282.P7VUi6gpBa@amdc1227> (raw)
In-Reply-To: <511CC11B.5030700@samsung.com>

Hi,

On Thursday 14 of February 2013 11:48:59 Sylwester Nawrocki wrote:
> On 01/18/2013 12:47 PM, Padmavathi Venna wrote:
> > Add support for device based discovery.
> > 
> > Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
> > ---
> 
> ...
> 
> >  /* Lock for cross i/f checks */
> > 
> > @@ -997,19 +1006,76 @@ static struct i2s_dai *i2s_alloc_dai(struct
> > platform_device *pdev, bool sec)> 
> >  	return i2s;
> >  
> >  }
> > 
> > +#ifdef CONFIG_OF
> > +static int samsung_i2s_parse_dt_gpio(struct i2s_dai *i2s)
> > +{
> > +	struct device *dev = &i2s->pdev->dev;
> > +	int index, gpio, ret;
> > +
> > +	for (index = 0; index < 7; index++) {
> > +		gpio = of_get_gpio(dev->of_node, index);
> > +		if (!gpio_is_valid(gpio)) {
> > +			dev_err(dev, "invalid gpio[%d]: %d\n", index, gpio);
> > +			goto free_gpio;
> > +		}
> > +
> > +		ret = gpio_request(gpio, dev_name(dev));
> > +		if (ret) {
> > +			dev_err(dev, "gpio [%d] request failed\n", gpio);
> > +			goto free_gpio;
> > +		}
> > +		i2s->gpios[index] = gpio;
> > +	}
> > +	return 0;
> > +
> > +free_gpio:
> > +	while (--index >= 0)
> > +		gpio_free(i2s->gpios[index]);
> > +	return -EINVAL;
> > +}
> > +
> > +static void samsung_i2s_dt_gpio_free(struct i2s_dai *i2s)
> > +{
> > +	unsigned int index;
> > +	for (index = 0; index < 7; index++)
> > +		gpio_free(i2s->gpios[index]);
> > +}
> > +#else
> > +static int samsung_i2s_parse_dt_gpio(struct i2s_dai *dai)
> > +{
> > +	return -EINVAL;
> > +}
> > +
> > +static void samsung_i2s_dt_gpio_free(struct i2s_dai *dai)
> > +{
> > +}
> > +
> > +#endif
> 
> NAK.

+1

> 
> Why we should leave with this temporary code when there is already
> pinctrl support for Exynos SoCs ?
> 
> If the pinctrl driver for Exynos5 was updated you could instead just do
> 
> devm_pinctrl_get_select_default(&i2s->pdev->dev);

I said it already by the way of some other Exynos5 patches that Exynos5 
has to be migrated to pin control.

The legacy GPIO interface was supposed to be kept only for compatibility 
with existing code (until it gets migrated to pin control), not for adding 
new code relying on it.

If you intend to add new code which needs to configure pin muxes, you 
should migrate Exynos5 to pin control first. This won't be particularly 
hard, since pinctrl-exynos driver already supports Exynos5 and all that is 
missing are Device Tree nodes for it.

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D Center
SW Solution Development, Linux Platform

  reply	other threads:[~2013-02-14 11:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-18 11:46 [PATCH V6 00/10] Add DT support for i2s Padmavathi Venna
2013-01-18 11:47 ` [PATCH V6 01/10] ASoC: Samsung: Rename samsung i2s secondary device name Padmavathi Venna
2013-01-24  6:41   ` Mark Brown
2013-01-18 11:47 ` [PATCH V6 02/10] ASoC: SAMSUNG: Add DT support for i2s Padmavathi Venna
2013-02-14 10:29   ` Sylwester Nawrocki
2013-02-14 10:48   ` Sylwester Nawrocki
2013-02-14 11:05     ` Tomasz Figa [this message]
2013-02-14 11:43     ` Mark Brown
2013-02-14 20:33       ` Sylwester Nawrocki
2013-02-15 12:01         ` Mark Brown
2013-02-17  0:31           ` Padma Venkat
2013-01-18 11:47 ` [PATCH V6 03/10] ARM: SAMSUNG: Make dma request compatible to generic dma bindings Padmavathi Venna
2013-01-29  6:20   ` Mark Brown
2013-01-29  9:30     ` Padma Venkat
2013-01-18 11:47 ` [PATCH V6 04/10] spi: s3c64xx: Modify SPI driver to use generic DMA DT support Padmavathi Venna
2013-01-29  5:19   ` Mark Brown
2013-01-29  9:32     ` Padma Venkat
2013-01-18 11:47 ` [PATCH V6 05/10] ARM: dts: Add nodes for i2s controllers for Samsung Exynos5 platforms Padmavathi Venna
2013-01-18 11:47 ` [PATCH 06/10] ARM: EXYNOS: Enable platform support for I2S controllers Padmavathi Venna
2013-01-18 11:47 ` [PATCH V6 07/10] ASoC: SMDK: WM8994: Add device tree support for machine file Padmavathi Venna
2013-01-29  7:12   ` Mark Brown
2013-01-29  9:39     ` Padma Venkat
2013-01-18 11:47 ` [PATCH V6 08/10] ARM: dts: Modify SPI nodes according generic DMA DT bindings Padmavathi Venna
2013-01-29  7:39   ` Mark Brown
2013-01-18 11:47 ` [PATCH V6 09/10] ASoC: Samsung: Update Kconfig for I2S,SPDIF and PCM audio Padmavathi Venna
2013-01-29  7:40   ` Mark Brown
2013-01-18 11:47 ` [PATCH V6 10/10] dmaengine: Fix compilation error in non-DT case Padmavathi Venna
2013-01-27  3:39   ` Mark Brown
2013-01-28 13:47   ` Vinod Koul
2013-01-29  8:53     ` Padma Venkat

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=1448282.P7VUi6gpBa@amdc1227 \
    --to=t.figa@samsung.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=ben-linux@fluff.org \
    --cc=boojin.kim@samsung.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jassisinghbrar@gmail.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=padma.kvr@gmail.com \
    --cc=padma.v@samsung.com \
    --cc=s.nawrocki@samsung.com \
    --cc=sbkim73@samsung.com \
    --cc=swarren@nvidia.com \
    --cc=thomas.abraham@linaro.org \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).