Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2744176pxu; Mon, 7 Dec 2020 14:38:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0JJpMtTuhRVqwf11frwXFOakPmotbpfbvaohtVlt8A3rS/7G+zS8Ri7ifBwuFYM1qRozs X-Received: by 2002:a05:6402:1803:: with SMTP id g3mr22585202edy.10.1607380681261; Mon, 07 Dec 2020 14:38:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607380681; cv=none; d=google.com; s=arc-20160816; b=DJ0K+XQ3bflHGSo0bl7pOuPDUCdSg4GvAclWqPdR9iLyMPpRKn/3bjnKQXfy1ZYta8 5Fo2DBa/ZgytAlDUccyKOGjon/GLLL1k2bHPv4B3v9TasYIJzfSkGm7uh8BAZnJnDJa8 fFhvv5iPS2upTrNf73KkkuLArUKEPtcFmoJV87uUYPoj1dwDwPwtUcD94xTvhu8UEfaU Jg2tGej3cyTl4EEk5+wn6HdjULWzKmamv7bUFTFq8uoNSOUWh88lhV/V4ewr8y26/z4D xLtoaEhcJWEJcGSFmcshLlwgAF87SCAQXm/709nV6ANahMkjpCQ4URczwnY9Xj/gL703 a6Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=JocXKKqkq81jtue3iPNbkusuvkat05xi0rcFW4AvdSg=; b=v5uL9djjSNrZWUWEUQ6pJPPuQgntFQ4ZqhAduE1zJy/1eQ8tqxBfpsOeluJdkX+yLr fGufzuITqCzCnZKgab/IXLQ+0+LwCA7InjjHkK9ioefnfOx0y054m1juDuFfrtLaWOYj zzWIaBb3ci8j0ulcEiSFxVuxlF6DlhSnHignAI08fuqWtGFUgMqUL36HnweGodI4WEwG +AqNztJ0jullF0JpxkeS7CWAoVS+R2fs/INJf4X+VhppRMjZ+JaFO/pVKt85INJbtAh4 3M4pMiBwaCj5ZiJNM05Hc4D06sLU+sVbsitXdT2aNGNZaO8Hbib1FHgIgBCOioewJ0Cq 6i1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t28T89OU; 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 n1si6272223edq.466.2020.12.07.14.37.38; Mon, 07 Dec 2020 14:38:01 -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=t28T89OU; 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 S1726617AbgLGWfv (ORCPT + 99 others); Mon, 7 Dec 2020 17:35:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726156AbgLGWfv (ORCPT ); Mon, 7 Dec 2020 17:35:51 -0500 Received: from mail-vs1-xe44.google.com (mail-vs1-xe44.google.com [IPv6:2607:f8b0:4864:20::e44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5D4EC061749; Mon, 7 Dec 2020 14:35:10 -0800 (PST) Received: by mail-vs1-xe44.google.com with SMTP id x4so8501020vsp.7; Mon, 07 Dec 2020 14:35:10 -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:content-transfer-encoding; bh=JocXKKqkq81jtue3iPNbkusuvkat05xi0rcFW4AvdSg=; b=t28T89OUdsfeIZlpErYxluOBmLJ4K2tpxzV76dzXD6v1303zl6ik0UYfHKq3GR7o8r w1mdCjqT6XtjsyblutRdAsG9dW/ovYFi2xAHVm15vRL1bv4pa/a17N9ang9anIpBBzRx QdVc/3RfuE9CxDasTQi6YxRmiLJNvYHUXtvE1BeqC/OuJJLk3tb3YEjz11elLrAkErws FaMXwkJcRKAi4pFWmkJUMT9WuHYgCCnvle5firamvaA6dmLe2s2vc+ayXMn78reJfU0r vQSL4o6ChB6eoehiHyoYurChsIBo9t/2M/vZjvZv3dF/aiVLf/ONaKjrFczj0/G0KmdU Ympg== 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:content-transfer-encoding; bh=JocXKKqkq81jtue3iPNbkusuvkat05xi0rcFW4AvdSg=; b=aHV19vIhgLmUBjFtEJhhYOgZJXG8GolzckhwTQfvdephGSdHEh5AVhKAapeySs7spD sRhNVcJVDtC1RVF1BbWgnNr/yz1KWKfmB57fyj0McLRvsueabDZ56jMtVweYeejYAwdP SWzeWrbb8MohaINblQ2ESbci5tim7De8F1KatMdnDQBqZR8owyld8msj7e462pnz2F3o HG3r/8RX7qdkyk0Asz2ozcUs+Mi979ahvtHCvO0+10E0exhMmFuddNTbs0b1nACrzDEJ joc4S9jjZNw/zjig6oxa6zrSnmExbitHl4YsZIvcJqNQHfDhW+P/DMal1Ed3iv7MTv7k /QpQ== X-Gm-Message-State: AOAM533AEHQtKxVO8+Mp/pUsgBKorwNdof3O4yGIhSXirKoMmmfNS0CF dsVJGbToKmqAT6HoZN3C3cYljKN13ZqCESTw36Q= X-Received: by 2002:a67:e43:: with SMTP id 64mr14109094vso.40.1607380509710; Mon, 07 Dec 2020 14:35:09 -0800 (PST) MIME-Version: 1.0 References: <20201207193629.493241-1-clemens.gruber@pqgruber.com> <20201207220025.42b6g76wq7ph5nvb@pengutronix.de> In-Reply-To: <20201207220025.42b6g76wq7ph5nvb@pengutronix.de> From: Sven Van Asbroeck Date: Mon, 7 Dec 2020 17:34:58 -0500 Message-ID: Subject: Re: [PATCH v4 1/4] pwm: pca9685: Switch to atomic API To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Cc: Clemens Gruber , linux-pwm@vger.kernel.org, Thierry Reding , Lee Jones , Linux Kernel Mailing List , Mika Westerberg , David Jander Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Uwe, On Mon, Dec 7, 2020 at 5:00 PM Uwe Kleine-K=C3=B6nig wrote: > > This is not acceptable, if you have two PWM outputs and a consumer > modifies one of them the other must change. So if this chip only > supports a single period length of all channels, the first consumer > enabling a channel defines the period to be used. All later consumers > must live with that. (Also the first must be denied modifying the period > if a second consumer has enabled its PWM.) That makes sense. However, a possible wrinkle: when more than one pwm chann= el is requested, which one is able to change the period? Example: 1. start with all pwms free 2. pwm_request(0), pwm_apply(period=3D200Hz) 3. pwm_request(1) 4. pwm_apply(1, period=3D400Hz) fails? 5. pwm_apply(0, period=3D400Hz) succeeds? And if (5) succeeds, then pwm_get_state(1) will still return period=3D200Hz= , because the pwm core doesn't realize anything has changed. Are you ok with this behaviour?