From patchwork Fri Oct 18 12:56:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 176826 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp820796ill; Fri, 18 Oct 2019 05:56:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyu1yl3kVjL2+sCWdgh+VR5zSPGRPbE+yuEiWPMlSowHl4t4CFwq27wZA41YLHO8KBI3pDz X-Received: by 2002:a50:eb4d:: with SMTP id z13mr9282559edp.175.1571403382516; Fri, 18 Oct 2019 05:56:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571403382; cv=none; d=google.com; s=arc-20160816; b=N9fsKqCx6dqqE03KIM6NbIqzSEslNJT7vl5khPgIHtcIfa0V0wSI0w3K4VGZv39bnX PNvRqQjfHy8alh0lR4YcGeB+NtwIPqhJ71whD09UjKu98rnHXPKuEhpSaLubNsYfmxid w8kPBwlV6/eon/ydTikMBJ2S9lfhvxadsxB5XtCRE1qmDC7kfWvDSstfi4CPp7nA8kZq gwwbY+NCfhVQwD7hqcBOL9bZap6gHjemKS8DH3Q92GONlIn9STgJHW8snypDNHZGXZoG SWP1X56JT6ye6l69rTUuoOO5J0M7xv9PGixjrTU5ScnPglYENu/NL7OBv9nm2/+eioxM 3G+Q== 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; bh=uffMabFPldA3sW0xXZbJX93ZYIXfUZ6x/6qzeDvqKHU=; b=ya81EhTRxY1x9dHcCv4rxJ/SNhd2SaD5SN823WglMWoiZol5J2ZxbQkI7dIKGwNudL e4uo/20JclPk1cSPsrsGhXD9mxVcJ3OS/cdr7C4uTxQcfo9ommdKfWw6nQdGRnTxpQ8o dfKHaia27MV67eLsLdeC0KEhUS2tVfYYIf9P2BFOWfvFoziU7G+EOASlihqrI9rAcLSb TxcpuT5V6AocdulQNirlBwQe/esEcFSZx+tlww88Pp2zmXFW7p04omvFqKy6YbadlxJ7 Yu5UuU+86URCPD4duEA8cd4pOB9byH78TtVeInJPMj8VBz5OSqMXn1LEWLxp3yM/wh1N lfmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="a1/kW5wJ"; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si3965991edm.271.2019.10.18.05.56.22; Fri, 18 Oct 2019 05:56:22 -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=@linaro.org header.s=google header.b="a1/kW5wJ"; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438918AbfJRM4R (ORCPT + 26 others); Fri, 18 Oct 2019 08:56:17 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39053 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2410148AbfJRM4P (ORCPT ); Fri, 18 Oct 2019 08:56:15 -0400 Received: by mail-wm1-f67.google.com with SMTP id v17so5994303wml.4 for ; Fri, 18 Oct 2019 05:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uffMabFPldA3sW0xXZbJX93ZYIXfUZ6x/6qzeDvqKHU=; b=a1/kW5wJjmnv20kwpLmkrzovugTb1olIvoyebb0Vdjs5JnX4ljk48LR2JgfzAjq4/n YKi2C6bNqD6clsE+QBZVYEo9XsI9jYOLAtvqUdSnnzW/tlQWAbhfDG+sMMdt2e6Q+1LP j0c5e06g8KXzDIAG5CgCngwS8Z6LW3mdQFpgOI20kiWERusJCaNM7w5z37F3BEO+XFwm VbQyEFtAOvTXyzASG63fQ6P1o4Xt+5v+br3HT9BljgIjlArGhXRfP++umd0r5DVc1rZm TshzZHKWukXC0S2TOXY/8NsmxbDHS/UUjOOwV9zz/ILiIE/4x5e50M9xrFEpir2W6KMQ 3w2A== 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=uffMabFPldA3sW0xXZbJX93ZYIXfUZ6x/6qzeDvqKHU=; b=P1bk2o9hdyYgAVyfbrPQyHfG1BImackkh3KwOzVrpxKOhE/EgozpFWeLLgZ/PC9dbJ aOhI3rBDOWOfo/MlI4jwAHV0+aSYkXJWKfxL5Jyj4FVmvDRkTvdB91LPZd0j2vtPtwdD RUvoZPHk0ijYSfetqMcLNrO19tmKuf76QsOoIhEA7VIfj23JP/7fBRPDqYIrm+seCKuJ fZ1fAVPBYsZk5ozOVVgQOViFAS5pR0FCvxT+YSNhBtX0kK9drXaHaRJCVXTOKOuFxnH/ 02ytjQYueuxIPy+pkW/zUbdo8pLsQJ/kFhAqA2d5Dc8J+VaXIe/trK/yv9Hk9Ht0G8IR dFfA== X-Gm-Message-State: APjAAAW/uuYYjcwsulwtG0gVDbf936oMSMOo/zEni0+lpcErbfhJB4sx vgckptvc6H+3cjMBM2xlA/dmVg== X-Received: by 2002:a1c:6702:: with SMTP id b2mr2599688wmc.107.1571403373543; Fri, 18 Oct 2019 05:56:13 -0700 (PDT) Received: from localhost.localdomain ([95.149.164.47]) by smtp.gmail.com with ESMTPSA id q14sm6058491wre.27.2019.10.18.05.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 05:56:12 -0700 (PDT) From: Lee Jones To: broonie@kernel.org, linus.walleij@linaro.org, daniel.thompson@linaro.org, arnd@arndb.de Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dilinger@queued.net, Lee Jones Subject: [PATCH 3/4] mfd: cs5535-mfd: Register clients using their own dedicated MFD cell entries Date: Fri, 18 Oct 2019 13:56:07 +0100 Message-Id: <20191018125608.5362-4-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191018125608.5362-1-lee.jones@linaro.org> References: <20191018125608.5362-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CS5535 is the only user of mfd_clone_cell(). It makes more sense to register child devices in the traditional way and remove the quite bespoke mfd_clone_cell() call from the MFD API. Signed-off-by: Lee Jones --- drivers/mfd/cs5535-mfd.c | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/mfd/cs5535-mfd.c b/drivers/mfd/cs5535-mfd.c index b01e5bb4ed03..2711e6e42742 100644 --- a/drivers/mfd/cs5535-mfd.c +++ b/drivers/mfd/cs5535-mfd.c @@ -95,9 +95,23 @@ static struct mfd_cell cs5535_mfd_cells[] = { }, }; -static const char *olpc_acpi_clones[] = { - "olpc-xo1-pm-acpi", - "olpc-xo1-sci-acpi" +static struct mfd_cell cs5535_olpc_mfd_cells[] = { + { + .name = "olpc-xo1-pm-acpi", + .num_resources = 1, + .resources = &cs5535_mfd_resources[ACPI_BAR], + + .enable = cs5535_mfd_res_enable, + .disable = cs5535_mfd_res_disable, + }, + { + .name = "olpc-xo1-sci-acpi", + .num_resources = 1, + .resources = &cs5535_mfd_resources[ACPI_BAR], + + .enable = cs5535_mfd_res_enable, + .disable = cs5535_mfd_res_disable, + }, }; static int cs5535_mfd_probe(struct pci_dev *pdev, @@ -130,8 +144,18 @@ static int cs5535_mfd_probe(struct pci_dev *pdev, goto err_disable; } - if (machine_is_olpc()) - mfd_clone_cell("cs5535-acpi", olpc_acpi_clones, ARRAY_SIZE(olpc_acpi_clones)); + if (machine_is_olpc()) { + err = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, + cs5535_olpc_mfd_cells, + ARRAY_SIZE(cs5535_olpc_mfd_cells), + NULL, 0, NULL); + if (err) { + dev_err(&pdev->dev, + "Failed to add CS5532 OLPC sub-devices: %d\n", + err); + goto err_disable; + } + } dev_info(&pdev->dev, "%zu devices registered.\n", ARRAY_SIZE(cs5535_mfd_cells));