Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754383AbbLTMOW (ORCPT ); Sun, 20 Dec 2015 07:14:22 -0500 Received: from mail-lf0-f42.google.com ([209.85.215.42]:33512 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754262AbbLTMOU (ORCPT ); Sun, 20 Dec 2015 07:14:20 -0500 Message-ID: <1450613656.15911.62.camel@gmail.com> Subject: Re: [PATCH v5] rtc: support DS1302 RTC on ICP DAS LP-8x4x From: Sergei Ianovich To: Rob Herring Cc: linux-kernel@vger.kernel.org, Alexandre Belloni , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Alessandro Zummo , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "open list:REAL TIME CLOCK (RTC) SUBSYSTEM" Date: Sun, 20 Dec 2015 15:14:16 +0300 In-Reply-To: <20151220033815.GD9883@rob-hp-laptop> References: <397668667-27328-3-git-send-email-ynvich@gmail.com> <1450201525-9137-1-git-send-email-ynvich@gmail.com> <20151220033815.GD9883@rob-hp-laptop> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3384 Lines: 76 On Sat, 2015-12-19 at 21:38 -0600, Rob Herring wrote: > On Tue, Dec 15, 2015 at 08:45:23PM +0300, Sergei Ianovich wrote: > > Nothing in this is specific to ICP, so the subject should be updated. > > > Signed-off-by: Sergei Ianovich > > CC: Alexandre Belloni > > --- > >    v4..v5 > >    * drop THIS_MODULE from struct platform driver > >    * use "dallas" for vendor name per vendor-prefixes.txt > > > >    v3..v4 > >    * move DTS bindings to a different patch > > > >    v2..v3 > >    * use usleep_range instead of custom nsleep > >    * number change (07/16 -> 09/21) > > > >    v0..v2 > >    * use device tree > >    * use devm helpers where possible > > > >  .../devicetree/bindings/rtc/rtc-ds1302.txt         |  14 +++ > >  drivers/rtc/Kconfig                                |   2 +- > >  drivers/rtc/rtc-ds1302.c                           | 100 > > ++++++++++++++++++++- > >  3 files changed, 113 insertions(+), 3 deletions(-) > >  create mode 100644 Documentation/devicetree/bindings/rtc/rtc- > > ds1302.txt > > > > diff --git a/Documentation/devicetree/bindings/rtc/rtc-ds1302.txt > > b/Documentation/devicetree/bindings/rtc/rtc-ds1302.txt > > new file mode 100644 > > index 0000000..810613b > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/rtc/rtc-ds1302.txt > > @@ -0,0 +1,14 @@ > > +* Dallas Semiconductor DS-1302 RTC > > + > > +Simple device which could be used to store date/time between > > reboots. > > + > > +Required properties: > > +- compatible : Should be "dallas,rtc-ds1302" > > +- reg : Should be address and size of IO memory region > > This device is a SPI (or SPI like?) interface. So you have some sort > of > of FPGA logic in between the cpu and ds1302. The DT should have a node > for the controller and then the ds1302 as a child of it. A full blown > SPI driver may be overkill here, but that's a separate discussion from > the DT binding. Below is the quote from the actual DT of LP-8x4x: >                 fpga@5 { >                         compatible = "simple-bus"; >                         #address-cells = <1>; >                         #size-cells = <1>; >                         ranges = <0 5 0x3000000 0x10000>; >                         interrupt-parent = <&fpgairq>; > >                         rtc@901c { >                                 compatible = "dallas,rtc-ds1302"; >                                 reg = <0x901c 0x1>; >                                 status = "okay"; >                         }; You are right about the topology. ds1302 is a half-duplex SPI device. Does this mean I should rewrite the driver to handle the chip as a slave SPI device, and then provide a master SPI functionality at the FPGA? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/