Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp145721imu; Fri, 16 Nov 2018 19:30:21 -0800 (PST) X-Google-Smtp-Source: AJdET5d6j/iIwVFGGeH4LI70SBh7OvBVBKGjS1PjL7wc/1scBp37JPEturODV70IzQV5J47KrvH5 X-Received: by 2002:a17:902:4827:: with SMTP id s36-v6mr13018781pld.226.1542425421520; Fri, 16 Nov 2018 19:30:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542425421; cv=none; d=google.com; s=arc-20160816; b=nkPFNcFtTZoBfqVbNguINzPI7Cr3X6z0TlOuGhwgLOoiWeC/g48qPCDPmvECuQ56aK hInZx27tGW0QoW6eHIJBUC0vYutQ2/HYdK0QMGZXfuVauXOdtHzbotkAjOY+xHjAbClM sFE+EkI/ftRS+HfOE63QGQakFbScdEm6X6ll2ga27F/mvLraUJG+XQBVt9p/Qj9zOIyg 6DX29u026RuXjaGupj0ieo7P37sCWeOOomLRyogD/xaznrfxSxMC4EhH9XR+M9jtNNSh Q3NSJa2ExfMPczto3uKTmUVAqS3VGTJC21lwtI8FViiyVl8ipmKgeefxL2DVW3jrlQ9+ q8Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BnAwtWg28pS52MFFX6UK6keC0Ht3HGAZcKi384UsGP0=; b=pa5Vxh/zAwudX+ZML68HNLiOh2A1gpI9Aj0wLkDbrNMxKU1pwjzdGxycU2lIKp+JzR YprpiiNmwlxg5qmzo9xoRRXsIMK0YrcIoBLypaDPw/YH+sRHvfgS1NyYr3EHQhFf9PNL rq9BcdAcUodbqUviPEB8UNNaGp54YDIbdE4bVU7vwX88GDsNhTFuJgD8mRXKdeOB8SZv Iqwk/otO/p0meVIjdV2A6tVN34c0Ny2QSEbdmsioZUzUpbqKnqth1PND9ybsM2ZtCqTD zJb3hZx8wZYZeW1V5M+muRBfy1K6y5cHc3T6WjcyrpGyb5ePXPcXFVux3iryTQwGGLfn bt6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@usp-br.20150623.gappssmtp.com header.s=20150623 header.b=C87hDjzZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=usp.br Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4-v6si35832854pfa.25.2018.11.16.19.30.07; Fri, 16 Nov 2018 19:30:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@usp-br.20150623.gappssmtp.com header.s=20150623 header.b=C87hDjzZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=usp.br Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731203AbeKQNoa (ORCPT + 99 others); Sat, 17 Nov 2018 08:44:30 -0500 Received: from mail-io1-f65.google.com ([209.85.166.65]:45976 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730143AbeKQNoa (ORCPT ); Sat, 17 Nov 2018 08:44:30 -0500 Received: by mail-io1-f65.google.com with SMTP id w7so10908203iom.12 for ; Fri, 16 Nov 2018 19:29:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=usp-br.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BnAwtWg28pS52MFFX6UK6keC0Ht3HGAZcKi384UsGP0=; b=C87hDjzZns7pTuLgyUDCzfkWfI/l9DCOvsOgPq7sio5IKTuSMoxBQGVciUAyOCt+CS tQdgCHHA91FlrSbDCOeQzoZZ6DxMlJMvuxONSyrdYOa3QdIsewuf2IVgt7G3pr8E5Qu/ 71yuDWWZr3+rfIzj0E5sFz6RD5JMzCUYl8cVPYLsDMAVGa36S3qxmHrQwdn+Bx9U43Ax OToePeDwJhnxBF+5zOccOM7t2u/fRwXb2HkBaQmptU2boChDwUaFWjwIHeMs3ZaVW5DQ DOJed+HyVVtLm1t5dmg8kVVYS4Ca4R4PYUBWo00Vbc1f7f174upxW37XtTVJ9DHI4d/e FYkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BnAwtWg28pS52MFFX6UK6keC0Ht3HGAZcKi384UsGP0=; b=RmfWJwR2hXvq2hHvzvwEZnc6b4UvUOFEk/wrlNfi0yeKEMNHozIgCNT2D6zqYVkAhu xfmPy6/Hu1t4umgute9dprt8i91BgbvbQaZhBJ6i2TLJcEIaoVkLgWuWKbcOiM051z1Z YOLY+1S9KILLfQETOi/MTuWkUQJs7s/cWrm1bagsFvWkcG54Jk/MBhh9uhVzCSHrLsVA 9AOyCOErQc1QYbRvxUtuBV7Y3Jz8gQ3Ekflruj6fmdCXwjywfBmr47gf0fLRPJClpuOW tsILloQvoVX77lzBIJiIhNWRy9QW/zUMjgTb8HuVh0aAP/EwIPoa5MbF07RAP4c9o5sm qbkA== X-Gm-Message-State: AGRZ1gKQoDVaoNwn99Npabpl6l22el/OK2F8oRFPo9KJ8QRx+bEhO4u8 ujfgAhj6JoqkAVty5siCxztNt0EVeu84cA8lvjJzKA== X-Received: by 2002:a6b:abc6:: with SMTP id u189-v6mr9764928ioe.229.1542425361177; Fri, 16 Nov 2018 19:29:21 -0800 (PST) MIME-Version: 1.0 References: <20181109220044.24843-1-matheus.bernardino@usp.br> <20181109220044.24843-5-matheus.bernardino@usp.br> <20181111114848.266d3937@archlinux> In-Reply-To: <20181111114848.266d3937@archlinux> From: Matheus Tavares Bernardino Date: Sat, 17 Nov 2018 01:29:09 -0200 Message-ID: Subject: Re: [PATCH 4/6] dt-bindings:iio:resolver: Add docs for ad2s90 To: Jonathan Cameron Cc: Lars-Peter Clausen , Michael Hennerich , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , Rob Herring , Mark Rutland , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandru Ardelean , kernel-usp@googlegroups.com, Victor Colombo , broonie@kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 11, 2018 at 9:48 AM Jonathan Cameron wrote: > > On Fri, 9 Nov 2018 20:00:42 -0200 > Matheus Tavares wrote: > > > This patch adds the device tree binding documentation for the ad2s90 > > resolver-to-digital converter. > > > > Signed-off-by: Matheus Tavares > > --- > > .../bindings/iio/resolver/ad2s90.txt | 26 +++++++++++++++++++ > > 1 file changed, 26 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/iio/resolver/ad2s90.txt > > > > diff --git a/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt b/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt > > new file mode 100644 > > index 000000000000..b42cc7752ffd > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt > > @@ -0,0 +1,26 @@ > > +Analog Devices AD2S90 Resolver-to-Digital Converter > > + > > +https://www.analog.com/en/products/ad2s90.html > > + > > +Required properties: > > + - compatible : should be "adi,ad2s90" > > + - reg : SPI chip select number for the device > > + - spi-max-frequency : set maximum clock frequency, must be 830000 > > + - spi-cpol and spi-cpha : must be defined to enable SPI mode 3 > > As the part only works in mode 3, my gut feeling is that this belongs > in the driver, not here. Rob, what do you think? > For this patch, I assumed the part only worked in mode 3 based on the driver's code that set this at probe. But today I carefully looked for it at the datasheet and now I'm unsure. It is never said, explicitly, which SPI mode ad2s90 works with. But looking at the diagram that shows the expected pins signals at each communication moment, it seems to me that this chip can either work in mode 0 (CPOL=0, CPHA=0) or mode 3 (CPOL=1, CPHA=1). Could someone help me to confirm this? And if that is the case, them the SPI mode setting should be left in DT, as adc/mcp320x and dac/ti-dac082s085 do, right? Also, when I thought that ad2s90 only worked in mode 3, I wrote this patch based on the dt-binding docs for the adxl345 accelerometer, which only works in mode 3 but lets this setting to DT not in the driver. Do you think, perhaps, it is wrong in adxl345, them? Thanks, Matheus. > > + > > +Note about max frequency: > > + Chip's max frequency, as specified in its datasheet, is 2Mhz. But a 600ns > > + delay is expected between the application of a logic LO to CS and the > > + application of SCLK, as also specified. And since the delay is not > > + implemented in the spi code, to satisfy it, SCLK's period should be at most > > + 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which gives > > + roughly 830000Hz. > > + > > +Example: > > +resolver@0 { > > + compatible = "adi,ad2s90"; > > + reg = <0>; > > + spi-max-frequency = <830000>; > > + spi-cpol; > > + spi-cpha; > > +}; >