From patchwork Thu Apr 4 10:24:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 10885383 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 9E8AB17E1 for ; Thu, 4 Apr 2019 10:24:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A6A52851D for ; Thu, 4 Apr 2019 10:24:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E461285DC; Thu, 4 Apr 2019 10:24:46 +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,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 270322851D for ; Thu, 4 Apr 2019 10:24:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729064AbfDDKYm (ORCPT ); Thu, 4 Apr 2019 06:24:42 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:35096 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726563AbfDDKYl (ORCPT ); Thu, 4 Apr 2019 06:24:41 -0400 Received: by mail-lj1-f196.google.com with SMTP id t4so1610761ljc.2; Thu, 04 Apr 2019 03:24:39 -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=RbzTZinnvpnNKzXtXR+nOLcMGHWlBxzIt7XqDN1wyqM=; b=BSDJfwEpsMZFy3ifjP7PnYCDuDAly3eZxzBpbw0Tpr94e5ik3LWo966IVdhL+hDLZO Bm07w+5Mnu0Teg9iYxOt8TE7WI35DKrtVs4NYNfXPTGjDyhDDe6PZUTaWxRPFX6X6an7 X6GJrBfa1bOm9MARXRvRWQ8XAh2UEKbhyitfDMaMZBGo6lbzgPfwoxDusDYYvjEAoYLT L1IDTbVenL6tHtd7NYxS/WFgcEnPo+2IKAZ9TVVbGb1/K62v1YYdKoptt75zvBKnvFAD DOr0uFqtsxCWuqZEnCd9kzmHddVQXKFsjYgIm6HDl6Dnq7enjiLftBXdkJvjC/JpLCus S4FQ== X-Gm-Message-State: APjAAAU0xRJEmlbxaClq1NWm07EXo/I0PnLJYM3zB6Z6IjUgZ40VDPSg UjzNW5etnX0TZKa3qx1qcZY= X-Google-Smtp-Source: APXvYqz1rErzmp+5fNboiS+YMu2Y+1uJIf3bV+Yt0Mb2cnNRjXlmAHVSkDMWKeXhHbINmuG41ZO//g== X-Received: by 2002:a2e:9655:: with SMTP id z21mr2915540ljh.60.1554373478816; Thu, 04 Apr 2019 03:24:38 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id e14sm4241013ljk.45.2019.04.04.03.24.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Apr 2019 03:24:38 -0700 (PDT) Date: Thu, 4 Apr 2019 13:24:30 +0300 From: Matti Vaittinen To: Matti Vaittinen , mazziesaccount@gmail.com Cc: Rob Herring , Mark Rutland , Michael Turquette , Stephen Boyd , Linus Walleij , Bartosz Golaszewski , Sebastian Reichel , Liam Girdwood , Mark Brown , Alessandro Zummo , Alexandre Belloni , Wim Van Sebroeck , Guenter Roeck , 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, linux-watchdog@vger.kernel.org, heikki.haikola@fi.rohmeurope.com, mikko.mutanen@fi.rohmeurope.com, bogdan-petru.chircu-mare@nxp.com Subject: [PATCH v13 3/8] clk: bd718x7: Support ROHM BD70528 clk block Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Changelog v13: - No changes Changelog v12: - No changes 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 e705aab9e38b..86828939d095 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -285,10 +285,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");