Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1534539imm; Sat, 2 Jun 2018 03:16:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI414irveln5G3W4ybWVHtYhNb9UQLG4RuxWrqQFquU6V2HPMRtxGRRcaoRAGcwaBcfmOU2 X-Received: by 2002:a62:48cd:: with SMTP id q74-v6mr13903623pfi.153.1527934573058; Sat, 02 Jun 2018 03:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527934573; cv=none; d=google.com; s=arc-20160816; b=TCF7Mi0385qdVXEcxrg84nZrsSixz4WCT3hmNc1wzKOoY9G3L23MT2bVMDMgAlOluH xuS5xxnSW9YdXSGIDQzH6pP46qFxapDzm+L36pLAGleaGSydKnOVPHUQz4AR4YBTAFP6 6BVZMWidSCvAqj1CgkhXGrOuCRq7NAmYofck48+EhNxhnHPd0mPW06nudBu9FYc0njSb 2XO9RpNeCoavFiUfUOrxPJLjgtqc9Wpq9Uj72Sx73LQF2xvkmH3uZdwW4QO4SrVIclub irgTF5Se0LCfMmsNrHHhpwht+MZ7UJLK+GKh7yREli9Yqad3Lf1P9Zh0rlK7lS4tPGDp Ogog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=G7fLT9ClopkWO0j0+9xZUtS8kM9elG2AzdvP9KLRq6U=; b=kibS3I1A/lhRK+mdVH2h048DL6re2g+4fsIH87xA/6gU5+JNzCBlHOkfLUJKRhxcvV CApkwivxstJSORCQ4jJrtvFF90tTWVx40kT20831bSRKivK6UvVkPe066cusQrQ1JIvY KxUy5RLKWAynxbzNg6fzp1rsXLJEqlMBk81/b37behZaTBkmMzlIASPFQwKY/uUmU1T4 I/JuDkNQ3m3DytjOjsowpBjmW2qmsQiVl+lX4s2RX8r38rZKqTM9rpuLSXoRsInvf9EG VC4tVKwzgskmfhlKVUzxYXSjxY0G10iWYlkvW+qMkEFjYwnnsx1FY3DdFMP07klQviUe tlbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e3BPbFqR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m28-v6si6853961pgn.197.2018.06.02.03.15.28; Sat, 02 Jun 2018 03:16:13 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e3BPbFqR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751968AbeFBKMs (ORCPT + 99 others); Sat, 2 Jun 2018 06:12:48 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:54058 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751558AbeFBKMY (ORCPT ); Sat, 2 Jun 2018 06:12:24 -0400 Received: by mail-wm0-f68.google.com with SMTP id x6-v6so453948wmc.3; Sat, 02 Jun 2018 03:12:23 -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:in-reply-to:references; bh=G7fLT9ClopkWO0j0+9xZUtS8kM9elG2AzdvP9KLRq6U=; b=e3BPbFqRuIW2BTbFLIAQrOnZS9LfoEmRu+t+0GChMU69CGvNLAWXavLFo+PES3LBdg v4iVwNwuXF7r+Fxa4NX+s1/We18CFenu6M1hknQKU3B4BAZBWk9RgFLJyE/OL9f+0HoI DzYaguRZKeSFFdsdizjxP5W+l4cCvwSaaRH6+nXGLUplm9/GjFXxSTogFNONthi8U+uV HNY++Exox38/ExDMmkDKE5XObWs7dhzXTnlKs/jnK5PqTtLxz6VRkZmAcyMExoJv6Rd0 Hi/OEQcHord8cyBx0a7vXtxGmw0PXQxqmFecYs2lW/kpWoJG/WOSTmzbvgLsLgqfb3gs gaAg== 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:in-reply-to :references; bh=G7fLT9ClopkWO0j0+9xZUtS8kM9elG2AzdvP9KLRq6U=; b=VE4GSSjatF03l8jNPC6QfVTiEPkSr/mRoclWgZu4ZPimCDLnM9IrftXUXxHALduWOw FN2If7lwgWpsuctDHb22mVvztbywPuHbTlOZ592ODLm8zviXbC4msn58Cwo3IgjS8TEA X8nmabOoQbpEm+IbJjPUVcOF2BAEj2xNNN+TIJrzY2VtBiwfa4eMBttoOFmG0qCoLVcn hdNVHIDh0TwhzWanjKC444FHjtToBu+AhZKZ01DOjDwCkybnaTBZzK2JJ1Gszthb8qQS sqAUPEuAJdGPZiCMxTm3jMMEoff4gxmSAnFthGbRCkfK+lSILoFbzdVZkRuR5xGK07n8 cyKw== X-Gm-Message-State: APt69E1S1AFcWXhHduZGd8CBqCtWeGghYU+lQ0mi8e7ROIe9ioxwA/QT wScFxYbh89GZlhCzITcw2xHxO50v X-Received: by 2002:a1c:8cc8:: with SMTP id o191-v6mr4806637wmd.75.1527934342856; Sat, 02 Jun 2018 03:12:22 -0700 (PDT) Received: from kurokawa.lan (ip-86-49-107-50.net.upcbroadband.cz. [86.49.107.50]) by smtp.gmail.com with ESMTPSA id b16-v6sm38624797wrm.89.2018.06.02.03.12.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jun 2018 03:12:22 -0700 (PDT) From: Marek Vasut X-Google-Original-From: Marek Vasut To: linux-kernel@vger.kernel.org Cc: Marek Vasut , Geert Uytterhoeven , Lee Jones , Mark Brown , Steve Twiss , Wolfram Sang , linux-renesas-soc@vger.kernel.org Subject: [PATCH v3 08/10] mfd: da9063: Register RTC only on DA9063L Date: Sat, 2 Jun 2018 12:11:53 +0200 Message-Id: <20180602101155.26375-8-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180602101155.26375-1-marek.vasut+renesas@gmail.com> References: <20180602101155.26375-1-marek.vasut+renesas@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The DA9063L does not contain RTC block, unlike the full DA9063. Split the RTC block into separate mfd cell and register it only on DA9063. Signed-off-by: Marek Vasut Cc: Geert Uytterhoeven Cc: Lee Jones Cc: Mark Brown Cc: Steve Twiss Cc: Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org --- V2: No change V3: Rework of mfd: da9063: Disallow RTC on DA9063L --- drivers/mfd/da9063-core.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/drivers/mfd/da9063-core.c b/drivers/mfd/da9063-core.c index eebca3442cf3..b05910c797af 100644 --- a/drivers/mfd/da9063-core.c +++ b/drivers/mfd/da9063-core.c @@ -76,7 +76,7 @@ static struct resource da9063_hwmon_resources[] = { }; -static const struct mfd_cell da9063_devs[] = { +static const struct mfd_cell da9063_common_devs[] = { { .name = DA9063_DRVNAME_REGULATORS, .num_resources = ARRAY_SIZE(da9063_regulators_resources), @@ -100,15 +100,19 @@ static const struct mfd_cell da9063_devs[] = { .resources = da9063_onkey_resources, .of_compatible = "dlg,da9063-onkey", }, + { + .name = DA9063_DRVNAME_VIBRATION, + }, +}; + +/* Only present on DA9063 , not on DA9063L */ +static const struct mfd_cell da9063_devs[] = { { .name = DA9063_DRVNAME_RTC, .num_resources = ARRAY_SIZE(da9063_rtc_resources), .resources = da9063_rtc_resources, .of_compatible = "dlg,da9063-rtc", }, - { - .name = DA9063_DRVNAME_VIBRATION, - }, }; static int da9063_clear_fault_log(struct da9063 *da9063) @@ -225,16 +229,28 @@ int da9063_device_init(struct da9063 *da9063, unsigned int irq) da9063->irq_base = regmap_irq_chip_get_base(da9063->regmap_irq); - ret = mfd_add_devices(da9063->dev, -1, da9063_devs, - ARRAY_SIZE(da9063_devs), NULL, da9063->irq_base, - NULL); + ret = mfd_add_devices(da9063->dev, -1, da9063_common_devs, + ARRAY_SIZE(da9063_common_devs), + NULL, da9063->irq_base, NULL); if (ret) { dev_err(da9063->dev, "Cannot add MFD cells\n"); goto err_irq_exit; } + if (da9063->type == PMIC_TYPE_DA9063) { + ret = mfd_add_devices(da9063->dev, -1, da9063_devs, + ARRAY_SIZE(da9063_devs), + NULL, da9063->irq_base, NULL); + if (ret) { + dev_err(da9063->dev, "Cannot add MFD cells\n"); + goto err_mfd_cleanup; + } + } + return ret; +err_mfd_cleanup: + mfd_remove_devices(da9063->dev); err_irq_exit: da9063_irq_exit(da9063); return ret; -- 2.16.2