Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2986372ybl; Mon, 20 Jan 2020 13:23:52 -0800 (PST) X-Google-Smtp-Source: APXvYqxINIZnn//y7FMP4B+px6FEPRofS/bqrTYx4qnB39pg/MfY+jJ0BWUFSTU+M9rVLi6cfYkx X-Received: by 2002:a05:6830:1e30:: with SMTP id t16mr1154192otr.220.1579555432106; Mon, 20 Jan 2020 13:23:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579555432; cv=none; d=google.com; s=arc-20160816; b=M1pbovTZzJQj5DR5sUYlxvlc1HcbIKcRiIEuhc6FI1P9zP1kXTFUB2sj6CdxPipk9X l0YVH+2iva3OvcWT2iIn1yqOPr5EyMUUd67hTBTQZVJ0UNz31YZMgIlbF0/BoOgWUxAc /h4ELjTeUqn7y08SMDRuFPpnzdFYDVqoHlhjBqEPjUFM4ncibU9Q1Vs87u8oFeUanN/m w/xz3GMzTKEgceLqryJDQS39OdeLPOZ4uMpHG10CaoaDgqNb7OeufoYW0W80oKqrpf3t Hs9om/iDdTE/PTEn3JUJx+ZcU/AYZsvnJba3dTf1qF6lGuvX/hU5iwxQiSet1NBZF2bC RD0A== 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:to:from:dkim-signature; bh=kW9dkyFBPi+l/UtuEQfJCB6bv7j45VQfHWVLdC4M4eo=; b=YTLpqP3hw3C5LzdEtyifpzwZracAbe+KWRNW90juHz11RuUCJjDkybyxziZ02LVhD9 7/UAedYxQMmGDlbRC28PKmWgyDagw76f0iAexCtZLGUC6phkHUZZYBCPQ5kR/02FsIAA Nbox0Ti/nDZfmBVzXiP/1PyYthjcWrXmrVSurjXYpYL0vHi9Ly5RGqZBrGCuz3hKodcv OJrkTh7Fxmv10A+yS9IEbqNq+TKrD2jzsRJd7xtvOxISTz8D4axapfHE8ZW1Gr1dQ67e CVFvA09eBpgPzKfVwAuegy/xtfQO3a9ZFAyyzsu1CMnse30XaId/yobSw70vOjhsezzM t8hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=haqFFIAt; 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 g1si20329689otj.115.2020.01.20.13.23.40; Mon, 20 Jan 2020 13:23:52 -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; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=haqFFIAt; 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 S1727047AbgATVVT (ORCPT + 99 others); Mon, 20 Jan 2020 16:21:19 -0500 Received: from mail.andi.de1.cc ([85.214.55.253]:38584 "EHLO mail.andi.de1.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726894AbgATVVT (ORCPT ); Mon, 20 Jan 2020 16:21:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20180802; h=References:In-Reply-To:Message-Id:Date:Subject: To:From:Sender:Reply-To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kW9dkyFBPi+l/UtuEQfJCB6bv7j45VQfHWVLdC4M4eo=; b=haqFFIAtTJUKI1R4fnqqUPZOm Lkb1q0CBTfvhOrOBbaj5pHRG39q3CURLhKIz3NiRxH4QaO1WGTolLSJX2KF1vEXjmeXcp8tg3gZdq UHrb3inXvGuOHgujPKCmZb5v0EDHOujJ4Lcmb0rv4eK0Ni4tcBXSLmuYy3jYt8xQwOAo0=; Received: from p200300ccff0880007ee9d3fffe1fa246.dip0.t-ipconnect.de ([2003:cc:ff08:8000:7ee9:d3ff:fe1f:a246] helo=eeepc) by mail.andi.de1.cc with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iteTo-0006vs-Km; Mon, 20 Jan 2020 22:21:05 +0100 Received: from andi by eeepc with local (Exim 4.89) (envelope-from ) id 1iteTn-0007WH-QI; Mon, 20 Jan 2020 22:21:03 +0100 From: Andreas Kemnade To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, lee.jones@linaro.org, b.galvani@gmail.com, linus.walleij@linaro.org, andreas@kemnade.info, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, phh@phh.me, stefan@agner.ch, letux-kernel@openphoenux.org, martin.blumenstingl@googlemail.com Subject: [PATCH RFC v2 3/3] mfd: rn5t618: add ADC subdevice for RN5T618 Date: Mon, 20 Jan 2020 22:20:56 +0100 Message-Id: <20200120212056.28806-4-andreas@kemnade.info> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200120212056.28806-1-andreas@kemnade.info> References: <20200120212056.28806-1-andreas@kemnade.info> X-Spam-Score: -1.0 (-) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RN5T618 has an ADC but RN5T567 has not, so we need separate subdevice lists for both. Signed-off-by: Andreas Kemnade --- Untested, IMHO only acceptable with a Tested-By drivers/mfd/rn5t618.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/rn5t618.c b/drivers/mfd/rn5t618.c index 6828fd40b0a1..d37d7a31cf26 100644 --- a/drivers/mfd/rn5t618.c +++ b/drivers/mfd/rn5t618.c @@ -21,6 +21,7 @@ static const struct mfd_cell rn5t618_cells[] = { { .name = "rn5t618-regulator" }, { .name = "rn5t618-wdt" }, + { .name = "rn5t618-adc" }, }; static const struct mfd_cell rc5t619_cells[] = { @@ -30,6 +31,11 @@ static const struct mfd_cell rc5t619_cells[] = { { .name = "rn5t618-wdt" }, }; +static const struct mfd_cell rn5t567_cells[] = { + { .name = "rn5t618-regulator" }, + { .name = "rn5t618-wdt" }, +}; + static bool rn5t618_volatile_reg(struct device *dev, unsigned int reg) { switch (reg) { @@ -203,16 +209,32 @@ static int rn5t618_i2c_probe(struct i2c_client *i2c, return ret; } - if (priv->variant == RC5T619) + switch (priv->variant) { + case RC5T619: ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_NONE, rc5t619_cells, ARRAY_SIZE(rc5t619_cells), NULL, 0, NULL); - else + break; + case RN5T618: ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_NONE, rn5t618_cells, ARRAY_SIZE(rn5t618_cells), NULL, 0, NULL); + break; + case RN5T567: + ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_NONE, + rn5t567_cells, + ARRAY_SIZE(rn5t567_cells), + NULL, 0, NULL); + break; + /* + * Should not happen because we come here only with a valid device + * tree match, so variant contains any of the above. + */ + default: + return -ENOENT; + } if (ret) { dev_err(&i2c->dev, "failed to add sub-devices: %d\n", ret); return ret; -- 2.11.0