From patchwork Fri Aug 31 04:45:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 10583125 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 593F6920 for ; Fri, 31 Aug 2018 04:49:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 478F82BFEE for ; Fri, 31 Aug 2018 04:49:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B65E2BFF5; Fri, 31 Aug 2018 04:49:56 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 C1EDD2BFEE for ; Fri, 31 Aug 2018 04:49:55 +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=Fl+BEVfejg7Fa0UpuIBy8akjmzz4l7Vip83ucpgzmAY=; b=u6TNVau6LruHUv nTOfVS2N0j8rz3OB3T2MECciGOstyUjx3f1PcJ8NgberfNCf9T6c2T2LYJgCYCYPjGJM12iXK4d+M m01EzR04C2KLnojMqGXvK6n7FvnnjcK+CoZoxBCbcyPZb2P2pCGGuJ3lJeXsjc+VwNDYcIfvhBFna d6gKHkYobsz9HiOHWRzmhq3pH0VrBWeJ5kcLPaDsNSPpqZtEhNNmJDsSqeYHivcZ2Ah/HLuFb/ssZ wmXjZ4FP8RFSaI3U84OFzMc5PsUUxKniOwJas34uNkXlMolRKFZFE9BHGnFLy1cyV4GkS+cqGtYo0 rzsAmXDNq06wKEkUTliQ==; 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 1fvbNV-0006FB-RD; Fri, 31 Aug 2018 04:49:49 +0000 Received: from mail-ve1eur02on062e.outbound.protection.outlook.com ([2a01:111:f400:fe06::62e] helo=EUR02-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvbNR-0006Cf-50 for linux-arm-kernel@lists.infradead.org; Fri, 31 Aug 2018 04:49:47 +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=QtCExRLW5aonuriSXlTRg565FfW8BDJ9qiAkMapuozM=; b=VAn1CnK8jGaaQAZJYYArspySA/uAMYU8UK4BqEjujmonBfv+MAaorNRL5+sL/xP/xVzFZy3w7y78Unm9cLhOINqb5NnttQBCqgZjkqpYE4HgHlppom52JLked9zyzuExnAn5waiRTV1UccG1nO6ngGYUohbJLl7FzAAtbEboEDM= Received: from b29396-OptiPlex-7040.ap.freescale.net (119.31.174.66) by AM0PR04MB4212.eurprd04.prod.outlook.com (2603:10a6:208:66::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.18; Fri, 31 Aug 2018 04:49:25 +0000 From: Dong Aisheng To: linux-clk@vger.kernel.org Subject: [PATCH V6 0/4] clk: new APIs to handle all available clocks Date: Fri, 31 Aug 2018 12:45:52 +0800 Message-Id: <1535690756-22234-1-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR03CA0061.apcprd03.prod.outlook.com (2603:1096:203:52::25) To AM0PR04MB4212.eurprd04.prod.outlook.com (2603:10a6:208:66::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b3db8f21-5011-4ba2-0ab8-08d60efd22c9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4212; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4212; 3:/An6jHlBefwQGQdiiGky2xyb0ClkMipBGoTDT7DCH3IYNkMdicENhI8/tlPFUz+7ovGtJ5vhkkVlkctivthBRYyH10Vty3/K2/0j2qj8EbfIWtBWC1gMTG8M4z07k5MkRhcQ9hjz+1PNCdxVn0kJMyX/ssKmta0fNzA29kndS3TQqGG80jPWiyTEZnuQtnIPtfdijJ6Oghje0c8rqt7Uh10rWplwnSBTXngtWXQceKImMiTX8+wQW7d+7Vw8wIeM; 25:xZEb4DiuKCcgq+IP+dCyZ4nvlF18KkOK6dSfpbewqlzNsIHIUStif+vExb/ysvTNbQXroLMtEYpOYdu52MgkyJkp2/lVlpzDbplNEvFfdTmHZcZZ75VZLP0YTeCG2MU6OzHHPjo9FxNF+rFoSw4/wYuLXv3D4LaZZGDrqkSLPWvIhV9vrXffOJpRYSr04wxz7mPFXUAYX0T7QMAOmiukUaTGWqA9DPmZG83UocS40cDNeXa2oGyjFqFnDd4zrUSpwCexU+h0mTqg7YnaaLF4+pPUqqKdILcF2bRtq7RG+OIQcXjLhBEWd47fEc0/FuSUbSSu0SDad6XDiWMa2Es4Iw==; 31:wT3o8RFeaUzo7AsRGtwzUcFV7orFDInrzmVjV9qC5bYwat6NZe+eLhQKm83sQfWYfGgtkEiTTbnzttHYO95DpWpZfIhS+w+2L/+ZJZUFTYfK8Exo+Z8QjKQu5R/A6wBCivk6OdhpHliJetUNKU4zr4r7wjQoGldRYEZzD0O/5apss9uqbNmJXnx7oNOCAHtDrXTCb2sEMUgw7Ngr33bKUcXTuiC1hizEZZu46c1idAw= X-MS-TrafficTypeDiagnostic: AM0PR04MB4212: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aisheng.dong@nxp.com; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4212; 20:EGJP3+EU9sCvYX3UwTIjNinfwkZ0HKaHtI0IMo/nJMcK0SNt44DTgHFBJrObLaHfGZfdAJvlsU3EEqQX+eSKWeYx3gny3uJVfafXymfzQovrPvDNolW4FOjkanguvaJFYivPgAsfBThfOxrcpQEAyWZvy7CHuJ8urloqt2D9fnSBed3lLZfTpEot8KKQRzywkqb2vCzRemY25A0ADD+GilIlTJOcbMf9+uJB5NTWbbB6KTZ7ZQH8h9MseA6sA63ASaI6jdhHyg0Tf8tUJhPkhHU0BePTeKS2x6Tt7DyJgq92iIfuMqOh5zZHjaCn8tk8BUJIXJakSrNhT3AjkvIb3n5VQBvAF2+S1SYJOVI/nql3Yj7B3LD5H+H70wFBH34bta3V8dNIlbvYrU28Wo/rl/P00Yu3AO3m4ieuraLnvqqoA7mTxyRrpO37HGnjubkqu/iZdQYtkN5Hw/Cbek89XUBLNXecO+VFXmgyUCmJ4kUAZ8qhnm3NqmVd8El3nvuZ; 4:TkmkCMbRCpOVPU0kwaeDLWPp8tiSE1ad0cX8LT0AwG376NbceVSE6JZQzbNDN0bp8emLuL94XMj8iNSfb6N0B6EJi47dc0WXl2J61fmrxnn/EbgmYAssENBUevTmHnL+7fBeFIGJNjCGtOiA2l7K+OjjZgBDuWK7SKm1B1NA0havfWJpUnLqngEv1wH/IW45tULBx8hLC/lGL9dfMUxk4pl4QI13wzgvcz6YkrZQvF5nb6ml24UrwqKxn8jEMESBkhPuvhBS4BdHYjUpyJ7h+w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:AM0PR04MB4212; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4212; X-Forefront-PRVS: 07817FCC2D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(396003)(366004)(39860400002)(136003)(376002)(199004)(189003)(5660300001)(26005)(52116002)(186003)(47776003)(966005)(16526019)(2351001)(2906002)(6666003)(386003)(6506007)(51416003)(53936002)(6306002)(2616005)(105586002)(486006)(25786009)(4326008)(6512007)(476003)(956004)(36756003)(66066001)(478600001)(86362001)(6486002)(106356001)(316002)(16586007)(6116002)(3846002)(50466002)(2361001)(81156014)(48376002)(7736002)(97736004)(305945005)(50226002)(81166006)(6916009)(8936002)(68736007)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4212; H:b29396-OptiPlex-7040.ap.freescale.net; 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-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4212; 23:yQBvx16o8aqE2tVcggZBVHC4ofptZda371gBe9gxz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HQvV70Sm9g91knMwdBRchjQ42f/t++ORDrO80OExwT8+GwawVX311l/hjE=; 7:z7q/D0aAy58D/yb/SKU5wFWjXEu5LVpsP95s/DFGnnphr91stKyr/evNUsSunGJj67rq88mKhDef4QCZD4dMytvRMPKmQfdaZLWnMvvz76mEokkqLS+IYXBnmv3uaUniroML+i5CvNxNE3scxccLxY42DxM3ohk8VDfsJ0PVn+OnUrrQqY8ioK4c1JZfAJ4f5EWPHaaNGcBgeQck18fNudJdj/mu6moVL0eBHyS7Al+2qnd4jsxrSEOT7U74H5tC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 04:49:25.8556 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b3db8f21-5011-4ba2-0ab8-08d60efd22c9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4212 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_214945_349600_A696EE6B X-CRM114-Status: UNSURE ( 8.91 ) X-CRM114-Notice: Please train this message. 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: Dong Aisheng , thor.thayer@linux.intel.com, sboyd@kernel.org, mturquette@baylibre.com, linux-kernel@vger.kernel.org, hdegoede@redhat.com, linux-imx@nxp.com, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org 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 This patch series is a continue of discussion from here, https://patchwork.kernel.org/patch/9986293/ that some users may want to handle all available clocks from device tree without need to know the detailed clock information likes clock numbers and names. This is useful in writing some generic drivers to handle clock part. Note: This patch series is tested on MX6Q SDB cpufreq driver with a minor change to switch to use clk_bulk_get_all. But patch 4 only test compiling. Hopefully someone could help test the function. v3->v4: * improve 'devres->clks = *clks' according to Stephen's suggestion v2->v3: * address all comments from Stephen * fix build warnings on other architectures. v1->v2: * add clk_bulk_{get|put}_all() which only supports DT platform currently * remove _all variants and the wrapper struct clk_bulk * make of_clk_bulk_get and of_clk_bulk_get_all private until someone proves they need it because they don't have a struct device pointer. Dong Aisheng (4): clk: bulk: add of_clk_bulk_get() clk: add new APIs to operate on all available clocks clk: add managed version of clk_bulk_get_all video: simplefb: switch to use clk_bulk API to simplify clock operations drivers/clk/clk-bulk.c | 80 ++++++++++++++++++++++++++++++++++++++++++ drivers/clk/clk-devres.c | 24 +++++++++++++ drivers/video/fbdev/simplefb.c | 72 ++++++++++--------------------------- include/linux/clk.h | 65 +++++++++++++++++++++++++++++++++- 4 files changed, 186 insertions(+), 55 deletions(-)