Linux Samsung SOC development
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Tomasz Figa <t.figa@samsung.com>
Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>,
	linux-arm-kernel@lists.infradead.org,
	spi-devel-general@lists.sourceforge.net,
	linux-samsung-soc@vger.kernel.org, naveenkrishna.ch@gmail.com,
	grant.likely@secretlab.ca, jaswinder.singh@linaro.org,
	kgene.kim@samsung.com, cpgs@samsung.com,
	devicetree@vger.kernel.org,
	Javier Martinez Canillas <javier.martinez@collabora.co.uk>,
	Doug Anderson <dianders@chromium.org>
Subject: Re: [PATCH 1/3] spi: s3c64xx: move "cs-gpio" from subnode to SPI DT node
Date: Wed, 16 Jul 2014 18:09:05 +0100	[thread overview]
Message-ID: <20140716170905.GT17528@sirena.org.uk> (raw)
In-Reply-To: <53C56520.8030801@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 1317 bytes --]

On Tue, Jul 15, 2014 at 07:30:08PM +0200, Tomasz Figa wrote:
> On 15.07.2014 14:20, Naveen Krishna Chatradhi wrote:

> >  	/* The CS line is asserted/deasserted by the gpio pin */
> > -	if (sdd->cs_gpio)
> > -		cs->line = of_get_named_gpio(data_np, "cs-gpio", 0);
> > +	cs->line = spi->cs_gpio;
> >  
> >  	if (!gpio_is_valid(cs->line)) {

> This check is wrong when native chip select is used. However I'm not
> sure how to distinguish this from a situation when invalid GPIO was
> specified, because cs->line will be -ENOENT in both cases. Mark, any ideas?

Hrm.  I'd *hope* that of_get_named_gpio() would distinguish between the
property being there but unparsable and the property being absent.  Does
it not do this?

> > -		if (!of_find_property(pdev->dev.of_node, "cs-gpio", NULL))
> > +		if (!of_find_property(pdev->dev.of_node, "cs-gpios", NULL))
> >  			sdd->cs_gpio = false;

> What is this boolean flag used for now? If cs->line now either contains
> a valid GPIO or a negative error, why gpio_is_valid() couldn't be used
> on it? I believe it was done correctly in previous version.

We ought to handle the errors differently depending on where they came
from - an unspecified GPIO means use the physical chip select but a GPIO
we fail to obtain is an error we should handle.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-07-16 17:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15 12:20 [PATCH 0/3] spi: s3c64xx: fix the driver to use "cs-gpios" property Naveen Krishna Chatradhi
2014-07-15 12:20 ` [PATCH 1/3] spi: s3c64xx: move "cs-gpio" from subnode to SPI DT node Naveen Krishna Chatradhi
2014-07-15 17:30   ` Tomasz Figa
2014-07-16 17:09     ` Mark Brown [this message]
2014-07-15 12:20 ` [PATCH 2/3] spi: s3c64xx: validate s3c64xx_spi_csinfo before using Naveen Krishna Chatradhi
2014-07-15 17:49   ` Tomasz Figa
2014-07-15 20:00     ` Javier Martinez Canillas
2014-07-15 12:21 ` [PATCH 3/3] ARM: DTS: fix the chip select gpios definition in the SPI nodes Naveen Krishna Chatradhi

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=20140716170905.GT17528@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=ch.naveen@samsung.com \
    --cc=cpgs@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jaswinder.singh@linaro.org \
    --cc=javier.martinez@collabora.co.uk \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=naveenkrishna.ch@gmail.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=t.figa@samsung.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