Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4674137pxb; Tue, 28 Sep 2021 01:06:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybBpQ/etw38rVaXXA2I2ZBJI3/1E99hl08gpy/9VRr/d/ec1I5osUNYSl5G+tbjJBKNrNi X-Received: by 2002:a63:348c:: with SMTP id b134mr3396571pga.243.1632816416124; Tue, 28 Sep 2021 01:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632816416; cv=none; d=google.com; s=arc-20160816; b=iQqX8ip00/7E2HeK+9X9wwA4vNpNBfLjLPIEk2rTXuyAFNc9oStmltMYuj3xREN69k rW/KI07iH8K694PsEa0VG4eDlPFl/CFv3j1atJG7C6Wy66mf8Q5zF+zJDVtvezO/hq27 24uNczw7Ib4IILVA/I0ehecjjeqhXE1uSZTSXqrt7zLsBBG4Zj3F6xKh0kxv32SQ5HJa Ged5G6v2wkHxYnTHsavY1H6/oKIFWBwRKr5WdAdy85Jl7pWQ2p61aRABgYyuR0cIq2GX BXm5CvYklK5iHwaVNQyuYe0IqWRVP5Nt2nZrNugYi6RG+19gh4Ny0KeutTDCYBlFiBQT DXrg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=l6+f8N/o4CzHvn8mnmbz2zIJFwh4u7TbPKw9aQRkUvM=; b=sAJ+l7ScFhBfuc+DHK2zlmG8E7Q+gaH0mTCYaOxT9qrnC0uuVlAVP5/yL74iEwNOE0 tkwkJfilq5KjthMdPNLLdy5AnqWy30v8cTjuhZ5hk+6iMRtHyva2TNUE26hNcTKyn+fT lx/O87veLWww3Ow2e6ATTlGJv7NwXlH5wjqeVyF/6S+CNUkL9iyD2n/iCVKHwsrfon5C lXLGMs7PqDvVGj4+9TfgA8v5zEq1Vo4lE49PRRJrmxYiZEpB3JVXvAt7FrGjTmroM+Mv SO6uS2GnQzASZaK28b4RWjAycpvO/GqLRPemMRw0FGI1owE7M5SpjO6/Rx4JIrw+u/1/ m5lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=n5eU77gF; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="kWc/DHWt"; 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 y10si2336783pjg.107.2021.09.28.01.06.43; Tue, 28 Sep 2021 01:06:56 -0700 (PDT) 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=@sholland.org header.s=fm3 header.b=n5eU77gF; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="kWc/DHWt"; 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 S239477AbhI1IGG (ORCPT + 99 others); Tue, 28 Sep 2021 04:06:06 -0400 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]:36803 "EHLO wnew3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239313AbhI1IF3 (ORCPT ); Tue, 28 Sep 2021 04:05:29 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 3E71D2B01482; Tue, 28 Sep 2021 04:03:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 28 Sep 2021 04:03:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=l6+f8N/o4CzHv n8mnmbz2zIJFwh4u7TbPKw9aQRkUvM=; b=n5eU77gF7m3rbPoQ6DuuZfycVPMtJ UY7eLzE/Q2nQkcEUTOu7BmHb3OoBdTNkngxNZKfgzMsi9jDIGYau4+3lgwQlcMeu L6/rz/tV8DNj4i8p4LIDk1gdaKbsx4rRkIIKkLaUdyMspICIfKzB2Wbn1+N6IDxi PwqxbheWhGsHj4JkkjlVcrWa7LwpLV/BYUEYOGHooGGbppTssw/OIB2ok8k1w2e6 8v8+IFqJ9qEC7B5FoRN4wMElUNJ7TobnnHsYqw4JKTYMrLgt54j6Fi3pMeWNTQQa Wy4MLIYuE2qQaDGN9K8LoKv3pSeI80Orvr/d70g9VVhD0SL1xK61Rr/5A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=l6+f8N/o4CzHvn8mnmbz2zIJFwh4u7TbPKw9aQRkUvM=; b=kWc/DHWt bsK7M+veN52q/bybsVtsKK3EcGgSJ65PgKTUaNfb3777IiiGm/oeKSKSsGWicHCO /uA6fCfst491/f6m7RYffh1gFJee9uWxZ7es15CdbW646l+CBuEqIjw8euPzhGBV j1h3fxrrYhfUuughYVnuq5h6mL7RcJ/h34vksmnQPjYqVuy7aQ1cScHccESFDH8j CLHCJcOGtWeepUVhSMQP5A4qVgqW6bdZxYkp+cu4zriPhAisR9OOs9wh2OQNi3KF OW5ZJetVAiVo6adOS7M8wn4QQmpoZyMKJhXxDOfZINcRpfWbmgiZq9nEb2f8y5PY ocq0E1jhYB/lzw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudejledguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepudfhjeefvdfhgfefheetgffhieeigfefhefgvddvveefgeejheej vdfgjeehueeinecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Sep 2021 04:03:45 -0400 (EDT) From: Samuel Holland To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Rob Herring Cc: Michael Turquette , Stephen Boyd , Alessandro Zummo , Alexandre Belloni , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-rtc@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Samuel Holland Subject: [PATCH v2 4/9] clk: sunxi-ng: mux: Add macro using CLK_HW_INIT_PARENTS_DATA Date: Tue, 28 Sep 2021 03:03:30 -0500 Message-Id: <20210928080335.36706-5-samuel@sholland.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210928080335.36706-1-samuel@sholland.org> References: <20210928080335.36706-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some muxes need the flexibility to specify a combination of internal parents (using .hw) and external parents (using .fw_name). Support this with a version of the SUNXI_CCU_MUX_WITH_GATE macro that uses CLK_HW_INIT_PARENTS_DATA to provide the parent information. Signed-off-by: Samuel Holland --- Changes since v1: - None. drivers/clk/sunxi-ng/ccu_mux.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/clk/sunxi-ng/ccu_mux.h b/drivers/clk/sunxi-ng/ccu_mux.h index e31efc509b3d..f0e3094f29e4 100644 --- a/drivers/clk/sunxi-ng/ccu_mux.h +++ b/drivers/clk/sunxi-ng/ccu_mux.h @@ -72,6 +72,20 @@ struct ccu_mux { SUNXI_CCU_MUX_TABLE_WITH_GATE(_struct, _name, _parents, NULL, \ _reg, _shift, _width, 0, _flags) +#define SUNXI_CCU_MUX_DATA_WITH_GATE(_struct, _name, _parents, _reg, \ + _shift, _width, _gate, _flags) \ + struct ccu_mux _struct = { \ + .enable = _gate, \ + .mux = _SUNXI_CCU_MUX(_shift, _width), \ + .common = { \ + .reg = _reg, \ + .hw.init = CLK_HW_INIT_PARENTS_DATA(_name, \ + _parents, \ + &ccu_mux_ops, \ + _flags), \ + } \ + } + static inline struct ccu_mux *hw_to_ccu_mux(struct clk_hw *hw) { struct ccu_common *common = hw_to_ccu_common(hw); -- 2.31.1