Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7041685imu; Thu, 31 Jan 2019 04:05:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN4eGt/cEH5V2tC1y9sOqd3vjMPmLeXpbXj9YPzWqRpzm8o86w/9pZ5jnof+fRFA17NGF6fQ X-Received: by 2002:a17:902:bd0a:: with SMTP id p10mr33417453pls.322.1548936323656; Thu, 31 Jan 2019 04:05:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548936323; cv=none; d=google.com; s=arc-20160816; b=eoi8VDGpqmzfEag5078CUicV6HomWkoOxsDazwNoJbtyglOMuAqvXFTTCKgwjEEprI eblMkGhMi/v/s8a1YYMABmEZFf3Xfmp6a1xrwD0rR3eDdkM53QPauefi4iJcaTucMXec mojJGfVVYeGhfwNJp1C9/dehz8xDMgzGeDbxwnC94kxGLS4JsaXPaEiNi86HwJE5piqA 522jY7HUJMKa4PBOBDg0G3rvg/D+kZHdnAln4Cx4VDGqqbAcyADRAjkZO65JE39kM8Om cokmSV1oAcMYlEFvZ3tbgMxQOBaustmICt7CWeShQb8XWXZ/mF8SN/5+JOlzX7p3vzUV pe2g== 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=wjntFQCQBO8gCvZ1THC9JCAeRH6+57daYb7m1z5r9+k=; b=SFjkAna7z7jsHpNpdgykIw/QbbjYoZS/bApsMh1zE+zs6NoHOWhZUZ2fgKA2al669J 8yx0wBITdpwpwXIfwIfgwzdeGcj+KL9q+o4t3zY1QjAxyB96asxnK/AE4/PbA5/dWsyX esrSDMK5pBzJKfYeLT2pcBAkbATyGERmz8UgwujREQiyW+NV2ZIFyW0ra6W3iutBELIQ iJZt78KdESq6ev7xL90W2hZ6nEFs+wi0JxP+/NsSBAIsh/89F8Tbsn6cO99XBa9n3CVx RXgge/XnXDCtFRcUjWxS7eYuU0dIeump0BCzzG+PSWyMh5d/edqcNUpx0fj7nAAHqSY+ nltw== 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 d2si2106306pfe.159.2019.01.31.04.05.08; Thu, 31 Jan 2019 04:05:23 -0800 (PST) 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 S1732654AbfAaME0 (ORCPT + 99 others); Thu, 31 Jan 2019 07:04:26 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:37667 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726977AbfAaMEZ (ORCPT ); Thu, 31 Jan 2019 07:04:25 -0500 Received: by mail-lj1-f196.google.com with SMTP id t18-v6so2462550ljd.4; Thu, 31 Jan 2019 04:04:23 -0800 (PST) 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=wjntFQCQBO8gCvZ1THC9JCAeRH6+57daYb7m1z5r9+k=; b=LAlxBZuuO9jgt3j4ZEnZJ/jgEMGwGSA3iK1f+tszatEJi/jZptbx92s4Fw7JzyNirB ix+IJ5Yrdn1D65vlBLd5mpt7lNd/X11J0QOw6Loo0hnPt1mDhc+UuE1jfC8ZDIeCW9dh y6HJs76EEymFrqEazSJvTws55OhQCQea1gqO2cZLKgNjIcrDYPoaJ+QEpJ1uq0mQ+cfR 8wQhzL8P/0E00/in0da01bwAhzfrLDgzsAPJzQRmvHP8FFsIFZDbbxCT3LNuD1qH3TPg LZbbFTssGSvv0MxGqkhF7NRr+xG3AZYOhBrpLxZLeiO6ldHqd7g4jgCfwJmd/NvxmGZ2 tUEA== X-Gm-Message-State: AJcUuke+Qq98cm23k35tyleZIDIlMgTUv6S/8aTKH1VIayOuczjYe9xP 1kEizpUvLqP5pCqgw2cLcwo= X-Received: by 2002:a2e:5cc8:: with SMTP id q191-v6mr27688273ljb.192.1548936262579; Thu, 31 Jan 2019 04:04:22 -0800 (PST) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id l7sm228428lfc.55.2019.01.31.04.04.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Jan 2019 04:04:21 -0800 (PST) Date: Thu, 31 Jan 2019 14:04:09 +0200 From: Matti Vaittinen To: mazziesaccount@gmail.com, matti.vaittinen@fi.rohmeurope.com Cc: heikki.haikola@fi.rohmeurope.com, mikko.mutanen@fi.rohmeurope.com, lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, broonie@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linus.walleij@linaro.org, bgolaszewski@baylibre.com, sre@kernel.org, lgirdwood@gmail.com, a.zummo@towertech.it, alexandre.belloni@bootlin.com, wim@linux-watchdog.org, linux@roeck-us.net, 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 Subject: [RFC PATCH v4 05/10] 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.9.2 (2017-12-15) 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 --- drivers/clk/Kconfig | 6 +++--- drivers/clk/clk-bd718x7.c | 21 +++++++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index e5b2fe80eab4..992cfb86f2ca 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. source "drivers/clk/actions/Kconfig" source "drivers/clk/bcm/Kconfig" diff --git a/drivers/clk/clk-bd718x7.c b/drivers/clk/clk-bd718x7.c index 461228ebf703..41c1374f4217 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,21 @@ 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 +132,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.14.3 -- 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 ~~~