The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Sergei Ianovich <ynvich@gmail.com>
Cc: linux-kernel@vger.kernel.org, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Mark Brown <broonie@kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	"open list:SPI SUBSYSTEM" <linux-spi@vger.kernel.org>
Subject: Re: [PATCH v1] spi: master driver to enable RTC on ICPDAS LP-8841
Date: Mon, 22 Feb 2016 11:55:31 -0600	[thread overview]
Message-ID: <20160222175531.GA28101@rob-hp-laptop> (raw)
In-Reply-To: <1456105630-28914-1-git-send-email-ynvich@gmail.com>

On Mon, Feb 22, 2016 at 04:47:06AM +0300, Sergei Ianovich wrote:
> ICP DAS LP-8841 contains a DS-1302 RTC. This driver provides an SPI
> master which makes the RTC usable. The driver is not supposed to work
> with anything else.
> 
> The driver uses the standard MicroWire half-duplex transfer timing.
> Master output is set on low clock and sensed by the RTC on the rising
> edge. Master input is set by the RTC on the trailing edge and is sensed
> by the master on low clock.
> 
> Signed-off-by: Sergei Ianovich <ynvich@gmail.com>
> ---
>  .../devicetree/bindings/spi/spi-lp8841-rtc.txt     |  55 +++++
>  drivers/spi/Kconfig                                |  10 +
>  drivers/spi/Makefile                               |   1 +
>  drivers/spi/spi-lp8841-rtc.c                       | 272 +++++++++++++++++++++
>  4 files changed, 338 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/spi/spi-lp8841-rtc.txt
>  create mode 100644 drivers/spi/spi-lp8841-rtc.c
> 
> diff --git a/Documentation/devicetree/bindings/spi/spi-lp8841-rtc.txt b/Documentation/devicetree/bindings/spi/spi-lp8841-rtc.txt
> new file mode 100644
> index 0000000..f191aef
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/spi-lp8841-rtc.txt
> @@ -0,0 +1,55 @@
> +* ICP DAS LP-8841 SPI Controller for RTC
> +
> +ICP DAS LP-8841 contains a DS-1302 RTC. This driver provides an SPI
> +master which makes the RTC usable. The driver is not supposed to work
> +with anything else.

Bindings describe h/w not drivers.

> +The driver uses the standard MicroWire half-duplex transfer timing.
> +Master output is set on low clock and sensed by the RTC on the rising
> +edge. Master input is set by the RTC on the trailing edge and is sensed
> +by the master on low clock.
> +
> +Required properties:
> +
> +- #address-cells: should be 1
> +
> +- #size-cells: should be 0
> +
> +- compatible: should be "icpdas,spi-lp8841-rtc"

icpdas,lp8841-spi-rtc would be more inline with naming conventions.

> +
> +- reg: should provide IO memory address
> +
> +Requirements to SPI slave nodes:
> +
> +- There can be only one slave device.
> +
> +- The spi slave node should claim the following flags which are
> +  required by the spi controller.
> +
> +  - spi-3wire: The master itself has only 3 wire. It cannor work in

s/cannor/cannot/

> +    full duplex mode.
> +
> +  - spi-cs-high: DS-1302 has active high chip select line. The master
> +    doesn't support active low.
> +
> +  - spi-lsb-first: DS-1302 requires least significant bit first
> +    transfers. The master only support this type of bit ordering.
> +
> +
> +Example:
> +
> +spi0@901c {

spi@901c

> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +	compatible = "icpdas,spi-lp8841-rtc";
> +	reg = <0x901c 0x1>;
> +
> +	rtc@0 {
> +		compatible = "maxim,rtc-ds1302";
> +		reg = <0>;
> +		spi-max-frequency = <500000>;
> +		spi-3wire;
> +		spi-lsb-first;
> +		spi-cs-high;
> +	};
> +};

  parent reply	other threads:[~2016-02-22 17:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22  1:47 [PATCH v1] spi: master driver to enable RTC on ICPDAS LP-8841 Sergei Ianovich
2016-02-22  3:10 ` Mark Brown
2016-02-22  9:26   ` Sergei Ianovich
2016-02-22 11:08     ` Mark Brown
2016-02-22  9:40 ` [PATCH v2] " Sergei Ianovich
2016-02-22 10:39   ` Mark Brown
2016-02-22 11:57 ` [PATCH v3] " Sergei Ianovich
2016-02-22 21:27   ` Mark Brown
2016-02-22 17:55 ` Rob Herring [this message]
2016-02-23 10:44 ` [PATCH v4] " Sergei Ianovich
2016-02-23 23:28   ` Rob Herring
2016-02-24  4:09   ` Mark Brown

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=20160222175531.GA28101@rob-hp-laptop \
    --to=robh@kernel.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=ynvich@gmail.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