From patchwork Wed Jul 3 09:05:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 3156 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 ED7F63F102 for ; Wed, 3 Jul 2024 11:05:18 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-57c6979daf7sf1966493a12.1 for ; Wed, 03 Jul 2024 02:05:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1719997518; cv=pass; d=google.com; s=arc-20160816; b=JVh1N87geEdUmivE+65ZzAenr+BMTwVtkHQAiUYDAHIMussISUBXTYVaCyaPtCJ+gA rJR2ypDGFOT0TUZjhehF+G4A3mgQ6r+jcGfg9HEhMXTrSEmpk8kigKCudTB76MMkh7O3 Gu5l/whB6ty/WdvI+TqlmtUJrGax5tQ5UpcDqSjoZspIRHoMULd5yEZpp+ClqE9Rtmbj zQuQ7ON5eTJYWnT8JC0b7g7zY9cB2huFxRnwvyoJ3Q/4i/yeYnqrvzH7vU/JalOUxAGG yV4Q75F8kfsf8qjR/PkDy9pOFyLpGtrHUBctoY/0N3hKfwrsHI6yBJxW5DD2Jp+o9t05 TqvQ== 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=y5CjqY2yv4Fo8Hyqvd3RHbNff0xOZYrkX9X+0pPNkoA=; fh=czNANGcxggG/UA/dlDdRLqHVYTcUEYdGiGWtN9vI80Q=; b=g6P9euSTmnI5zF0+NHus4nDaQZPoaxWSXQSnWVGNW5U2ri096ZA2Du3KXNrbcbyAGN aNOM7neTU8nvWdr0/5Cz7unB6H9uytPmtz136MwXn4RGGI9aJLt+e0lBhPPYWANJH62O AeSvpmPUObVJ3i/sjOwW79LHKOGPX36YTamF5EIgiR1pUnXJi0Y0k1oq9LpOhOaytNch mSg2gv1ATOM/3OVN+eFN6bjRDr20jXR0ZkmK37v8qd2oyb/dZTdd25EwN8jPFt7yIKIp UqXvWSPBN/YCAA3cex67FeR2wRZlkqQXFCKqBOvWPS1DBia0enmgeJWucSyYu1M+1cIo NftA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=doUiLnBT; 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=1719997518; x=1720602318; 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=y5CjqY2yv4Fo8Hyqvd3RHbNff0xOZYrkX9X+0pPNkoA=; b=afD8fxgK38MJjpSHftmOpQay8N8dPXwkSAOkOxo5lu3SRiROAd4T1+2+l70NvlaPdC 94xkx7byODjpeoEIMLn6+Y2sqZGbvHsMchnLm8Tw3oP/VHshy9pr2rAGl+ec3Ik3gtJF idRqu7vJjoYFlbhn5qeB2gFY8jwKB9y3ZtsPs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719997518; x=1720602318; 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=y5CjqY2yv4Fo8Hyqvd3RHbNff0xOZYrkX9X+0pPNkoA=; b=m7rPIGDPqXwi8+fwKKIUlNFcTZNJLrbrN8CyyojIS3lkdJgL/ulSI61YgkIwE6voHm vtfwMXF5Up3TEyhJUv0aqiI25gXnycnqDy/oWTFxb4xDQtJCwzuLYdv454DzB5P3YFmH cCNVQkjRjNNOttlnSKPlr5hS9uzjaRFi2WRKkL3GvqqByYyWLgSXuELf2S8/rVp78jnE s++eKKBaxpntpjtbbC4jQZEwqTcw6tjHO4R6YzeJL891474Olup56FAHTgYLOIU4OKSL bvrvzFE3eKoknQPBkL0VGskphy4q+GIBOcsvx8NLWNTHZv/ZJJkYHnbkX3w5mkc56sd5 x+hA== X-Forwarded-Encrypted: i=2; AJvYcCWPZDVRyuCiB2Gy1wmaG749byaBuDA/tc6a8Cdm0eFj+a26fE2WLHgstjeWPSD6oBrV0LmkcDd3m27py2AgQLAXZqGJu/tx0IqBxEFMqkxBOQCXJxTul46+kXDWzg== X-Gm-Message-State: AOJu0YyNDr9lXvlDxPY/dwRnrlp2fm+hZQ4S/gAlTlJnld4L+rr6LCUt 7TiUihLjZZWxyIpt79nznncg5MwG7UiTrlLHNBWgC596MolWhgKod046UEG08LXCoQ== X-Google-Smtp-Source: AGHT+IEmqUDUq7iNTcwlm3kdTLVhVSsmODgie9d0bqKMmypgHNf5amLaNis68/jf0WTHUofTFtSOxA== X-Received: by 2002:a05:6402:14d8:b0:58d:7b30:bef6 with SMTP id 4fb4d7f45d1cf-58d7b30c07cmr11281a12.37.1719997518459; Wed, 03 Jul 2024 02:05:18 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:14:b0:584:e611:3b90 with SMTP id 4fb4d7f45d1cf-58645a65156ls2673907a12.2.-pod-prod-09-eu; Wed, 03 Jul 2024 02:05:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWIfUT+62si6gNGEGTGxrVGBBVHtw8H4zGi9NlFIE9aQJQz9YAHKeEE9GZUGDr3+7XwIVcTYVTexxblgbDzHoFldpXFjzlhGXVw2Dj3mh/FgWEj X-Received: by 2002:a17:906:a091:b0:a6f:49eb:31a5 with SMTP id a640c23a62f3a-a75144b67a4mr545666566b.77.1719997516696; Wed, 03 Jul 2024 02:05:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719997516; cv=none; d=google.com; s=arc-20160816; b=b1iS2biniki/ROPw6mx1f68/iTbkfimzyIkDLE0dEbGLzHMkD7YrFPMkp5pFccrWej vqHgGhbOYvbw9/FnJb5mn4zRpDcIjYshoyWmvkcYbf7HFiQW8nJKHQgXM4R0/uSdRFso VJWTFguBmCai56GTk2hXulS+vmg0mpw6XmS9Qrr8jzB0hKacqO2dboFEnp6lII9wO6u4 ZI/vxxepL2LOg6sXyxtACKP2uXrOJu8xsa3dkERq7OD0F41dj93hZjUZFiDcglk62rFr qy5vJHo1W8tuJEJWS60FRXm/fSKKSD7OqdxlLvp52P8blJululwJ8B4n3G8DzHQgrUiD 8l5w== 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=LjmTckBV+07wWKN3HJ+3wUh9ZFw51lqArJvINqyjWlI=; fh=zDlYtxkavpla5AtZNQQrJK1SbhJLdxG6VDZoc6O0Up8=; b=PVfWh5Hx1wWBnvNM2yfPgAPVTEZvZ3cO3EA9Do1xrgQPDaF0F2kyKnwJlTtsrRN3o9 viI8gtd11OVwiJwXgSeks4iv4vAxL8P55NP8beih/iAYzlkGByoCGoqfh5B36MkhKRw+ LyrPsif+qf3UYB9IoD8zLPCd5by/5F9cUjjiaN+VfVp8WT+yZNwbP8XTOPvPA80uN8fA 3U0gBF1Vx3MGbLNogiGZGOD3BsuRXmRmz37kwS9VR+r+TrkKVvI3WrwawoNtlGM67RzG GyVy2yjVxdPqd74MuJTVlSObIF3Juzpnw9uCMHJmAVIPaB2bi9rvB24EouljeXMdStts g7Vw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=doUiLnBT; 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-a72ab1d6c08sor341279066b.12.2024.07.03.02.05.16 for (Google Transport Security); Wed, 03 Jul 2024 02:05:16 -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; AJvYcCXy0/G3KFlYP3xFF0wBKCiTsCmxDMGVjW/SaHTjUT0R9nYzGfXRc5QrDfCR8tiIJ59G+IrKAvLzMARQlve8jAyrtiAoKREE+zKYmmiB+vuf0J3S X-Received: by 2002:a17:906:5d1:b0:a72:b804:566f with SMTP id a640c23a62f3a-a75144a2809mr649662266b.52.1719997516143; Wed, 03 Jul 2024 02:05:16 -0700 (PDT) Received: from panicking.amarulasolutions.com ([2001:b07:6474:ebbf:d622:a7f3:7832:9423]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72aaf1bb6bsm491186866b.30.2024.07.03.02.05.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 02:05:15 -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 1/2] clk: clk-mux: Make public the clk_fetch_parent_index Date: Wed, 3 Jul 2024 11:05:10 +0200 Message-ID: <20240703090512.92636-2-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240703090512.92636-1-michael@amarulasolutions.com> References: <20240703090512.92636-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=doUiLnBT; 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 --- 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