Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1845171rwb; Fri, 11 Nov 2022 00:56:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf6xdaJ9/pvNLFlPMT4KqTnuEoqyZZSpKHnSIUs9xmXElHQ7et2FRC72cBNzio3wurnJsOzV X-Received: by 2002:a17:906:8052:b0:7ad:821f:a3e6 with SMTP id x18-20020a170906805200b007ad821fa3e6mr996213ejw.688.1668156994627; Fri, 11 Nov 2022 00:56:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668156994; cv=none; d=google.com; s=arc-20160816; b=S3hV72ftwMcN0/ilLYr9tJYVogKqDYD6vEkaTQyPCmSQ1EflZJ1AGh8aBtv5aurnAV kZH/JaXVqjhtwwviLyoDME/9VIIrhBI2K0fYpgsZVWdFJM24F6PaSTlttnWGkARp9jMy RBIojtStiMkeG2v4zYJlQrRSD7gzQTyp64h94sBgQPdgjXXzXFqdFMw81If+kKEm2RNV uM7zWejIiRR6wcQv8Q7NR+LM3UCEUlvOW9k6C1A+mJYJ0wXIXUz9MX5gW1pdc8bwwJoI Qqr6QsUF7mYD9mueOYLz+dHAmPTnhdvTvEXZDmSXBpPLaku7/fY3QnUSgNtqTeFgatOw isMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=kALPzKGCKIkkU2eUXvBWZPTRuCJrQKLEDnhduGVi91w=; b=OW2j8ASkCbX8TVi0vEBtIjC6PQ6GHahYqeosdAnF73P503ZYS/bnqrwnfHh2auSDIB AVHMVN30D+TuyGKfU2Qj7ptLsv4uM/kdcGdZ7egLBhXF3lnxVOcGlDCR65g7y10prG/x aYrWjGvps1YIOJSiK0hsFoTBA07qR58PM/y5JoSx/3JSBOCiSpdHdqrMLGjFntioIkW1 Dhj6l/SnkhubJtE2TghfDdLhQtLY2/7kkx5z5RgbK9sMRuSUn3+MyX57XHzympSyIoSn jbdrNAUicZN3/itpfq/98WmWAYddQxmOg+LBrajyZw+rcgAIvGC10Xe8++XaRCf+ZdRo PBUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bXKbxgj2; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb9-20020a0564020d0900b0046289aad428si2155334edb.496.2022.11.11.00.56.12; Fri, 11 Nov 2022 00:56:34 -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=@kernel.org header.s=k20201202 header.b=bXKbxgj2; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232986AbiKKIAw (ORCPT + 92 others); Fri, 11 Nov 2022 03:00:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232987AbiKKIAm (ORCPT ); Fri, 11 Nov 2022 03:00:42 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7D0E748E8; Fri, 11 Nov 2022 00:00:40 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4505FB82405; Fri, 11 Nov 2022 08:00:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCA15C433C1; Fri, 11 Nov 2022 08:00:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668153637; bh=/JhKtSplEXWQW83/PgxO5BdmEweOLgZbpN75oFE0iQE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bXKbxgj2UCTHUgeiGA+vW+Pc06m+20eJOo+npKH0T0z6xBvXwNBmy/nWBbAo7HJ2f HDxHRP5biJytHOqONg5WlAPFBBWqfCjz5e3YiQH27oEZP2hW5wi5rQfPY2z7DIM6NL cKst6mvMt3HKjZZK5fmNA593a2Xi9uIkxppyVXIy3bijpGj+R+aZx526NQQ678BB8o YWDAG5KrCQBYMlyJsKUO3ItrixysfwtSnk+EKwWyBPKH7fU+yX1eernRm+A7Hjn//6 62ngoqWbRW6nzjTl+Tj2llrao/t4SaOFSa2hh7wR1eMQtrVyq86bnTJyVrFjpcQvtV dnrWszvKuSCoA== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1otOxn-005LMf-A2; Fri, 11 Nov 2022 08:00:35 +0000 Date: Fri, 11 Nov 2022 08:00:10 +0000 Message-ID: <87h6z5vs39.wl-maz@kernel.org> From: Marc Zyngier To: Mark Brown Cc: Richard Fitzgerald , lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linus.walleij@linaro.org, tglx@linutronix.de, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: Re: [PATCH 09/12] irqchip: cirrus: Add driver for Cirrus Logic CS48L31/32/33 codecs In-Reply-To: References: <20221109165331.29332-1-rf@opensource.cirrus.com> <20221109165331.29332-10-rf@opensource.cirrus.com> <87mt8zutib.wl-maz@kernel.org> <86pmdvow5y.wl-maz@kernel.org> <86k042q1uc.wl-maz@kernel.org> <05ae0e20-b472-f812-1afc-ef8c2a97cdeb@opensource.cirrus.com> <87iljmve87.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: broonie@kernel.org, rf@opensource.cirrus.com, lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linus.walleij@linaro.org, tglx@linutronix.de, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Thu, 10 Nov 2022 20:36:16 +0000, Mark Brown wrote: > > On Thu, Nov 10, 2022 at 06:47:20PM +0000, Marc Zyngier wrote: > > > Read again what I have written. Having to expose a device-specific API > > for endpoint drivers to obtain their interrupts, and requiring them to > > know about some magic values that describe the interrupts source are > > not a acceptable constructs. > > > We have firmware descriptions to expose interrupt linkages, and your > > HW is not special enough to deserve its own top level API. Yes, we > > accepted such drivers in the past, but it has to stop. > > > Either you describe the internal structure of your device in DT or > > ACPI, and make all client drivers use the standard API, or you make > > this a codec library, purely specific to your device and only used by > > it. But the current shape is not something I'm prepared to accept. > > ACPI gets to be a lot of fun here, it's just not idiomatic to describe > the internals of these devices in firmware there and a lot of the > systems shipping this stuff are targeted at other OSs and system > integrators are therefore not in the least worried about Linux > preferences. Let me reassure the vendors that I do not care about them either. By this standard, we'd all run Windows on x86. > You'd need to look at having the MFD add additional > description via swnode or something to try to get things going. MFD > does have support for that, though it's currently mainly used with > devices that only have ACPI use (axp20x looks like the only potentially > DT user, from the git history the swnode bits are apparently for use on > ACPI systems). That might get fragile in the DT case since you could > have multiple sources for description of the same thing unless you do > something like suppress the swnode stuff on DT systems. > > Given that swnode is basically DT written out in C code I'm not actually > convinced it's that much of a win, unless someone writes some tooling to > generate swnode data from DT files you're not getting the benefit of any > of the schema validation work that's being done. We'd also need to do > some work for regulators to make sure that if we are parsing DT > properties on ACPI systems we don't do so from _DSD since ACPI has > strong ideas about how power works and we don't want to end up with > systems with firmware providing mixed ACPI/DT models without a clear > understanding of what we're geting into. > > I do also have other concerns in the purely DT case, especially with > chip functions like the CODEC where there's a very poor mapping between > physical IPs and how Linux is tending to describe things internally at > the minute. In particular these devices often have a clock tree > portions of which can be visible and useful off chip but which tends to > get lumped in with the audio IPs in our current code. Ideally we'd > describe that as a clock subdevice (or subdevices if that fits the > hardware) using the clock bindings but then that has a bunch of knock on > effects the way the code currently is which probably it's probably > disproportionate to force an individual driver author to work through. > OTOH the DT bindings should be OS neutral ABI so... I don't think this is a reason to continue on the current path that pretends to have something generic, but instead is literally a board file fragment with baked-in magic numbers. An irqchip is supposed to offer services to arbitrary clients (endpoint drivers) that are oblivious of the irqchip itself, of the hwirq mapping, and use the standard APIs to obtain a virtual interrupt number. None of that here. This is a monolithic driver, only split across multiple subsystem to satisfy a "not in my backyard" requirement. If the vendors/authors want to keep the shape of the code as is, they can do it outside of the irqchip code and have some library code with an internal API. At least they will stop pretending that this is a general purpose driver. And the existing madera code can also go in the process. M. -- Without deviation from the norm, progress is not possible.