From patchwork Mon Apr 16 12:56:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 133460 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp3536446ljb; Mon, 16 Apr 2018 05:57:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx49JWvBQQ6QkMN8pg4N5Yz2+6jGt5wMag8MSlVggXISz1ne6lqgAr0w+T7p2d8k25qTFFMQV X-Received: by 10.99.126.88 with SMTP id o24mr4790572pgn.325.1523883428800; Mon, 16 Apr 2018 05:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523883428; cv=none; d=google.com; s=arc-20160816; b=wm+DxbpqGKzjItnnawFk5hqj89EJMTMhzYIRALWcaGoDbc8zeMuqQcAdoAwHCZJY07 uYMWFy4PaT1xn8yy+fVjdtNFtlgmNRaarAO+DBcO8yZSXv74MLPwQqneO6YKbXwRUDnY W/1jepr4s4JkU6wrL0vydtKJ93M4baxjveKUIwR6DUCMwl4Ej7oTDidUcFR8m1/jKlcC vDIlQeYA2wseWxS+W8OwrOAIx8KEQ1y2ifniIVoxLaj16/kt6KvNBuyorSCG9TRtW+bC ew1LFHluTVQBWUAOTfccHz05PXOo+4SLrgjm5OEiOUEeKiqbATjnxPQf6fiXpFDqcU4X RgfQ== 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:arc-authentication-results; bh=8wzB/SJbeKZNhcUltb5VO29BnHaUk/3azIrkC7wvBiE=; b=aVKf84Tv04qNaPV5ZQyjs9gJTzYNG7iX2puxUqSuWuIyV+YlYIuA3gSZ+Mh0nGkCV6 VOEKA97ZiBw8sbIy9AdA6k38esuudQtMVR0NzAiqBuMP1GhAlWTiTVBmkw83kRKJvWAc aG98RvEJPdmLknxjti0OBVAVVksPQKcUKO2u61VZphYNcWImnaaNtsrZ1DPyNx+ri0QR j+Qnbf3wzT+6K5iyCtL5ZbnSVSBM36NHFkdHZUgmf2HpIIZEygZCF/HXHJCFrCZ8ed0Y e1DzfbK3GTWeJ0bpNax2bHc879KkXu/rlf84ihzEKSayhsjur5U1252kBHwMIoCOisso eDzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gp8WnNFo; 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 b4si9471195pgu.79.2018.04.16.05.57.08; Mon, 16 Apr 2018 05:57:08 -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=gp8WnNFo; 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 S1754698AbeDPM5G (ORCPT + 29 others); Mon, 16 Apr 2018 08:57:06 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:43740 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752578AbeDPM5D (ORCPT ); Mon, 16 Apr 2018 08:57:03 -0400 Received: by mail-wr0-f193.google.com with SMTP id y7so25713270wrh.10 for ; Mon, 16 Apr 2018 05:57:02 -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=8wzB/SJbeKZNhcUltb5VO29BnHaUk/3azIrkC7wvBiE=; b=gp8WnNFo56HSNaXZiJjgKQfluIQgNNn5ywK9SexBWlzxXafqqczoLDGj8/oVoGKWRf wPHVc3AWlMdxtZp4+t6NT7qVUlOKhGumbK16qXgdf27gZnZ6AWcTkD+bJJeJVpO+kd19 PYr3pKB5U0nJGn1wrmMxweVc5tRtzJJvX01AU= 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=8wzB/SJbeKZNhcUltb5VO29BnHaUk/3azIrkC7wvBiE=; b=P0C2/9AgJJiABvQv9paz5p1GFlGTguFkynN+m5WOSankskOmG5KSs7TOJX9KV+9w+R Sl7+WqUAT7h+qyKJznbip7ecwMvE5g+rZaf8+/5xELDQN3Cf/QDcnjykn76ExnDiYalh 8hC2N/Lp6sBIq4AfXiB0ZIBnXfuo1Xs/ssE2XXUdtNyGXsX3xqESrJrT6xG3E92Rt5iO WUQytvwBmG2LVgtIXJDEUUgps6pPyqfaI71+elil0rZszTMKsvuefm+Bkszq5L+9Ww9Q hKze/GgO84oSSfzrgIgMY2xHAPSHKWIpawzH+v6Xxu3H2w9uClAYBrs4YPLhwo8ASP5+ puFw== X-Gm-Message-State: ALQs6tDtOibpESYzUcS21+nqv3IQkDobX2AqHC6NUhM2XCqu0r6lCu3P CVcWXPPgmScph/mHrAgR8Io/VA== X-Received: by 10.223.136.34 with SMTP id d31mr4802150wrd.18.1523883421937; Mon, 16 Apr 2018 05:57:01 -0700 (PDT) Received: from localhost.localdomain ([2.27.167.70]) by smtp.gmail.com with ESMTPSA id m35sm15615174wrm.59.2018.04.16.05.57.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 05:57:01 -0700 (PDT) From: Lee Jones To: linus.walleij@linaro.org, ldewangan@nvidia.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lee Jones Subject: [PATCH v2 2/3] mfd: ab8500: Example using new OF_MFD_CELL MACRO Date: Mon, 16 Apr 2018 13:56:26 +0100 Message-Id: <20180416125627.22156-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180416125627.22156-1-lee.jones@linaro.org> References: <20180416125627.22156-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ... with and without platform ID. Signed-off-by: Lee Jones Acked-by: Linus Walleij --- drivers/mfd/ab8500-core.c | 138 ++++++++++++++-------------------------------- 1 file changed, 42 insertions(+), 96 deletions(-) -- 2.14.1 diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 30d09d177171..38b6b34165d1 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -610,107 +610,53 @@ int ab8500_suspend(struct ab8500 *ab8500) } static const struct mfd_cell ab8500_bm_devs[] = { - { - .name = "ab8500-charger", - .of_compatible = "stericsson,ab8500-charger", - .platform_data = &ab8500_bm_data, - .pdata_size = sizeof(ab8500_bm_data), - }, - { - .name = "ab8500-btemp", - .of_compatible = "stericsson,ab8500-btemp", - .platform_data = &ab8500_bm_data, - .pdata_size = sizeof(ab8500_bm_data), - }, - { - .name = "ab8500-fg", - .of_compatible = "stericsson,ab8500-fg", - .platform_data = &ab8500_bm_data, - .pdata_size = sizeof(ab8500_bm_data), - }, - { - .name = "ab8500-chargalg", - .of_compatible = "stericsson,ab8500-chargalg", - .platform_data = &ab8500_bm_data, - .pdata_size = sizeof(ab8500_bm_data), - }, + OF_MFD_CELL("ab8500-charger", NULL, &ab8500_bm_data, + sizeof(ab8500_bm_data), 0, "stericsson,ab8500-charger"), + OF_MFD_CELL("ab8500-btemp", NULL, &ab8500_bm_data, + sizeof(ab8500_bm_data), 0, "stericsson,ab8500-btemp"), + OF_MFD_CELL("ab8500-fg", NULL, &ab8500_bm_data, + sizeof(ab8500_bm_data), 0, "stericsson,ab8500-fg"), + OF_MFD_CELL("ab8500-chargalg", NULL, &ab8500_bm_data, + sizeof(ab8500_bm_data), 0, "stericsson,ab8500-chargalg"), }; static const struct mfd_cell ab8500_devs[] = { #ifdef CONFIG_DEBUG_FS - { - .name = "ab8500-debug", - .of_compatible = "stericsson,ab8500-debug", - }, + OF_MFD_CELL("ab8500-debug", + NULL, NULL, 0, 0, "stericsson,ab8500-debug"), #endif - { - .name = "ab8500-sysctrl", - .of_compatible = "stericsson,ab8500-sysctrl", - }, - { - .name = "ab8500-ext-regulator", - .of_compatible = "stericsson,ab8500-ext-regulator", - }, - { - .name = "ab8500-regulator", - .of_compatible = "stericsson,ab8500-regulator", - }, - { - .name = "ab8500-clk", - .of_compatible = "stericsson,ab8500-clk", - }, - { - .name = "ab8500-gpadc", - .of_compatible = "stericsson,ab8500-gpadc", - }, - { - .name = "ab8500-rtc", - .of_compatible = "stericsson,ab8500-rtc", - }, - { - .name = "ab8500-acc-det", - .of_compatible = "stericsson,ab8500-acc-det", - }, - { - - .name = "ab8500-poweron-key", - .of_compatible = "stericsson,ab8500-poweron-key", - }, - { - .name = "ab8500-pwm", - .of_compatible = "stericsson,ab8500-pwm", - .id = 1, - }, - { - .name = "ab8500-pwm", - .of_compatible = "stericsson,ab8500-pwm", - .id = 2, - }, - { - .name = "ab8500-pwm", - .of_compatible = "stericsson,ab8500-pwm", - .id = 3, - }, - { - .name = "ab8500-denc", - .of_compatible = "stericsson,ab8500-denc", - }, - { - .name = "pinctrl-ab8500", - .of_compatible = "stericsson,ab8500-gpio", - }, - { - .name = "abx500-temp", - .of_compatible = "stericsson,abx500-temp", - }, - { - .name = "ab8500-usb", - .of_compatible = "stericsson,ab8500-usb", - }, - { - .name = "ab8500-codec", - .of_compatible = "stericsson,ab8500-codec", - }, + OF_MFD_CELL("ab8500-sysctrl", + NULL, NULL, 0, 0, "stericsson,ab8500-sysctrl"), + OF_MFD_CELL("ab8500-ext-regulator", + NULL, NULL, 0, 0, "stericsson,ab8500-ext-regulator"), + OF_MFD_CELL("ab8500-regulator", + NULL, NULL, 0, 0, "stericsson,ab8500-regulator"), + OF_MFD_CELL("abx500-clk", + NULL, NULL, 0, 0, "stericsson,abx500-clk"), + OF_MFD_CELL("ab8500-gpadc", + NULL, NULL, 0, 0, "stericsson,ab8500-gpadc"), + OF_MFD_CELL("ab8500-rtc", + NULL, NULL, 0, 0, "stericsson,ab8500-rtc"), + OF_MFD_CELL("ab8500-acc-det", + NULL, NULL, 0, 0, "stericsson,ab8500-acc-det"), + OF_MFD_CELL("ab8500-poweron-key", + NULL, NULL, 0, 0, "stericsson,ab8500-poweron-key"), + OF_MFD_CELL("ab8500-pwm", + NULL, NULL, 0, 1, "stericsson,ab8500-pwm"), + OF_MFD_CELL("ab8500-pwm", + NULL, NULL, 0, 2, "stericsson,ab8500-pwm"), + OF_MFD_CELL("ab8500-pwm", + NULL, NULL, 0, 3, "stericsson,ab8500-pwm"), + OF_MFD_CELL("ab8500-denc", + NULL, NULL, 0, 0, "stericsson,ab8500-denc"), + OF_MFD_CELL("pinctrl-ab8500", + NULL, NULL, 0, 0, "stericsson,ab8500-gpio"), + OF_MFD_CELL("abx500-temp", + NULL, NULL, 0, 0, "stericsson,abx500-temp"), + OF_MFD_CELL("ab8500-usb", + NULL, NULL, 0, 0, "stericsson,ab8500-usb"), + OF_MFD_CELL("ab8500-codec", + NULL, NULL, 0, 0, "stericsson,ab8500-codec"), }; static const struct mfd_cell ab9540_devs[] = {