From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4DD7C47094 for ; Mon, 7 Jun 2021 10:15:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9345F611AC for ; Mon, 7 Jun 2021 10:15:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230197AbhFGKRT (ORCPT ); Mon, 7 Jun 2021 06:17:19 -0400 Received: from mga01.intel.com ([192.55.52.88]:29272 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230173AbhFGKRT (ORCPT ); Mon, 7 Jun 2021 06:17:19 -0400 IronPort-SDR: 3VWfOU3J66URngaGhgEvtZ91QaJaJiyl0zxZJS7AEr6VfPO3Y89SJJ8Boc230V947vvUachla+ 0/ugqNUGKbaQ== X-IronPort-AV: E=McAfee;i="6200,9189,10007"; a="225929274" X-IronPort-AV: E=Sophos;i="5.83,254,1616482800"; d="scan'208";a="225929274" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 03:15:27 -0700 IronPort-SDR: AJLJPtkefJD47LH/+w6cY4diPnnfDUaOB+onXayCfbv+mkNDV0WHGAHYwvmMB/FN87QoIGZ5ms WqoKZTeu9Hrw== X-IronPort-AV: E=Sophos;i="5.83,254,1616482800"; d="scan'208";a="418458616" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 03:15:23 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lqCHw-000EBv-Ag; Mon, 07 Jun 2021 13:15:20 +0300 Date: Mon, 7 Jun 2021 13:15:20 +0300 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Flavio Suligoi , Thierry Reding , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, linux-acpi@vger.kernel.org, Jonathan Corbet , Lee Jones , "Rafael J. Wysocki" , Len Brown Subject: Re: [PATCH v2 2/7] pwm: core: Always require PWM flags to be provided Message-ID: References: <20210531194947.10770-1-andriy.shevchenko@linux.intel.com> <20210531194947.10770-2-andriy.shevchenko@linux.intel.com> <20210606213054.bmqgs5hehbowa62d@pengutronix.de> <20210607095324.yaiu5lzb5zgoejpa@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210607095324.yaiu5lzb5zgoejpa@pengutronix.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Mon, Jun 07, 2021 at 11:53:24AM +0200, Uwe Kleine-König wrote: > On Mon, Jun 07, 2021 at 12:02:37PM +0300, Andy Shevchenko wrote: > > On Sun, Jun 06, 2021 at 11:30:54PM +0200, Uwe Kleine-König wrote: > > > On Mon, May 31, 2021 at 10:49:42PM +0300, Andy Shevchenko wrote: > > > > It makes little sense to make PWM flags optional since in case > > > > of multi-channel consumer the flags can be optional only for > > > > the last listed channel. > > > > > > I think the same holds true for dt references. > > > > Can you elaborate this? I haven't got what you are talking about, not a DT > > expert here. > > Ah no, I mixed that up. While the function that parses the phandle is > flexible, for each pwm controller the number of arguments is fixed, so > > pwms = <&pwm1 100000 &pwm2 100000 &pwm3 1000000>; > > cannot be interpreted as 3-argument references to two PWMs. This is > different to ACPI (I guess, not an ACPI expert here :-) because &pwm1 > "knows" if it needs 1 or 2 additional parameters (#pwm-cells). It's not about ACPI, it's about "the ACPI glue layer in Linux kernel". Used API is a part of it and it does allow only two cases, either NULL entry (by having 0 as an argument) or full-length supplied tuple (in case of PWM it's 3, so, means 4 parameters. Let's consider examples: (0, 0, x3, y3, z3, t3) // NULL, NULL, PWM3 (x1, y1, z1, t1, 0, x3, y3, z3, t3) // PWM1, NULL, PWM3 So, making last parameter "flexible" will work only for the last tuple in the array. Read this [1] for further information. [1]: https://elixir.bootlin.com/linux/latest/source/drivers/acpi/property.c#L629 -- With Best Regards, Andy Shevchenko