Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2678539pxp; Mon, 14 Mar 2022 02:29:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxh7/ldtbZ0oA5G0wu3DGubboAw7dpih63WzSUx09YbXfxZFLdh1931N13dKMuNabWs3W2 X-Received: by 2002:a17:906:68c2:b0:6b4:9f26:c099 with SMTP id y2-20020a17090668c200b006b49f26c099mr18125639ejr.41.1647250153985; Mon, 14 Mar 2022 02:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647250153; cv=none; d=google.com; s=arc-20160816; b=uhlDy+YyxbjEnN2edO6Xh5er2kMpDl1QrqCq2vH6kCL+K7zbZfxjDcch8jeqiCTLcx aZJRxwlik4jbtxQf78YVU2Zb125HYfCovNdO01y4E92Bk+tnJ47KhEdxHAdO6y298amR T1lR0xyQU9uGDr5uU/csIO2YAWuGbUK0DbTA9WltJmmzX+B4CTat1kLra704JrubPfVi czKQPiZlpSUJIBfIv24f+QgOv0kdwL5Drw6tgCcNqMNWhcHfH/qtJNsWOMZXjZVNiD6s TxqSlFxRnz6RER9DtFXWVO3S88GFXZywIJPwgQPQbk+Vy7D1kHn6TKzaXxDzS/MGhQFR 1rsw== 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:to:from :dkim-signature; bh=ULORFmB1Gv653NhwYAC6GyuMCDu1OWN34Ide113fYeY=; b=b2uJ06XB3OTGU9eeTiksAgZ7kQNWKxanexxI8T2/lkBe06ZYXXEIbRCVfVzEhtpewE agC9ZLCEKddXkwAxJ0WZogrENKT+Qdr/wT4YycrhtpfDOsJjTIRG/1cRbqcRSziEsrBr VtZp272RWvwySOVLtDLDci4i42z09j1WK42l0OPeWZcmAozbTFTeEODQQW/HhGkfZmf9 vg6B9CM/DkOeJ+K37VpCzhvOaykHu0Z/Ex3B/NOLTP82nhKrDRlAyGir9OkZ+pJjy4y0 P1JDezJyAjcvrxuzhDbNcyK/Q8kL7nlPGv1UNqFlcbHfn58zgWjJbqvjron0Q/8rH0+J 8uGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jLZx6wHR; 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 qa9-20020a170907868900b006dab9e2f03asi8824324ejc.398.2022.03.14.02.28.49; Mon, 14 Mar 2022 02:29:13 -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=jLZx6wHR; 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 S229486AbiCMTHJ (ORCPT + 99 others); Sun, 13 Mar 2022 15:07:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235404AbiCMTGl (ORCPT ); Sun, 13 Mar 2022 15:06:41 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 806BB50B13; Sun, 13 Mar 2022 12:05:17 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a8so29583203ejc.8; Sun, 13 Mar 2022 12:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ULORFmB1Gv653NhwYAC6GyuMCDu1OWN34Ide113fYeY=; b=jLZx6wHRAQlKhDJq8r1pf+twX5RsUltvQMFTKUyaZOIJHmvCGm60JM5AWPsMmoo9kf 4f2Zh1MzbE5QaCzShn8HEoVMDNi+Iwe9y1GR7uPw/9ddI8tbEZLFnAT37eb6rPn4NA2i Z6MztMJafR88Nmu4cUhShdLBFS6s1GhpnbhbOmJn19eqfP2JTZ3pK8HVQavg0SwjBurd AEP7MqUReH6kgOEE8xR3Er930To+yPqhshHnGUTWaqxqGkdLGM+oF8SpbGwWpmSylEOX ONYf3wzXmrwd6X1XaNNjvL0hWZju7iMng6aYOIAqTSvhmBoHWrOvLzWQOpRLnLFVh8PN Xbsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ULORFmB1Gv653NhwYAC6GyuMCDu1OWN34Ide113fYeY=; b=39o98h+pZPqhWehlVh62zZwciQ4J+JmxWZ1yafDeg3Hg0KfngA7Lmti7nJxivZPzQ/ KW7VDej7gDwSVwdO+2twHyvInJSc6npb8gImHGCDYja1U3ACpRQSPxZiNu8LQt8Z2Z6j 9jcYQ4nTMhN4LIJS4EWNhW5Y0EdxmOqDlOw2clslc01yy/Qb3z99QBZHy11thOUhDrnb aPTuUqdDSuMpVG07oor48SQcrvgd0zGvpuCce++Z8DF1PX/wEvccpwrSC3zbNahX32oR kkXDNRkE6/bJLwRslSdciM0N1Hn6t5eluT3fCmw/iLYWIKuzp6ayGyqNb3+pgi3Q9JED ZDxw== X-Gm-Message-State: AOAM5329zy5sS7fo3LMkoP8vRV3a/IgiBjwnmhmYYBTS/edThzbbB2vq BmlJFJhdTodwQuQpEN3hY1o= X-Received: by 2002:a17:906:9b8f:b0:6db:ab62:4713 with SMTP id dd15-20020a1709069b8f00b006dbab624713mr9662533ejc.738.1647198315903; Sun, 13 Mar 2022 12:05:15 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-42-71-246.ip85.fastwebnet.it. [93.42.71.246]) by smtp.googlemail.com with ESMTPSA id n13-20020a170906724d00b006cedd6d7e24sm5856697ejk.119.2022.03.13.12.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Mar 2022 12:05:15 -0700 (PDT) From: Ansuel Smith To: Rob Herring , Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Peter De Schrijver , Prashant Gaikwad , Thierry Reding , Jonathan Hunter , Ansuel Smith , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 13/16] clk: qcom: clk-krait: add enable disable ops Date: Sun, 13 Mar 2022 20:04:16 +0100 Message-Id: <20220313190419.2207-14-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220313190419.2207-1-ansuelsmth@gmail.com> References: <20220313190419.2207-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Add enable/disable ops for krait mux. On disable the mux is set to the safe selection. Signed-off-by: Ansuel Smith --- drivers/clk/qcom/clk-krait.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/clk/qcom/clk-krait.c b/drivers/clk/qcom/clk-krait.c index 82fe7031e1f4..fc277fe3841c 100644 --- a/drivers/clk/qcom/clk-krait.c +++ b/drivers/clk/qcom/clk-krait.c @@ -85,7 +85,25 @@ static u8 krait_mux_get_parent(struct clk_hw *hw) return clk_mux_val_to_index(hw, mux->parent_map, 0, sel); } +static int krait_mux_enable(struct clk_hw *hw) +{ + struct krait_mux_clk *mux = to_krait_mux_clk(hw); + + __krait_mux_set_sel(mux, mux->en_mask); + + return 0; +} + +static void krait_mux_disable(struct clk_hw *hw) +{ + struct krait_mux_clk *mux = to_krait_mux_clk(hw); + + __krait_mux_set_sel(mux, mux->safe_sel); +} + const struct clk_ops krait_mux_clk_ops = { + .enable = krait_mux_enable, + .disable = krait_mux_disable, .set_parent = krait_mux_set_parent, .get_parent = krait_mux_get_parent, .determine_rate = __clk_mux_determine_rate_closest, -- 2.34.1