Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3939343ybi; Mon, 3 Jun 2019 03:00:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyx2p6haEW8k0hZXUFt5EFdLGYnrB4I7Y2WEb4FZarnm6DA+bQ5C+cddvAvamNPWxFBKHx4 X-Received: by 2002:a17:902:8d92:: with SMTP id v18mr5067528plo.211.1559556045892; Mon, 03 Jun 2019 03:00:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559556045; cv=none; d=google.com; s=arc-20160816; b=ZrdLMLaQkzNUcNJM7wHltXcKVpGYzUxWGsnKIlq+Ay896C3XhUC3TjcpG0nJtCYWHB Cz2Ety4N4nEiqc8at6gm3/aO8heLhQ0wQoJvKq5lqWfvPJkD15fYlUBiofIxieSw+dm6 ET/Ic38u4ZXcr2rAk2V1oo2rMobGUUno2F/D+tNBHV/SNk78Awo4NV6DFNR1XLKAWP7J t/h7E7QnjdIJozobvxTUXAhTGREl3xR/zai1vvH43hosApCg0+GnMHxDrpWhnT5iy6N1 XrFniYghohiKNrKBp6Ugvqea1xNotB48N6v3tniFOafA8++JKG/vnHfQIFVu2hHJzglj EciQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=xEI6d6G4ess0W+jEsNn0vDwu9Rko+8JiDaoJH/VFBrM=; b=Nt2nhlp+2Sv9+v36gQ74lypKmmP5nkE8uAaPG5OVBJkudJvPyU4rALaakc9opBuXeW /GKZT2EZmqwiWjNjXwjldo3OdbXLgUxu3ZgB0LZi1EhJC9T7D5p9bjQUZaE1OZep73Ic vqxQ9s/GnhdtenwYpPrqj+reOil7mQ7kV3oLAAnppfrmXw1PjOn6FoDJShzdU0KnlPen vnUIoEjiRTUGH18Jbmhn9d93HupeGPHZh+igOYR2serCLROacsHLbna95AJybaU6aH1o EKOQAgnf/y9DuiCDzWgFqnwozO1qQlVbi+bOiCF866cthIw8pHg+Ou5gCGzxowI0QLVv 9Iww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12si1202612plp.63.2019.06.03.03.00.20; Mon, 03 Jun 2019 03:00:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727367AbfFCHZ5 (ORCPT + 99 others); Mon, 3 Jun 2019 03:25:57 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:32783 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbfFCHZ5 (ORCPT ); Mon, 3 Jun 2019 03:25:57 -0400 Received: by mail-lf1-f68.google.com with SMTP id y17so12748185lfe.0; Mon, 03 Jun 2019 00:25:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xEI6d6G4ess0W+jEsNn0vDwu9Rko+8JiDaoJH/VFBrM=; b=F4w/ife2vndXDKn+53IrMWIDd1CgdBZbC20wiWimxdJFG51kjos8Xo+8Vxy1JDnzMW 5THf6+VA7dK7JZEg7PGWG8DTnysgBdcUZ4oHVhLtETnbwsEVeet0wrfDjBDrkCnwsQ8A LnwhfNQc+8C+bMBwJwuqC9S9N5RF4ndS1TwFdejTfUaroYWtSsg59IatAEt80Ol6qd6V NsASFC4SgtPEJIVxc7GZg+LNDu+jRmfauaHeRwdIK8Id7s0JAhCxhs5/kSAGJJcLLqjj lGCLtoMHAcKhiq982wg9Nsi1esWta/GzA79IYCwg/bABzjZ1osv1AZ+5WXpp5qZrbeRs DUCg== X-Gm-Message-State: APjAAAXrPpQFjF0o5K8O2GRUNotxkMH7hsyYxOeNXp7iNLCGuROVU1t5 b9275CsgbTvg96UzS4st6FI= X-Received: by 2002:a19:1908:: with SMTP id 8mr12529265lfz.171.1559546754283; Mon, 03 Jun 2019 00:25:54 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id z26sm48010ljz.64.2019.06.03.00.25.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jun 2019 00:25:53 -0700 (PDT) Date: Mon, 3 Jun 2019 10:25:39 +0300 From: Matti Vaittinen To: mazziesaccount@gmail.com, matti.vaittinen@fi.rohmeurope.com Cc: Lee Jones , Rob Herring , Mark Rutland , Michael Turquette , Stephen Boyd , Linus Walleij , Bartosz Golaszewski , Sebastian Reichel , Liam Girdwood , Mark Brown , Alessandro Zummo , Alexandre Belloni , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org Subject: [PATCH v15 3/7] clk: bd718x7: Support ROHM BD70528 clk block Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ROHM BD70528 is an ultra low power PMIC with similar 32K clk as bd718x7. Only difference (from clk perspective) is register address. Add support for controlling BD70528 clk using bd718x7 driver. Signed-off-by: Matti Vaittinen Acked-by: Stephen Boyd --- Unchanged from v14 drivers/clk/Kconfig | 6 +++--- drivers/clk/clk-bd718x7.c | 20 ++++++++++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index fc1e0cf44995..dd411c86b979 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -293,10 +293,10 @@ config COMMON_CLK_STM32H7 config COMMON_CLK_BD718XX tristate "Clock driver for ROHM BD718x7 PMIC" - depends on MFD_ROHM_BD718XX + depends on MFD_ROHM_BD718XX || MFD_ROHM_BD70528 help - This driver supports ROHM BD71837 and ROHM BD71847 - PMICs clock gates. + This driver supports ROHM BD71837, ROHM BD71847 and + ROHM BD70528 PMICs clock gates. config COMMON_CLK_FIXED_MMIO bool "Clock driver for Memory Mapped Fixed values" diff --git a/drivers/clk/clk-bd718x7.c b/drivers/clk/clk-bd718x7.c index 461228ebf703..ae6e5baee330 100644 --- a/drivers/clk/clk-bd718x7.c +++ b/drivers/clk/clk-bd718x7.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -86,9 +87,20 @@ static int bd71837_clk_probe(struct platform_device *pdev) dev_err(&pdev->dev, "No parent clk found\n"); return -EINVAL; } - - c->reg = BD718XX_REG_OUT32K; - c->mask = BD718XX_OUT32K_EN; + switch (mfd->chip_type) { + case ROHM_CHIP_TYPE_BD71837: + case ROHM_CHIP_TYPE_BD71847: + c->reg = BD718XX_REG_OUT32K; + c->mask = BD718XX_OUT32K_EN; + break; + case ROHM_CHIP_TYPE_BD70528: + c->reg = BD70528_REG_CLK_OUT; + c->mask = BD70528_CLK_OUT_EN_MASK; + break; + default: + dev_err(&pdev->dev, "Unknown clk chip\n"); + return -EINVAL; + } c->mfd = mfd; c->pdev = pdev; c->hw.init = &init; @@ -119,5 +131,5 @@ static struct platform_driver bd71837_clk = { module_platform_driver(bd71837_clk); MODULE_AUTHOR("Matti Vaittinen "); -MODULE_DESCRIPTION("BD71837/BD71847 chip clk driver"); +MODULE_DESCRIPTION("BD71837/BD71847/BD70528 chip clk driver"); MODULE_LICENSE("GPL"); -- 2.17.2 -- Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =]