From patchwork Wed Oct 10 02:16:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10633851 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 0382E112B for ; Wed, 10 Oct 2018 02:16:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3B0B29DB3 for ; Wed, 10 Oct 2018 02:16:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D457629DDD; Wed, 10 Oct 2018 02:16:41 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6302F29DB3 for ; Wed, 10 Oct 2018 02:16:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727284AbeJJJgc (ORCPT ); Wed, 10 Oct 2018 05:36:32 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:54103 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727193AbeJJJgc (ORCPT ); Wed, 10 Oct 2018 05:36:32 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 10 Oct 2018 11:16:37 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id E154474C47; Wed, 10 Oct 2018 11:16:36 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.54,362,1534777200"; d="scan'208";a="293131789" Received: from mail-os2jpn01lp0152.outbound.protection.outlook.com (HELO JPN01-OS2-obe.outbound.protection.outlook.com) ([23.103.139.152]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Oct 2018 11:16:36 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+yFsIHr27uwGUcljfJclW5M0wOWeEepm/kegbwsuMIg=; b=PCaxcJZxVJEF8yGE2kWyR72BO1S0nrpMy7UCGyuw1t6BS9Ug0ewULiLxc5y7RZxBA169ohUkP6sC0YCVXfShPc48B8IJUxRwCtS2yJUev2KLmjQ52fiPUh6RS66WmjGqE84itTSRta2zq4y67zGLfeQk5UyEGGSBZ/9wL4WVPxM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.130) by TYXPR01MB1870.jpnprd01.prod.outlook.com (2603:1096:403:b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.23; Wed, 10 Oct 2018 02:16:35 +0000 Message-ID: <87d0si1rkt.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 1/2] dt-bindings: clock: add description of 74aup1g157gw User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") To: Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <87efcy1rm4.wl-kuninori.morimoto.gx@renesas.com> References: <87efcy1rm4.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 10 Oct 2018 02:16:35 +0000 X-Originating-IP: [211.11.155.130] X-ClientProxiedBy: KAXPR01CA0047.jpnprd01.prod.outlook.com (2603:1096:402:1a::33) To TYXPR01MB1870.jpnprd01.prod.outlook.com (2603:1096:403:b::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5fa4604-e76e-456c-b436-08d62e566721 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:TYXPR01MB1870; X-Microsoft-Exchange-Diagnostics: 1;TYXPR01MB1870;3:LwBjoxJwubJyBq2eri4fFkeOnO9/xoMb3SQMr8mjGzxjvNn1IkfbZM4PZTfKOCysCmAI5d7HUb9X/CRwew0vYIHvVc2m9TT0kMyrdTInuC8+0YPmIME1lkmyO8WUfzl7pAnBvjDTGr5Krhvh82faf973py09eYSTL8CR/Fc5TAoMf9crozlep1k5j618XyNiHQlnXuIeVU2McgGwP7ZsxaJ1og6hsjs5DzsvYwCczpn9YN5xYzSb7iasu/sAVYzi;25:HwH8K+Ef4pCXVXoaax/W6HkIooAj+PGXXvDc/926kWajqVZkoW1HsLAWhFN5mHCeTdjVjW/CGbewsRILQdjJ2kNPwK91RXubwkdAqd1vfu0cK7PbXlMcjd0FG+8vKYgORJU7XIGI7uTE4d4pj1exJN0mhC1E9qojjlHH16h95JRpr88Jc+6MtDq0xp+lfvlycZXyIyPfcLbaXKqQ34R4jd14tdYBBkh+ufjGmaSUMHqyQw4cF9eeujSuQtGF+1U6uJuzv9UQZEpg+WjzZhROCuhsX/C93JY31sHaLf1gMuG/9grgdOnGOMWSO0zjpl+E0ly38+2l0LRhx/ugsf3X5g==;31:0B5en2G26sroy34CTVxBT1ysUqfktQ/7KynNYHhFDhxh3Fg8cYECl5l6adjZiVSf1Nbq8qKiuzkqRHUe9cS9dlC4WLwHyCXz4vlrYWHXq9DLVSm+auWY2Jxkclw36zaemFHHwj2uDvzjPTgyzVTwUKaz+zxGetKsZX2uwje1PTmGKQtBg0IW+W3Xes/qNuMl9+amVx+VrfOpRm5GspNW8BLMMovVomDmS+BXNID6+bE= X-MS-TrafficTypeDiagnostic: TYXPR01MB1870: X-Microsoft-Exchange-Diagnostics: 1;TYXPR01MB1870;20:QncC290J9I1CZZjXLDG/Y3bw3hjgBycv41kMrwK4GpEMTvI/A3tFrYLPxwXEnZrEWl0zPugyRuFxHUj10Sl1dCcj6OMUc8AO46xmw+YnkvTQwKe3INod551ove7II3Bz4vl0xjmNgbZwhP7SHNMpowspgYXz3A+jU9Q6equn6q7gUxrzs+6VAC5uBMiBrmdFVYEtcmN5Y8x6C3xczzjRFAFHz52X2oHptSidtdu/PiGrNVlNqvIz7t+h3/csm3trFWYs9YoVWqGbmV2YCunWZSxZ1LYFnhBMUuWwv16C2HaS2OGDH8sJsne2YRBL5XCAa5fJY/oBDumiIvVSj6/80c0QgTIPWSrjZ5i4tPALU7y5eTriUJoYjWB7LsTZGbAU3C3WM8C/eXXslubTPXV36GHv7t9oCHfjNKL61rxQ6VZnYLmounVLJjUNju+/ItaZ0wjPRONx3mxCktNdL2aCIjdKxoYAFh8+i9jtEZK2rpls0hiSsrXjMFrU4Ie76ZII;4:TOjj8+5pEt+SFar6JTUiskU6fBl9yzKLCv98QvNVUkM54jD600XlW/L3y7f36NR6n2/vmCEaTafXIYlBiff3A0JdrZE+TviORk52egFQQCNaQY/TebP7rRp9hOyGDMAJI1aZKDJNCf2/gC/VuhqyOoADaDS4csSfazqyltyFVw9bOucRGFu1Ilr2BO1hWdJb/WjJJIgzRTlsiqAu5cz0CsGCIB17SMtB91pX3AST157u05JxDWFGZG9HgnEdU9P7+pwco/7BitwILdOgiGXU9w== 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)(93006095)(93001095)(10201501046)(3231355)(944501410)(52105095)(3002001)(6055026)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699051);SRVR:TYXPR01MB1870;BCL:0;PCL:0;RULEID:;SRVR:TYXPR01MB1870; X-Forefront-PRVS: 08213D42D3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(366004)(376002)(39860400002)(346002)(136003)(396003)(189003)(199004)(53936002)(86362001)(4326008)(8676002)(81156014)(58126008)(69596002)(81166006)(68736007)(110136005)(53416004)(386003)(66066001)(105586002)(7696005)(47776003)(52116002)(106356001)(76176011)(16526019)(6486002)(2906002)(8936002)(3846002)(6116002)(7736002)(23726003)(26005)(186003)(305945005)(486006)(476003)(16586007)(36756003)(50466002)(97736004)(25786009)(2616005)(446003)(316002)(11346002)(478600001)(956004)(5660300001)(16060500001);DIR:OUT;SFP:1102;SCL:1;SRVR:TYXPR01MB1870;H:morimoto-PC.renesas.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;TYXPR01MB1870;23:aIFWfRvwWL20wyXqFve935PrnZXZuqA34T3GTCjX9addPzPWWR8USjGPBCdHvatjbSUrA7Jyz09taXit8LaC2NPTTZ3XKhNZNSGDBDWqP6Fh4lIplUDRLgGXLn9FViDTXjU/DJvBbghvW2kYR1s9lGKnTKMv4vnAmrp746CNrKHecvaTKptjHmuMBHQeTmkGOh5FNDHjN4s0SxUuTt7SIgZtYFuAiR02I0CQ9Okin8a40v02pLx8rFcHrWvRQEjKWSCtkpuSi+FUIIPwcjoquT4aFC6F7cslO9IMlk36Dz/vym3zvbBrrXXWHuF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ft7CgPLvOMLLOvI+iQzRxx9ReYF5f7BJrsCrisB5N14mg9gObQ4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;TYXPR01MB1870;20:e0fktDWdF50qNhBIcjS+dYvE8/KRCRh7seb8iL+rDIqMLB1Ku2DsFrqiGjlc/R2+xrtMMXzMtXsj/6TnEOaFflYeJm6eywqf6Xk8lVg+hmnf+noj2DulAjlOduwdmGdykN5NARgPB7l43dFDRVbgsKLwLj+DpJmJoCMF59cb0tk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2018 02:16:35.0460 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d5fa4604-e76e-456c-b436-08d62e566721 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYXPR01MB1870 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto 74aup1g157gw needs i0 and i1 pin as input, select and output it by sel gpio pin. This patch adds description for 74aup1g157gw as clock multiplexer. "nxp,74aup1g157gw-clk" will select most closest input as output, "nxp,74aup1g157gw-audio-clk" will select 48kHz/44.1kHz categorized input as output. Signed-off-by: Kuninori Morimoto --- .../devicetree/bindings/clock/nxp,74aup1g157gw.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/nxp,74aup1g157gw.txt diff --git a/Documentation/devicetree/bindings/clock/nxp,74aup1g157gw.txt b/Documentation/devicetree/bindings/clock/nxp,74aup1g157gw.txt new file mode 100644 index 0000000..d07bc04 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/nxp,74aup1g157gw.txt @@ -0,0 +1,19 @@ +NXP 74AUP1G157GW Low-power 2-input multiplexer for clock + +Required properties: +- compatible: "nxp,74aup1g157gw-clk" (select closest input as output) + "nxp,74aup1g157gw-audio-clk (select 48kHz / 44.1kHz as output) +- clocks: select input clock as i0, i1 +- clock-names: "i0" and "i1" +- sel-gpios: selector pin + +Examples: + + clk { + #clock-cells = <0>; + compatible = "nxp,74aup1g157gw-audio-clk"; + clocks = <&clk8snd>, <&clksnd>; + clock-names = "i0", "i1"; + sel-gpios = <&gpio_exp_75 13 GPIO_ACTIVE_HIGH>; + }; + From patchwork Wed Oct 10 02:16:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10633853 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 833F114DB for ; Wed, 10 Oct 2018 02:16:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7185329DC8 for ; Wed, 10 Oct 2018 02:16:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64B4429DB3; Wed, 10 Oct 2018 02:16:55 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A717629DB3 for ; Wed, 10 Oct 2018 02:16:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727166AbeJJJgp (ORCPT ); Wed, 10 Oct 2018 05:36:45 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:24720 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727160AbeJJJgp (ORCPT ); Wed, 10 Oct 2018 05:36:45 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 10 Oct 2018 11:16:50 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id E674078130; Wed, 10 Oct 2018 11:16:50 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.54,362,1534777200"; d="scan'208";a="294715697" Received: from mail-os2jpn01lp0152.outbound.protection.outlook.com (HELO JPN01-OS2-obe.outbound.protection.outlook.com) ([23.103.139.152]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 10 Oct 2018 11:16:50 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2tz/COKT1TGQJDq2H5ier8QM2Ui9vC9MhROR2qZIMPA=; b=hMWWnw2qcwsht/vYR/8EjlEyIjwO4NOko+WHB70vfSQ5c2ZxGj7xlOt2mSybZ6Wd13AHGVv+HIMzRC1jYN2JXkw1TEb2p2l2RcNIXoSO4wcDbZVjd5i8NYKB4tdTkx1muuZeUyxHajh0HKk6Spe8+A7pIXEwi06CSV8ghTI7VEM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.130) by TY1PR01MB1866.jpnprd01.prod.outlook.com (2603:1096:403:2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.23; Wed, 10 Oct 2018 02:16:48 +0000 Message-ID: <87bm821rkf.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/2] clk: add 74aup1g157gw 2-input multiplexer as clock driver User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") To: Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <87efcy1rm4.wl-kuninori.morimoto.gx@renesas.com> References: <87efcy1rm4.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 10 Oct 2018 02:16:48 +0000 X-Originating-IP: [211.11.155.130] X-ClientProxiedBy: TY1PR01CA0184.jpnprd01.prod.outlook.com (2603:1096:403::14) To TY1PR01MB1866.jpnprd01.prod.outlook.com (2603:1096:403:2::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b4d7e77b-0d6c-452a-fc6d-08d62e566f0d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:TY1PR01MB1866; X-Microsoft-Exchange-Diagnostics: 1;TY1PR01MB1866;3:BIJRvNmsY5TeKIKPGUEbqtk+BbSB4C9ufiuZycaDM7W+2qQhe5vbko2JIAwvRVyz+REYbJritkqJ4Bi9USGTWgcwyHj1mL2xCqhL24a9AVh1waDgrRqR8Bmr3eOI2DGJgkDAK06jo9dd937RNXJCoBspSw5rVTVt96lZ8H3olV0MC/Ofk1Istf4Xz8MK9tTTwxbK9JSsYsNH7CzIDdD+ZOh2OVIFrBmFaCWJxs4Z+lnq9iIeoFPlLvZz0aSy00/v;25:8Lg0SRqX5Cq9tajbEbf5VGoWbgKU9FtdsY98ZaBW3wMcxPvp+gViNgQgg1spSH8M5UMlZ2ONrpRQTsjiK9xt5uXG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1Nz;4:TcUSTjARUyNj7F/DZnKZcP/fcl0AVRLkvLtiO11sZB/5hH5SH9HRdosSqw3+k0Wd37G12OEjyXvlhKEMtFh53kqKELihLRnXjKzKePmJ5sh5aHWUEHgaMapj/KFmbJiEAP6zPcWLawO//WsyWDenB7ofD2mA2JZjOek7Put9aGqDMuzoh2E558YulbRZrB041Oc/NU+rAufcqqKsuPRKkg4DL3LLPd8XePdwWqfkbCsA+Co22rmXo20smTTLLbQbzHaUHWLl9gNWt0u63TpPFA== 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)(93006095)(93001095)(3002001)(10201501046)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051);SRVR:TY1PR01MB1866;BCL:0;PCL:0;RULEID:;SRVR:TY1PR01MB1866; X-Forefront-PRVS: 08213D42D3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(366004)(136003)(376002)(346002)(189003)(199004)(16526019)(8676002)(81166006)(7736002)(446003)(8936002)(575784001)(186003)(14444005)(81156014)(305945005)(4326008)(50466002)(486006)(36756003)(2616005)(26005)(86362001)(956004)(68736007)(476003)(47776003)(97736004)(11346002)(66066001)(386003)(478600001)(7696005)(23726003)(5660300001)(53936002)(3846002)(6116002)(110136005)(16586007)(316002)(106356001)(52116002)(76176011)(2906002)(58126008)(53416004)(105586002)(6486002)(25786009)(69596002)(16060500001);DIR:OUT;SFP:1102;SCL:1;SRVR:TY1PR01MB1866;H:morimoto-PC.renesas.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) X-Microsoft-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uY7gqlFz35QYqAxyw==;5:ZwQYzUugEmWADmRfbLHc4TqQ7sdClQb3oyoSUH4BVCo7bmJ7SYmlwmoV+rxsYJSAxULRaP+Fxgc3vbwPpAR8MuilmgtZbV+1bdKG3aUhN+pmlKBJYuKIT05X6USI3CsGRQqSTm4l2v+Xm2Z8vCxKaAaYM1Jp00KwMKTsC5IuTnY=;7:p1oc72vK9VHz2SeetK6pqCmeOVeczcFysr5fjj02oocy3tswLmSHGrl7IvEpKhg3mTvh7bgv69lyi9bl/2vVrq29lXKFwtlU8j7OvpGn8JcO7pJE5JyasiVAV8Z60DkuHmw8jGCL0oSQO6pgHZvqKPFSZNlt66K9iLpPmjOOhGr7WNm5EFJRoSFKu2ROiOekT7U3hnNxWdnUBgbXzt4MCTbJ/8HSEhkidk9nvAXL2i+RSAkJz7TsF/4iwIYYQroU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;TY1PR01MB1866;20:JVH7FUvIkHeUWcibdUcomxh/hUoo5AfKtaLmthnCg9T9EZJ6OuOcPBzKCfwh+XjxL+c+lsVfTJmJlqj+OBQ8B3J3JMHexMtCzzPktfDlLEyIn+8ngZ73X+KezfulYrfalH1pxLG8dY0UBFmiJPGqz9lUm14ZjChSJieNnClG8l8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2018 02:16:48.3926 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b4d7e77b-0d6c-452a-fc6d-08d62e566f0d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1PR01MB1866 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto 74aup1g157gw needs i0 and i1 pin as input, select and output it by sel gpio pin. This driver adds new 74aup1g157gw as clock multiplexer. "nxp,74aup1g157gw-clk" will select most closest input as output, "nxp,74aup1g157gw-audio-clk" will select 48kHz/44.1kHz categorized input as output. Signed-off-by: Kuninori Morimoto --- drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 2 +- drivers/clk/nxp/Kconfig | 4 + drivers/clk/nxp/Makefile | 1 + drivers/clk/nxp/clk-74aup1g157gw.c | 213 +++++++++++++++++++++++++++++++++++++ 5 files changed, 220 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/nxp/Kconfig create mode 100644 drivers/clk/nxp/clk-74aup1g157gw.c diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index 292056b..9cfeb0e 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -299,5 +299,6 @@ source "drivers/clk/sunxi-ng/Kconfig" source "drivers/clk/tegra/Kconfig" source "drivers/clk/ti/Kconfig" source "drivers/clk/uniphier/Kconfig" +source "drivers/clk/nxp/Kconfig" endmenu diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index ed344eb..fcfd42a 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -84,7 +84,7 @@ obj-$(CONFIG_ARCH_MMP) += mmp/ endif obj-y += mvebu/ obj-$(CONFIG_ARCH_MXS) += mxs/ -obj-$(CONFIG_COMMON_CLK_NXP) += nxp/ +obj-y += nxp/ obj-$(CONFIG_MACH_PISTACHIO) += pistachio/ obj-$(CONFIG_COMMON_CLK_PXA) += pxa/ obj-$(CONFIG_COMMON_CLK_QCOM) += qcom/ diff --git a/drivers/clk/nxp/Kconfig b/drivers/clk/nxp/Kconfig new file mode 100644 index 0000000..44c8fed --- /dev/null +++ b/drivers/clk/nxp/Kconfig @@ -0,0 +1,4 @@ +config CLK_74AUP1G157GW + tristate "NXP 74AUP1G157GW Low-power 2-input multiplexer support as clock" + help + This enables NXP 74AUP1G157GW 2-input multiplexer as clock driver diff --git a/drivers/clk/nxp/Makefile b/drivers/clk/nxp/Makefile index d456ee6..2965bdd 100644 --- a/drivers/clk/nxp/Makefile +++ b/drivers/clk/nxp/Makefile @@ -2,3 +2,4 @@ obj-$(CONFIG_ARCH_LPC18XX) += clk-lpc18xx-cgu.o obj-$(CONFIG_ARCH_LPC18XX) += clk-lpc18xx-ccu.o obj-$(CONFIG_ARCH_LPC18XX) += clk-lpc18xx-creg.o obj-$(CONFIG_ARCH_LPC32XX) += clk-lpc32xx.o +obj-$(CONFIG_CLK_74AUP1G157GW) += clk-74aup1g157gw.o diff --git a/drivers/clk/nxp/clk-74aup1g157gw.c b/drivers/clk/nxp/clk-74aup1g157gw.c new file mode 100644 index 0000000..78199bb --- /dev/null +++ b/drivers/clk/nxp/clk-74aup1g157gw.c @@ -0,0 +1,213 @@ +// SPDX-License-Identifier: GPL-2.0 +// +// Copyright (C) 2018 Renesas Solutions Corp. +// Kuninori Morimoto +// +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define CLK_I_NUM 2 +struct clk_priv { + struct clk_hw hw; + struct device *dev; + struct clk *i[CLK_I_NUM]; + struct gpio_desc *sel; + long (*round_rate)(struct clk_hw *hw, unsigned long rate, + unsigned long *parent_rate); +}; +#define hw_to_priv(_hw) container_of(_hw, struct clk_priv, hw) +#define priv_to_dev(priv) priv->dev +#define for_each_iclk(i) \ + for ((i) = 0; (i) < CLK_I_NUM; (i)++) + +static int clk74_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) +{ + struct clk_priv *priv = hw_to_priv(hw); + struct device *dev = priv_to_dev(priv); + int i; + + for_each_iclk(i) { + if (rate == clk_get_rate(priv->i[i])) { + dev_dbg(dev, "set rate %lu as i%d\n", rate, i); + gpiod_set_value_cansleep(priv->sel, i); + return 0; + } + } + + dev_err(dev, "unsupported rate %lu\n", rate); + return -EIO; +} + +static long clk74_round_rate_close(struct clk_hw *hw, unsigned long rate, + unsigned long *parent_rate) +{ + struct clk_priv *priv = hw_to_priv(hw); + struct device *dev = priv_to_dev(priv); + unsigned long min = ~0; + unsigned long ret = 0; + int i; + + /* + * select closest rate + */ + for_each_iclk(i) { + unsigned long irate = clk_get_rate(priv->i[i]); + unsigned long diff = abs(rate - irate); + + if (min > diff) { + min = diff; + ret = irate; + } + } + + dev_dbg(dev, "(close)round rate %lu\n", ret); + + return ret; +} + +static long clk74_round_rate_audio(struct clk_hw *hw, unsigned long rate, + unsigned long *parent_rate) +{ + struct clk_priv *priv = hw_to_priv(hw); + struct device *dev = priv_to_dev(priv); + unsigned long ret = 0; + int is_8k = 0; + int i; + + /* + * select 48kHz or 44.1kHz category rate + */ + if (!(rate % 8000)) + is_8k = 1; + + for_each_iclk(i) { + unsigned long irate = clk_get_rate(priv->i[i]); + + if (( is_8k && !(irate % 8000)) || + (!is_8k && (irate % 8000))) { + ret = irate; + } + } + + dev_dbg(dev, "(audio)round rate %lu\n", ret); + + return ret; +} + +static long clk74_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *parent_rate) +{ + struct clk_priv *priv = hw_to_priv(hw); + + return priv->round_rate(hw, rate, parent_rate); +} + +static unsigned long clk74_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct clk_priv *priv = hw_to_priv(hw); + struct device *dev = priv_to_dev(priv); + unsigned long rate; + int i = gpiod_get_raw_value_cansleep(priv->sel); + + rate = clk_get_rate(priv->i[i]); + + dev_dbg(dev, "recalc rate %lu as i%d\n", rate, i); + + return rate; +} + +static u8 clk74_get_parent(struct clk_hw *hw) +{ + struct clk_priv *priv = hw_to_priv(hw); + + return gpiod_get_raw_value_cansleep(priv->sel); +} + +static const struct clk_ops clk74_ops = { + .set_rate = clk74_set_rate, + .round_rate = clk74_round_rate, + .recalc_rate = clk74_recalc_rate, + .get_parent = clk74_get_parent, +}; + +static const char * const clk74_in_name[CLK_I_NUM] = { + "i0", + "i1", +}; + +static int clk74_probe(struct platform_device *pdev) +{ + struct clk *clk; + struct clk_init_data init; + struct clk_priv *priv; + struct device *dev = &pdev->dev; + const char *parent_names[CLK_I_NUM]; + int i, ret; + + priv = kzalloc(sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENODEV; + + for_each_iclk(i) { + clk = devm_clk_get(dev, clk74_in_name[i]); + if (IS_ERR(clk)) + return -EPROBE_DEFER; + priv->i[i] = clk; + parent_names[i] = __clk_get_name(clk); + } + + memset(&init, 0, sizeof(init)); + init.name = "74aup1g157gw"; + init.ops = &clk74_ops; + init.parent_names = parent_names; + init.num_parents = CLK_I_NUM; + + priv->hw.init = &init; + priv->dev = dev; + priv->round_rate = of_device_get_match_data(dev); + priv->sel = devm_gpiod_get(dev, "sel", 0); + if (IS_ERR(priv->sel)) + return -EPROBE_DEFER; + + gpiod_direction_output(priv->sel, 0); + + ret = devm_clk_hw_register(dev, &priv->hw); + if (ret < 0) + return ret; + + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, &priv->hw); + if (ret < 0) + return ret; + + platform_set_drvdata(pdev, priv); + + dev_info(dev, "probed\n"); + + return 0; +} + +#define OF_ID(name, func) { .compatible = name, .data = func } +static const struct of_device_id clk74_of_match[] = { + OF_ID("nxp,74aup1g157gw-clk", clk74_round_rate_close), + OF_ID("nxp,74aup1g157gw-audio-clk", clk74_round_rate_audio), + { } +}; +MODULE_DEVICE_TABLE(of, clk74_of_match); + +static struct platform_driver clk74_driver = { + .driver = { + .name = "74aup1g157gw", + .of_match_table = clk74_of_match, + }, + .probe = clk74_probe, +}; +builtin_platform_driver(clk74_driver);