From patchwork Wed Apr 19 17:46:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 9688491 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BD0FB602DC for ; Wed, 19 Apr 2017 17:48:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B38EE28354 for ; Wed, 19 Apr 2017 17:48:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A86FE283E8; Wed, 19 Apr 2017 17:48:02 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 4C11E28354 for ; Wed, 19 Apr 2017 17:48:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968687AbdDSRsB (ORCPT ); Wed, 19 Apr 2017 13:48:01 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:33307 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968685AbdDSRsB (ORCPT ); Wed, 19 Apr 2017 13:48:01 -0400 Received: by mail-io0-f196.google.com with SMTP id k87so5592733ioi.0; Wed, 19 Apr 2017 10:48:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=nNDjven7fwzVC5v2o8S4kg0LXhu3zgukGv0UuhDfXqs=; b=i1QONlr9lkzYHji9lN5SQCYzlc6J28B0ZBKbyQ4d1KxGjHydGrUY+T2lJvbo6Gsftq tV8fSvifq05226R3tUOuLpKWPPfL3UKLjmhU2UtA9ZXJFRxDZnmIpA41OZHI+kpR1nzk 59hvooylNUvshmjYJoMBSpkGuLY5muj3GdJnd4+WMi3NgTGxKsaLSOlmV98Yny2As0Ml UTa/+hs82ZGwkorr7oSQUEbv1qc4DxSJMcvLLUPZxGLULXAfOoviWoWuuWxGhXHYhOlQ thZUfDpbI5VNiNkD9dvHxYY/bzsxqOyBM7y1baN/Rk1Hifof6K/+lnL2caylSADxEIV5 dZ/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nNDjven7fwzVC5v2o8S4kg0LXhu3zgukGv0UuhDfXqs=; b=rEflUU47LrpsrDag3V9XVZh+U46U0YGZHG1AnUmJfIO3HinRQ2tSI/lG7/FNH9XPWF 8NspLV0vfr4pknieYbSekWWxofnvNauF1mqlG8e71kpDu7sBxVq5vzHZsom1Hr77EmwF unqu7yP01NkPzRGGdDQ7wp/OZBJCUusLmp7s/kiHwgGQ9XgveMSlFX7brnzYBeurg+Xb aQYvelxTAkRQgypDf3WDgiQt4OSWsvOTP66p0Q6uPrNBXOnOUVY1KLcfDTbL0zd5goX2 QSxzqF5r+kt7qXn/Rgq8Ywvs9DwVp5TtepCMUQh9VU8e7wsge8W8QJPMzq7KACazMM7A p0LA== X-Gm-Message-State: AN3rC/6PV1remXHuOf0BHC5yb+aXv1jjNx4e//E8JV3Ta8JsxUOOkL6i 1ELzrEQDy5NJyQ== X-Received: by 10.98.0.7 with SMTP id 7mr160364pfa.127.1492624080066; Wed, 19 Apr 2017 10:48:00 -0700 (PDT) Received: from localhost.localdomain (KD118152108246.ppp-bb.dion.ne.jp. [118.152.108.246]) by smtp.gmail.com with ESMTPSA id x68sm5760574pgx.57.2017.04.19.10.47.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Apr 2017 10:47:59 -0700 (PDT) From: Yoshihiro Kaneko To: linux-clk@vger.kernel.org Cc: Michael Turquette , Stephen Boyd , Geert Uytterhoeven , Simon Horman , Magnus Damm , linux-renesas-soc@vger.kernel.org Subject: [PATCH] clk: renesas: rcar-gen3: Fix SD divider setting Date: Thu, 20 Apr 2017 02:46:30 +0900 Message-Id: <1492624001-3758-10-git-send-email-ykaneko0929@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Takeshi Kihara This patch fixed the SD divider settiing for corresponding to the change in the HS200/HS400 mode. Signed-off-by: Takeshi Kihara Signed-off-by: Yoshihiro Kaneko --- This patch is based on the clk-next branch of linux-clk tree. drivers/clk/renesas/rcar-gen3-cpg.c | 41 +++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/clk/renesas/rcar-gen3-cpg.c b/drivers/clk/renesas/rcar-gen3-cpg.c index 8419f27..4ab76b1 100644 --- a/drivers/clk/renesas/rcar-gen3-cpg.c +++ b/drivers/clk/renesas/rcar-gen3-cpg.c @@ -1,6 +1,7 @@ /* * R-Car Gen3 Clock Pulse Generator * + * Copyright (C) 2017 Renesas Electronics Corp. * Copyright (C) 2015-2016 Glider bvba * * Based on clk-rcar-gen3.c @@ -205,29 +206,29 @@ struct sd_clock { * sd_srcfc sd_fc div * stp_hck stp_ck (div) (div) = sd_srcfc x sd_fc *------------------------------------------------------------------- - * 0 0 0 (1) 1 (4) 4 - * 0 0 1 (2) 1 (4) 8 - * 1 0 2 (4) 1 (4) 16 - * 1 0 3 (8) 1 (4) 32 - * 1 0 4 (16) 1 (4) 64 - * 0 0 0 (1) 0 (2) 2 - * 0 0 1 (2) 0 (2) 4 - * 1 0 2 (4) 0 (2) 8 - * 1 0 3 (8) 0 (2) 16 - * 1 0 4 (16) 0 (2) 32 + * 0 0 1 (2) 0 (-) 2 : HS400 + * 0 0 0 (1) 1 (4) 4 : SDR104 / HS200 + * 0 0 1 (2) 1 (4) 8 : SDR50 + * 1 0 2 (4) 1 (4) 16 : HS / SDR25 + * 1 0 3 (8) 1 (4) 32 : NS / SDR12 + * 0 0 0 (1) 0 (2) 2 : (no case) + * 1 0 2 (4) 0 (2) 8 : (no case) + * 1 0 3 (8) 0 (2) 16 : (no case) + * 1 0 4 (16) 0 (2) 32 : (no case) + * 1 0 4 (16) 1 (4) 64 : (no case) */ static const struct sd_div_table cpg_sd_div_table[] = { /* CPG_SD_DIV_TABLE_DATA(stp_hck, stp_ck, sd_srcfc, sd_fc, sd_div) */ - CPG_SD_DIV_TABLE_DATA(0, 0, 0, 1, 4), - CPG_SD_DIV_TABLE_DATA(0, 0, 1, 1, 8), - CPG_SD_DIV_TABLE_DATA(1, 0, 2, 1, 16), - CPG_SD_DIV_TABLE_DATA(1, 0, 3, 1, 32), - CPG_SD_DIV_TABLE_DATA(1, 0, 4, 1, 64), - CPG_SD_DIV_TABLE_DATA(0, 0, 0, 0, 2), - CPG_SD_DIV_TABLE_DATA(0, 0, 1, 0, 4), - CPG_SD_DIV_TABLE_DATA(1, 0, 2, 0, 8), - CPG_SD_DIV_TABLE_DATA(1, 0, 3, 0, 16), - CPG_SD_DIV_TABLE_DATA(1, 0, 4, 0, 32), + CPG_SD_DIV_TABLE_DATA(0, 0, 1, 0, 2), + CPG_SD_DIV_TABLE_DATA(0, 0, 0, 1, 4), + CPG_SD_DIV_TABLE_DATA(0, 0, 1, 1, 8), + CPG_SD_DIV_TABLE_DATA(1, 0, 2, 1, 16), + CPG_SD_DIV_TABLE_DATA(1, 0, 3, 1, 32), + CPG_SD_DIV_TABLE_DATA(0, 0, 0, 0, 2), + CPG_SD_DIV_TABLE_DATA(1, 0, 2, 0, 8), + CPG_SD_DIV_TABLE_DATA(1, 0, 3, 0, 16), + CPG_SD_DIV_TABLE_DATA(1, 0, 4, 0, 32), + CPG_SD_DIV_TABLE_DATA(1, 0, 4, 1, 64), }; #define to_sd_clock(_hw) container_of(_hw, struct sd_clock, hw)