Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5033333imm; Tue, 16 Oct 2018 04:14:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV62STPSc42JTW2jc/nu29rtoUCest44DnFJ9nGfNyZZEH/wWtpQEYCLpPTFUlmu+3lSKbO/9 X-Received: by 2002:a17:902:27a8:: with SMTP id d37-v6mr21251854plb.318.1539688457205; Tue, 16 Oct 2018 04:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539688457; cv=none; d=google.com; s=arc-20160816; b=ZPk1J57fBNQxtTvE3NFSaSHiYNXr1oBfL5o81cYxRXNuaLU1lESJ5BnUhUNW8OznMh t/Q9LZ+HmGQjZVKvosIVTrCcvLe0Hueqi6gJ2A9afHZU30s/tlh2/YjYfGY6/mPQuckb Yyji7MvhLQn99CV3/iuRx1e7R7y9hx48vFwR6C0qCWp+NzKdBgRsLN/VybnkhVgnmee8 VPyMurpGSDuZfSXdJ98qE7ixf4IAejhLaROW8N08ev9NIyiXs4rjWy0qxV34Kkiubmb1 wFxoagy6JT+IjtLAzIBskUjq1kDak9/YkfrjgTxhe3Xho+Uj7Rs9L5ZfGtS0/pIUay8z ZnFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4je4xhXUCeLf8WgsbR+Mno33Kmekkz3UdqSRFHJ3HPs=; b=c2hccxCDfXVQVFF3kUyJ/TH/Mm+YAB6lGMFXs8SD/yb31IMuSQpOH1CHIP/Juc2Rxe +uzuOlzREM2E3xVtXdP1eiyDWOBmhCvhsWdBL3uKEGUjSr8EWJGRtvWXbSa0iOQVGaHB uOW4oo9SqMBOqVnBaeLnOlYi0IWq503R1ujOiHBFMYDVZqUm9QqqKnlKVVCS1pegY7mr mq8G7ntU0oBxqt6vuC1pzkw69I6N4MhSLZwM2YL43ACROa6I3zIRVEgTpCR6MfS0fcU4 0JuFyC+AHqIqL0+NCdovolqX5sPcNTLdySKI+uMnGLH1A68M0UbVudPJugf4RDHnxMcg kMDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kLDfKh1+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o6-v6si13033265plk.31.2018.10.16.04.14.00; Tue, 16 Oct 2018 04:14:17 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=kLDfKh1+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727191AbeJPTD0 (ORCPT + 99 others); Tue, 16 Oct 2018 15:03:26 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:56164 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726595AbeJPTDZ (ORCPT ); Tue, 16 Oct 2018 15:03:25 -0400 Received: by mail-wm1-f67.google.com with SMTP id 206-v6so22003794wmb.5; Tue, 16 Oct 2018 04:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4je4xhXUCeLf8WgsbR+Mno33Kmekkz3UdqSRFHJ3HPs=; b=kLDfKh1+m47caMGRW8CaYkQSRo8Oaky3+rOBBamCWNj4QStSP90ObSv6FYVHl5a5zA X0IsJPV5UPd79C4e1HGdqtupUkS5FBhjuKRDjzx0gtU8nEBROtsLwjkUEzzijB5oKnVZ BdKyOd7hUka9GrRL2gQZPVQY7rkI2ooLS+5yllGXPNCMEczrwuXdYqRicIAB2u7FUwEk 2F4ge9OwPqaNrKfFmWFkEtRUBQAG5t/Sl1GnEiJe9mdvAvAqDD5a2Ik1g/ugX7nMLjTw 0ikYfvtlMPWoQZbcMdG/5zREisQQZDOEhlG4SXt9hWLCuXBTGq+tCTft2Qn/+janivIc 3wVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4je4xhXUCeLf8WgsbR+Mno33Kmekkz3UdqSRFHJ3HPs=; b=LQTBon7oZSqychd9vQv+aGNXwhhFFsc6Vy8BzNx3gmk1cRhv/JwfWAo7mJvhBAlsYt 8NLjFiaU/meo4nFG1wr+peK5Zawq00PVGak8A/Fwe9fDeqwuz//J39WZIsQHESlnu2bu Bbp3vcSADZ5JypWYDhSF0fwitO8fSmIV979DZWARjDFvXR2PvL9N2Eq7HpPVMiaQyO69 YUPhiFPPlveAxYg4r9ZG+c4M7xXkLMSYEkUNPDa2oAQSUL/4KKUD2JaARUJPY/+opBIT ETxyMnvzSGyXKdArJTsD/g+YhnU33Mms/T54s38+MyHXvrcU3RJyd/b8dX9L5yA5VRRk 7oKw== X-Gm-Message-State: ABuFfoiTdnAr00vJll/JzZ+6Xm75jba7+B2qEUHWIpa8WLUMJjGGSMIN Ee3Pc94pHnvQUMsV9bopeFI= X-Received: by 2002:a1c:ee15:: with SMTP id m21-v6mr16157442wmh.124.1539688407082; Tue, 16 Oct 2018 04:13:27 -0700 (PDT) Received: from localhost (pD9E5106D.dip0.t-ipconnect.de. [217.229.16.109]) by smtp.gmail.com with ESMTPSA id 143-v6sm12746627wmv.6.2018.10.16.04.13.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Oct 2018 04:13:26 -0700 (PDT) Date: Tue, 16 Oct 2018 13:13:24 +0200 From: Thierry Reding To: Wesley Terpstra Cc: Atish Patra , Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-pwm@vger.kernel.org, linux-gpio@vger.kernel.org, linus.walleij@linaro.org, Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland , Christoph Hellwig Subject: Re: [RFC 1/4] pwm: sifive: Add DT documentation for SiFive PWM Controller. Message-ID: <20181016111324.GD8852@ulmo> References: <1539111085-25502-1-git-send-email-atish.patra@wdc.com> <1539111085-25502-2-git-send-email-atish.patra@wdc.com> <20181010134926.GD21134@ulmo> <25758ab9-eb36-741b-6264-42412b3ddd8e@wdc.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vni90+aGYgRvsTuO" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --vni90+aGYgRvsTuO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 15, 2018 at 04:19:20PM -0700, Wesley Terpstra wrote: > On Mon, Oct 15, 2018 at 3:57 PM Atish Patra wrote: > > >> +SiFive PWM controller > > >> + > > >> +Unlike most other PWM controllers, the SiFive PWM controller curren= tly only > > >> +supports one period for all channels in the PWM. This is set global= ly in DTS. > > >> +The period also has significant restrictions on the values it can a= chieve, > > >> +which the driver rounds to the nearest achievable frequency. > > > > > > What restrictions are these? If "nearest achievable" is too far off t= he > > > target period it might be preferable to error out. > > > > > > > @Wes: Any comments? >=20 > When I last looked at this driver and hardware, I briefly considered > throwing up my hands and pretending that this PWM device had no period > control at all, only duty-cycle. There are several examples of PWM > controllers in linux already that behave that way. Can you point those out? So far we've always opted to refuse changing the period of PWM channels that share a period if it didn't match the current period. > Most of the uses of this PWM are only going to care about the > duty-cycle, not the period. So failing when the period is unachievable > seems worse to me than just completely eliminating access to period > control. I'm not sure we've ever tried to completely take period out of the picture. You could probably do it if you use only the atomic API because then you just leave the period untouched. And if you have a post-clock change you just need to make sure to record the new period and update the duty cycle so that the ratio remains the same. I think that could work, but I think it'd be best to be explicit about it, rather than just handwaving it. Thierry --vni90+aGYgRvsTuO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAlvFx9IACgkQ3SOs138+ s6EG5Q//VozF9Lk+dGPqd7hls3pRBj6SyqljD13wEXsC+zLveuBBDKtOFvJ53yYj A5PxNzKHGdfFcEm+WWNthJezglWFUBwoeiJVmOkuhHSTAwSXr+bhKjPRzPyRssNe Av0PZyxQ9yB9XsmZSZrixTtGT6XpAW3MB/9ha3G/PkL6lEM7mI1rCoA1riiZsnpq gX5v1d8+lizsAJMYIDduyAbyB3+zvpRwtrQSEuM+p5pwpQBZhZiEI18fXOazDGmF p0FCHWwRTXXlVN2gOk84+Q8/mXRFA35NqbhTJ6yrqavZLd2k7nhwVr69N1bw2DQC PzdzYM/JD4CowrfzpAnNG6ysqvkzh44zQB0uHhF8dDNQC+JqAYReUNH8/JjbHqd/ cuI21LU5l0mBgMyza9Eal+WwXXMe/tppz9CcHddMEke3RUXDo+MRHDNtphid/sOf TznJLIAbOiOGsoUfyoHycbEh0xmMiNoqnayt7sUvdzoKSxi+HIwsvVbsPMvlqapM qGq0t3q/gK19MiEG5yUEhNf3WzhJCGMdJKcnlAzX8chKA2nrmIGvBIr29TUnPo8X cMmOUncqNkQ3oj9ypACk+9ACXNAAQoupww+fLQZ/0V6lm4BM7JjLRCpsxPqKjYhK nbW9AskHYjXg5kVVMj7/GwwdXNXV9Q/iWCxax2JxY8bsuXuxnMk= =DuQI -----END PGP SIGNATURE----- --vni90+aGYgRvsTuO--