From patchwork Thu Mar 7 09:20:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 10842455 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 284C81575 for ; Thu, 7 Mar 2019 09:20:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12B5F2E589 for ; Thu, 7 Mar 2019 09:20:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10DA42EA7E; Thu, 7 Mar 2019 09:20:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 68A732EA16 for ; Thu, 7 Mar 2019 09:20:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JulqXVOcXWU329W1S7xxDAOzim4ff4NrVdPEmLRNYI0=; b=PqIjNAarznLgkB 7JCvpTu3wL1q87W42p/JD8jDwuwCN0eqTlt560WMbBTIjDgb2eRLKabrq2qQrYX9ps3tXKvo30bZ4 642Nq2liQg42XxOLH+5q4lokAMH+fjRyQBNUKylf0XCMehJWSUDR4XrVk9/bL9GWj/tMaikSbKepe 9hF3S4hKNruMHQlpQTwfbiEZlZUaD/zk4VpCtjs1aqoZnx37qMGfJEfeVCCSmAv7wHfchLx2NgrvM jWiEKDSb4xPYs7Y4qgdZFCGVo16cR3UHN+ExLpY1fMdhESAMIgIhMK9dQVNwhkcIYAoge7tfLiZuF +9x6CXvH8x0ctFMcRXZw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1pCn-0005QG-7K; Thu, 07 Mar 2019 09:20:45 +0000 Received: from mail-am5eur02on061f.outbound.protection.outlook.com ([2a01:111:f400:fe07::61f] helo=EUR02-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1pCj-0005Pm-PR for linux-arm-kernel@lists.infradead.org; Thu, 07 Mar 2019 09:20:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=55oBowp/yd8Cq40cGA1S25Yny7Uwz3XY5OIwHrC4dd4=; b=OVJyOak3kj30b5d3LSHfzwGXC7KrjSPqJYGLa8dTPrY08GvccO64dCouAwVmohgbbL+rIdQ6DbLqAZdKM0hTELnakIMqlOUlkPghejP37Tus0eST0cu1TsRdvQEpDCJ0yTYRWRbJtXm7ux8t8cCFjRIJ15M6Qwc1ccJSJjFYaY8= Received: from AM0PR04MB5779.eurprd04.prod.outlook.com (20.178.202.151) by AM0PR04MB6436.eurprd04.prod.outlook.com (20.179.252.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Thu, 7 Mar 2019 09:20:37 +0000 Received: from AM0PR04MB5779.eurprd04.prod.outlook.com ([fe80::9579:32ab:898e:6769]) by AM0PR04MB5779.eurprd04.prod.outlook.com ([fe80::9579:32ab:898e:6769%2]) with mapi id 15.20.1665.021; Thu, 7 Mar 2019 09:20:37 +0000 From: Abel Vesa To: Michael Turquette , Stephen Boyd , Sascha Hauer , Lucas Stach , Shawn Guo Subject: [RFC] clk: imx: Allow re-parenting by default on set rate Thread-Topic: [RFC] clk: imx: Allow re-parenting by default on set rate Thread-Index: AQHU1McGI7U/PNQmd0+BEjFYJ+Rc/w== Date: Thu, 7 Mar 2019 09:20:37 +0000 Message-ID: <1551950425-7346-1-git-send-email-abel.vesa@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR01CA0065.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::42) To AM0PR04MB5779.eurprd04.prod.outlook.com (2603:10a6:208:131::23) x-originating-ip: [95.76.156.53] authentication-results: spf=none (sender IP is ) smtp.mailfrom=abel.vesa@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 42e8ba8f-9293-460c-c25c-08d6a2de28cf x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB6436; x-ms-traffictypediagnostic: AM0PR04MB6436: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM0PR04MB6436; 23:y80h7hCxbtcFGT09Yg1ZiK3KXM/Ka0Dloj06TDM?= =?iso-8859-1?q?n/JYdW0xAidslGF?= =?iso-8859-1?q?hrAQ/urZ8bV7cIhMjZA/j0AIWqckTVYi73vXi9L8qzFzJ8rp5qVacUGAp4Im?= =?iso-8859-1?q?kmw5E7tB51sE8V7qfCx3S/A8SY51OfB1u6P4F2bgwlOaygIHAKqGYLrpvn0f?= =?iso-8859-1?q?h5AAUMZD/nDczFEUndcgXMusgEvk9OCb7pYQ9W30g3v4Cg69l//ddK4cv0Br?= =?iso-8859-1?q?K+KYVGBLym6hK9gSU3AT7mqoCjgThMqn6YV5NcvBfc3V8ObwiytvZvNg8e+u?= =?iso-8859-1?q?/Zk+4bBrwJ95zffetYT62AhIaIRhytgnmf6+2wXEU2qzuLl9VqoEGyA9ghoV?= =?iso-8859-1?q?el77h7rIT8NBAVgi593ze2hRdUim7qGKQabkARLPLI60vyDedd7FGTLHhchm?= =?iso-8859-1?q?YwI6q6VcS/PrSHUSkRPwPJBxf1JbTKFg6iLurorBS+8wNkhvTMdWCihcK1ZZ?= =?iso-8859-1?q?2Ipt7dhiVeLJm3Af8rTruh2ZBIolauZMf76I4nvc65wN8IlPIBaNEImvG7ND?= =?iso-8859-1?q?KnxSgl3U8qnwAHt87JShGgVMT6iANipJvTTNqPxR5ppySIBuEwVO4NA9CnC3?= =?iso-8859-1?q?ihg2pIcUbGccmbgTpX+8OlxvA3Rq+vRuPRLq4XRR7nubP08BCh6hTYsiRXp9?= =?iso-8859-1?q?hkYSlNbnXOmPcg8C49vf2KXDr/tIVORArZTD5DIaVJcFO8JVvJsEqlxaW96n?= =?iso-8859-1?q?tnnFf1ouqFAYqiaAZGXyopToWhdslRa0Iq9lNa0Lu9k58cY6WPymfPT4jsKN?= =?iso-8859-1?q?KiDMdG27D4UHBe0dREz9S0N9G3lTKmka2Z3B1+l6zUPK3Wg3uyqXSwPsIPOJ?= =?iso-8859-1?q?d+arjG389GZ5V8iiNBNudBORI9yLd8c8bBkLh8BJnk1D4r4BbV/NqrTsZfyX?= =?iso-8859-1?q?z5Z2pnXQRK2Tj68bXxCD9J/OKGlDdYt3IAG6FVm8esIKILsoKzCWdvrY8ReV?= =?iso-8859-1?q?F0QAyLqvAFOrKTplLFqHJNlaQ4xYgJICOaaWK/BDOdmYlIN/Nt4TAKbIe3g9?= =?iso-8859-1?q?j1KijvnP0L9YIAJ6fCsM7PTsvaw3mL0XH53cq4kOzr0GflgV/vWXrhg6+a1I?= =?iso-8859-1?q?NqRg5gM3lW1U87Wn+kt2eU7Zm7/IuxuSbnSBcju0oJp/wrz9LTR06ItSltip?= =?iso-8859-1?q?tA3yf5S5vA8MnjYmRCSZh0TB0M+fXZ7Njz6sniWg=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 096943F07A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(366004)(346002)(136003)(199004)(189003)(6436002)(53936002)(36756003)(305945005)(6486002)(6116002)(66066001)(478600001)(4326008)(86362001)(3846002)(7736002)(106356001)(14454004)(25786009)(5660300002)(81156014)(81166006)(8936002)(14444005)(256004)(8676002)(68736007)(99286004)(102836004)(386003)(6506007)(71190400001)(105586002)(71200400001)(52116002)(316002)(54906003)(110136005)(186003)(50226002)(486006)(44832011)(26005)(476003)(2616005)(2906002)(97736004)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB6436; H:AM0PR04MB5779.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: L72R9L2vvlsGD92rLsvNErDdzLmX+1vJxFt8hL3PdtSdmaUn5nmGOdg6EHejlaVv8Z+oPe/KomdqwVtS1URSN5MZK2h5c5j6PLY1xg8bNbDW/Mr1Xy+e59Lh4rg5sPj6p44AwpzWbEbdgok4a910aYshozVVxgd949XMFKEfeQlztigzbFFQ8kPoMztAKmpLZSmf0CCkm4mQ7h5bvjFfs+1nfXx6y2DSo4lLniAOShDhMdN31qdCdCivnhb2MOvUgnExkXLXfqvw3/oSPBLxfkponxnNvYuXlBXgWQl0qeRlic9s9UevrT32C/rWkrQAOfEBcOPbexN5XaP+Ek07orSNofkzZJfuMh3Iq8MC0d0A336k49XUDJXzd4D8uyxKxXcfJEpMyTRel4qomuQ3aPd3bNk5LUjlOlJUAxhAm1Q= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42e8ba8f-9293-460c-c25c-08d6a2de28cf X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Mar 2019 09:20:37.3769 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6436 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190307_012041_925663_676C6516 X-CRM114-Status: GOOD ( 12.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aisheng Dong , Jacky Bai , Anson Huang , Linux Kernel Mailing List , dl-linux-imx , Fabio Estevam , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Abel Vesa Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP By default, the muxes should re-parent on set_rate. This would allow the drivers to control only the leaf clock node, leaving the rest to the clock driver, that way simplifying the clock control. Signed-off-by: Abel Vesa --- drivers/clk/imx/clk.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 5748ec8..055b602 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -148,7 +148,7 @@ static inline struct clk *imx_clk_mux_ldb(const char *name, void __iomem *reg, int num_parents) { return clk_register_mux(NULL, name, parents, num_parents, - CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT, reg, + CLK_SET_RATE_PARENT, reg, shift, width, CLK_MUX_READ_ONLY, &imx_ccm_lock); } @@ -321,7 +321,7 @@ static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg, int num_parents) { return clk_register_mux(NULL, name, parents, num_parents, - CLK_SET_RATE_NO_REPARENT, reg, shift, + 0, reg, shift, width, 0, &imx_ccm_lock); } @@ -330,7 +330,7 @@ static inline struct clk *imx_clk_mux2(const char *name, void __iomem *reg, int num_parents) { return clk_register_mux(NULL, name, parents, num_parents, - CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE, + CLK_OPS_PARENT_ENABLE, reg, shift, width, 0, &imx_ccm_lock); } @@ -340,7 +340,6 @@ static inline struct clk_hw *imx_clk_hw_mux2(const char *name, void __iomem *reg int num_parents) { return clk_hw_register_mux(NULL, name, parents, num_parents, - CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE, reg, shift, width, 0, &imx_ccm_lock); } @@ -351,7 +350,7 @@ static inline struct clk *imx_clk_mux_flags(const char *name, unsigned long flags) { return clk_register_mux(NULL, name, parents, num_parents, - flags | CLK_SET_RATE_NO_REPARENT, reg, shift, width, 0, + flags, reg, shift, width, 0, &imx_ccm_lock); } @@ -361,7 +360,7 @@ static inline struct clk *imx_clk_mux2_flags(const char *name, int num_parents, unsigned long flags) { return clk_register_mux(NULL, name, parents, num_parents, - flags | CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE, + flags | CLK_OPS_PARENT_ENABLE, reg, shift, width, 0, &imx_ccm_lock); } @@ -373,7 +372,7 @@ static inline struct clk_hw *imx_clk_hw_mux_flags(const char *name, unsigned long flags) { return clk_hw_register_mux(NULL, name, parents, num_parents, - flags | CLK_SET_RATE_NO_REPARENT, + flags, reg, shift, width, 0, &imx_ccm_lock); } @@ -389,7 +388,7 @@ struct clk *imx8m_clk_composite_flags(const char *name, #define __imx8m_clk_composite(name, parent_names, reg, flags) \ imx8m_clk_composite_flags(name, parent_names, \ ARRAY_SIZE(parent_names), reg, \ - flags | CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE) + flags | CLK_OPS_PARENT_ENABLE) #define imx8m_clk_composite(name, parent_names, reg) \ __imx8m_clk_composite(name, parent_names, reg, 0)