Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1437711pxu; Thu, 17 Dec 2020 09:54:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqeEHdKjM+6f9c2l2Rw7T8NfMAS6izzMKTbtlvck79dVuPYbO50VP9J5mc91Ybkx6fOfTo X-Received: by 2002:aa7:c753:: with SMTP id c19mr526929eds.358.1608227688610; Thu, 17 Dec 2020 09:54:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608227688; cv=none; d=google.com; s=arc-20160816; b=X27YyU8aH0hKs6We11q6XUGWZA8Asak4ow4NT1jG6por3MloXwc/oqfmA/zXOGzj53 A3qssCrQ9MGs9SCxl+Nll06QdsdTf3QcN49A6gC6lYuQO2dIPMG5ckkwbOTv75J6VTmK G3cnnR7FSjVjZzFrwtmIUCT9rQx65y4DxaBzSVFW0SyTHOW5tqQD9bJKdHA4/HA7BIb0 1ZzsTcaxnDaw8UwYN/T+B2zIPWVvY//Wane7EUC6+B+Aadsf0touo+AmDL4dOpDDtDxp b0B5xaf3cyvy7710a8tAmgjmZ8Vun4/PFeaTw6Svwj75rkI0ViiGOCMxO7wQoSSGvEe6 USlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=o4wBtU5fm9orzQxfqfq4ZnR0tVlAljZj6kq4gq9ZFCw=; b=M0Xv/827a/6SkrZRU+JRzTowO0xqvtM+Q1CN7QPIIk429tIQy2n+fiyfnGhIvzqv6G V7hrr20Un4kTTsgnbpkVV5tzKNu3n1yZuBW2QSJV2Zn5R7r3GrYKD28Xv8Fm/SpNtC9C 6NH1JVxYleT4dnIt+NsH4z6bTubzTRFR5oC43rdN2e3oWYhBZ32XRslxmPLkG9FE6jeg 0+WSrE22L9zcMiKylzeLJp+8pomz7SNPN4CUKvn4MOoEXOE/frsrQhHEILgLMdXbmr8i txrf1wPkBezj4H8E1XYx/ZCxPFZ21EZulAeKtvLoFHkDPEJbxyFn+dE3Sy1wSCXmNjIc J3EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PRIDciiK; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gf18si3110474ejb.202.2020.12.17.09.54.24; Thu, 17 Dec 2020 09:54:48 -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=@gmail.com header.s=20161025 header.b=PRIDciiK; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728184AbgLQRxh (ORCPT + 99 others); Thu, 17 Dec 2020 12:53:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbgLQRxf (ORCPT ); Thu, 17 Dec 2020 12:53:35 -0500 Received: from mail-vs1-xe32.google.com (mail-vs1-xe32.google.com [IPv6:2607:f8b0:4864:20::e32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72B7AC0617A7; Thu, 17 Dec 2020 09:52:55 -0800 (PST) Received: by mail-vs1-xe32.google.com with SMTP id x4so15389359vsp.7; Thu, 17 Dec 2020 09:52:55 -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=o4wBtU5fm9orzQxfqfq4ZnR0tVlAljZj6kq4gq9ZFCw=; b=PRIDciiK3kxktIwkS5JXGn6CUwVypiatHkhHd/aGA3FRwHtmbNuzR6FwnFKfa0YNkE EBDFT48AvcoJ0Qf34eDkghFslX8GULpSP2/TpXCLMp5qxJYJZQmY8bIbCbs0puOMUNZp yDlzCkaR3Jj9Cb0ont1jBmwwfWlWU+16AC2HLh/hr9fXvULqLY/JKwKsgVJdp9pvRRks fV5UGcLUu3oLs+QxUCoYN+/mlQd0WqOO7AKrJqbvubZQcLUmzY0ZT4hABgIDNLN0Sh8h /6laFXSnSaou+YODJfRd3iUt0dugDRoyWHCn2/dsQ87LDE4z0pu6RDsoKK18nySZ80uC 1opg== 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=o4wBtU5fm9orzQxfqfq4ZnR0tVlAljZj6kq4gq9ZFCw=; b=iPs7Z9wzhysTZ4WXxsyreIXaSZTHiRiuiXyiCm3sQY3GXQRfJNETb+805noz5Z2HbI /V9vHhBRalrQaXioYebzPzajSVnVOELW4YVltRgXMUQwBbz2efYuNBnZ2R/7cWlss7TW z5npw0K/jN9Lp57tOc4RXRSrWc4Daex41DZFpxhPZCOo2pAR8Vm47t82fUgnIo8ipKaI tVP/E8FEwSIx939d99qSoLsiBEUNIXD/26nXOjVcYcbiFS232PFT3OzAoL0bt/PhjlBA R9xMCyQa9kNt/cqXjQlkLIH2VhfWOkZAozv4VK2Kqo5DPNH5MZTc+J3ALZ6cKTQLXNJ4 SiUQ== X-Gm-Message-State: AOAM532hJ3P0g2pRONN6Wm5u6rRbPUSZwd4qzVk6kURcvOKeZ6avoIEm MVOevRtia/UoPDitR9mJSpHYspixgpVa8x2bBQLODrTZln2GMg== X-Received: by 2002:a67:2e16:: with SMTP id u22mr416762vsu.12.1608227574165; Thu, 17 Dec 2020 09:52:54 -0800 (PST) MIME-Version: 1.0 References: <20201216125320.5277-1-clemens.gruber@pqgruber.com> <20201216125320.5277-2-clemens.gruber@pqgruber.com> In-Reply-To: From: Sven Van Asbroeck Date: Thu, 17 Dec 2020 12:52:42 -0500 Message-ID: Subject: Re: [PATCH v5 2/7] pwm: pca9685: Support hardware readout To: Clemens Gruber Cc: Thierry Reding , Linux Kernel Mailing List , linux-pwm@vger.kernel.org, =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 17, 2020 at 12:43 PM Clemens Gruber wrote: > > > > Conclusion: .get_state() will always return "pwm disabled", so why do we > > bother reading out the h/w? > > If there are no plans for the PWM core to call .get_state more often in > the future, we could just read out the period and return 0 duty and > disabled. I'm not sure why we should even read out the period? When a channel is disabled, the period is not externally visible, therefore it's meaningless ? As far as I can tell, we can use this for .get_state(): memset(&pwm->state, 0, sizeof(pwm_state)); > > Thierry, Uwe, what's your take on this? > > > Of course, if we choose to leave the pwm enabled after .free(), then > > .get_state() can even be left out! Do we want that? Genuine question, I do > > not know the answer. > > I do not think we should leave it enabled after free. It is less > complicated if we know that unrequested channels are not in use. > Good point, I agree with you.