Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp838653rwi; Wed, 26 Oct 2022 07:51:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ZwtDkLu+lzTIpzqI5ufQPEUo8RrxYdAZAAZPuVhd9X5n5KTIvN0LisBXE3I0ASPIf+kX4 X-Received: by 2002:a63:ea4e:0:b0:454:26eb:b73f with SMTP id l14-20020a63ea4e000000b0045426ebb73fmr38566554pgk.451.1666795874034; Wed, 26 Oct 2022 07:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666795874; cv=none; d=google.com; s=arc-20160816; b=fLwLif9f1nZEIcWtt8eOy0zhsBSuqA0IkmiGqYtJCTuxjMzHUtZ6AQC7KtFB9MkXRB lUKWhgq5e1TzgVew+zvJuFas8t1uaurOvGtqfvbbhsbuUeSignkWi1mGIwgcX9t+YDho zCsmpqi0VpKp9+6kXnpx6hQpKGcGseFyq1vBRB5nYzjz0HgzS81KKlD0Kd/YBZ4Q+vOH tsGo3kwBjqpkUcee8awcabAcHH7J2EE7JrP0EUQo1JQkncABtvlzmFQLQc6o73SWl/DQ PBlixILV/etuGtx8Gfl6Qhhc0trNOCbuhUzVcoTdPDvziKZ7vMXGEyNosmJHzBg3pgbJ VO9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to:subject :cc:to:from:references:dkim-signature; bh=OOQ+kDA4G+wlVL+Ry3C2hNPCcp5na+qrAnLo83Besj4=; b=Qui+RvfTaeaN1nD5/gd5x2gKacmSRpSVcKYN/z9huEwTalyhKIESE1S67DhsM+q/J3 dWrzyU+EPzJyMQ91r45siTQiCEsMSv3QIvhgIS2+UA0XjKsEKd4vfNY3XCZ3jQ+/mvWc wOv58LF/HeVtUwHf/0INHrY+fjf1VbEVbN5Nd5wHwSXvn003byjuCOoLXgGiWp7L17N9 p5hG6ZpR0a1A5Wa3mofUrUZC+cvOuefwcPORXb5qJM5V10cTMxJyorSoOuT5c+JYuiNd AxuruL95EbhI+OUoOtNZsHnExqD3xf0xzJBC4QbNM+hzEKdGf/6tlsJx+BkoIYi3xCj9 R7Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NsT4aKIW; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h12-20020aa79f4c000000b00565d37ee1casi7345472pfr.166.2022.10.26.07.51.01; Wed, 26 Oct 2022 07:51:14 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=NsT4aKIW; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233856AbiJZOmk (ORCPT + 99 others); Wed, 26 Oct 2022 10:42:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233681AbiJZOme (ORCPT ); Wed, 26 Oct 2022 10:42:34 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A25BDDED27; Wed, 26 Oct 2022 07:42:32 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id y16so16257435wrt.12; Wed, 26 Oct 2022 07:42:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :references:from:to:cc:subject:date:message-id:reply-to; bh=OOQ+kDA4G+wlVL+Ry3C2hNPCcp5na+qrAnLo83Besj4=; b=NsT4aKIWNh8VI1pqGxDuMdij95PeSRomq9fcVnLuUdufvUhkiJenOSIq4zjBZcpguL YHwYgOdkenfpk64mO5RIPHJOucrjh2Ak0Q0NrslVONPd/XfgVznuQTvYmiVTkWmEDUx3 CSW1gg23t7h/JH4EkTVhztriJju1ZSQBqvvYQ9blkWaDu/W7fGmOY60IQL50ffUV5eG3 AuxSAJwmjXCDkZLf63CIkr4yYedZ5gSKGYTpoEixWgeZ0Y9lMNRlxliPiPDQI3UkfdEh idW0PZT2K5Z6pirybjnWPe2e7aZ5Ei2QAzt4bioCuWu4jfToiAZc2HCuj27wU9SBzOty euNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :references:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OOQ+kDA4G+wlVL+Ry3C2hNPCcp5na+qrAnLo83Besj4=; b=TY3feQJ8De2jqkKSKUzDX6XsK6sXaHKQl+foPr57/gUoMEvua0P8P3Z1QIUnsKprPE QI1RMdekSGNaCMsCAFokfHMq9Kx+4aW+DGmOTZq3wQ7Zj+Ap2S5ZLE8KT3fjmWE1yT54 Y4xC0B5caZavizzdZOp8rnnMwL+rFK4FQjkL6ol5OyLM2Dhrg7UFRGxYemx0pn+B0pA8 R56C8zGDsCW+aA1up0mSrAzA6rSBD96o590i2CftXUhBwK82gPsCacWGNu+w84VXPBaz sEXFvq2jEDRZ6r+2OIZBQofhPRG7J4N0dlMTxl7LuJeGRNh4KBSQjBtD70K9t1dkHmIR TUHA== X-Gm-Message-State: ACrzQf3/EeMEXwpWls2ss2RAfMLr300DSX+pO/wwhvT8UPIkiEzS9Nen QMETuT5DDQo2nXLmp97bnFZIrx2xPtDKLA== X-Received: by 2002:a05:6000:18c7:b0:22e:5503:9c46 with SMTP id w7-20020a05600018c700b0022e55039c46mr27782051wrq.668.1666795351099; Wed, 26 Oct 2022 07:42:31 -0700 (PDT) Received: from localhost (94.197.44.200.threembb.co.uk. [94.197.44.200]) by smtp.gmail.com with ESMTPSA id y17-20020a05600c365100b003cf4eac8e80sm690283wmq.23.2022.10.26.07.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 07:42:30 -0700 (PDT) References: <20221022162742.21671-1-aidanmacdonald.0x0@gmail.com> From: Aidan MacDonald To: Mark Brown Cc: lgirdwood@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, kuninori.morimoto.gx@renesas.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/2] ASoC: simple-card: Support custom DAI system clock IDs In-reply-to: Date: Wed, 26 Oct 2022 15:42:31 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,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 Mark Brown writes: > On Tue, Oct 25, 2022 at 12:17:25AM +0100, Aidan MacDonald wrote: >> Mark Brown writes: > >> > We already have clock bindings, if we need to configure clocks we should >> > be using those to configure there. > >> The existing clock bindings are only useful for setting rates, and >> .set_sysclk() does more than that. See my reply to Krzysztof if you >> want an explanation, check nau8821 or tas2552 codecs for an example >> of the kind of thing I'm talking about. > > I thought there was stuff for muxes, but in any case if you are adding a > new binding here you could just as well add one to the clock bindings. > >> I picked those codecs at random, but they are fairly representative: >> often a codec will allow the system clock to be derived from another >> I2S clock (eg. BCLK), or provided directly, or maybe generated from an >> internal PLL. In cases like that you need to configure the codec with >> .set_sysclk() to select the right input. Many card drivers need to do >> this, it's just as important as .set_fmt() or .hw_params(). > > There is a strong case for saying that all the clocking in CODECs might > fit into the clock API, especially given the whole DT thing. The ASoC APIs don't speak "struct clk", which seems (to me) like a prerequisite before we can think about doing anything with clocks. Even if ASoC began to use the clock API for codec clocking, it's not clear how you maintain backward compatibility with the existing simple-card bindings. You'd have to go over all DAIs and mimic the effects of "snd_soc_dai_set_sysclk(dai, 0, freq, dir)" because there could be a device tree relying on it somewhere. So... given you're already stuck maintaining .set_sysclk() behavior forever, is there much harm in exposing the sysclock ID to the DT?