Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4329879pxb; Sun, 14 Feb 2021 06:48:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1Ic929X/hGW7x7why1g6wO5daD/sDkk5O2FrvFh/8muEVBWH9tx9/j71ajoyFib3W26Rq X-Received: by 2002:a05:6402:5211:: with SMTP id s17mr11815555edd.312.1613314106930; Sun, 14 Feb 2021 06:48:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613314106; cv=none; d=google.com; s=arc-20160816; b=qoQ98VDatOpyCXiGvyEx913ud1dCF5ZWZfnHZjMYWG5tZR1IaLyBMTSSbh3bTu0X9l UBBAITRDlNtC0RuRtWGcEq4wSsrUpE+qO76wNEZpdQ2pVFCusEMvHuYEme79ATIFHMPO POjqNw1fVlAhaHZCSH16bhSGaOOMJMxOlc0E1Dchw1tuYmVv91cGvmB0P+0qeM9b6gYH 5wWEeLD+v1dqVZYR8/zuGCpcFzmYgDj+rmw1eMug4+H1Qo5WPa3vcvTKr8ZGt6S5vT5b AwJiKsjTbbsr1IqvQtFoTOW81yRsd2IqnNk8M/BhDA0Vjxd5Up4G3YFi7MykLabEPX9D u2vg== 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=sxi7a6E8cRH4ZwXVlJ0++ebboH+ZCqj50zgHlBOdnPA=; b=mlcWt8KqFSNAigCbv6LPG5yu9WQHLFKFwVaRFaV2jlP8G4Sz61nydu+eMShDWAnkM1 Or2+SnuILLhMrN4wpLp2C6BDisyPZkBTgjAefNeDYvUtBusPRclNZTHOgKRwoTLIDriI sOt29bsghcpW8/wgG3dygy1M5RvcY90w8puXqC4+eCOaEJLMKKWrDpgvpIHpaheWMvB0 QaTRproavJRC0wvjB1D6MkPf7HTBrPGaCJamnygmpusbCAn+HWsgeRwwYSU7ceQtJis3 kBuWXyIAz1VQJt5hrcTrcxSExIjajqt2WVNPNTlBi9ydOVE0U7SSiWmHROgtGjzujBJT UjTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pqgruber.com header.s=mail header.b=xw3sdAsH; 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 d24si9887059edt.102.2021.02.14.06.48.04; Sun, 14 Feb 2021 06:48:26 -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=xw3sdAsH; 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 S229714AbhBNOrf (ORCPT + 99 others); Sun, 14 Feb 2021 09:47:35 -0500 Received: from mail.pqgruber.com ([52.59.78.55]:50520 "EHLO mail.pqgruber.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbhBNOrd (ORCPT ); Sun, 14 Feb 2021 09:47:33 -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 2B2B9C727E0; Sun, 14 Feb 2021 15:46:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pqgruber.com; s=mail; t=1613314011; bh=sxi7a6E8cRH4ZwXVlJ0++ebboH+ZCqj50zgHlBOdnPA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xw3sdAsHZOtda3rZh7oPB+C/nGMt6R03OGoXlhK5VwQYhvW1mZdbmFcF2dTAwYNlf J+sIYMEjkhYj8wXKclccHIlliuTxLidO7c7MghieT0yS8E5VtBloE3cS7Kappk1MCn 9CIOnrVoEDC48W8yi1vucbOEdJ2t+MKK/hIGebps= Date: Sun, 14 Feb 2021 15:46:49 +0100 From: Clemens Gruber To: linux-pwm@vger.kernel.org Cc: Sven Van Asbroeck , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Thierry Reding , Linux Kernel Mailing List Subject: Re: [PATCH v5 2/7] pwm: pca9685: Support hardware readout Message-ID: References: <20201216125320.5277-1-clemens.gruber@pqgruber.com> <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 all, On Fri, Jan 29, 2021 at 09:37:47PM +0100, Clemens Gruber wrote: > Hi Sven, > > On Fri, Jan 29, 2021 at 01:05:14PM -0500, Sven Van Asbroeck wrote: > > Hi Clemens, > > > > On Fri, Jan 29, 2021 at 11:31 AM Clemens Gruber > > wrote: > > > > > > Ok, so you suggest we extend our get_state logic to deal with cases > > > like the following: > > > > Kind of. We can't control how other actors (bootloaders etc) program the > > chip. As far as I know, there are many, many different register settings that > > result in the same physical chip outputs. So if .probe() wants to preserve the > > existing chip settings, .get_state() has to be able to deal with every possible > > setting. Even invalid ones. > > Is the driver really responsible for bootloaders that program the chip > with invalid values? > The chip comes out of PoR with sane default values. If the bootloader of > a user messes them up, isn't that a bootloader problem instead of a > Linux kernel driver problem? > > > In addition, .apply() cannot make any assumptions as to which bits are > > already set/cleared on the chip. Including preserved, invalid settings. > > > > This might get quite complex. > > > > However if we reset the chip in .probe() to a known state (a normalized state, > > in the mathematical sense), then both .get_state() and .apply() become > > much simpler. because they only need to deal with known, normalized states. > > Yes, I agree. This would however make it impossible to do a flicker-free > transition from bootloader to kernel, but that's not really a usecase I > have so I can live without it. > > Another point in favor of resetting is that the driver already does it. > Removing the reset of the OFF register may break some boards who rely on > that behaviour. > My version only extended the reset to include the ON register. > > > > > In short, it's a tradeoff between code complexity, and user friendliness/ > > features. > > > > Sven > > Thierry, Uwe, what's your take on this? > > Thierry: Would you accept it if we continue to reset the registers in > .probe? > > Thanks, > Clemens I realize that it is a difficult time at the moment, but it is a little bit frustrating not getting any response from the maintainer. I think the best way forward is to just keep the register resets in probe as they are. If this is to be changed, I think it should be done in a separate patchset and by someone who has a usecase requiring it. Best regards, Clemens