Received: by 10.223.185.116 with SMTP id b49csp1108767wrg; Fri, 23 Feb 2018 12:05:20 -0800 (PST) X-Google-Smtp-Source: AH8x225aScMLwMhGkfSZ9HHc2/Tcq5tPXiva+c8C9k/5FOYuTVIbfm7Mi0nMfVGYvyJTxV2D/7YS X-Received: by 10.98.172.18 with SMTP id v18mr2837649pfe.175.1519416320162; Fri, 23 Feb 2018 12:05:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519416320; cv=none; d=google.com; s=arc-20160816; b=sOZdII44dCN3TZ3v83Pa/xxAFWbGeJAu+f07mYu9L3evkvyPaB7VgSK4zEEbAUleyk +4wA3jKEvPCbHt3XkjZ4hUKCs6hC3eJVUWKGztbkXefQUf1IYSa09Goaz+TKPYnEQPW0 qd0+c1k1AqDyKOtPPHRA2MPnbcFju04bFrpjXAmpAPRLhMLZj3Nc9KmqnrJJV9GfvYy8 hcfZekmXMVBRnOgVCulQIf1my1afU787zercqIZFUmH06wAlMk86s5Ljw0msjr/boPdm vbiqjU2N4oacldeJsqWwodpdq2LSLhzP3yd17S+rVVZQG0186A+rA4BSk9erdsGb35su 2ARg== 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:arc-authentication-results; bh=kYQNUIski0g8G0S6lO8byxa06NlimHxe//zSl2APrNc=; b=ZrZZxQRTs+tQqxQlYM3gwVRUKDYFE82IaB8M0nZbtDDiQJAb9zlfGmMiWFvqkIh2TX HSaxZ1AEo8RjCsYibuktQeOlx0g/GSx3IHcW2et6Tt8RTgR83Y7fc1403ARaKs1ynxv6 C/vflJAAByvKX592RApI6ICIGGsuLkXYcyoq4pegwoKnGc9C2sL7YXtwuU+g4vCCdsgB 3g+m9ENZvE4n2obA4u327yTvYop+XIQUPxoR8px+hLlS1eKv6I+ZEk8fsPiva4eCgWwB 0BUjB9Kjn+CupC8uSYFb+FDhuvxOznako9stBsXnrkrivshaN5xAQ4xIv4CNkhmfB2Cg 038g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si449935plk.52.2018.02.23.12.05.03; Fri, 23 Feb 2018 12:05:20 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933446AbeBWUDV (ORCPT + 99 others); Fri, 23 Feb 2018 15:03:21 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:38274 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933365AbeBWUDN (ORCPT ); Fri, 23 Feb 2018 15:03:13 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 8018F27602F From: Sebastian Reichel To: Sebastian Reichel , Liam Girdwood , Mark Brown , Rob Herring , Tony Lindgren , Lee Jones Cc: Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Sebastian Reichel Subject: [PATCHv5 3/5] mfd: motorola-cpcap: Add audio-codec support Date: Fri, 23 Feb 2018 21:02:52 +0100 Message-Id: <20180223200254.25685-4-sebastian.reichel@collabora.co.uk> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180223200254.25685-1-sebastian.reichel@collabora.co.uk> References: <20180223200254.25685-1-sebastian.reichel@collabora.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sebastian Reichel Add support for the audio-codec node by converting from devm_of_platform_populate() to devm_mfd_add_devices(). Signed-off-by: Sebastian Reichel --- drivers/mfd/motorola-cpcap.c | 51 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c index d2cc1eabac05..f6c79a4ccb55 100644 --- a/drivers/mfd/motorola-cpcap.c +++ b/drivers/mfd/motorola-cpcap.c @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -216,6 +217,53 @@ static const struct regmap_config cpcap_regmap_config = { .val_format_endian = REGMAP_ENDIAN_LITTLE, }; +static const struct mfd_cell cpcap_mfd_devices[] = { + { + .name = "cpcap_adc", + .of_compatible = "motorola,mapphone-cpcap-adc", + }, { + .name = "cpcap_battery", + .of_compatible = "motorola,cpcap-battery", + }, { + .name = "cpcap-charger", + .of_compatible = "motorola,mapphone-cpcap-charger", + }, { + .name = "cpcap-regulator", + .of_compatible = "motorola,mapphone-cpcap-regulator", + }, { + .name = "cpcap-rtc", + .of_compatible = "motorola,cpcap-rtc", + }, { + .name = "cpcap-pwrbutton", + .of_compatible = "motorola,cpcap-pwrbutton", + }, { + .name = "cpcap-usb-phy", + .of_compatible = "motorola,mapphone-cpcap-usb-phy", + }, { + .name = "cpcap-led", + .id = 0, + .of_compatible = "motorola,cpcap-led-red", + }, { + .name = "cpcap-led", + .id = 1, + .of_compatible = "motorola,cpcap-led-green", + }, { + .name = "cpcap-led", + .id = 2, + .of_compatible = "motorola,cpcap-led-blue", + }, { + .name = "cpcap-led", + .id = 3, + .of_compatible = "motorola,cpcap-led-adl", + }, { + .name = "cpcap-led", + .id = 4, + .of_compatible = "motorola,cpcap-led-cp", + }, { + .name = "cpcap-codec", + } +}; + static int cpcap_probe(struct spi_device *spi) { const struct of_device_id *match; @@ -260,7 +308,8 @@ static int cpcap_probe(struct spi_device *spi) if (ret) return ret; - return devm_of_platform_populate(&cpcap->spi->dev); + return devm_mfd_add_devices(&spi->dev, 0, cpcap_mfd_devices, + ARRAY_SIZE(cpcap_mfd_devices), NULL, 0, NULL); } static struct spi_driver cpcap_driver = { -- 2.16.1