Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7658536rwi; Mon, 24 Oct 2022 18:26:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM70H6hnB27Xjf1o7kZKOggZDO5U6KhnCUsD/5naP1Qu9b2QMqSch+UZs0A9yT3Eo4otndQj X-Received: by 2002:a17:902:b589:b0:179:f8c5:7212 with SMTP id a9-20020a170902b58900b00179f8c57212mr35979781pls.174.1666661183368; Mon, 24 Oct 2022 18:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666661183; cv=none; d=google.com; s=arc-20160816; b=WlkkTsE38v594PEhM4BbnTO1M6ew4aMHHWTD6pOnRPXdvATom8S+Zhc7ry48Lg2i0I B3EfENQLTV+bGEuqiww214IHAYdIifz0l4U9qHPa3ZTk4WTPXVH/KYVRudk1oZpmz5si Otkxom7gpcHmk6WE+JgjDoqlug79IczFF290jBbRref7iyo3O7ba4pHB+Wjswo5Tk2ic yXE/dToFxBkABnlsz4iAqWFsbbRB2vfXo+t2bYnaz3C62+gN21X1h48SR51RQY0XWIoI OJI1yGmzBufRh48fHvP+dRiv/rLM1VhlJneELYp0JlYUwGDDdHkVlOqoeano4KxaBmzf YP8w== 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=YjuOzmttWb0ZHzslbkylBfXvXPUFq+qvy1vIDkbRbIs=; b=qXOckZDov1TlJG/50dWiFsJNlaXY8GCbPyREIJRs2phqViNLMSw1Ppo3JDQhVgARZI Cu+7vWnbX1PvhvWKddgYu5Qtt3nQRFTuF3UslAKX6YhiU95rDUk7W19dB1VCFrUKMgKq GuzoJhVnL8qkzGU+T52p1Ahf0BYKYspylXjVNGcGczP3t2A0/HlGdZXDG2NtuT54hXHZ cPgyFc0qdPGvxicH9xtLFPc89b+sBGk+W65JEx3WXE2Wn/e22ex1MGzkWbd38IJbuwKU Sx2UlfL197D+KvUllgazhtl2omg2dVM3jQJYjU9b9JFhEtgRP/M6+V5DNoWyruuYh60P DXrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AhItJiJe; 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 w18-20020a170902c79200b00186be05c702si1037008pla.530.2022.10.24.18.26.10; Mon, 24 Oct 2022 18:26:23 -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=AhItJiJe; 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 S230090AbiJYAo0 (ORCPT + 99 others); Mon, 24 Oct 2022 20:44:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231177AbiJYAoJ (ORCPT ); Mon, 24 Oct 2022 20:44:09 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B81213CBC2; Mon, 24 Oct 2022 16:17:27 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id c7-20020a05600c0ac700b003c6cad86f38so10646811wmr.2; Mon, 24 Oct 2022 16:17:27 -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=YjuOzmttWb0ZHzslbkylBfXvXPUFq+qvy1vIDkbRbIs=; b=AhItJiJettksiQTOHFgseTFR6DqFe/e7wb0/Uo96LIVwtwKXo5K5/fE62sCVPmEZpS T/pPdLPGS+Fo/xdYbfJZ7GREbBXngiazcLSBEnVbB0TcLPfyDsun/5lvIGwZEW1CwE+C qpgsbYBGHuXqLJHEJoGDQ8r3eSutZpAqd8JRp3xBIKVT33rshMDX7sxM+U918g5DrEFq TKNzvDq0kkwrBm74FVZ28BUy8Ke9oXOcst+1EfjkmS3MX2xEM2S1YwZgSBuUrxuUIpfd PPOMhOE+fm5whqD2iXiTp+u7ih+OO4vYs+uag2KuURwed7Z7jsCxRkyO+DVITWs86dX4 nSjA== 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=YjuOzmttWb0ZHzslbkylBfXvXPUFq+qvy1vIDkbRbIs=; b=YzL/x7wF67XrBSZ49cbRMdkbSj78650N4dyBPkxwl5ifnAPXx8qA/9FR+sv8TATYY8 FYnm1jqsegj+nmzmJexIquq5JxR6iCiPy8zjIfbD6ayNqKS4I0hlg5U447VlYW8nU6Qj WTbg6zfWRetUTb5nTfVMeNNlJtWXExxHnCyfr13O1NWYFT2ZBFQxxNHq1G5+0TFWEPwR ASlYszg7nLZ2tWdJeeIIamivMDj52FtsV6naoy87//fDpikI5crgZCTCQRbFaLVySkTm GWpR8mN6t7wa+Um5ynmX/kgcHZcDgNS2Ki3H80AHt9Hz0TBhtnA2A2jaGHWsUvS1arYI Qymw== X-Gm-Message-State: ACrzQf1+ugT/JeHjRQ4fKrDNVifaTlvRPbFVn8fMq+oaOdZuuMJetaQ4 G++ckdbKHHUsR8PPNihccTVMkY1LY/0DwQ== X-Received: by 2002:a05:600c:4618:b0:3c6:bf28:ae64 with SMTP id m24-20020a05600c461800b003c6bf28ae64mr45996137wmo.51.1666653446401; Mon, 24 Oct 2022 16:17:26 -0700 (PDT) Received: from localhost (94.197.2.59.threembb.co.uk. [94.197.2.59]) by smtp.gmail.com with ESMTPSA id bl40-20020adfe268000000b002365cd93d05sm768366wrb.102.2022.10.24.16.17.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 16:17:25 -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: Tue, 25 Oct 2022 00:17:25 +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 Sat, Oct 22, 2022 at 05:27:41PM +0100, Aidan MacDonald wrote: > >> Some DAIs have multiple system clock sources, which can be chosen >> using the "clk_id" argument to snd_soc_dai_set_sysclk(). Currently >> this is hardcoded to 0 when using simple cards, but that choice is >> not always suitable. > > 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 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(). Normal DT clocks don't seem capable of doing the job of .set_sysclk() even in principle. Regards, Aidan