linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Mack <zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH 2/2] SPI: spi-gpio: Add DT bindings
Date: Wed, 25 Jul 2012 14:17:15 +0200	[thread overview]
Message-ID: <500FE3CB.9020902@gmail.com> (raw)
In-Reply-To: <20120725121131.GA2628-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

On 25.07.2012 14:11, Wolfram Sang wrote:
> On Wed, Jul 25, 2012 at 01:44:12PM +0200, Daniel Mack wrote:
>> This patch adds DT bindings to the spi-gpio driver and some
>> documentation about how to use it.
>>
>> Signed-off-by: Daniel Mack <zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>>  Documentation/devicetree/bindings/spi/spi-gpio.txt |   29 ++++++
>>  drivers/spi/spi-gpio.c                             |   99 +++++++++++++++++++-
>>  2 files changed, 125 insertions(+), 3 deletions(-)
>>  create mode 100644 Documentation/devicetree/bindings/spi/spi-gpio.txt
>>
>> diff --git a/Documentation/devicetree/bindings/spi/spi-gpio.txt b/Documentation/devicetree/bindings/spi/spi-gpio.txt
>> new file mode 100644
>> index 0000000..8a824be
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/spi/spi-gpio.txt
>> @@ -0,0 +1,29 @@
>> +SPI-GPIO devicetree bindings
>> +
>> +Required properties:
>> +
>> + - compatible: should be set to "spi-gpio"
>> + - #address-cells: should be set to <0x1>
>> + - ranges
>> + - gpio-sck: GPIO spec for the SCK line to use
>> + - gpio-miso: GPIO spec for the MISO line to use
>> + - gpio-mosi: GPIO spec for the MOSI line to use
>> + - cs-gpios: GPIOs to use for chipselect lines
>> + - num-chipselects: number of chipselect lines
>> +
>> +Example:
>> +
>> +	spi {
>> +		compatible = "spi-gpio";
>> +		#address-cells = <0x1>;
>> +		ranges;
>> +
>> +		gpio-sck = <&gpio 95 0>;
>> +		gpio-miso = <&gpio 98 0>;
>> +		gpio-mosi = <&gpio 97 0>;
>> +		cs-gpios = <&gpio 125 0>;
>> +		num-chipselects = <1>;
> 
> Can't we use of_gpio_named_count() instead of this property?

I thought so too, but it's probably also a good idea to keep this driver
in line to what other drivers do, no? Anyway, I can of course change it
if desired.

>> +
>> +		/* clients */
> 
> Minor: A simple example is helpful for people new to devicetree as I
> experienced in the last days.

Hmm, aren't there enough examples in a) the full dts files in the kernel
and b) in the documenation of spi clients?


Thanks,
Daniel


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

  parent reply	other threads:[~2012-07-25 12:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-25 11:44 [PATCH 1/2] SPI: spi-gpio: store chipselect information in private structure Daniel Mack
     [not found] ` <1343216652-1463-1-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-07-25 11:44   ` [PATCH 2/2] SPI: spi-gpio: Add DT bindings Daniel Mack
     [not found]     ` <20120725121131.GA2628@pengutronix.de>
     [not found]       ` <20120725121131.GA2628-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-07-25 12:17         ` Daniel Mack [this message]
     [not found]           ` <20120725123244.GB2628@pengutronix.de>
     [not found]             ` <20120725123244.GB2628-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-07-25 12:35               ` Daniel Mack
2012-07-25 19:33   ` [PATCH 1/2] SPI: spi-gpio: store chipselect information in private structure Mark Brown
     [not found]     ` <20120725193359.GB9792-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2012-07-25 19:38       ` Daniel Mack
     [not found]         ` <50104B52.7090509-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-07-25 19:52           ` Mark Brown
     [not found]             ` <20120725195203.GC9792-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2012-07-25 20:00               ` Daniel Mack
     [not found]                 ` <50105052.4000603-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-07-25 20:12                   ` Mark Brown
     [not found]                     ` <20120725201227.GE9792-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2012-07-25 20:22                       ` Daniel Mack
2012-08-01 20:45   ` Daniel Mack
     [not found]     ` <5019955F.3030108-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-08-01 20:51       ` Mark Brown
     [not found]         ` <20120801205135.GA29157-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-08-01 20:58           ` Daniel Mack

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=500FE3CB.9020902@gmail.com \
    --to=zonque-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@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 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).