Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3985870pxb; Mon, 1 Feb 2021 09:28:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwX48MEbDtJSqqifM8ZZ6u97xVwm8hmgGCdNVZFGDKQhIi32OE34ZDAS3sxPUE38roLVbvZ X-Received: by 2002:a17:907:2710:: with SMTP id w16mr3171536ejk.73.1612200519833; Mon, 01 Feb 2021 09:28:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612200519; cv=none; d=google.com; s=arc-20160816; b=PL21fXtNsHoQEoEl1KV9hHhpcXk0J50nQBK+riy4HO+FM1dAiUl5ehfTzpCC0INbWq sMiGySPk02aqwROacPoWPEiIZBhre6cQrnyHSSB7RGTnwAsoodoRqFvYyTv4lAPg7uy8 gAa+4INbdMvc+OzurJmbrDzM83VwzyJNTWqilIGWDTXUYggqlTTFN04a0ufY7lUK8xfa rgZGwW6qx58fzgTklm/zZZNrf28PePFlgnxxT/eT89IRyok1A0Jh1ZiJrw4dtlLqRMSr WqPCJf6PpkQpmOQF735/IVtF9WcsGOj17DXIMbVubFanl6q9Qdl05L4zY2QBahUSAoCX thuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+ts/5g1qWFJkzk5tLXZNFyB6pmP9M4qhq/bTMqcP9Go=; b=GqPsQQabB/+wKqGhlEOAI0tv8z00wRzsXSomiZbZjzrwOlD24o/SogUXmuxSkqStKK etGsIb4I0KfZpdgbRo7bW0h2NwB1gOzEQmtvtP64EKsVaSNc7C1Jhe/1Co0LS1+sFMCT l2MXpaT/8UHcAISAZoaTdp9l0wmQD+gWNN4TmZod0c6BIwmq9a5XNbP56Xe1Xgg4Mz+M NpMDwX94cVmASkcqd7bWjT9eZs64FstqdVSSezs6Z5r+u4tvB6kdARIoDyfcIiKyMUYA c0IYj4iaw4jLMDfXRRYtVWFL7YmEvRQKysODtzk5S7CaQAqOgLZKWgYheDIcoMGDdVi0 En5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pqgruber.com header.s=mail header.b=SxJvTVxK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=pqgruber.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e17si10912803edz.241.2021.02.01.09.28.14; Mon, 01 Feb 2021 09:28:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pqgruber.com header.s=mail header.b=SxJvTVxK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=pqgruber.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230346AbhBARYu (ORCPT + 99 others); Mon, 1 Feb 2021 12:24:50 -0500 Received: from mail.pqgruber.com ([52.59.78.55]:41310 "EHLO mail.pqgruber.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230171AbhBARYq (ORCPT ); Mon, 1 Feb 2021 12:24:46 -0500 Received: from workstation.tuxnet (213-47-165-233.cable.dynamic.surfer.at [213.47.165.233]) by mail.pqgruber.com (Postfix) with ESMTPSA id 9353EC72B41; Mon, 1 Feb 2021 18:24:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pqgruber.com; s=mail; t=1612200243; bh=+ts/5g1qWFJkzk5tLXZNFyB6pmP9M4qhq/bTMqcP9Go=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SxJvTVxKZ+KJc3ii4sC5rtg8sDwtwuvR1fBUzxxtcTzzz0S42qGNMonJW9FypDKR5 gvHnfcfdr2hw5kxY3BXBI+y7qfwLIv9ryvn9ImzFBaeT5Rp+zUg2BKRXgxc7KC0kVD AKB//FPqOHjscfmOmQBJFxzJAbEAbl+BLp5BoFJQ= Date: Mon, 1 Feb 2021 18:24:02 +0100 From: Clemens Gruber To: Sven Van Asbroeck , Thierry Reding Cc: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Linux Kernel Mailing List , linux-pwm@vger.kernel.org Subject: Re: [PATCH v5 2/7] pwm: pca9685: Support hardware readout Message-ID: References: <20201216125320.5277-2-clemens.gruber@pqgruber.com> <20210111203532.m3yvq6e5bcpjs7mc@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sven, Thierry, Uwe, On Fri, Jan 29, 2021 at 05:16:51PM -0500, Sven Van Asbroeck wrote: > Hi Clemens, > > On Fri, Jan 29, 2021 at 4:24 PM Sven Van Asbroeck wrote: > > > > LEN_ON = 409, LED_OFF = 1228 and > > LED_ON = 419, LED_OFF = 1238 > > produce the same result. you can't see the difference between the two > > when scoping the channel. there are probably more ways to do this, > > some might surprise us. It's a tricky chip. > > Please ignore this example, it's bogus. In my defence, it's a Friday > afternoon here :) Happens to the best of us :) > > But consider the following: imagine the bootloader has enabled a few > pwm channels, and the driver's .probe() has left them on/unchanged. > Then the user enables another pwm channel, and tries to change the > period/prescaler. How would pca9685_may_change_prescaler() know > if changing the prescaler is allowed? > > And the following: imagine the bootloader has enabled a few > pwm channels, and the driver's .probe() has left them on/unchanged. > After .probe(), the runtime_pm will immediately put the chip to sleep, > because it's unaware that some channels are alive. (We could read out the state in .probe. If a pwm is already enabled by the bootloader, then the user can't change the period. Also, the chip would not be put to sleep. The user then can export channels and see if they are enabled. If he wants to change the period, he needs to find the one enabled by the bootloader and change the period there, before he requests more. If the bootloader enabled more than one, then he has to disable all but one to change the period. Or did I miss something?) > > I'm sure I'm overlooking a few complications here. probe not changing > the existing configuration, will add a lot of complexity to the driver. > I'm not saying this is necessarily bad, just a tradeoff. Or, a management > decision. But I agree that it is simpler if we keep the resets in probe. It would also avoid a potentially breaking change for users that do not reset their pca9685 chips in their bootloader code. There might be users out there that depend on the driver to reset the OFF registers in .probe. If Thierry agrees / allows it, I can keep the resets for now. Removing the resets could then be left as something to discuss further in the future and something that belongs in a separate patch series? Clemens