All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Michael Welling <mwelling-EkmVulN54Sk@public.gmane.org>
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] spi: omap2-mcspi: Add support for GPIO chipselects
Date: Thu, 9 Apr 2015 11:52:02 +0100	[thread overview]
Message-ID: <20150409105202.GU6023@sirena.org.uk> (raw)
In-Reply-To: <1428528961-7838-1-git-send-email-mwelling-EkmVulN54Sk@public.gmane.org>

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

On Wed, Apr 08, 2015 at 04:36:01PM -0500, Michael Welling wrote:
> This patch allows for GPIOs specified in the devicetree to be used as SPI chipselects
> on TI OMAP2 SoCs.

Please keep your commit messages under 80 columns.

> +	if (gpio_is_valid(spi->cs_gpio)) {
> +		if (gpio_request(spi->cs_gpio, dev_name(&spi->dev)) == 0)
> +			gpio_direction_output(spi->cs_gpio,
> +					!(spi->mode & SPI_CS_HIGH));
> +	}

For this to work we need to be sure that unspecified GPIOs are invalid
which isn't normally the default - zero tends to be a valid GPIO and
that's also the default for otherwise uninitialized data.  Is there
something that takes care of this?

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

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org>
To: Michael Welling <mwelling@ieee.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: omap2-mcspi: Add support for GPIO chipselects
Date: Thu, 9 Apr 2015 11:52:02 +0100	[thread overview]
Message-ID: <20150409105202.GU6023@sirena.org.uk> (raw)
In-Reply-To: <1428528961-7838-1-git-send-email-mwelling@ieee.org>

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

On Wed, Apr 08, 2015 at 04:36:01PM -0500, Michael Welling wrote:
> This patch allows for GPIOs specified in the devicetree to be used as SPI chipselects
> on TI OMAP2 SoCs.

Please keep your commit messages under 80 columns.

> +	if (gpio_is_valid(spi->cs_gpio)) {
> +		if (gpio_request(spi->cs_gpio, dev_name(&spi->dev)) == 0)
> +			gpio_direction_output(spi->cs_gpio,
> +					!(spi->mode & SPI_CS_HIGH));
> +	}

For this to work we need to be sure that unspecified GPIOs are invalid
which isn't normally the default - zero tends to be a valid GPIO and
that's also the default for otherwise uninitialized data.  Is there
something that takes care of this?

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

  parent reply	other threads:[~2015-04-09 10:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 21:36 [PATCH] spi: omap2-mcspi: Add support for GPIO chipselects Michael Welling
2015-04-08 21:36 ` Michael Welling
     [not found] ` <1428528961-7838-1-git-send-email-mwelling-EkmVulN54Sk@public.gmane.org>
2015-04-09 10:52   ` Mark Brown [this message]
2015-04-09 10:52     ` Mark Brown
2015-04-13 20:45   ` Michael Welling
2015-04-13 20:45     ` Michael Welling

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=20150409105202.GU6023@sirena.org.uk \
    --to=broonie-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mwelling-EkmVulN54Sk@public.gmane.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.