Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9543268ybl; Fri, 17 Jan 2020 14:02:24 -0800 (PST) X-Google-Smtp-Source: APXvYqw3DmJxSo/zfqYlgDF/qxqKOimOZCq/M59f+piORKTq+icLeV4USo+ZP7APS04eI11dlklD X-Received: by 2002:a05:6830:1185:: with SMTP id u5mr7266754otq.147.1579298544341; Fri, 17 Jan 2020 14:02:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579298544; cv=none; d=google.com; s=arc-20160816; b=Zp/TBIG5iZQegwVvL05lkx34nvoqZ/pbbdT9oDeosHL9xVqaW/KIAyyIqEBwg2skgL CwLuN0q896qh+/4kGxrpif2ZRus61/oEQwG4OT+oLPT58pd1/gmN+GGUhRH1zyB4koYr zFH0jcqwoMb2bLz5tZW236aA6D15hhNCMY7TTBuJtFteCQz5Cg4PLY1C0bX8VqJpLdqV AD+FNyBLYeTXRJOsmO/6aO2SzsLB0Ox12IcxyFBBJAXTL83Ylwu8bxDPuUA/ovNLMF6x 2tksj/IYn872YTE80hywYDzbSk9/BzhUb0yDvn6la2JBWZOXZ6e/WKDcwS2ODC/BSN39 wTnQ== 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:to:from :dkim-signature; bh=0048lV13ZokozP4YvlHWJOpblcHlXEz5JICeHY2wzSk=; b=ddD2zJy+RGCkY6ie85NQFjJxuk+L0AjKimnahS2EbMFi4/jbc6PNrGWKodf2oZOGVp AqVGlcCJU6wAXDjgNOrALSEnWXM6gY4sisx/mvbODhlJMBJP/jU/4okmGuGGSXKdla5r J1Lj1OjEzJ9HmsYwVPgjP8Gt2KKOTf+xgfoR6hPfCWVdAKMrqe/EulS8RXDoKcndtSeM CsmpEgy9uSSEM+PnX7ah07z06zUnCY+w7viiZX2uJyPa9h9k2ANQdmQMdpVDtkmH2OGN 1jlePz4YizI2jognZcnETTYlKPJ3nVsuHU7xV5t6XZItJqp5/GP+1cDWoFz+fWPQc0QY Z6Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b="k/zrJDWw"; 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 n14si16250766otk.179.2020.01.17.14.02.12; Fri, 17 Jan 2020 14:02: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="k/zrJDWw"; 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 S1730121AbgAQWBM (ORCPT + 99 others); Fri, 17 Jan 2020 17:01:12 -0500 Received: from mail.andi.de1.cc ([85.214.55.253]:38972 "EHLO mail.andi.de1.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730040AbgAQWBK (ORCPT ); Fri, 17 Jan 2020 17:01:10 -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:To:From:Sender:Reply-To:Cc: 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=0048lV13ZokozP4YvlHWJOpblcHlXEz5JICeHY2wzSk=; b=k/zrJDWwY12ZvS04IJ3NHURVdK UFBKipGOlHi5wJ0ITBFacNDkrbGWzy+I8Qo5NegfptbTwMU9YXbyD7Irx4xQ/IH0uGCdOq54l4nXI grOOv1CDOU9HHRkc9caoRSXd7YaGZR7tfPxFkqWWkkK+3v09P95NmfxSdN2UWy8MvGCc=; Received: from p200300ccff371b001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:cc:ff37:1b00:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1isZfr-00078j-Tx; Fri, 17 Jan 2020 23:01:06 +0100 Received: from andi by aktux with local (Exim 4.92) (envelope-from ) id 1isZfr-0003yj-LG; Fri, 17 Jan 2020 23:01: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 Subject: [RFC PATCH 5/5] mfd: rn5t618: add ADC subdevice for RN5T618 Date: Fri, 17 Jan 2020 22:59:26 +0100 Message-Id: <20200117215926.15194-6-andreas@kemnade.info> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200117215926.15194-1-andreas@kemnade.info> References: <20200117215926.15194-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 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