Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp774155imn; Sat, 30 Jul 2022 02:30:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR6taiILQgxMqraoU3D9l+KRF4IiJvV7tnGJ/sEOzYYkDb840OCV/ZghKbBV2a0bgCbJtcae X-Received: by 2002:a17:90b:4c8d:b0:1f2:bd7a:41b7 with SMTP id my13-20020a17090b4c8d00b001f2bd7a41b7mr9047044pjb.66.1659173417297; Sat, 30 Jul 2022 02:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659173417; cv=none; d=google.com; s=arc-20160816; b=EZrzB0SqEyHE09MVxjasIXPl+NjZNltTxA/hLtnLciruYCrTgekJaqRC+PKhhmdnd0 rVZ3yBzoVfQy8LvW8AVWO8tqSFnp1rrwt3Yr+0jBOxQ4ibxElk5oADYCvsBNbfyXmLl7 8DkCIIne+2fKNitjyqXz35qCaiFS/XUz+10tCxAnicU+EVExZPsdwK0XeGNRym/N6Y8T QjmOMpfumyokam6d6xaADR8srQE60d4JN42bGnybtwG7dUnH5q/uIC4RMJgnmkLkEvSd yLriMqZ0fm7FuV8c1luTnr8E7HtHKYyABtsjH1BPDNnXHFH4oALnkJ7/QkCffceY44rj 95xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=WVPx/KX6To8JoYkXn1eofLsUkqE8StNK5f16O84HSHs=; b=Io7eHTrxfcwxeolrKFYZ6hEHg5HWyEKQNsx2/V89JlIcqvd/uLH1K03EYCXPiz86pN vDhPIoelOpu4Ss6A/ax4/ugiqauoesoOntdd7jnPMTQ4vx/vG7gyMydlRbmopiCGFus2 O86oRI8xNjtoKbP1eaedsoiNndAnk//PH/u6amzbMLyrtLy2jE5/RZE6R5vWraTvtPJm dIie0PKBc/NREFnjQ/Shh4u9hO8MJJ0v4qGCd6We+c8DYgegcEZWPVct6vd2fKdrFRyS EzxJIkz6yw3clO4Aj1FuTaoD0Dr4WIISPY5+6KYfxL0P73gil1PuSv8a+JGxvE83Vear /ICw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=RGBQaUvk; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n17-20020a170902d2d100b0016da6ca8bdasi7541211plc.343.2022.07.30.02.30.02; Sat, 30 Jul 2022 02:30:17 -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=@quicinc.com header.s=qcdkim header.b=RGBQaUvk; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234110AbiG3JS1 (ORCPT + 99 others); Sat, 30 Jul 2022 05:18:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234018AbiG3JSW (ORCPT ); Sat, 30 Jul 2022 05:18:22 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 060CB41D19; Sat, 30 Jul 2022 02:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1659172701; x=1690708701; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=WVPx/KX6To8JoYkXn1eofLsUkqE8StNK5f16O84HSHs=; b=RGBQaUvkzMFhn5GSsr3ensbkM4EJJ4TX+4xhyCCtcrhvohHMTwS5JZyE A5kIzuY4w0hiGw1m7ejR8rsWbGup4c3OiLzSD7jhx3ZGAH+gs37PizFRA uxfNJFAjnbfOl8EIGwOGQ/rMIVjTaRgbCSDW9PuzUuztUVt1tMgi+pNlP Y=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-01.qualcomm.com with ESMTP; 30 Jul 2022 02:18:20 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2022 02:18:20 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Sat, 30 Jul 2022 02:18:19 -0700 Received: from hyd-lnxbld559.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Sat, 30 Jul 2022 02:18:15 -0700 From: Akhil P Oommen To: freedreno , , , Rob Clark , Bjorn Andersson , "Stephen Boyd" CC: Douglas Anderson , Akhil P Oommen , Andy Gross , Konrad Dybcio , Michael Turquette , Philipp Zabel , Stephen Boyd , , Subject: [PATCH 2/5] clk: qcom: Allow custom reset ops Date: Sat, 30 Jul 2022 14:47:41 +0530 Message-ID: <20220730144713.2.I4b69f984a97535179acd9637426a1331f84f6646@changeid> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1659172664-10345-1-git-send-email-quic_akhilpo@quicinc.com> References: <1659172664-10345-1-git-send-email-quic_akhilpo@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Add support to allow soc specific clk drivers to specify a custom reset operation. A consumer-driver of the reset framework can call "reset_control_reset()" api to trigger this. Signed-off-by: Akhil P Oommen --- drivers/clk/qcom/reset.c | 6 ++++++ drivers/clk/qcom/reset.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/clk/qcom/reset.c b/drivers/clk/qcom/reset.c index 819d194..4782bf1 100644 --- a/drivers/clk/qcom/reset.c +++ b/drivers/clk/qcom/reset.c @@ -13,6 +13,12 @@ static int qcom_reset(struct reset_controller_dev *rcdev, unsigned long id) { + struct qcom_reset_controller *rst = to_qcom_reset_controller(rcdev); + const struct qcom_reset_map *map = &rst->reset_map[id]; + + if (map->op) + return map->op(map); + rcdev->ops->assert(rcdev, id); udelay(1); rcdev->ops->deassert(rcdev, id); diff --git a/drivers/clk/qcom/reset.h b/drivers/clk/qcom/reset.h index 2a08b5e..295deeb 100644 --- a/drivers/clk/qcom/reset.h +++ b/drivers/clk/qcom/reset.h @@ -11,6 +11,8 @@ struct qcom_reset_map { unsigned int reg; u8 bit; + int (*op)(const struct qcom_reset_map *map); + void *priv; }; struct regmap; -- 2.7.4