Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp1471022imp; Fri, 22 Feb 2019 04:18:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IYjQC/zp//iUYvqSvYjzpVwwmPItfIr5xgXzrrDNS8fAA4zxlGe+J848GJvm0LtvFjfzqb0 X-Received: by 2002:a65:5bc9:: with SMTP id o9mr3733129pgr.42.1550837883228; Fri, 22 Feb 2019 04:18:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550837883; cv=none; d=google.com; s=arc-20160816; b=mTt9ytTJqfAvgM8obls0GnJi0ZUXznyJCUYVqiVwXeZais4yYp2INwlROkqZQC+jSO XrE+RTgHnPnmhQ3TZsDrLcF/edmhKlQt0JNTKvOTqEaglUYk97/CGF1crk1fKIiZRiCN rXZLYJmU/jxTEQgdAqrZijGSrSxM/2jren6icQkhuFFjUExvfTtzxVvJ6uZIZrnKm2jM 4Tty/bdn6NuqM2J7d+/nIaurH3o8mZSRT4lCrGFwsshUOAhZLHYyyd+lnu6Dn6debnrX xRg9zQ+Btg2DPeIky+I8YnB8vTS5T9pd6ieCsVynHEe0qYSH/5qkBqY8wE8eKCjec89/ qB9A== 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=DSDXeQtwrVw22ntSVHFiO7PWYxPzF9EBjM/hlsDz/Rw=; b=zhfb7nU4pjvM70Gm+kCWYZUwdfFJVDscYMHLe5F2Y/KwPm+ofRU70Ppm0G+mdbvEZB tSd/1QSWyEmasi1VXav7wTchpYWwyb0GG5GSzOkDWp+Wg2R8K1ZJV3w5YFhsULrIyYHF pNC1kJPS8ccVEniC2GJFF8/MoPAA3eM94WFuTZ3hpDvNA4sDNxcySVsdRRd7N5Dj2/Av d79gZ+1zpxgWrxRgR8iVRvLVCLGvx2Aj4CUc2R6UAemcvMCFYhZUgjMgILKG/BlM1a5S 2Et8+cW1kXEBEQ98Ej84DxQAlBc3G9dEVA4dsC/kvjjj2aEKM7YwjVM/JTpClfd213Ea GR7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iM1FitHf; 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 128si1329101pfd.19.2019.02.22.04.17.48; Fri, 22 Feb 2019 04:18:03 -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=@gmail.com header.s=20161025 header.b=iM1FitHf; 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 S1726980AbfBVMQG (ORCPT + 99 others); Fri, 22 Feb 2019 07:16:06 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:46225 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725942AbfBVMQG (ORCPT ); Fri, 22 Feb 2019 07:16:06 -0500 Received: by mail-io1-f66.google.com with SMTP id k21so1513156ior.13; Fri, 22 Feb 2019 04:16:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DSDXeQtwrVw22ntSVHFiO7PWYxPzF9EBjM/hlsDz/Rw=; b=iM1FitHfcrLmn9bStAvtW7HxnSeec5Wx/GxwiGNQ/R8xS8B/l7tn7Nzszw6KlZSR0s rpWJpikgVyLZb6jli3V6gQ/ohK9pASTC7BsQMXxBAjk+vvaJqc1sTl+InwZGqx0cZE10 YByycpl6IrD3K7TUJ/uxYrpDBJGkZhCWDkR1//I6VENKMDYk/abgZQv6lP5Fj0osiuI9 Zj0XP6z0QodXZ4bwtBVvcdistsabQXcfHOO82hdmHYsTJhYxDWf4A+TSRXsP84rYst8M gC3vLliBBdPtrNnIXPhhgaXH4T88EZYUqQT6G/xJJuInhpm+hckaKFPIt6N05sMFDjP5 RAhg== 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=DSDXeQtwrVw22ntSVHFiO7PWYxPzF9EBjM/hlsDz/Rw=; b=Qx8rcbVN+61xEaJaMSi7s72NJhZ9z/ZtIFYmP5NogwV2+KFLwCYySqlo8yvLpHJFNv fSjujuJ+ae4do0+GzgGCOlVNDCha7l8P27aIGXVd6KsA7X2vQcE3izT0DiqLJ3OWI2xR cIA7O9mgEECo4xfcMr9dGeHH/wHGm59ShKqlcgIL5OavMa9/2Yas+d1BNwO9+Zi5MyNa 54L97hBbiYsCMTjZJHuJmgOOTQFq6V40Gnwuk6aNTYosKVDvPUCWiSgiCZlUfue5PTN+ 6fqkIJN7IwUVL1c3m2HhaFrrpe3vyZLjBI/qG+TN/hB5CfFZcIPGUnv8gd5TpcrN6I7q bCzg== X-Gm-Message-State: AHQUAub5RS7IQkzGJdq/zhMBqJjw9q2tUaF3pXuNAOZEa0FnZTtUiDUz AqdmiBwhZ18ak0eSlIW+uSzySAEnCxshHhc5otI= X-Received: by 2002:a5d:9750:: with SMTP id c16mr2072673ioo.300.1550837765071; Fri, 22 Feb 2019 04:16:05 -0800 (PST) MIME-Version: 1.0 References: <20190219095808.12059-1-m.othacehe@gmail.com> <20190219095808.12059-3-m.othacehe@gmail.com> <20190221195641.hqvjxixhj7fi4gff@pengutronix.de> In-Reply-To: <20190221195641.hqvjxixhj7fi4gff@pengutronix.de> From: Mathieu Othacehe Date: Fri, 22 Feb 2019 13:15:53 +0100 Message-ID: Subject: Re: [PATCH v3 3/3] pwm: hibvt: Add hi3559v100 support To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Cc: Thierry Reding , robh+dt@kernel.org, mark.rutland@arm.com, linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, LKML 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 Hi Uwe, > The patch looks fine now. (If you have to do another round: > s/again/twice/ in the commit log and s/once more/twice/ in the comment > below.) Ok. > > I wonder if this behaviour is a bug or a feature of the hardware. Is > this additional enable needed to apply changes to both period and > duty_cycle atomically? Is the 2nd enable needed independent of the PWM > already running? Can you share the relevant part of the documentation > without violating an NDA? The same goes for the period, so I'll precise it in v4. This behaviour is not documented in the SoC manual. I discovered it by hitting the problem. Hisilicon support confirmed it was needed without any further details. It looks like this behaviour is "by design" because there are 2 registers for duty cycle and period and 2 state registers for duty cycle and period. When the first two registers are edited, the state registers are only updated on sending a new "1" in pwm enable. I don't know if the two boards already supported by hibvt driver have the same design but it seems quite likely. Maybe this enable thing could be done for all boards and not considered as a quirk. Thanks, Mathieu