Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2545694ybb; Mon, 30 Mar 2020 08:13:46 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvGewLIA7YKuSHhEZ1lbUMcL98/214Bbkys4pzQqOcz5g4qdz8OA1SLBG6wFwIiADEEABKW X-Received: by 2002:aca:4286:: with SMTP id p128mr7564838oia.29.1585581226810; Mon, 30 Mar 2020 08:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585581226; cv=none; d=google.com; s=arc-20160816; b=J/PXEAX8nO8lIy5wKW/7zj54B9VMgRxnPSqp2qmDOBg407gKvxx+S4hdhKGQ7iNTlH UBUAmJUqroPGEFRU5StEPAjeGsPvcFbioVEnadOdVgeo4BafELWNiM91sgVBJnTKS9RA xg7mHboa+wfcfhZ/rI6IoRMpNAQXTY07b3Dwh7yYo+MbAKavh8RWr+VXzsoZN87hCUd6 1COz2o8gpABSWsZ0d2/zXYCb/jhG3+MDste1aEaeDKZbk2v8LaIhh2c9B/Be3SfP8b14 mzfF68s4Ls2ZwEmjeKDDCKpjAMNfjHJR5L8C9TPgBFOY1NaitMBKqcufDYqSO4G+/GXc AyuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=owWsc4oE1uz/vgJXIvKbvjOwxqJ8BtE9s6a1tLJFCQc=; b=KsyEyI32BCGs2dtNQIWE4WC/U4wE8veWWmIKmAJdIrrOO+HpOuX6F9IyjEHbqqGCfA MLFKY3sK9cjOyNmd8Xe+XJjuX+0La7CAusItYxtQxtmZdH8rsAM/FtJIBx8rhT/qPLYq med5hgmEgp6vzL8K+Am7tnYQ8uxHmmZitphEwyLwqA3TcO4mmzBFCa79nKyfBr8pCp4u KAzq+6yb/BOU/69L+/AHv0ZtnJYwql965mva1B0MfFPhITw3X0a/pt8AIUz8eR38v9sC 902gnicfPW9Ydb5v6o68lSqoxdAbiRw8ytUZ/Ah/xOruY/lRDds6h2QMEND+8RG3lNpF sJ7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pqgruber.com header.s=mail header.b=i2BdfEdZ; 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=NONE dis=NONE) header.from=pqgruber.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si6277391otq.75.2020.03.30.08.13.31; Mon, 30 Mar 2020 08:13:46 -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=@pqgruber.com header.s=mail header.b=i2BdfEdZ; 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=NONE dis=NONE) header.from=pqgruber.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728124AbgC3PMe (ORCPT + 99 others); Mon, 30 Mar 2020 11:12:34 -0400 Received: from mail.pqgruber.com ([52.59.78.55]:57178 "EHLO mail.pqgruber.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727067AbgC3PMe (ORCPT ); Mon, 30 Mar 2020 11:12:34 -0400 Received: from workstation.tuxnet (213-47-165-233.cable.dynamic.surfer.at [213.47.165.233]) by mail.pqgruber.com (Postfix) with ESMTPSA id 81AF1C028FA; Mon, 30 Mar 2020 17:12:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pqgruber.com; s=mail; t=1585581152; bh=owWsc4oE1uz/vgJXIvKbvjOwxqJ8BtE9s6a1tLJFCQc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i2BdfEdZXZazeotMsRW0DdmPwflxF8eSoHPIHQ0tHMUbYig+LXhUrNodmO5g1ZAm2 7XAVjuS392ZPa7bboNXxL0/kkYpjbxjFnobbyCYYnHXRQ6pNMPZDUyFsdT79E3A29W TX0QhZ1KTNG/rdio4m41YvZ3bSlt69/xPeW+CSyo= Date: Mon, 30 Mar 2020 17:12:31 +0200 From: Clemens Gruber To: Matthias Schiffer Cc: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , thierry.reding@gmail.com, linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, andy.shevchenko@gmail.com Subject: Re: (EXT) Re: [PATCH 1/4] pwm: pca9685: remove unused duty_cycle struct element Message-ID: <20200330151231.GA1650@workstation.tuxnet> References: <20200226135229.24929-1-matthias.schiffer@ew.tq-group.com> <20200226151034.7i3h5blmrwre2yzg@pengutronix.de> <32ec35c2b3da119dd2c7bc09742796a0d8a9607e.camel@ew.tq-group.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <32ec35c2b3da119dd2c7bc09742796a0d8a9607e.camel@ew.tq-group.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Feb 26, 2020 at 06:03:02PM +0100, Matthias Schiffer wrote: > As it turns out, this driver is broken in yet another way I didn't find > before: For changing the global prescaler the chip needs to be put into > sleep mode, but the driver doesn't follow the restart sequence > described in the datasheet when waking it back up. In consequence, > changing the period of one PWM does not only modify the period of all > PWMs (which is bad enough, but can't be avoided with this hardware), > but it also leaves all PWMs disabled... I am unable to reproduce this: If I set a specific duty cycle on a channel and then change the period, the channel stays active. I can see the brightness of an LED decrease if I increase the period. This is expected, because after the SLEEP bit is set, we wait for 500usecs and then write to the LED ON/OFF registers. This leaves the channel enabled with the new period (but with old duty_ns value => different ratio) A few years ago, I played around with the idea of remembering the duty_ns to period_ns ratio and setting it accordingly after a period change, possibly also with a shortcut of setting the RESTART bit if the ratio did not change. Maybe after the switch to the atomic API, this would be a nice improvement. Best regards, Clemens