Message ID | 20240105-topic-venus_reset-v1-2-981c7a624855@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-19524-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:37c1:b0:101:2151:f287 with SMTP id y1csp988883dyq; Mon, 8 Jan 2024 04:38:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyzeeB5ODdYRPy/YCmESg73k2YwrT7NobXCLgHWErJvulQ0+xJmxUwMg1rlGmm3tjOkjXp X-Received: by 2002:a05:6214:246e:b0:67a:94ae:7d06 with SMTP id im14-20020a056214246e00b0067a94ae7d06mr5362262qvb.19.1704717522545; Mon, 08 Jan 2024 04:38:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704717522; cv=none; d=google.com; s=arc-20160816; b=oNfdWItsJVTqPm/jB0yAfcZhZ75NJgCRaNWE+VCae8UGSrqHH+6G8/sav1+LPNXHMx wByJa5nw0bFz/11kBEzjymjmOFI3satYouMUY6tfm2uMsfLCi4GmoKvNxpv1AC41skfs zR2Ql3TVzi4i2JlDU3PEQscroPIdXUPDtYnopIUgzlyVH6U0gJKZXhlYurdVDjsIbgeN Oz9EhQXgiRRHC2X7Hz/y970i+2jbEAPGU1sPmd6P89A9bhtHRkPp2Ou+KCnODTAO4via qF9IC2TVR9FVsGOfWKFRvtaJMPNvgFzVcjMEvpAHCE+GY/VbxOJzSs7jLC8IUDkPUwMV qrSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=HUvQsMq1PbRCWmoeSPQnQVBbz3tj7l9AsvjXF5PvuL8=; fh=xaSuZj1ajbxHn52v8M2SiBWQNwlImHP6rQYKWo0AWtU=; b=VTNAbjDVaCarqxb+STUe57RuwbSwqjcR1XS1PM1+MGmP/fsDamRAOXkLE5FKxKz0aX 2VF8QmxbfjntmyIikrr6W9vN6Topy0fG1/TH4tKXqGSG3gaHZAu4q2MOl7FX4WJrAQdA HpzPFle4oZduMSYZeOO7sHiGadQRkSaSLJJKMdQltALS3Pq6QJl2CCXZrAfu2tIfXSEL IgC/rNs0JHLm4pdQrZUEy+C/Q+LQy/3h+Bpeq4P2WRJ3Sgo8bJuTCLTfeEBLaUU0HEXW k143RGYosCsA8F8uDoAOneI1x9UeCEajmKJ0jGyGgOzDoiJD4kJsPZi72a2hvBYefIzd 4d6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h7QwnjlZ; spf=pass (google.com: domain of linux-kernel+bounces-19524-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19524-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z19-20020a056214041300b0067f7a01e3a1si5318257qvx.600.2024.01.08.04.38.42 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 04:38:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19524-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h7QwnjlZ; spf=pass (google.com: domain of linux-kernel+bounces-19524-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19524-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 581D01C2259E for <ouuuleilei@gmail.com>; Mon, 8 Jan 2024 12:38:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC82052F63; Mon, 8 Jan 2024 12:32:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="h7QwnjlZ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E3EE51008 for <linux-kernel@vger.kernel.org>; Mon, 8 Jan 2024 12:32:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-557bfc7f7b4so890309a12.0 for <linux-kernel@vger.kernel.org>; Mon, 08 Jan 2024 04:32:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704717154; x=1705321954; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=HUvQsMq1PbRCWmoeSPQnQVBbz3tj7l9AsvjXF5PvuL8=; b=h7QwnjlZyyhDWs/H8McSNX+DYKnqEum/fUWlJdHaDzUYIISABMWnkW17lkNBbjpTaQ vWQaSRAKrx7u67B6DBHKGjQ3GnbS2ar55MgawuILgdQYoQD+yjLLtieIKU8HhWAb+X2V 4wro+Oi6IZO60hkplN9McWaDPxK8GLjchZg6FZJfcpmG6VN/AolQudlAwkUToMsrfd+c sGFEYbhB5ZYsvAB72alNC+3YKjb226TkA9iWGFZJHUa7k+omBFYLCi86i4I2GuIHp1Ij 55eit7KqE5PkFXnOaqaJ9ahN9NY/5mzHnV/OL0iIpgVHz7wqZsvP5SCyWH3wWywQmdqP k4WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704717154; x=1705321954; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HUvQsMq1PbRCWmoeSPQnQVBbz3tj7l9AsvjXF5PvuL8=; b=B1eqbPHMUzBQnhqxjIEgqPHyzQ7iwil9dB62kG1ngCxJKdovN3L4zobJ6q2Au2DuId H1G5o+qdpR8Zl/5+baDhjhC4O2c21/D5Qn3kuQN9TyZn2nVNgixy/19RzO5A0YWjK3HJ VwFLMD+Srl3IewUPL7K96C16IYEjR4gDElA78F6OsZNyxHKonaZ/uxug1vQjl784pbwF fZR8v91tgkbPiloxzB34GRtB+Q5gQMeWzum9YHXLZ+E9BMGQeZAfBpyUGXpCO3U3vd6c G5pVS+hyaypAcp4p/PeQmD18AKn5cDzhIx/gq4HwJC4RBf4LMmKzeALVGkvNYJ/mEgl8 xXzw== X-Gm-Message-State: AOJu0Yz4U51mRGOS+CwfIE0tFcdyKLDOE4LrqW87JA2w+2exajtQlURO yAEr86e5vrNzCLP9M29uQdmrA0150mmExskGF2FxTg8K3fo= X-Received: by 2002:a17:906:4f8f:b0:a28:9546:f92a with SMTP id o15-20020a1709064f8f00b00a289546f92amr3213285eju.67.1704717154382; Mon, 08 Jan 2024 04:32:34 -0800 (PST) Received: from [10.167.154.1] (178235179081.dynamic-4-waw-k-1-3-0.vectranet.pl. [178.235.179.81]) by smtp.gmail.com with ESMTPSA id bs18-20020a170906d1d200b00a2808ee8ab1sm3892978ejb.150.2024.01.08.04.32.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 04:32:33 -0800 (PST) From: Konrad Dybcio <konrad.dybcio@linaro.org> Date: Mon, 08 Jan 2024 13:32:19 +0100 Subject: [PATCH 02/18] clk: qcom: reset: Commonize the de/assert functions Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240105-topic-venus_reset-v1-2-981c7a624855@linaro.org> References: <20240105-topic-venus_reset-v1-0-981c7a624855@linaro.org> In-Reply-To: <20240105-topic-venus_reset-v1-0-981c7a624855@linaro.org> To: Bjorn Andersson <andersson@kernel.org>, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org>, Philipp Zabel <p.zabel@pengutronix.de> Cc: Marijn Suijten <marijn.suijten@somainline.org>, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue <bryan.odonoghue@linaro.org>, Dikshita Agarwal <quic_dikshita@quicinc.com>, Vikash Garodia <quic_vgarodia@quicinc.com>, Konrad Dybcio <konrad.dybcio@linaro.org>, Manivannan Sadhasivam <mani@kernel.org> X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1704717148; l=1900; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=8Ln08zwOLxxs1oCk9D1EV6KlVNtzHvoS1MgmoKMR/Vw=; b=uiBlXQSeveo6OYtgybsM4Ijx6cJYCnikHYLQARjmmvJSPRoT7VQNpExbZxFteGRcrSkoV7nIV k30jOX8wJPNAfiTklEPXntTjteUaycuNfblwmHzLXT7OokZFEvnvC+u X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787525880917333539 X-GMAIL-MSGID: 1787525880917333539 |
Series |
Qualcomm GCC/VIDEOCC reset overhaul for Venus
|
|
Commit Message
Konrad Dybcio
Jan. 8, 2024, 12:32 p.m. UTC
They do the same thing, except the last argument of the last function
call differs. Commonize them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
drivers/clk/qcom/reset.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
Comments
On 08/01/2024 12:32, Konrad Dybcio wrote: > -static int > -qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) > +static int qcom_reset_set_assert(struct reset_controller_dev *rcdev, unsigned long id, > + bool assert) Personally I'd not elongate the function declaration. > { > struct qcom_reset_controller *rst; > const struct qcom_reset_map *map; > @@ -33,21 +33,17 @@ qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) > map = &rst->reset_map[id]; > mask = map->bitmask ? map->bitmask : BIT(map->bit); > > - return regmap_update_bits(rst->regmap, map->reg, mask, mask); > + return regmap_update_bits(rst->regmap, map->reg, mask, assert ? mask : 0); and I'd probably do u32 bits = 0; if (assert) bits = mask; regmap_update_bits(rst->regmap, map->reg, mask, bits); because I prefer for aesthetic reasons not to do ternary inputs like that. However its up to you to change or not. Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- bod
diff --git a/drivers/clk/qcom/reset.c b/drivers/clk/qcom/reset.c index e45e32804d2c..c4ac4d18829b 100644 --- a/drivers/clk/qcom/reset.c +++ b/drivers/clk/qcom/reset.c @@ -22,8 +22,8 @@ static int qcom_reset(struct reset_controller_dev *rcdev, unsigned long id) return 0; } -static int -qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) +static int qcom_reset_set_assert(struct reset_controller_dev *rcdev, unsigned long id, + bool assert) { struct qcom_reset_controller *rst; const struct qcom_reset_map *map; @@ -33,21 +33,17 @@ qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) map = &rst->reset_map[id]; mask = map->bitmask ? map->bitmask : BIT(map->bit); - return regmap_update_bits(rst->regmap, map->reg, mask, mask); + return regmap_update_bits(rst->regmap, map->reg, mask, assert ? mask : 0); } -static int -qcom_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id) +static int qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) { - struct qcom_reset_controller *rst; - const struct qcom_reset_map *map; - u32 mask; - - rst = to_qcom_reset_controller(rcdev); - map = &rst->reset_map[id]; - mask = map->bitmask ? map->bitmask : BIT(map->bit); + return qcom_reset_set_assert(rcdev, id, true); +} - return regmap_update_bits(rst->regmap, map->reg, mask, 0); +static int qcom_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id) +{ + return qcom_reset_set_assert(rcdev, id, false); } const struct reset_control_ops qcom_reset_ops = {