From patchwork Mon Jan 30 23:59:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 50556 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2464541wrn; Mon, 30 Jan 2023 16:05:31 -0800 (PST) X-Google-Smtp-Source: AK7set8zgoBBBFTO5fQMDZ3tceIBm/m3wO+sI1VXsLDmjCY/vPvVJctRFWkPADYB9peXK1yTjR/7 X-Received: by 2002:a05:6402:378b:b0:4a2:4abc:29be with SMTP id et11-20020a056402378b00b004a24abc29bemr5171455edb.35.1675123531595; Mon, 30 Jan 2023 16:05:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675123531; cv=none; d=google.com; s=arc-20160816; b=hSlr6CQ/3NYP8jgdXyJ11ck9cwWPF3uZIMfsf1ZhngKUoAvTYlEO+5aorVqy9A/YrK Q+V+Yrv1LqIP2d5FsmV4DGib3FPWQSQKnMz70jaZ79OacH3iW4Rlwkm13POMnsEOC9/r XIj+7gugKy2DeBsIG0e8m7B5Jh4yDb1/V22p6zrcHT+JQ4GPjGasskRPsY5WUQWlrOU8 krS7Dh7GHjzYvaBRGgOzoS1d+YK4fW8iDy+NT0fwFYTfQI74yqNPKkNU58lU9HzUdB+O PYwwcwyVzwKTlIr7ZBUISxyXeeuvRj1o35C1Qvg+dnUO5NInGbYC+YHMoV6TbWs2dd65 WDzw== 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; bh=aWGy+d1x41QAHpHzB5Mf6KI/uH3br8ARPCTrkb+qZ2A=; b=AU8CQHFrnIMLgsokWngbqKAZKJs1RjYbjFdzAKeNF/3rkQ4tqtATbAGkKrvGFLVKHL 4RFjUaaiNgsaIfHj7ABH1eMAne83ux2v4rMj5bR6KvnZoUSlujIDmR+EyVSVNCJBuKQv UgINGEGPJZBrSnqS3a3fcZTfE6/qlcBS0f71WD8rDqcLGeONZtxMU5w5oDSFcJxR2tzM IZir3K2zgu3gQ6n2Pqb4lgdLWskrq6gbPExWJNBGzK7FnYuiCsVakSfcDI/zLJeADrNT KououSodEcfaYTd17f3Q/bMYiEhJKOVOh36IoYT/r4xsVV8FpzhfIL9nKMRROI+RBcw2 k30Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HwHIHYZ5; 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=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h25-20020aa7de19000000b0046b1d405d4asi15246261edv.206.2023.01.30.16.05.07; Mon, 30 Jan 2023 16:05:31 -0800 (PST) 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=@linaro.org header.s=google header.b=HwHIHYZ5; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229969AbjA3X7l (ORCPT + 99 others); Mon, 30 Jan 2023 18:59:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231272AbjA3X7j (ORCPT ); Mon, 30 Jan 2023 18:59:39 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D1D11CF6B for ; Mon, 30 Jan 2023 15:59:38 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id qw12so21014198ejc.2 for ; Mon, 30 Jan 2023 15:59:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aWGy+d1x41QAHpHzB5Mf6KI/uH3br8ARPCTrkb+qZ2A=; b=HwHIHYZ51hTrApQCxcPqlwjpY/C4bkSm1evdoWD0HfowfZl3UFnwuC8bP3nNMPAgCQ 0tD6Y291TuLrYBKVkrHcxZC+gVy3LCh2PjYgZreqhoEVvLZ5dZUJyNPMtSSs5Yy1LOe4 ghD/82FNbm/LWQZN/5yIOXEfIJXGEzi/0/aPk6wth3dmggXQu3HYXFISNNdIKQtFEt7F rRTlJmx1DZz6ftOoCO5XNhA/Dw3y2LMCyWL5VFGjESIPObwFN6Rr11zj1peSRrD1I/m6 Hkiy1BfWnCPMRlVumPy9lb7LHX/C4HB6CXDCvW/POXakY8bNbnDm+GyAGegdZtSb42cM KsnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aWGy+d1x41QAHpHzB5Mf6KI/uH3br8ARPCTrkb+qZ2A=; b=SruVQMWPSm7d/tyQyTCFcqPzRAFt90rbRkGMzcW7cYRpHgZIM5bTc/Bv4Rs3e/E8jJ WtJTYl+KdH0pG7G8DUQh3zAayIHfz4ua8H7Zst4i6EVICw74g8ST+95mtIJtEVw72msy ipYuWkgI/88NuG80lAcb5KsWyVtk0CvsBskvuSGe9jvqzhsL5QWUCCmlTvix3CY5mZ9o hn7YiWs/Zje5vH7/XqF+VDT7c5prEgpPoI6O+ZlkroOnivaMMjJLMIOZM76DtQDDMJdl Gkm6yrUnCzY8J0FkPx8ZtsQ7+sx/mDL3hartjpsUdhfk4LnExb8cm6iBF25Aof0U0hKs QBJA== X-Gm-Message-State: AO0yUKUHoj/SS0vuxMe0r0uhZWM2IQlKu+Kpa5divui3tlt9aB8+x622 rJf761E3ah/OpE1tZAVaB12I3Q== X-Received: by 2002:a17:907:728d:b0:88b:bf70:2e79 with SMTP id dt13-20020a170907728d00b0088bbf702e79mr1288223ejc.30.1675123177051; Mon, 30 Jan 2023 15:59:37 -0800 (PST) Received: from localhost.localdomain (abyl20.neoplus.adsl.tpnet.pl. [83.9.31.20]) by smtp.gmail.com with ESMTPSA id jr23-20020a170906515700b0086f4b8f9e42sm7577751ejc.65.2023.01.30.15.59.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 15:59:36 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Cc: marijn.suijten@somainline.org, Konrad Dybcio , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/8] clk: qcom: branch: Add SLEEP/WAKE fields definitions Date: Tue, 31 Jan 2023 00:59:20 +0100 Message-Id: <20230130235926.2419776-3-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230130235926.2419776-1-konrad.dybcio@linaro.org> References: <20230130235926.2419776-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756494331948380331?= X-GMAIL-MSGID: =?utf-8?q?1756494331948380331?= HLOS-controlled branch clocks on non-ancient Qualcomm platforms feature SLEEP and WAKE fields which can be written to to configure how long the clock hardware should wait internally before being (un)gated. Some very sensitive clocks need to have these values programmed to prevent putting the hardware in a not-exactly-good state. Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/clk-branch.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/qcom/clk-branch.h b/drivers/clk/qcom/clk-branch.h index d8fc7b93ef6d..773f760a4590 100644 --- a/drivers/clk/qcom/clk-branch.h +++ b/drivers/clk/qcom/clk-branch.h @@ -41,6 +41,8 @@ struct clk_branch { #define CBCR_FORCE_MEM_CORE_ON BIT(14) #define CBCR_FORCE_MEM_PERIPH_ON BIT(13) #define CBCR_FORCE_MEM_PERIPH_OFF BIT(12) +#define CBCR_WAKEUP GENMASK(11, 8) +#define CBCR_SLEEP GENMASK(7, 4) static inline void qcom_branch_set_force_mem_core(struct regmap *regmap, u32 reg, bool on) {