From patchwork Fri Jul 5 07:19:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 3174 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8775F3F102 for ; Fri, 5 Jul 2024 09:20:02 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-57c6e28b151sf1369193a12.2 for ; Fri, 05 Jul 2024 00:20:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720164002; cv=pass; d=google.com; s=arc-20160816; b=Z61yRJttQ8Wqvd2bohaBnRn5ezsWmR673ZhN0mCf3boe0r0Zv+zirv6kP37zjvtrU/ IJrI64BDKvEpNHgob7QT/9LIk+W+2Ubc9VeCJvK/K4VHVHA6YyOb0onoEQdd40x/DxSG wxuFJRMKfAsT1NgvITE7buW/JSSSB8BWKTqu8asReGuOH8dFmJ1kWv+hWEr8LM/ouzvY I+mvMgOaAuL9E2U1DV/6U2TCIZDozqQZs+kPhRt9SlmM8CQwGpOImVrY87JRDfrziNBJ IloWACZvLN2UGnGtFVzkdVkegDQ3rEOnwBNm3+kl9pH7E5zd1fi9Zg2T8wC4DjUd8Bsk ZyDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=hy46STq8yN4AS4FQR3hcRWlA6gd9pbC3tpIP8YGdgf4=; fh=Rh/H8j0Diu8mj1LQxqHbzW6iXXsvzHaBFpOqlafuzjE=; b=0Ysf3bGDD9QbFp80XN9TA5ceOG3HReZ+TULIY7ONTLYwPjZ7pWQjaxx6yFkHPnWcna f69j+8iTDvDr97cV1f7V3pEPA2LWtDam6pShlrvezmUT8q94DaPo5vJh1spMuQcxWWKv 8113NyzynSllMyow2KCb6dUcVVkyxz4RFl7acMBD0tCFEJuWfT0UTclAN2R/Anh6Ux9I Zvck6kG3QDFDfHRVvQk0Hzbp+kKh8+5H/1KLAcZWfQ6TXDZh+sKWsppqEV+SEXz02rx/ sl+KDJwHv5IMAfib0UBGKyG+kOS5jXRE3PDzpt7SaM+PrmKdyNhkndFHkvYf6vBnxXJL Vcng==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nJ5K4DpD; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1720164002; x=1720768802; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=hy46STq8yN4AS4FQR3hcRWlA6gd9pbC3tpIP8YGdgf4=; b=qUNRpBFCV7nZ7f6aom1H4gHcZuQu2O5WNK/FfyNRSAWxlltZCZu6Lg9z9OkRkcGS1x C3t3XqUolH35zWQ4r/MslXPa+Z7kJjd/nEQL2A6iOIWJ87zEGZuNfholeG4GrciiCQte aNnCGm1mEX1t8Ikg1iNUEYjJEz48S8WqrJkzs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720164002; x=1720768802; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hy46STq8yN4AS4FQR3hcRWlA6gd9pbC3tpIP8YGdgf4=; b=U/wNn2omoiQmGSJ7IdQBXjadJQqsUfBJf36OhBqew9wjNz1JvSNp9+B5oas0wjfBtO mfjt9yRMBVEgLh7rM4EKWlaj+7b/wGzlCsc4MjeekqXwg7rE0SHxrpUDblIJUXFqT0ZV wLsmn+3Nt5RteOveDPSxZiY+Z5Xu5iaR2hDrTi0KQwBsKfnAak+UmWjSe7JvoRc3iJJh VjuMGB2Jp9KqHbiMobc3JAzyRnyp9CSjcFtloxGaCmAXrSxU2Z0KqFDKcJL3gRk7M2J3 SuWN1uLLajWvaEXq6frhQVtDSHdTgIEyF+9lhXXBEYEA0MYI+5gqajRz7NKKdqhmd6td L8/A== X-Forwarded-Encrypted: i=2; AJvYcCU018X7ebktz3+CWhYJy9rZC9+Do8EXgKXaFOEWTXf+mT0wHznwzgsM7dI/wNPp/vFYZEG/00rDcof/g/ZUHTvxpTa7D39/MWCz31cJ+dpOwMykzS42d6ynozpvag== X-Gm-Message-State: AOJu0YwOvsOsM270yh6n9Fhup+jgCZKy2PkoPANPT/AcZ+VkXQK3kiQo hBpsN9aJTj4RFNVI7dTLlkR4NsnMtigki+4aMeAdBhQa001E5Qky5RisT8jS5iswag== X-Google-Smtp-Source: AGHT+IEbK32yKLCSpIM2Y6aw5snMU9YckdlcQCqySbuW/lLhfc+6ZWHGcMR1VWesZj3WVLxdxigRFw== X-Received: by 2002:a05:6402:148d:b0:58b:52a2:6eb6 with SMTP id 4fb4d7f45d1cf-58e5ba8d9e3mr1810596a12.42.1720164002143; Fri, 05 Jul 2024 00:20:02 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:1767:b0:584:e611:3b90 with SMTP id 4fb4d7f45d1cf-58e24eb151cls723066a12.2.-pod-prod-09-eu; Fri, 05 Jul 2024 00:20:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV8EDfCExsT8HxUCZtNS1spCQLk7hgQLfVilNEfwsowcceg75U0s4VK1kWI4bMfwx4apPq2aN3gfH7Ap3nDl1ceswNTGKttn1Brk7h5/xH+xjHh X-Received: by 2002:a17:906:13db:b0:a77:cca9:b21c with SMTP id a640c23a62f3a-a77cca9b865mr55067766b.34.1720164000355; Fri, 05 Jul 2024 00:20:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720164000; cv=none; d=google.com; s=arc-20160816; b=JISb/Iah/NBUfNOUEVumRdEw3u5e1l035WTVCIv0++4s3FsC5QoJePKejng6/HOGfP 0Uzbo/mIHLLx0sa8fPKi8E4e7tIaMN/KVjEUxgiOXwlI7eceLBm2B78XGj2wDCZeEg88 8gQ+ITQxK8eiXdoSpVYjQe9Z9NogAbsDPPE8BH5kqr/NsYcyKlUWdBclIwsWZxnPSrUS ansyFYhLbzYH+NX2bLalM9SALgSFFn1I2nbc+zJd9+s1jhiJ0jVlnJl8phb3phThm71/ Z+kHfrURg08vYx0DZUmsb8nZaSN7IoL11qVwKuFCISZads7RS8ATM2sohhUkok+ketwd JQKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=cjPyDwYxW8ixxUOfF5BImnGofyLtSOc9yNE6LGakbDc=; fh=5wN+uVlBmDJZNfdkCf/no3fjbB4uuoNBKgUfaBZOKpE=; b=1GS/2+GJ0SbtMEqD7PobZqzaSYEPs4xvegBj5yJil6zU3/GMqGKnJoPgfbcjTDEbN6 0uhETndKCE8uSwcuJ4bBtOlc0AFqg5XD3ohAUbrosudDP8fHoVWw+G85zAgD+e38s1t6 0wQLjxZUopP+apTMSdFL8ICEfpMm7TZEscyzVvjXDNSOIYnGVW4Oe1GDeVLmHGNENpdu +RYl6U5zTz+2BSBorhAQtPoijazJkfWAXiCTlN6G0S0idaeqUtaI3lbIEbjLDvf0bS0N 6msxL5YMxwbZCR+YajpYkTc/WCSMBx/U6KtgqxJ2ZasZ3IrY3ZaiTCxxz9uQy7xryrH9 VoqA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nJ5K4DpD; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id a640c23a62f3a-a77bf7496b1sor70097366b.1.2024.07.05.00.20.00 for (Google Transport Security); Fri, 05 Jul 2024 00:20:00 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCXK0GtWrmPpfcR3EZD9Mvg/LTIEalsqfWB3likq/KFRVH/oYn4BqrIBUSnLbxZwv15rSpRQWvLcouvotf+Kp+HI1AzqdSJKd15NsrjdeFGiqYIU X-Received: by 2002:a17:906:4751:b0:a74:5b82:7f28 with SMTP id a640c23a62f3a-a77ba4787a5mr251579166b.23.1720163999821; Fri, 05 Jul 2024 00:19:59 -0700 (PDT) Received: from panicking.. ([2001:b07:6474:ebbf:a3e:4288:e106:2eef]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72ab0b84d5sm655158066b.223.2024.07.05.00.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 00:19:59 -0700 (PDT) From: Michael Trimarchi To: Lukasz Majewski , Sean Anderson Cc: Tom Rini , linux-amarula@amarulasolutions.com, u-boot@lists.denx.de, Dario Binacchi , Michael Trimarchi Subject: [PATCH V2 1/2] clk: clk-mux: Make public the clk_fetch_parent_index Date: Fri, 5 Jul 2024 09:19:51 +0200 Message-ID: <20240705071952.12245-2-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240705071952.12245-1-michael@amarulasolutions.com> References: <20240705071952.12245-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nJ5K4DpD; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Make public the clk_fetch_parent_index and rename it. This allow us to be reused in driver specialization Signed-off-by: Michael Trimarchi --- V1->V2: Nothing changed --- drivers/clk/clk-mux.c | 5 ++--- include/linux/clk-provider.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index f410518461e..e3481be95fa 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c @@ -102,8 +102,7 @@ u8 clk_mux_get_parent(struct clk *clk) return clk_mux_val_to_index(clk, mux->table, mux->flags, val); } -static int clk_fetch_parent_index(struct clk *clk, - struct clk *parent) +int clk_mux_fetch_parent_index(struct clk *clk, struct clk *parent) { struct clk_mux *mux = to_clk_mux(clk); @@ -127,7 +126,7 @@ static int clk_mux_set_parent(struct clk *clk, struct clk *parent) u32 val; u32 reg; - index = clk_fetch_parent_index(clk, parent); + index = clk_mux_fetch_parent_index(clk, parent); if (index < 0) { log_err("Could not fetch index\n"); return index; diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index b8acacd49ee..59f9c241b84 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -74,6 +74,7 @@ struct clk_mux { #define to_clk_mux(_clk) container_of(_clk, struct clk_mux, clk) extern const struct clk_ops clk_mux_ops; u8 clk_mux_get_parent(struct clk *clk); +int clk_mux_fetch_parent_index(struct clk *clk, struct clk *parent); /** * clk_mux_index_to_val() - Convert the parent index to the register value