Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp727651imm; Wed, 23 May 2018 04:44:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoCt2CR82D38/r1OeRg6F/yatZThV/bV0LfGdswcOHvJuUVvZeQwJevYIkw4TdK0SsO/qnm X-Received: by 2002:a17:902:ea:: with SMTP id a97-v6mr2586947pla.28.1527075849217; Wed, 23 May 2018 04:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527075849; cv=none; d=google.com; s=arc-20160816; b=ybizwcsEqnuAADOmcsPtkTxLRFrRCxe6iVRQ0fXFydYp8xTaE0ieqT6YSeIVPoVyEr YX7Cux6GO73MQUa+bFqK60zH2GDsZ92n7gJ2zAqepVj0DZBBJROm6FHAcWkB5UQ1rsYL BP8fkODP1DDfJLLs1x6bkeRgSZvJNVCwr1CK6rE3gBbtMMrVZ5pr2rMC7s7LZnGaRR/T DeBMNfpvNYOr8uS8L+5Rq5Yyd4Y7WTszUYVwXA3JNHVW4EtgBcjLFPJziIf/eeQkmriY YhbQ82ru9BEN5eldel6Mkt0aYN4M5Y+sFfqsZYPvPvJQVqexrud6oP2ZLWUjhodiz53H 7lLw== 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=FVkCdsRgDYnfC9GNcGfoTtsIJMoMQ6YtmMXYL/1p94M=; b=DIOGWLxyH3l9g4bkjLzsdHnxtp0j8hWM+QZxytDEZkQhA+M4qsBCZx5HwbKSxbjUxn gYh2qx+FjdBTELBFP/VhliTC5g6i3VHrohu8sINSZqReUtk1QyEJW4XeZX5M5L7KJea/ x7xANAlJSuIm72TA8f6z8CKZVEODBzubpBSbwvfya74rmH+A5qIw88w3FQcmIqQmQ2gK 5j0lMCy82EjPXQBAMi+o6wEFz85HsNDMr143sgfgpCLT6DwoKyCdzSqbhsis1Bvt/RM6 xtMswJzhM6RXnPbClVO0+eZXSIVfGbSgKzgiebXQoLQoOi+NdBZKGQgLYSKd+w4YSgrj KxmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h/rkGJvP; 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 b10-v6si14675725pgs.456.2018.05.23.04.43.54; Wed, 23 May 2018 04:44:09 -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=h/rkGJvP; 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 S932715AbeEWLnL (ORCPT + 99 others); Wed, 23 May 2018 07:43:11 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:37894 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932662AbeEWLm5 (ORCPT ); Wed, 23 May 2018 07:42:57 -0400 Received: by mail-wr0-f195.google.com with SMTP id 94-v6so25882412wrf.5; Wed, 23 May 2018 04:42:56 -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=FVkCdsRgDYnfC9GNcGfoTtsIJMoMQ6YtmMXYL/1p94M=; b=h/rkGJvPpSxDESHLNuD4i15OJmOvdRFx7PnA/uxmtSQmkpOKMe3b6egjn28fUpQaDZ 0QIzcS4PFu/CzUWGjvgD7zcKSXE+a+KilY3FlNyA/VNxOp8wcn1hNu0h4DuUZ0I/CMgy y0M51c3+bx1sEAwUy8h2fsYH65VFgxpE6PeshaYD4ezROP6xJpnqXg9HdijQRgiD+vbt jleZV4IALmWQMT6XgyjLR3l1imHe0tx/gWsBFX7HrIBUQPTGWdpGaKO+rX5mNjOyi5z+ O/56kPaV8bZ/mJy5nWFws0znESq5iNYGnEq3GGXY4Ea15wCoAyTuu7WpWWteHZOCAmSk I6GQ== 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=FVkCdsRgDYnfC9GNcGfoTtsIJMoMQ6YtmMXYL/1p94M=; b=ChtX+oYsemeHdvBk1zrReRwYshMcsvNm+8/w33CvoJDjH0aBXRojkm6hzJK9AZsxBp IbC6C66GcL1LCcdmqDgTHnbINOA8C5N9I44fQWImjCT2lAzq4q2tucBJyb3FinUhwqDB O5HxgPOI+TyVOmVtEg3INIlhhduUmMHQXYtlsJCPFXE2ltUGytec8sO2j1DpLlUav/d9 wxtiOBiOlTWDMb0Z6n3R9PlLguOh8hPZIL5TkUQkeczrb5goIOuNUvmo5OT2mDMbgmSK 2Q0lJ0hGcxJ1C/HRoOeF/sGRIkLySJvov02tjBtXtac65zS/myloTtynijzLexfPr7Fi XWtw== X-Gm-Message-State: ALKqPwcM14gL4dIUT6MGNTuMd3U/WZgiI3REmKEQKgMpQn56AlunWqgk JPiDCtY5Kl+t1TDJoYFV653bCCd5 X-Received: by 2002:adf:92e3:: with SMTP id 90-v6mr2106630wrn.64.1527075775344; Wed, 23 May 2018 04:42:55 -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 y45-v6sm17382223wrd.97.2018.05.23.04.42.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 04:42:54 -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 4/6] mfd: da9063: Disallow RTC on DA9063L Date: Wed, 23 May 2018 13:42:28 +0200 Message-Id: <20180523114230.10109-4-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180523114230.10109-1-marek.vasut+renesas@gmail.com> References: <20180523114230.10109-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. Do not allow binding RTC driver on this variant of the chip. 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 --- drivers/mfd/da9063-core.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/mfd/da9063-core.c b/drivers/mfd/da9063-core.c index 7360b76b4f72..263c83006413 100644 --- a/drivers/mfd/da9063-core.c +++ b/drivers/mfd/da9063-core.c @@ -101,14 +101,14 @@ static const struct mfd_cell da9063_devs[] = { .of_compatible = "dlg,da9063-onkey", }, { + .name = DA9063_DRVNAME_VIBRATION, + }, + { /* Only present on DA9063 , not on DA9063L */ .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) @@ -163,7 +163,7 @@ int da9063_device_init(struct da9063 *da9063, unsigned int irq) { struct da9063_pdata *pdata = da9063->dev->platform_data; int model, variant_id, variant_code; - int ret; + int da9063_devs_len, ret; ret = da9063_clear_fault_log(da9063); if (ret < 0) @@ -225,9 +225,13 @@ 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); + da9063_devs_len = ARRAY_SIZE(da9063_devs); + /* RTC, the last device in the list, is only present on DA9063 */ + if (da9063->type == PMIC_TYPE_DA9063L) + da9063_devs_len -= 1; + + ret = mfd_add_devices(da9063->dev, -1, da9063_devs, da9063_devs_len, + NULL, da9063->irq_base, NULL); if (ret) dev_err(da9063->dev, "Cannot add MFD cells\n"); -- 2.16.2