Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757417AbdDRCTq (ORCPT ); Mon, 17 Apr 2017 22:19:46 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:43845 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754857AbdDRCTn (ORCPT ); Mon, 17 Apr 2017 22:19:43 -0400 X-IronPort-AV: E=Sophos;i="5.37,217,1488812400"; d="scan'208";a="240859414" Authentication-Results: codeaurora.org; dkim=none (message not signed) header.d=none;codeaurora.org; dmarc=none action=none header.from=renesas.com; Message-ID: <87r30qxxzb.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/3] clk: cs2000: tidyup DEVICE_CFG2 settings User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Stephen Boyd , Michael Turquette CC: , , In-Reply-To: <87tw5mxy2h.wl%kuninori.morimoto.gx@renesas.com> References: <87tw5mxy2h.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="US-ASCII" Date: Tue, 18 Apr 2017 02:19:37 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0050.jpnprd01.prod.outlook.com (10.164.161.160) To HK2PR06MB0818.apcprd06.prod.outlook.com (10.162.240.148) X-MS-Office365-Filtering-Correlation-Id: 4b37d03b-5077-4cf0-c6cc-08d486015d23 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(201703131423075)(201703031133081);SRVR:HK2PR06MB0818; X-Microsoft-Exchange-Diagnostics: 1;HK2PR06MB0818;3:TTv3LZvgQerCxcM7yfDMULOWXXLLubLPoQ8oUaa8Ybh0Uro1caQkur01e9QVSBdNA9OisTX55UBVljUcAjE/9iC13ifCv0WxHojs75TDK5pUj/EVTZCDOhrve3e1Z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GwWfT2zaiHV2WGK44cc1y4UVZH+R0e1IzAuzIvJQngqtk7+PpJa32reJ9TnT/q3/YgedZ7CaUAvhGYsaILmphyzR1n8QA5MmqbFjz8THewNp+Cv/cZ4daebkgCBrvTHb0KNDuAYWgF8jVOSxa+HirAqYZ+OaOMTlXcAZnTunBHPnIKmGR/5H9ReUd+5HGRg2s/eskAG3xsC6U6BZc0YV/l/RR+G3GmfUEPHQnuxMJq/nX+acnw9npLidcgb4XIF+Fk+cCxU78yz0WoswBk1jh3tUFoPOnMgK1nSxPpe4ejHCPLxq6Y74xqI8bJ3P5xxFclkCmcVSXiWf62kC9RsA+9eQh/bzLq39ViK9yrHk0+I+9HHaJh9RHXWFQZUPGL8on6lpCsZE5QuEOYdgyWr+7xh+oM/wI1lEUjZCOafg6GJ2knutLoI+P7Dh22/8EVtW X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(6072148);SRVR:HK2PR06MB0818;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB0818; X-Microsoft-Exchange-Diagnostics: 1;HK2PR06MB0818;4://t5/xdlwr7MUHjk7vY+vewF14KI3H+c0tD5QPYf+JYTbx5pavROjj+UYnlhBUV/IIXOb2eefw5cvepDLgEaVBIJOD93KsV2JojgIhfPJZJVFSslIj2g/SkxCswktESuqzE/2BeJVgG/gT2mCVCjzxPSyOLg83prB0xl0VkaEoROt1Dl5sUs7p0+QvnVy8lE7MMjoj3Uz8IzwimGr/x01uzUJcRTlRZFylHtHTVoswNDzB725n5MN/JkoaJWqGmChaTnuu8+yfuSDanm02e/qR1dKidSP033Kcon48IizXw0LTcOglnPF0ZtTHbKj2wBC9LuFCUwch/iaUzx3qSny86ZnFacyHpFnZijVXEQyS9gVg/eUyDFosgjUUgumWxa5tojZWy05NIyJkuNRVfTEAIlEgOdRq0qRgrR/vz/umcIMAIsGoOmlvY+rNcV9W0mFhjbqUsWC812CHVGlb+T3pv4Ax49x9fKjVATNUhT0jKwVNqFLrNQlJzhxcbD/DLXmpaDNaW0T8IFM6KAF6Mn7JAIH69v8Njpy9lZu4I6qb1dLlhMDbh7OvZ//EaaurB7GPjb/xKvE5V96aGL4IcMBKgYeeJmNM/cpiY+H6LyKCTsTa9iy7ic+aAOuC8UjRqBlF7wiHm0Crr2k1HrG0W8QVrkVg4Z1yVI5RCpqUagHbFGf/dau1eyGfB+w861h/Xc9lJMuMR/S0TFK+LpAC+pXoac81vz4OseH6C5wSQuUuI= X-Forefront-PRVS: 028166BF91 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(39850400002)(39410400002)(39860400002)(39400400002)(39840400002)(39450400003)(83506001)(305945005)(6486002)(54906002)(2906002)(38730400002)(6116002)(575784001)(81166006)(25786009)(3846002)(86362001)(23726003)(8676002)(4326008)(53936002)(189998001)(2950100002)(53416004)(76176999)(50986999)(4001350100001)(42186005)(54356999)(7736002)(66066001)(50466002)(33646002)(47776003)(5660300001)(36756003)(16060500001);DIR:OUT;SFP:1102;SCL:1;SRVR:HK2PR06MB0818;H:morimoto-PC.renesas.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HK2PR06MB0818;23:kuFdnxfZCc70JCToA8vAWkFWSxcfX9AklQFn/6AuT?= =?us-ascii?Q?/B5NNLRX4TdEoRz29ggBipATEp7yEn9u3KUnJr5KQApnLRVlYUdt3ahWERFH?= =?us-ascii?Q?5FmXeA1m+uIqDkDP20fl9wFUaMdj4/IlPX5hVrArh2Djq5WA/dHlGfYE03sK?= =?us-ascii?Q?DhVZHTLPk276EFZtDVXkc6N69XApo0zZ2Gwjnffnrl8X82sOXDozP++G4kAc?= =?us-ascii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PefdKXBToYShod5pM1YewaDyPwVStttySic0KDCfUPTLVOJt3Chv9elhr6zfvMRA6I1Tcvt6LbgFT1pU7tknpD6fAjAKubKD5qzgWOu3C7ca0cZc2EQ==;20:DuaGZ6wLKP080Upfo1z88C6Fw7qOTvjiJULsxox3ovJvw/u7I941vhIwpgzuPoz5JFrf5Lwq27b+6utAM9u2meZC0JkqjWurPj/bfkzLQteKKkJ3smd0js9f/UMcp2/5R8W4x0lWpFHOOu9WmbYa5MQ29JnovNGHZqyvdEXpVIE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2017 02:19:37.6223 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0818 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1412 Lines: 45 From: Kuninori Morimoto DEVICE_CFG2 can select ratio from user defined ratio and LOCKCLK is for it. But current driver sets fixed 0 value. This patch fixes it. Note is that current cs2000 driver is using/supporting only ratio0 (= ch0) now. DEVICE_CFG2 can select STATIC/DYNAMIC ratio mode, and current cs2000 driver is selecting STATIC mode, but it was not understandable on current code. This patch also solve this issue. Signed-off-by: Kuninori Morimoto --- drivers/clk/clk-cs2000-cp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-cs2000-cp.c b/drivers/clk/clk-cs2000-cp.c index a8fa6bd..f3ab0ca 100644 --- a/drivers/clk/clk-cs2000-cp.c +++ b/drivers/clk/clk-cs2000-cp.c @@ -48,7 +48,9 @@ #define AUTORMOD (1 << 3) #define LOCKCLK(x) (((x) & 0x3) << 1) #define LOCKCLK_MASK LOCKCLK(0x3) -#define FRACNSRC (1 << 0) +#define FRACNSRC_MASK (1 << 0) +#define FRACNSRC_STATIC (0 << 0) +#define FRACNSRC_DYNAMIC (1 << 1) /* GLOBAL_CFG */ #define ENDEV2 (0x1) @@ -267,8 +269,8 @@ static int cs2000_ratio_select(struct cs2000_priv *priv, int ch) return ret; ret = cs2000_bset(priv, DEVICE_CFG2, - (AUTORMOD | LOCKCLK_MASK | FRACNSRC), - 0); + (AUTORMOD | LOCKCLK_MASK | FRACNSRC_MASK), + (LOCKCLK(ch) | FRACNSRC_STATIC)); if (ret < 0) return ret; -- 1.9.1