Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp283908rwb; Wed, 9 Nov 2022 02:23:16 -0800 (PST) X-Google-Smtp-Source: AMsMyM7wFDPBXrLmm7wM237GoJMzXx6rE4svwDq5BMP5DR1QH/2uI6mYVYd9qeLXSf5vzE55aFY4 X-Received: by 2002:a05:6402:34c6:b0:462:a46a:a3b6 with SMTP id w6-20020a05640234c600b00462a46aa3b6mr59167090edc.164.1667989396367; Wed, 09 Nov 2022 02:23:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667989396; cv=none; d=google.com; s=arc-20160816; b=LMO/tYYMJpoc/FWyvKoObcIwIcXn/WpbMWLap+8mu8hNvMlZIqZEm33wupMlDPpBrf joj+rvDVCv9BxIrZ6HXRRth2CZfEGImkkSE1XuC7QsHcD3IvlWsjiOE8CjCkVP5JnrCq 9P61f43x2dXrhviDyEklF+zEN0gJH3J+Wb7Ka2YuBsO5++GuoysMCAn0p+ddh1v8qBiZ 9WEl7uo6agw5k+LM0mbxfjcpSHHwtlnPQJt8WWhABMzzb/ApClH+ehCxaYube1qniQS4 G+TPmbC9ABL2qfGOVkCCrJ7AI6pNQJfx85wwL1F63D8f8i2jwZe9l70yFSoen9/azU2z 8sXQ== 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=U+M6w+R6FHYw23U9WYJNoWQ39Q7v0W77OetkXqSRij8=; b=0CZ7QD/1jLvBlEEtPQ62eGl29sdYq1cbVsbAGDfGQhXIF4AHPmegg28Z8vtAJjSIXe uxCA89a4OJGTffIbFcxOwQ6I3O4B6V3OSM2CeEM83C225Hyji0G9lf7LIDDbJ/4pbv67 IZWTt0P8UjzYUHhbn5JbaxJk7BdcvREKsiSzJcZm0PeCiWmBrQJd4+MWh+jBMDBVa7Ol 6r1YHNiJ4MqJFWxPtA6evs4fhkse3c+NNQnKDThfn6m0BbKjN6rF5fUCzJxpTEwN+HeV XqGfAfj4I13icGV9p1lUx2OINt2cdzczMWYUes6OcSuekcC/eLR5Rex5TVnGTRBDBxOC LDQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QFR9DBBI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq28-20020a1709073f1c00b0078d85177210si16758780ejc.756.2022.11.09.02.22.49; Wed, 09 Nov 2022 02:23:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QFR9DBBI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229980AbiKIKIU (ORCPT + 94 others); Wed, 9 Nov 2022 05:08:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbiKIKIS (ORCPT ); Wed, 9 Nov 2022 05:08:18 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AAE012A8C for ; Wed, 9 Nov 2022 02:08:17 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id t25so45289604ejb.8 for ; Wed, 09 Nov 2022 02:08:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=U+M6w+R6FHYw23U9WYJNoWQ39Q7v0W77OetkXqSRij8=; b=QFR9DBBIlQOEM4cGA/+2bC5zT32JmpkmQGtfFPQb5d+KE2BGLOOlqvkeq/iqd6I+wA g+5Bc0zHBCjc1izMsCvtMUD+MFeIF0pwD56JuGlRo6A0QLus9g2hP/M+euIovcu6or1j RRz0ivnAYsbmfHDAKN3lpyZevihl1bh9wENq3j+Vmerwfw+58l0ZW/nCmftyVYTUXDBQ 5snC6zZEcng4jV83Vx7Ldw9RzeNN+/lQS/8aZ02imDa3SjlUMWlbEW6j4ngpTZIgoEgO eCkc0UwTDCuhu9EZWR2C3d8Om5AgW6ssYlCFQE99crCezXpOCOGERq++9fPJtFR+fkLE JEDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=U+M6w+R6FHYw23U9WYJNoWQ39Q7v0W77OetkXqSRij8=; b=JbnmM0ueLnnEorRGkN8IfnGybXG5G39wAJ+JZvGiHo8DfF5/v8Tk5aoRuHmDjXdnfW A3g4RyK7J1adQGClYyVQpph0Np6vD7LP48crSENU8VBD36IG71tIc1A/vbiZl3vGVMzp 05te2NeyNPkioLl13UnbRVMslaatUKE4eUvEWIO9xxCmbqubHMVdNxBu7YO5IKZf7gL/ okD+eWcU+ec6Y2PwzmycB0GK7HBe3tZn5TYPWLLXLohpEDWERNSj64zz7Ds7mk2qW/jz mvtVBAl+nJJT+tw0SwbCXb41AMCVXlIsELpmN93vdfC+x9khZu2+GJzNveY1r/JrUqk3 DEDQ== X-Gm-Message-State: ACrzQf075WAnYuSiEdbTjVlG8ludffdGSV8ZCmDW5bPvhnrRepKtiQ32 rQLpiKcsihhzY8f8vwfOrr0B3EBZ/tkl9OEh06nlKw== X-Received: by 2002:a17:907:c1e:b0:7ae:31a0:571e with SMTP id ga30-20020a1709070c1e00b007ae31a0571emr24404336ejc.690.1667988495931; Wed, 09 Nov 2022 02:08:15 -0800 (PST) MIME-Version: 1.0 References: <20221108142226.63161-1-andriy.shevchenko@linux.intel.com> <20221108142226.63161-7-andriy.shevchenko@linux.intel.com> In-Reply-To: From: Linus Walleij Date: Wed, 9 Nov 2022 11:08:04 +0100 Message-ID: Subject: Re: [PATCH v2 6/6] pinctrl: intel: Enumerate PWM device when community has a capabilitty To: Andy Shevchenko Cc: Mika Westerberg , Hans de Goede , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Thierry Reding , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 9, 2022 at 10:56 AM Andy Shevchenko wrote: > On Wed, Nov 09, 2022 at 10:08:51AM +0100, Linus Walleij wrote: > > I guess I can be convinced that this hack is the lesser evil :D > > > > What is it in the platform that makes this kind of hacks necessary? > > The PWM capability is discoverable by the looking for it in the pin > control IP MMIO, it's not a separate device, but a sibling (child?) > of the pin control, that's not a separate entity. OK I get it. > Moreover, not every pin control _community_ has that capability (capabilities > are on the Community level and depends on ACPI representation of the > communities themself - single device or device per community - the PWM may or > may not be easily attached. OK I think I understand it a bit, if ACPI thinks about the PWM as "some feature of the community" then that is how it is, we have this bad fit between device tree and Linux internals at times as well, then spawning a device from another one is the way to go, we need to consider the option that it is Linux that is weird at times, not the HW description. > What you are proposing is to invent at least two additional properties or so > for the pin control device description and then to support old platforms, > create a board file somewhere else, which will go through all pin control > devices, checks the capabilities, then embeds the properties via properties > (Either embedded into DSDT, if done in BIOS, or swnodes). > > Do I get you right? > > If so, in my opinion it's way more ugly and overkill that the current > approach. No I just wanted to understand things better. This small hack in the pin controller is way better than a bigger and widespread hack somewhere else. > That said, I agree that this looks not nice, but that's all what > Mika and me can come up with to make all this as little ugly and > intrusive as possible. I can live with it, rough consensus and running code. Acked-by: Linus Walleij Yours, Linus Walleij