Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5535163pxb; Wed, 26 Jan 2022 14:23:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnEuZTm506rJQVBJ2a3GCTfnKev/+XDQV2pNc8wc3PTzrQOmHXZQT6cFZxRM0OqK7vpAz1 X-Received: by 2002:a17:906:608c:: with SMTP id t12mr652680ejj.131.1643235829085; Wed, 26 Jan 2022 14:23:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643235829; cv=none; d=google.com; s=arc-20160816; b=xYnCqjculUGiIBJIbpCY9g9wlEGI35rtGnwGyIfNXKyRu4YeHjx3tcZVqru3vj+RI6 lLvwAXKYicB7nrcCl6OjsCqT188pTQ4ohV2zUl0IhUeIgP2kb8h/EnSqN3iedneywGue Edpql329KEth4ipLNZQf29G/avz97pMP9oZ4X1looXrQg9PwXzXJc8QmRF9woZeZijKa /GQ2Y7Q4QVYh/ytlsds0o2erXOaD5Tv9YvsXju6X7gxGrPE6822Ula7UcClVYWYdqlei d7OtocmLCShOhCMcRT0xl09ocKbDdixjBNDAkdYsmT08n4R9sXZWnxXbPittJ7HNTkTy YUsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=SMChCTUbPJn0KLnYEQbDS0l8nZYQGlwBBP39s3KW15U=; b=FItbr3ouxb8XQ9XuFRV27ZdtjngFZUX6FlNwc5bsmlOyUdvx6uVrY0GcGzL5y+goN0 S4rwrAqRrKwVqg+vR8FN78jyNrBPauRNtXjgnTVHfZ2l1kk9ud3Y4zCQ2a03xQ2XkvQy uL9S4FFoS7AdZltC2PLGeLMrIQhXQ2ugEd/tgBuA1IxJnCj4LC4MHPoSw6ouNL3drvQj VMWAvBV4vx6RFrOB/1lDmHCAh6S2l57aTNK0s29nc3kwB8VBUnKnvd/Q3sN8USpq12Xd ky74gA9WG7AZ3eO0rDta2ORL1KUgY0cDmRFYRHJqAOn/krKWR5sTpIdiiS8hv7Ai8yLg 69EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PaEx50NL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sc11si306158ejc.113.2022.01.26.14.23.24; Wed, 26 Jan 2022 14:23:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PaEx50NL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243851AbiAZRkZ (ORCPT + 99 others); Wed, 26 Jan 2022 12:40:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbiAZRkY (ORCPT ); Wed, 26 Jan 2022 12:40:24 -0500 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81425C06161C; Wed, 26 Jan 2022 09:40:23 -0800 (PST) Received: by mail-wr1-x434.google.com with SMTP id e8so449696wrc.0; Wed, 26 Jan 2022 09:40:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SMChCTUbPJn0KLnYEQbDS0l8nZYQGlwBBP39s3KW15U=; b=PaEx50NLhLlXA3wmwHxA2aMToislHAwBjJjzJOMha5pY7v81kRTxkPRZG/NNjkwO3V ICoe2j4ygbAqs0j5Ibmid1rcj9CeA6LDHKge+y7O4mXM5HflkC6ZSVtJDByyVWV9XuNW brt5Gl07qDdyiPycQrSncPBhqF8KIDtI6oIZQAT3vVfeOFFDyuQVPFif7fsBrcSxAhCn YTEgJpzV9jGVcGvoDQAepo+2/rJpXQG6fskfTmRrAdZYJxRQArNt3jpKO8gNchfLm1rZ JsGL3+hl/OkroNAznQllflUUQ1Ql1WaK3dilojKrRE03lQHOGeARgMGUwI59ezQBdidp crMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=SMChCTUbPJn0KLnYEQbDS0l8nZYQGlwBBP39s3KW15U=; b=BsKE6cHxL3Oc3TsCJIwUysj8hPq6DOxZ4RxfDDOhpDv016yyYWVW8VHflNlNqsaKgQ i8dLAZgN+bMFdjbf9ixJzuIjqQjXxQsLQMYM+LkMhko840lYQeUybf//GJZmiuIEJAhk SLKOEytgjUKLupTE9HGrcLjNGhdKemqrlqYgGFSFZ3pcJwnzNpCFtyw3b7QBdkk81R/4 2BTnU7VpF+D63nJjvceFlS4xN/oGx9wP0jEPNSQ7pCx9V9lrt3hXNHz2Oyzg3sUGUZQm azGj/EYM9EKeYObhUMGmBt8Zkot2ogchCF6Ax52h8r6hOErK/PEUIHVtx5iwHn60LZWu oHdA== X-Gm-Message-State: AOAM531NHZGhKgsnrTX10ONnwhSo1Nh9tPQFvqb8+oEwEy/XGizVcwt4 tfM+UP7EzbT/CYmxF3mR6JGXVm1SGkU= X-Received: by 2002:adf:eac8:: with SMTP id o8mr22920992wrn.332.1643218822002; Wed, 26 Jan 2022 09:40:22 -0800 (PST) Received: from stitch.. (80.71.140.73.ipv4.parknet.dk. [80.71.140.73]) by smtp.gmail.com with ESMTPSA id y2sm3498451wmj.13.2022.01.26.09.40.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 09:40:21 -0800 (PST) Sender: Emil Renner Berthing From: Emil Renner Berthing To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org Cc: Emil Renner Berthing , Michael Turquette , Stephen Boyd , Rob Herring , Andy Shevchenko , Geert Uytterhoeven , Arnd Bergmann , Michael Zhu , Fu Wei , linux-kernel@vger.kernel.org Subject: [PATCH v1 0/7] JH7100 Audio Clocks Date: Wed, 26 Jan 2022 18:39:46 +0100 Message-Id: <20220126173953.1016706-1-kernel@esmil.dk> X-Mailer: git-send-email 2.35.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series add support for the audio clocks on the StarFive JH7100 RISC-V SoC, although the first two patches are fixes to the original addition of the basic clock driver. At least the first fix may be considered for 5.17. It turns out the SoC has several memory ranges for different clocks, but they all share the layout of the control registers. This could be modelled in 3 ways: 1) Model all the clocks as a single peripheral with multiple memory ranges and have a single driver for them all. 2) Model each memory range as different, but related peripherals with a single driver handling all of them. 3) Model each memory range as different peripherals with separate drivers that can share most code. Although the first option would require less code this series implements the 3rd option. The basic clock driver has to be built-in to boot the SoC, so separate drivers for the other registers means less code needs to be built-in and can be left as loadable modules. Emil Renner Berthing (7): clk: starfive: jh7100: Don't round divisor up twice clk: starfive: jh7100: Handle audio_div clock properly dt-bindings: clock: Add JH7100 audio clock definitions dt-bindings: clock: Add starfive,jh7100-audclk bindings clk: starfive: jh7100: Make hw clock implementation reusable clk: starfive: jh7100: Support more clock types clk: starfive: Add JH7100 audio clock driver .../clock/starfive,jh7100-audclk.yaml | 57 ++++++ MAINTAINERS | 8 +- drivers/clk/starfive/Kconfig | 8 + drivers/clk/starfive/Makefile | 1 + .../clk/starfive/clk-starfive-jh7100-audio.c | 170 +++++++++++++++++ drivers/clk/starfive/clk-starfive-jh7100.c | 176 +++++++++--------- drivers/clk/starfive/clk-starfive-jh7100.h | 112 +++++++++++ .../dt-bindings/clock/starfive-jh7100-audio.h | 41 ++++ 8 files changed, 482 insertions(+), 91 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh7100-audclk.yaml create mode 100644 drivers/clk/starfive/clk-starfive-jh7100-audio.c create mode 100644 drivers/clk/starfive/clk-starfive-jh7100.h create mode 100644 include/dt-bindings/clock/starfive-jh7100-audio.h -- 2.34.1