Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5522288ybv; Mon, 17 Feb 2020 22:21:25 -0800 (PST) X-Google-Smtp-Source: APXvYqwDEPNIV0MHMc8Inrk0V4qz/+P2ukzGN2mTeT+/iT2FbM04rlgVbyoH7I+Km9vN6ITo8En9 X-Received: by 2002:aca:ccce:: with SMTP id c197mr301998oig.31.1582006884911; Mon, 17 Feb 2020 22:21:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582006884; cv=none; d=google.com; s=arc-20160816; b=C+XTi/sMD1G99GxDl/F/sC9IkttjaFMWqyKjz8JBDie47Nb2eLPxPWefkXaI/1lxQt qO+c3krRMy04B+j/b1lznoOpTBF7eSQHScsr8Kbr9m5UwqzCv8CEBKpTCvVe1e4HZvvn Gha5TFfgYohcw8mG9x49v/epyGbLAb6l1bmEj36YEOn91/pbYr8cHfM/Q0ba5pxbdslg R9vDsjTBYcZZ5yJXSW6FYAFiiyLH78DPvI5X1gP+QDO9O4qllNjfZqAZ42K7tqLVrxQR E7gwqs3HsE+zapVoIt47DPvR1GM3WkWTeZy+40dJfxnqRLQuWmnd4FTw+Z3wFvcFr9Xg SWWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nmY2tjaMWRwVLTyGzwjeXNSRFboYF38fEHLRyvhHHzA=; b=ajq86Li3Xz6O0id72BMw2Kz/U9+iXVcYk8xp9gMcOSYSDbpjHKfvS4t/NhVpVst9hi kC9d2Bor1Jhehg10i/dIy6PMjAIkQY4r0z6u492nqzCQcC511yZjD/r1mLrQjI2lQJZ6 1210RaJsGvXNEy1vMx4yYreMic0wQLfcl44CNlkDbWAL8AbITohHeblANe93VU0G2vij eHda6CSuqYEBATMHV/1LaDamS5ZwHcG399/ntsyaLQkXek1RbVoh0PucyhjmmdoJvown bLQRTouaiIQ9a200+Ubr2doatOM8lPvjs9osHX4a5LGUT5i1Whd6v0DhmrgnujITQIIa gPmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b="RHBmr/rj"; 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 e1si1470538otr.8.2020.02.17.22.21.12; Mon, 17 Feb 2020 22:21:24 -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="RHBmr/rj"; 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 S1726276AbgBRGUu (ORCPT + 99 others); Tue, 18 Feb 2020 01:20:50 -0500 Received: from mail.andi.de1.cc ([85.214.55.253]:58022 "EHLO mail.andi.de1.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbgBRGUu (ORCPT ); Tue, 18 Feb 2020 01:20:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20180802; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=nmY2tjaMWRwVLTyGzwjeXNSRFboYF38fEHLRyvhHHzA=; b=RHBmr/rjCFx1xxay/NykFECKA7 GOquwGZj8aEAYoe6td91EuHQYFzOyq/E4/+zDlm0ewsYmbYXC9G/tHKDvdfZUd478prGNDL0WoJS5 rqEUTniMFtU5GNB20FRZN0FDMzF6BSau5o2Mu+Tbegt3aCB6oZJvgCWVIpL07+9lU8JU=; Received: from [77.247.85.102] (helo=localhost) by mail.andi.de1.cc with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1j3wFM-0000on-I9; Tue, 18 Feb 2020 07:20:41 +0100 Received: from andi by localhost with local (Exim 4.92) (envelope-from ) id 1j3wF5-0005rM-OK; Tue, 18 Feb 2020 07:20:23 +0100 From: Andreas Kemnade To: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, lee.jones@linaro.org, b.galvani@gmail.com, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, phh@phh.me, stefan@agner.ch, letux-kernel@openphoenux.org, martin.blumenstingl@googlemail.com, jic23@kernel.org Cc: Andreas Kemnade Subject: [PATCH RFC v3 4/4] mfd: rn5t618: add ADC subdevice for RN5T618 Date: Tue, 18 Feb 2020 07:17:25 +0100 Message-Id: <20200218061725.22420-5-andreas@kemnade.info> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200218061725.22420-1-andreas@kemnade.info> References: <20200218061725.22420-1-andreas@kemnade.info> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Not needed for the RC5T619, feel free to ignore them if the whole series would be delayed just because of missing Tested-By for this. 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.20.1