From patchwork Thu Dec 2 07:28:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alain Volmat X-Patchwork-Id: 12694447 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58F22C433F5 for ; Thu, 2 Dec 2021 07:31:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wX9D2ZTDRVSwdzlpWvMQZp415pTEGeliriAQ77gVEIU=; b=4IYU3JHmVjW3iZ PfWIXPYiaaRYyWjbzRKCLDEoblszyaRDyaxAD8992ejBfVzDSSzy9Rwz1fhYEBQGM0/sZKurT+qR4 Ob+D9O63uWVaf9DTetoySI7QTWvZd140gPI0gbrMaeGpmh5tdaHCoBUF6UzYxYgx910uYwN1O5gS6 7uwl2GO2VJfQOTWXIKlsKveaWWu0y1IfOiqTRN81N1+lc63h1PKNmgwmFJUF7kLtSprm9syvIODvy 1CPJi/gfAFFKjMGseSlogeYr9a5xl2aZBa66hUrCMUCNwfrE9t+zaf5AxyUwd/kdHZmumF/y0fz3Z zc0S5/BreyncSY2US/Xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1msgX1-00BBWn-To; Thu, 02 Dec 2021 07:29:28 +0000 Received: from st43p00im-ztbu10063701.me.com ([17.58.63.178]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1msgWq-00BBUA-6j for linux-arm-kernel@lists.infradead.org; Thu, 02 Dec 2021 07:29:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1638430154; bh=0DrK59zmZ/s+Xx7NIv/Tj8gNBGopWg8sxyxeNU5Pn9U=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=JTog/7yQj4Ro+JmTU4BIzoE1xy6I3J4pIpQqTW1Rkv9gHIrAO1oB4Cw4Bw8EGkx9T DuRicDpZQ/5d82LXUJDHv/wCQrJls4RuOnuSzy7zoXuWc6670BqhIhJc4xS2NCQHfD 5kiIUre/ZTm43zRgP9XBPtPdAi4Sdv6HU4+0/k4tCqSyvX01dIyJb11uU8+LsFPudD Ygkqz70aaY0uRos0GKiKE1A9N0RAilbLDdeJ4eCq9k2vFZC0qNRIY74+bhoVqWGIDr JFJRBnyAk9jRCcBkAHk4x3EW4Bvhc9N039y6XYJzZ0e1GP7y0SN8Rqcfrr/loNArU+ BeM8Lj/4mWSuA== Received: from localhost (101.220.150.77.rev.sfr.net [77.150.220.101]) by st43p00im-ztbu10063701.me.com (Postfix) with ESMTPSA id ED4A99A07FE; Thu, 2 Dec 2021 07:29:13 +0000 (UTC) From: Alain Volmat To: Michael Turquette , Stephen Boyd , Rob Herring , Patrice Chotard Cc: Lee Jones , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Alain Volmat Subject: [PATCH 1/2] clk: st: clkgen-fsyn: search reg within node or parent Date: Thu, 2 Dec 2021 08:28:49 +0100 Message-Id: <20211202072850.194314-2-avolmat@me.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211202072850.194314-1-avolmat@me.com> References: <20211202072850.194314-1-avolmat@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.790 definitions=2021-12-01_01:2021-11-30, 2021-11-30 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2009150000 definitions=main-2112020043 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211201_232916_346303_C5D61083 X-CRM114-Status: GOOD ( 15.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In order to avoid having duplicated addresses within the DT, only have one unit-address per clockgen and each driver within the clockgen should look at the parent node (overall clockgen) to figure out the reg property. Such behavior is already in place in other STi platform clock drivers such as clk-flexgen and clkgen-pll. Keep backward compatibility by first looking at reg within the node before looking into the parent node. Signed-off-by: Alain Volmat Reviewed-by: Patrice Chotard --- drivers/clk/st/clkgen-fsyn.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/clk/st/clkgen-fsyn.c b/drivers/clk/st/clkgen-fsyn.c index 164285d6be97..0d41164f2c7f 100644 --- a/drivers/clk/st/clkgen-fsyn.c +++ b/drivers/clk/st/clkgen-fsyn.c @@ -988,9 +988,16 @@ static void __init st_of_quadfs_setup(struct device_node *np, void __iomem *reg; spinlock_t *lock; + /* + * First check for reg property within the node to keep backward + * compatibility, then if reg doesn't exist look at the parent node + */ reg = of_iomap(np, 0); - if (!reg) - return; + if (!reg) { + reg = of_iomap(of_get_parent(np), 0); + if (!reg) + return; + } clk_parent_name = of_clk_get_parent_name(np, 0); if (!clk_parent_name)